@@ -12,7 +12,7 @@ use linera_views::{
12
12
common:: { CommonStoreConfig , ReadableKeyValueStore , WritableKeyValueStore } ,
13
13
memory:: MemoryStore ,
14
14
} ;
15
- #[ cfg( feature = "rocksdb" ) ]
15
+ #[ cfg( with_rocksdb ) ]
16
16
use linera_views:: {
17
17
common:: AdminKeyValueStore ,
18
18
rocks_db:: { PathWithGuard , RocksDbStore , RocksDbStoreConfig } ,
@@ -41,7 +41,7 @@ pub mod key_value_store {
41
41
enum ServiceStoreServerInternal {
42
42
Memory ( MemoryStore ) ,
43
43
/// The RocksDb key value store
44
- #[ cfg( feature = "rocksdb" ) ]
44
+ #[ cfg( with_rocksdb ) ]
45
45
RocksDb ( RocksDbStore ) ,
46
46
}
47
47
@@ -64,7 +64,7 @@ impl ServiceStoreServer {
64
64
. read_value_bytes ( key)
65
65
. await
66
66
. map_err ( |e| Status :: unknown ( format ! ( "Memory error {:?} at read_value_bytes" , e) ) ) ,
67
- #[ cfg( feature = "rocksdb" ) ]
67
+ #[ cfg( with_rocksdb ) ]
68
68
ServiceStoreServerInternal :: RocksDb ( store) => store
69
69
. read_value_bytes ( key)
70
70
. await
@@ -78,7 +78,7 @@ impl ServiceStoreServer {
78
78
. contains_key ( key)
79
79
. await
80
80
. map_err ( |e| Status :: unknown ( format ! ( "Memory error {:?} at contains_key" , e) ) ) ,
81
- #[ cfg( feature = "rocksdb" ) ]
81
+ #[ cfg( with_rocksdb ) ]
82
82
ServiceStoreServerInternal :: RocksDb ( store) => store
83
83
. contains_key ( key)
84
84
. await
@@ -92,7 +92,7 @@ impl ServiceStoreServer {
92
92
. contains_keys ( keys)
93
93
. await
94
94
. map_err ( |e| Status :: unknown ( format ! ( "Memory error {:?} at contains_keys" , e) ) ) ,
95
- #[ cfg( feature = "rocksdb" ) ]
95
+ #[ cfg( with_rocksdb ) ]
96
96
ServiceStoreServerInternal :: RocksDb ( store) => store
97
97
. contains_keys ( keys)
98
98
. await
@@ -110,7 +110,7 @@ impl ServiceStoreServer {
110
110
Status :: unknown ( format ! ( "Memory error {:?} at read_multi_values_bytes" , e) )
111
111
} )
112
112
}
113
- #[ cfg( feature = "rocksdb" ) ]
113
+ #[ cfg( with_rocksdb ) ]
114
114
ServiceStoreServerInternal :: RocksDb ( store) => {
115
115
store. read_multi_values_bytes ( keys) . await . map_err ( |e| {
116
116
Status :: unknown ( format ! ( "RocksDB error {:?} at read_multi_values_bytes" , e) )
@@ -126,7 +126,7 @@ impl ServiceStoreServer {
126
126
Status :: unknown ( format ! ( "Memory error {:?} at find_keys_by_prefix" , e) )
127
127
} )
128
128
}
129
- #[ cfg( feature = "rocksdb" ) ]
129
+ #[ cfg( with_rocksdb ) ]
130
130
ServiceStoreServerInternal :: RocksDb ( store) => {
131
131
store. find_keys_by_prefix ( key_prefix) . await . map_err ( |e| {
132
132
Status :: unknown ( format ! ( "RocksDB error {:?} at find_keys_by_prefix" , e) )
@@ -146,7 +146,7 @@ impl ServiceStoreServer {
146
146
. map_err ( |e| {
147
147
Status :: unknown ( format ! ( "Memory error {:?} at find_key_values_by_prefix" , e) )
148
148
} ) ,
149
- #[ cfg( feature = "rocksdb" ) ]
149
+ #[ cfg( with_rocksdb ) ]
150
150
ServiceStoreServerInternal :: RocksDb ( store) => store
151
151
. find_key_values_by_prefix ( key_prefix)
152
152
. await
@@ -165,7 +165,7 @@ impl ServiceStoreServer {
165
165
. write_batch ( batch)
166
166
. await
167
167
. map_err ( |e| Status :: unknown ( format ! ( "Memory error {:?} at write_batch" , e) ) ) ,
168
- #[ cfg( feature = "rocksdb" ) ]
168
+ #[ cfg( with_rocksdb ) ]
169
169
ServiceStoreServerInternal :: RocksDb ( store) => store
170
170
. write_batch ( batch)
171
171
. await
@@ -239,7 +239,7 @@ enum ServiceStoreServerOptions {
239
239
endpoint : String ,
240
240
} ,
241
241
242
- #[ cfg( feature = "rocksdb" ) ]
242
+ #[ cfg( with_rocksdb ) ]
243
243
#[ command( name = "rocksdb" ) ]
244
244
RocksDb {
245
245
#[ arg( long = "path" ) ]
@@ -579,7 +579,7 @@ async fn main() {
579
579
let store = ServiceStoreServerInternal :: Memory ( store) ;
580
580
( store, endpoint)
581
581
}
582
- #[ cfg( feature = "rocksdb" ) ]
582
+ #[ cfg( with_rocksdb ) ]
583
583
ServiceStoreServerOptions :: RocksDb { path, endpoint } => {
584
584
let path_buf = path. into ( ) ;
585
585
let path_with_guard = PathWithGuard :: new ( path_buf) ;
0 commit comments