Documentation ¶
Index ¶
- func NewDispatcher(logger *zap.Logger, host host.Host, opts []server.Opt) *rangesync.Dispatcher
- type ATXHandler
- type ATXSyncSource
- type Config
- type Fetcher
- type HashSync
- type HashSyncSource
- type LayerTicker
- type MultiEpochATXSyncer
- type P2PHashSync
- func (s *P2PHashSync) Load() error
- func (s *P2PHashSync) Set() rangesync.OrderedSet
- func (s *P2PHashSync) Start()
- func (s *P2PHashSync) StartAndSync(ctx context.Context) error
- func (s *P2PHashSync) Stop()
- func (s *P2PHashSync) Synced() bool
- func (s *P2PHashSync) WaitForSync(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDispatcher ¶ added in v1.7.9
Types ¶
type ATXHandler ¶ added in v1.7.9
type ATXHandler struct {
// contains filtered or unexported fields
}
func NewATXHandler ¶ added in v1.7.9
type ATXSyncSource ¶ added in v1.7.9
type ATXSyncSource struct {
// contains filtered or unexported fields
}
func NewATXSyncSource ¶ added in v1.7.9
func (*ATXSyncSource) CreateHashSync ¶ added in v1.7.9
func (as *ATXSyncSource) CreateHashSync(name string, cfg Config, epoch types.EpochID) (HashSync, error)
CreateHashSync implements HashSyncSource.
type Config ¶
type Config struct { rangesync.RangeSetReconcilerConfig `mapstructure:",squash"` multipeer.MultiPeerReconcilerConfig `mapstructure:",squash"` TrafficLimit int `mapstructure:"traffic-limit"` MessageLimit int `mapstructure:"message-limit"` MaxDepth uint `mapstructure:"max-depth"` BatchSize uint `mapstructure:"batch-size"` MaxAttempts uint `mapstructure:"max-attempts"` MaxBatchRetries uint `mapstructure:"max-batch-retries"` FailedBatchDelay time.Duration `mapstructure:"failed-batch-delay"` }
Config contains the configuration for the P2PHashSync.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for the P2PHashSync.
type HashSyncSource ¶ added in v1.7.9
type LayerTicker ¶ added in v1.7.9
type MultiEpochATXSyncer ¶ added in v1.7.9
type MultiEpochATXSyncer struct {
// contains filtered or unexported fields
}
func NewMultiEpochATXSyncer ¶ added in v1.7.9
func NewMultiEpochATXSyncer( logger *zap.Logger, hss HashSyncSource, oldCfg, newCfg Config, parallelLoadLimit int, ) (*MultiEpochATXSyncer, error)
func (*MultiEpochATXSyncer) EnsureSync ¶ added in v1.7.9
func (s *MultiEpochATXSyncer) EnsureSync( ctx context.Context, lastWaitEpoch, newEpoch types.EpochID, ) (lastSynced types.EpochID, err error)
EnsureSync ensures that ATX sync is active for all the epochs up to and including currentEpoch, and that all ATXs are synced up to and including lastWaitEpoch. If newEpoch argument is non-zero, faster but less memory efficient sync is used for that epoch, based on the newCfg (larger maxDepth). For other epochs, oldCfg is used which corresponds to slower but more memory efficient sync (smaller maxDepth). It returns the last epoch that was synced synchronously.
func (*MultiEpochATXSyncer) Stop ¶ added in v1.7.9
func (s *MultiEpochATXSyncer) Stop()
Stop stops all ATX syncers.
type P2PHashSync ¶
type P2PHashSync struct {
// contains filtered or unexported fields
}
P2PHashSync is handles the synchronization of a local OrderedSet against other peers.
func NewATXSyncer ¶ added in v1.7.9
func NewP2PHashSync ¶
func NewP2PHashSync( logger *zap.Logger, d *rangesync.Dispatcher, name string, os rangesync.OrderedSet, keyLen int, peers *peers.Peers, handler multipeer.SyncKeyHandler, cfg Config, enableActiveSync bool, ) (*P2PHashSync, error)
NewP2PHashSync creates a new P2PHashSync.
func (*P2PHashSync) Load ¶
func (s *P2PHashSync) Load() error
Load loads the OrderedSet from the underlying storage.
func (*P2PHashSync) Set ¶
func (s *P2PHashSync) Set() rangesync.OrderedSet
Set returns the OrderedSet that is being synchronized.
func (*P2PHashSync) Start ¶
func (s *P2PHashSync) Start()
Start starts the multi-peer reconciler if it is not already running.
func (*P2PHashSync) StartAndSync ¶ added in v1.7.9
func (s *P2PHashSync) StartAndSync(ctx context.Context) error
StartAndSync starts the multi-peer reconciler if it is not already running, and waits until the local OrderedSet is in sync with the peers.
func (*P2PHashSync) Synced ¶
func (s *P2PHashSync) Synced() bool
Synced returns true if the local OrderedSet is in sync with the peers, as determined by the multi-peer reconciler.
func (*P2PHashSync) WaitForSync ¶
func (s *P2PHashSync) WaitForSync(ctx context.Context) error
WaitForSync waits until the local OrderedSet is in sync with the peers.