public void DeleteAllData() { _lastDictId = 0; // Resetting last oid is risky due to singletons. So better to waste something. _keyValueTrProtector.Start(); _keyValueTr.SetKeyPrefix(ObjectDB.AllObjectsPrefix); _keyValueTr.EraseAll(); _keyValueTr.SetKeyPrefix(ObjectDB.AllDictionariesPrefix); _keyValueTr.EraseAll(); _keyValueTr.SetKeyPrefix(ObjectDB.AllRelationsPKPrefix); _keyValueTr.EraseAll(); _keyValueTr.SetKeyPrefix(ObjectDB.AllRelationsSKPrefix); _keyValueTr.EraseAll(); }
public void Clear() { _keyValueTrProtector.Start(); _modificationCounter++; _keyValueTr.SetKeyPrefix(_prefix); _keyValueTr.EraseAll(); _count = 0; }
void DeleteSecondaryKey(IKeyValueDBTransaction keyValueTr, uint prevIdx) { var writer = new ByteBufferWriter(); writer.WriteBlock(ObjectDB.AllRelationsSKPrefix); writer.WriteVUInt32(Id); writer.WriteVUInt32(prevIdx); keyValueTr.SetKeyPrefix(writer.Data); keyValueTr.EraseAll(); }
public int RemoveByKeyPrefixWithoutIterate(ByteBuffer keyBytesPrefix) { if (_hasSecondaryIndexes) { //keyBytePrefix contains [Index Relation, Primary key prefix] we need // [Index Relation, Secondary Key Index, Primary key prefix] int idBytesLength = ObjectDB.AllRelationsPKPrefix.Length + PackUnpack.LengthVUInt(_relationInfo.Id); var writer = new ByteBufferWriter(); foreach (var secKey in _relationInfo.ClientRelationVersionInfo.SecondaryKeys) { WriteSKPrefix(writer); writer.WriteVUInt32(_relationInfo.Id); writer.WriteVUInt32(secKey.Key); writer.WriteBlock(keyBytesPrefix.Buffer, idBytesLength, keyBytesPrefix.Length - idBytesLength); _kvtr.SetKeyPrefix(writer.Data); _kvtr.EraseAll(); writer.Reset(); } } return(RemovePrimaryKeysByPrefix(keyBytesPrefix)); }
public void Clear() { _modificationCounter++; _keyValueTr.EraseAll(_prefix); _count = 0; }
public void EraseAll() { LogSimpleOperation(KVReplayOperation.EraseAll); _tr.EraseAll(); }
public void EraseAll() { EraseAllCount++; _keyValueDBTransaction.EraseAll(); }