public ReplicaStatusTable(LightningPersistence lmdb, string tableName, string replicaId) { _lmdb = lmdb; _replicaId = replicaId; _table = _lmdb.OpenTable(tableName); _clockKey = new TableKey(KEY_CLOCK); _countersKey = new TableKey(KEY_COUNTERS); }
public void TestCreateTable() { using (var persistence = new LightningPersistence(_config)) { using (var table = persistence.OpenTable("testtable")) { } } Assert.Pass(); }
public ReplicatorSource(LightningPersistence lmdb, string ownReplicaId, KvTable kvTable, WriteLogTable wlTable, ReplicationConfig replicationConfig, CancellationToken cancellationToken, Func <SyncPacket, Task> responseStreamWriteAsync) { _lmdb = lmdb; _ownReplicaId = ownReplicaId; _kvTable = kvTable; _wlTable = wlTable; _replicationConfig = replicationConfig; _cancellationToken = cancellationToken; (_pumpTask, _responseStreamWriteAsync) = StartBufferedWrites(responseStreamWriteAsync); }
public ReplicatorSink(LightningPersistence lmdb, string targetReplicaId, KvTable kvTable, ReplicationTable replicationTable, ReplicationConfig replicationConfig, CancellationToken cancellationToken, Action <WriteTransaction, string, ulong?> updateClock) { _lmdb = lmdb; _targetReplicaId = targetReplicaId; _kvTable = kvTable; _replicationTable = replicationTable; _replicationConfig = replicationConfig; _cancellationToken = cancellationToken; _updateClock = updateClock; }
public ReplicatorSlave(LightningPersistence lmdb, string ownReplicaId, KvTable kvTable, ReplicationTable replicationTable, WriteLogTable wlTable, ReplicationConfig replicationConfig, Action <WriteTransaction, string, ulong?> updateClock) // TODO: Add ACKs streaming { _lmdb = lmdb; _ownReplicaId = ownReplicaId; _kvTable = kvTable; _replicationTable = replicationTable; _wlTable = wlTable; _replicationConfig = replicationConfig; _updateClock = updateClock; _replicationSources = new ConcurrentDictionary <string, ReplicatorSource>(); _cts = new CancellationTokenSource(); }
public KvTable(LightningPersistence lmdb, string kvTableName, string replicaId, ReplicaStatusTable statusTable, ExpiryTable expiryTable, KvMetadataTable metadataTable, WriteLogTable wlTable, Func <VectorClock> currentClock, Func <WriteTransaction, VectorClock> incrementClock, Func <Item[], Task> updateNotifier) { _lmdb = lmdb; _replicaId = replicaId; StatusTable = statusTable; _kvTable = _lmdb.OpenTable(kvTableName); _expiryTable = expiryTable; _metadataTable = metadataTable; _wlTable = wlTable; _currentClock = currentClock; _incrementClock = incrementClock; _updateNotifier = updateNotifier; }
public ReplicationTable(LightningPersistence lmdb, string tableName) { _lmdb = lmdb; // _replicaId = replicaId; _table = _lmdb.OpenTable(tableName); }
public WriteLogTable(LightningPersistence lmdb, string tableName, string replicaId) { _lmdb = lmdb; _replicaId = replicaId; _table = _lmdb.OpenTable(tableName); }
public static Task <(TableKey, bool)[]> AddBatch(this LightningPersistence lmdb, Table table, (TableKey, TableValue)[] batch, bool requiresIsolation = false) =>
public static Task <bool> AddOrUpdate(this LightningPersistence lmdb, Table table, TableKey key, TableValue value, bool requiresIsolation = false) => lmdb.WriteAsync(txn => txn.AddOrUpdate(table, key, value), requiresIsolation);
public static TableKey[] KeysByPrefix(this LightningPersistence lmdb, Table table, TableKey prefix, uint page, uint pageSize) => lmdb.Read(txn => txn.KeysByPrefix(table, prefix, page, pageSize).ToArray());
public static bool ContainsKey(this LightningPersistence lmdb, Table table, TableKey key) => lmdb.Read(txn => txn.ContainsKey(table, key));
public KvMetadataTable(LightningPersistence lmdb, string tableName) { _lmdb = lmdb; _table = _lmdb.OpenTable(tableName); }
public LmdbLightClient(LightningConfig config) { _lmdb = new LightningPersistence(config); _kvTable = _lmdb.OpenTable("kv"); }
public ExpiryTable(LightningPersistence lmdb, string tableName) { _lmdb = lmdb; _table = _lmdb.OpenDupTable(tableName); }
public void TestCreateDb() { using (var persistence = new LightningPersistence(_config)) { } Assert.Pass(); }