add note about creating single abstraction for StorageBackend and KeyValueWithSchema
and about adding missing memory statistics for backends
MODIFY
storage/src/backend/btree_map.rs
storage/src/backend/btree_map.rs
@@ -68,6 +68,7 @@ impl KVStoreTrait for KVStore<EntryHash, ContextValue> {
}
fn get_mem_use_stats(&self) -> Result<RocksDBStats, KVStoreError> {
+ //TODO TE-431 StorageBackent::get_mem_use_stats() should be implemented for all backends
Ok(RocksDBStats {
mem_table_total: 0,
mem_table_unflushed: 0,

MODIFY
storage/src/backend/in_memory_backend.rs
storage/src/backend/in_memory_backend.rs
@@ -100,6 +100,7 @@ impl StorageBackend for InMemoryBackend {
}
fn get_mem_use_stats(&self) -> Result<RocksDBStats, StorageBackendError> {
+ //TODO TE-431 StorageBackent::get_mem_use_stats() should be implemented for all backends
Ok(RocksDBStats {
mem_table_total: 0,
mem_table_unflushed: 0,

MODIFY
storage/src/backend/rocksdb_backend.rs
storage/src/backend/rocksdb_backend.rs
@@ -80,9 +80,8 @@ impl StorageBackend for RocksDBBackend {
)?;
}
- (self.inner.deref() as &dyn KeyValueStoreWithSchema<MerkleStorage>).write_batch(
- rocksb_batch,
- )?;
+ (self.inner.deref() as &dyn KeyValueStoreWithSchema<MerkleStorage>)
+ .write_batch(rocksb_batch)?;
Ok(())
}

MODIFY
storage/src/backend/sled_backend.rs
storage/src/backend/sled_backend.rs
@@ -60,6 +60,7 @@ impl StorageBackend for SledBackend {
}
fn get_mem_use_stats(&self) -> Result<RocksDBStats, StorageBackendError> {
+ //TODO TE-431 StorageBackent::get_mem_use_stats() should be implemented for all backends
Ok(RocksDBStats {
mem_table_total: 0,
mem_table_unflushed: 0,

MODIFY
storage/src/storage_backend.rs
storage/src/storage_backend.rs
@@ -66,6 +66,7 @@ impl slog::Value for StorageBackendError {
}
}
+//TODO TE-432 - create single abstraction for StorageBackend and KeyValueWithSchema
pub trait StorageBackend: Send + Sync {
fn is_persisted(&self) -> bool;
fn get(&self, key: &EntryHash) -> Result<Option<ContextValue>, StorageBackendError>;

add note about creating single abstraction for StorageBackend and KeyValueWithSchema
and about adding missing memory statistics for backends