MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / create_new_shard

Method create_new_shard

utils/cache.py:90–96  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

88
89
90 def create_new_shard(self):
91 self.shard_file = open(self.path / f'shard_{self.shard}.bin', 'wb')
92 self.shard_table = f'shard_{self.shard}'
93 print(f'[CACHE] Creating new shard: {self.shard_table}')
94 self.con.execute(f'CREATE TABLE {self.shard_table}(offset, size)')
95 self.shard_index = 0
96 self.offset = 0
97
98
99 def finalize_current_shard(self):

Callers 1

addMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected