Documentation ¶
Index ¶
- func BatchIDForChunk(st storage.Reader, addr swarm.Address) ([]byte, error)
- func CleanupDirty(st transaction.Storage) error
- func DeleteTag(st storage.Writer, tagID uint64) error
- func IterateAll(st storage.Reader, iterateFn func(item storage.Item) (bool, error)) error
- func IterateAllTagItems(st storage.Reader, cb func(ti *TagItem) (bool, error)) error
- func IteratePending(ctx context.Context, s transaction.ReadOnlyStore, ...) error
- func NewPutter(s storage.IndexStore, tagID uint64) (internal.PutterCloserWithReference, error)
- func Report(ctx context.Context, st transaction.Store, chunk swarm.Chunk, ...) error
- type TagItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchIDForChunk ¶
BatchIDForChunk returns the first known batchID for the given chunk address.
func CleanupDirty ¶
func CleanupDirty(st transaction.Storage) error
CleanupDirty does a best-effort cleanup of dirty tags. This is called on startup.
func IterateAll ¶
func IterateAllTagItems ¶
func IteratePending ¶ added in v2.1.0
func IteratePending(ctx context.Context, s transaction.ReadOnlyStore, consumerFn func(chunk swarm.Chunk) (bool, error)) error
func NewPutter ¶
func NewPutter(s storage.IndexStore, tagID uint64) (internal.PutterCloserWithReference, error)
NewPutter returns a new chunk putter associated with the tagID. Calls to the Putter must be mutex locked to prevent concurrent upload data races.
Types ¶
type TagItem ¶
type TagItem struct { TagID uint64 // unique identifier for the tag Split uint64 // total no of chunks processed by the splitter for hashing Seen uint64 // total no of chunks already seen Stored uint64 // total no of chunks stored locally on the node Sent uint64 // total no of chunks sent to the neighbourhood Synced uint64 // total no of chunks synced with proof Address swarm.Address // swarm.Address associated with this tag StartedAt int64 // start timestamp }
TagItem is an store.Item that stores information about a session of upload.
func ListAllTags ¶
ListAllTags returns all the TagItems in the store.
func NextTag ¶
func NextTag(st storage.IndexStore) (TagItem, error)
NextTag returns the next tag ID to be used. It reads the last used ID and increments it by 1. This method needs to be called under lock by user as there is no guarantee for parallel updates.
Click to show internal directories.
Click to hide internal directories.