Documentation ¶
Index ¶
- func ChunkType(ch swarm.Chunk) swarm.ChunkType
- type BatchRadiusItem
- type BinItem
- type ChunkBinItem
- type ChunkItem
- type EpochItem
- type Reserve
- func (r *Reserve) AddSize(diff int)
- func (r *Reserve) Capacity() int
- func (r *Reserve) DeleteChunk(ctx context.Context, store internal.Storage, batch storage.Writer, ...) error
- func (r *Reserve) EvictBatchBin(ctx context.Context, txExecutor internal.TxExecutor, bin uint8, batchID []byte) (int, error)
- func (r *Reserve) EvictionTarget() int
- func (r *Reserve) Get(ctx context.Context, storage internal.Storage, addr swarm.Address, ...) (swarm.Chunk, error)
- func (r *Reserve) Has(store storage.Store, addr swarm.Address, batchID []byte) (bool, error)
- func (r *Reserve) IncBinID(store storage.Store, bin uint8) (uint64, error)
- func (r *Reserve) IsWithinCapacity() bool
- func (r *Reserve) IterateBin(store storage.Store, bin uint8, startBinID uint64, ...) error
- func (r *Reserve) IterateChunks(store internal.Storage, startBin uint8, cb func(swarm.Chunk) (bool, error)) error
- func (r *Reserve) IterateChunksItems(store internal.Storage, startBin uint8, cb func(ChunkItem) (bool, error)) error
- func (r *Reserve) LastBinIDs(store storage.Store) ([]uint64, uint64, error)
- func (r *Reserve) Put(ctx context.Context, store internal.Storage, chunk swarm.Chunk) (bool, error)
- func (r *Reserve) Radius() uint8
- func (r *Reserve) SetRadius(store storage.Store, rad uint8) error
- func (r *Reserve) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) DeleteChunk ¶
func (*Reserve) EvictBatchBin ¶
func (r *Reserve) EvictBatchBin( ctx context.Context, txExecutor internal.TxExecutor, bin uint8, batchID []byte, ) (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 ¶
func (*Reserve) LastBinIDs ¶
Click to show internal directories.
Click to hide internal directories.