Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultConcurrentReality = 3 // Normal replications will have no timeout, but daemon sets will // because it is unlikely that all hosts are healthy at all times NoTimeout = time.Duration(-1) )
Variables ¶
This section is empty.
Functions ¶
func AggregateHealth ¶
func IsFatalError ¶
Types ¶
type Replication ¶
type Replication interface { // Proceed with the prescribed replication Enact() // Cancel the prescribed replication Cancel() // Will block until the r.quitCh is closed // this is used to synchronize updates which quickly cancel and re-enact the replicaton WaitForReplication() CompletedCount() int32 InProgress() bool // SetManifest() can be used to change the manifest while a replication is in progress SetManifest(manifest.Manifest) // SetTimeout() is used to change the timeout used for the replication while it is in progress SetTimeout(timeout time.Duration) }
type Replicator ¶
type Replicator interface { InitializeReplication( overrideLock bool, ignoreControllers bool, concurrentRealityNodes int, rateLimitInterval time.Duration, podLabels map[string]string, ) (Replication, chan error, error) // InitializeDaemonSetReplication creates a Replication with parameters suitable for a daemon set. // Specifically: // * hosts are not locked // * replication controllers are ignored // * and preparers are not checked. InitializeDaemonSetReplication( nodeQueue chan types.NodeName, concurrentRealityRequests int, rateLimitInterval time.Duration, podLabels map[string]string, ) (Replication, chan error, error) }
func NewReplicator ¶
func NewReplicator( manifest manifest.Manifest, logger logging.Logger, nodes []types.NodeName, active int, store Store, txner transaction.Txner, labeler Labeler, health checker.HealthChecker, threshold health.HealthState, lockMessage string, timeout time.Duration, healthWatchDelay time.Duration, ) (Replicator, error)
type Store ¶
type Store interface { SetPodTxn( ctx context.Context, podPrefix consul.PodPrefix, nodename types.NodeName, manifest manifest.Manifest, ) error Pod(podPrefix consul.PodPrefix, nodename types.NodeName, podId types.PodID) (manifest.Manifest, time.Duration, error) NewSession(name string, renewalCh <-chan time.Time) (consul.Session, chan error, error) LockHolder(key string) (string, string, error) DestroyLockHolder(id string) error }
Click to show internal directories.
Click to hide internal directories.