File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ def final(
3030 config .finished = finished
3131 storage .save_shatter_meta (config )
3232
33- storage .consolidate (config .timestamp )
34- storage .vacuum ( )
33+ persist ( delayed ( storage .consolidate ) (config .timestamp ) )
34+ compute ( delayed ( storage .vacuum )() )
3535
3636
3737def get_data (extents : Extents , filename : str , storage : Storage ) -> pd .DataFrame :
@@ -233,7 +233,7 @@ def shatter(config: ShatterConfig) -> int:
233233 config .log .debug ('Shattering.' )
234234 try :
235235 run (leaves , config , storage )
236- storage .consolidate (config .timestamp )
236+ persist ( delayed ( storage .consolidate ) (config .timestamp ) )
237237 except Exception as e :
238238 final (config , storage )
239239 raise e
Original file line number Diff line number Diff line change @@ -476,6 +476,7 @@ def vacuum(self):
476476 for vac_type in ['commits' , 'fragments' , 'fragment_meta' ]:
477477 c = tiledb .Config ({'sm.vacuum.mode' : vac_type })
478478 tiledb .vacuum (self .config .tdb_dir , config = c )
479+ self .config .log .debug ('Vacuuming complete.' )
479480
480481 def consolidate (self , timestamp ) -> None :
481482 """
@@ -484,9 +485,11 @@ def consolidate(self, timestamp) -> None:
484485 time traveling.
485486 :param timestamp: TileDB timestamp, a tuple of start and end datetime.
486487 """
487- self .config .log .debug ('Consolidating db.' )
488488 for con_type in ['commits' , 'fragments' , 'fragment_meta' ]:
489- c = tiledb .Config ({'sm.consolidation.mode' : con_type })
489+ c = tiledb .Config ({
490+ 'sm.consolidation.mode' : con_type ,
491+ 'sm.consolidation.max_fragment_size' : (300 * 2 ** 20 ) #300MB
492+ })
490493 tiledb .consolidate (
491494 self .config .tdb_dir , timestamp = timestamp , config = c
492495 )
You can’t perform that action at this time.
0 commit comments