Documentation ¶
Index ¶
- func RemoveChunkWithItem(ctx context.Context, trx transaction.Store, item *BatchRadiusItem) error
- type BatchRadiusItem
- type BinItem
- type ChunkBinItem
- type EpochItem
- type Reserve
- func (r *Reserve) Capacity() int
- func (r *Reserve) EvictBatchBin(ctx context.Context, batchID []byte, count int, bin uint8) (int, error)
- func (r *Reserve) EvictionTarget() int
- func (r *Reserve) Get(ctx context.Context, addr swarm.Address, batchID []byte) (swarm.Chunk, error)
- func (r *Reserve) Has(addr swarm.Address, batchID []byte) (bool, error)
- func (r *Reserve) IncBinID(store storage.IndexStore, bin uint8) (uint64, error)
- func (r *Reserve) IsWithinCapacity() bool
- func (r *Reserve) IterateBin(bin uint8, startBinID uint64, ...) error
- func (r *Reserve) IterateChunks(startBin uint8, cb func(swarm.Chunk) (bool, error)) error
- func (r *Reserve) IterateChunksItems(startBin uint8, cb func(*ChunkBinItem) (bool, error)) error
- func (r *Reserve) LastBinIDs() ([]uint64, uint64, error)
- func (r *Reserve) Put(ctx context.Context, chunk swarm.Chunk) error
- func (r *Reserve) Radius() uint8
- func (r *Reserve) SetRadius(rad uint8) error
- func (r *Reserve) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveChunkWithItem ¶ added in v2.1.0
func RemoveChunkWithItem( ctx context.Context, trx transaction.Store, item *BatchRadiusItem, ) error
Types ¶
type BatchRadiusItem ¶
BatchRadiusItem allows iteration of the chunks with respect to bin and batchID. Used for batch evictions of certain bins.
func (*BatchRadiusItem) Clone ¶
func (b *BatchRadiusItem) Clone() storage.Item
func (*BatchRadiusItem) Marshal ¶
func (b *BatchRadiusItem) Marshal() ([]byte, error)
func (*BatchRadiusItem) Namespace ¶
func (b *BatchRadiusItem) Namespace() string
func (*BatchRadiusItem) String ¶
func (b *BatchRadiusItem) String() string
func (*BatchRadiusItem) Unmarshal ¶
func (b *BatchRadiusItem) Unmarshal(buf []byte) error
type ChunkBinItem ¶
type ChunkBinItem struct { Bin uint8 BinID uint64 Address swarm.Address BatchID []byte ChunkType swarm.ChunkType }
ChunkBinItem allows for iterating on ranges of bin and binIDs for chunks. BinIDs come in handy when syncing the reserve contents with other peers.
func (*ChunkBinItem) Clone ¶
func (c *ChunkBinItem) Clone() storage.Item
func (*ChunkBinItem) Marshal ¶
func (c *ChunkBinItem) Marshal() ([]byte, error)
func (*ChunkBinItem) Namespace ¶
func (c *ChunkBinItem) Namespace() string
func (*ChunkBinItem) String ¶
func (c *ChunkBinItem) String() string
func (*ChunkBinItem) Unmarshal ¶
func (c *ChunkBinItem) Unmarshal(buf []byte) error
type EpochItem ¶
type EpochItem struct {
Timestamp uint64
}
EpochItem stores the timetamp in seconds of the initial creation of the reserve.
type Reserve ¶
type Reserve struct {
// contains filtered or unexported fields
}
func (*Reserve) EvictBatchBin ¶
func (r *Reserve) EvictBatchBin( ctx context.Context, batchID []byte, count int, bin uint8, ) (int, error)
EvictBatchBin evicts all chunks from bins upto the bin provided.
func (*Reserve) EvictionTarget ¶
func (*Reserve) IsWithinCapacity ¶
func (*Reserve) IterateBin ¶
func (*Reserve) IterateChunks ¶
func (*Reserve) IterateChunksItems ¶
Click to show internal directories.
Click to hide internal directories.