File tree 2 files changed +13
-2
lines changed
geds_smart_open/src/geds_smart_open 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -225,8 +225,15 @@ def init_geds(cls):
225
225
if BLOCK_SIZE is not None :
226
226
config .cache_block_size = int (BLOCK_SIZE )
227
227
228
- # Init GEDS
228
+ GEDS_AVAILABLE_STORAGE = os .environ .get ("GEDS_AVAILABLE_STORAGE" )
229
+ if GEDS_AVAILABLE_STORAGE is not None :
230
+ config .available_local_storage = int (GEDS_AVAILABLE_STORAGE )
231
+
232
+ GEDS_AVAILABLE_MEMORY = os .environ .get ("GEDS_AVAILABLE_MEMORY" )
233
+ if GEDS_AVAILABLE_MEMORY is not None :
234
+ config .available_local_memory = int (GEDS_AVAILABLE_MEMORY )
229
235
236
+ # Init GEDS
230
237
cls ._geds = pygeds .GEDS (config )
231
238
try :
232
239
cls ._geds .start ()
@@ -266,10 +273,12 @@ def register_object_store(
266
273
def object_store_mapped (cls , bucket : str ) -> bool :
267
274
return bucket in cls ._known_s3_buckets
268
275
276
+
269
277
@atexit .register
270
278
def handle_shutdown ():
271
279
GEDSInstance .handle_shutdown ()
272
280
281
+
273
282
def register_object_store (
274
283
bucket : str , endpoint_url : str , access_key : str , secret_key : str
275
284
):
Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ PYBIND11_MODULE(pygeds, m) {
45
45
.def_readwrite (" port_http_server" , &GEDSConfig::portHttpServer)
46
46
.def_readwrite (" local_storage_path" , &GEDSConfig::localStoragePath)
47
47
.def_readwrite (" cache_block_size" , &GEDSConfig::cacheBlockSize)
48
- .def_readwrite (" cache_objects_from_s3" , &GEDSConfig::cache_objects_from_s3);
48
+ .def_readwrite (" cache_objects_from_s3" , &GEDSConfig::cache_objects_from_s3)
49
+ .def_readwrite (" available_local_storage" , &GEDSConfig::available_local_storage)
50
+ .def_readwrite (" available_local_memory" , &GEDSConfig::available_local_memory);
49
51
50
52
py::class_<GEDS, std::shared_ptr<GEDS>>(m, " GEDS" )
51
53
.def_property_readonly_static (
You can’t perform that action at this time.
0 commit comments