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

Function initDataShard

cmd/es-utils/main.go:314–333  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

312}
313
314func initDataShard() *es.DataShard {
315 ds := es.NewDataShard(*shardIdx, *kvSize, *kvEntries, *chunkSize)
316 for _, filename := range *filenames {
317 var err error
318 var df *es.DataFile
319 df, err = es.OpenDataFile(filename)
320 if err != nil {
321 log.Crit("Open failed", "error", err)
322 }
323 err = ds.AddDataFile(df)
324 if err != nil {
325 log.Crit("Open failed", "error", err)
326 }
327 }
328
329 if !ds.IsComplete() {
330 log.Warn("Shard is not completed")
331 }
332 return ds
333}
334
335func runShardWrite(cmd *cobra.Command, args []string) {
336 setupLogger()

Callers 6

runShardReadFunction · 0.85
runKVReadFunction · 0.85
runMetaReadFunction · 0.85
runShardWriteFunction · 0.85
runSampleReadFunction · 0.85
runWriteBlobFunction · 0.85

Calls 2

AddDataFileMethod · 0.95
IsCompleteMethod · 0.95

Tested by

no test coverage detected