TryReadWithMeta Read the encoded KV data and meta from storage file and decode it. Return error if the read IO fails. Return false if the data is not managed by the ShardManager.
(kvIdx uint64, readLen int)
| 200 | // Return error if the read IO fails. |
| 201 | // Return false if the data is not managed by the ShardManager. |
| 202 | func (sm *ShardManager) TryReadWithMeta(kvIdx uint64, readLen int) ([]byte, []byte, bool, error) { |
| 203 | shardIdx := kvIdx / sm.kvEntries |
| 204 | if ds, ok := sm.shardMap[shardIdx]; ok { |
| 205 | b, commit, err := ds.ReadWithMeta(kvIdx, readLen) |
| 206 | return b, commit, true, err |
| 207 | } else { |
| 208 | return nil, nil, false, nil |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | func (sm *ShardManager) GetShardMiner(shardIdx uint64) (common.Address, bool) { |
| 213 | if ds, ok := sm.shardMap[shardIdx]; ok { |
nothing calls this directly
no test coverage detected