MCPcopy Create free account
hub / github.com/ethstorage/es-node / AddDataShard

Method AddDataShard

ethstorage/shard_manager.go:113–121  ·  view source on GitHub ↗
(shardIdx uint64)

Source from the content-addressed store, hash-verified

111}
112
113func (sm *ShardManager) AddDataShard(shardIdx uint64) error {
114 if _, ok := sm.shardMap[shardIdx]; !ok {
115 ds := NewDataShard(shardIdx, sm.kvSize, sm.kvEntries, sm.chunkSize)
116 sm.shardMap[shardIdx] = ds
117 return nil
118 } else {
119 return fmt.Errorf("data shard already exists")
120 }
121}
122
123func (sm *ShardManager) AddDataFile(df *DataFile) error {
124 shardIdx := df.chunkIdxStart / sm.chunksPerKv / sm.kvEntries

Callers 5

createEthStorageFunction · 0.95
TestEncodingFunction · 0.95
createEthStorageFunction · 0.95
initStorageManagerFunction · 0.95
AddDataShardFromConfigFunction · 0.80

Calls 1

NewDataShardFunction · 0.85

Tested by 4

createEthStorageFunction · 0.76
TestEncodingFunction · 0.76
createEthStorageFunction · 0.76
initStorageManagerFunction · 0.76