HiveCrdt class

Inheritance

Properties

canonicalTime Hlc
Represents the latest logical time seen in the stored data.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether this dataset is empty.
no setter
isNotEmpty bool
Whether this dataset has at least one record.
no setter
nodeId String
Get this CRDT's node id
no setterinherited
onTablesChanged Stream<({Hlc hlc, Iterable<String> tables})>
Emits a list of the tables affected by changes in the database and the timestamp at which they happened. Useful for guaranteeing atomic merges across multiple tables.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tables Set<String>
Names of all tables contained in this dataset.
finalinherited

Methods

close() Future<void>
Closes all tables
delete() Future<void>
Deletes all tables from disk
get(String table, String key) → dynamic
Get a value from the local dataset.
inherited
getChangeset({Iterable<String>? onlyTables, String? onlyNodeId, String? exceptNodeId, Hlc? modifiedOn, Hlc? modifiedAfter}) CrdtChangeset
Get a Changeset using the provided changesetQueries.
inherited
getLastModified({String? onlyNodeId, String? exceptNodeId}) Hlc
Returns the last modified timestamp, optionally filtering for or against a specific node id. Useful to get "modified since" timestamps for synchronization. Returns Hlc.zero if no timestamp is found.
inherited
getMap(String table) Map<String, dynamic>
Get a table map from the local dataset.
inherited
getRecord(String table, String key) → Record?
getRecords(String table) Map<String, Record>
merge(CrdtChangeset changeset) Future<void>
Merge changeset with the local dataset.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDatasetChanged(Iterable<String> affectedTables, Hlc hlc) → void
Notifies listeners and updates the canonical time.
inherited
purge() Future<void>
Deletes all data from every table
put(String table, String key, dynamic value, [bool isDeleted = false]) Future<void>
Insert a single value into this dataset.
inherited
putAll(Map<String, Map<String, dynamic>> dataset, [bool isDeleted = false]) Future<void>
Insert multiple values into this dataset.
inherited
putRecords(Map<String, Map<String, Record>> dataset) Future<void>
toString() String
A string representation of this object.
inherited
validateChangeset(CrdtChangeset changeset) Hlc
Checks if changeset is valid. This method is intended for implementations and shouldn't generally be called from outside.
inherited
watch(String table, {String? key}) Stream<WatchEvent>
Returns a stream of changes. Use the optional key parameter to filter events or leave it empty to get all changes.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

open(Iterable<String> tables, {String? path, String? prefix}) Future<HiveCrdt>
Create or open tables and store them in path. Table names are used as file names. Use prefix to prepend the filename, otherwise Hive will prevent opening multiple boxes with the same tables. Useful for testing.