Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultWriteBatchSize defines the size of the batched header write. // Headers are written in batches not to thrash the underlying Datastore with writes. // TODO(@Wondertan, @renaynay): Those values must be configurable and proper defaults should be set // for specific node type. (#709) DefaultWriteBatchSize = 2048 )
Functions ¶
func FullAvailabilityWithLocalRandSquare ¶ added in v0.6.2
FullAvailabilityWithLocalRandSquare wraps full.GetterWithRandSquare with cache availability
func LightAvailabilityWithLocalRandSquare ¶ added in v0.6.2
LightAvailabilityWithLocalRandSquare wraps light.GetterWithRandSquare with cache availability
Types ¶
type ShareAvailability ¶
type ShareAvailability struct {
// contains filtered or unexported fields
}
ShareAvailability wraps a given share.Availability (whether it's light or full) and stores the results of a successful sampling routine over a given Root's hash to disk.
func NewShareAvailability ¶
func NewShareAvailability(avail share.Availability, ds datastore.Batching) *ShareAvailability
NewShareAvailability wraps the given share.Availability with an additional datastore for sampling result caching.
func (*ShareAvailability) Close ¶
func (ca *ShareAvailability) Close(ctx context.Context) error
Close flushes all queued writes to disk.
func (*ShareAvailability) ProbabilityOfAvailability ¶
func (ca *ShareAvailability) ProbabilityOfAvailability(ctx context.Context) float64
func (*ShareAvailability) SharesAvailable ¶
SharesAvailable will store, upon success, the hash of the given Root to disk.
Click to show internal directories.
Click to hide internal directories.