replicate

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultVerifyInterval is the default amount of time between verify operations.
	DefaultVerifyInterval = 1 * time.Second

	// DefaultReplicateConcurrency is the default number of replicator routines.
	DefaultReplicateConcurrency = uint(1)

	// DefaultVerifyTimeout is the default timeout for the replicator's verify retries.
	DefaultVerifyTimeout = 60 * time.Second

	// DefaultMaxErrRate is the default maximum allowed error rate for verify & store requests
	// before a fatal error is thrown.
	DefaultMaxErrRate = 0.5

	// DefaultReportMetrics is the default setting for whether the replicator reports Prometheus
	// metrics.
	DefaultReportMetrics = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Parameters

type Parameters struct {
	VerifyInterval       time.Duration
	ReplicateConcurrency uint
	VerifyTimeout        time.Duration
	MaxErrRate           float32
	ReportMetrics        bool
}

Parameters is the replicator parameters.

func NewDefaultParameters

func NewDefaultParameters() *Parameters

NewDefaultParameters returns the default replicator parameters.

type Replicator

type Replicator interface {
	// Start starts the replicator routines.
	Start() error

	// Stop gracefully stops the replicator routines.
	Stop()
}

Replicator is a long-running routine that iterates through stored documents and verified that they are fully replicated. When they are not, it issues Store requests to close peers to bring their replication up to the desired level.

func NewReplicator

func NewReplicator(
	peerID ecid.ID,
	orgID ecid.ID,
	rt routing.Table,
	docS storage.DocumentStorer,
	verifier verify.Verifier,
	storer store.Storer,
	replicatorParams *Parameters,
	verifyParams *verify.Parameters,
	storeParams *store.Parameters,
	rng *rand.Rand,
	logger *zap.Logger,
) Replicator

NewReplicator returns a new Replicator.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL