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

Function NewDataShard

ethstorage/data_shard.go:31–37  ·  view source on GitHub ↗
(shardIdx uint64, kvSize uint64, kvEntries uint64, chunkSize uint64)

Source from the content-addressed store, hash-verified

29}
30
31func NewDataShard(shardIdx uint64, kvSize uint64, kvEntries uint64, chunkSize uint64) *DataShard {
32 if kvSize%chunkSize != 0 {
33 panic("kvSize must be CHUNK_SIZE at the moment")
34 }
35
36 return &DataShard{shardIdx: shardIdx, kvSize: kvSize, chunksPerKv: kvSize / chunkSize, kvEntries: kvEntries, chunkSize: chunkSize}
37}
38
39func (ds *DataShard) AddDataFile(df *DataFile) error {
40 if len(ds.dataFiles) != 0 {

Callers 2

AddDataShardMethod · 0.85
AddDataFileAndShardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected