placement

package
v0.0.0-...-b51351f Latest Latest
Warning

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

Go to latest
Published: May 18, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClusterMappingProvider

func NewClusterMappingProvider(key string, kvStore kv.Store, opts ClusterMappingProviderOptions,
) (storage.ClusterMappingProvider, error)

NewClusterMappingProvider returns a new ClusterMappingProvider around a kv store and key

func NewShardSet

func NewShardSet(toSet ...uint) *schema.ShardSet

NewShardSet returns a new shard set initialized with a list of shards

Types

type ClusterMappingProviderOptions

type ClusterMappingProviderOptions interface {
	// Logger is the logger to use
	Logger(logger xlog.Logger) ClusterMappingProviderOptions
	GetLogger() xlog.Logger

	// Clock is the clock to use
	Clock(clock clock.Clock) ClusterMappingProviderOptions
	GetClock() clock.Clock
}

ClusterMappingProviderOptions are options used to build a ClusterMappingProvider

func NewClusterMappingProviderOptions

func NewClusterMappingProviderOptions() ClusterMappingProviderOptions

NewClusterMappingProviderOptions returns new empty ClusterMappingProviderOptions

type CommitOptions

type CommitOptions interface {
	// RolloutDelay is the amount of time to wait for the configuration to be
	// distributed across all interested listeners
	GetRolloutDelay() time.Duration
	RolloutDelay(t time.Duration) CommitOptions

	// TransitionDelay is the amount of time to wait for the cluster to converge
	// on the same state after a transition
	GetTransitionDelay() time.Duration
	TransitionDelay(t time.Duration) CommitOptions
}

CommitOptions are options for performing a commit

func NewCommitOptions

func NewCommitOptions() CommitOptions

NewCommitOptions returns an empty set of CommitOptions

type StoragePlacement

type StoragePlacement interface {
	// AddDatabase adds a new database to handle a set of retention periods
	AddDatabase(db schema.DatabaseProperties) error

	// JoinCluster adds a new cluster to an existing database and rebalances
	// shards onto that cluster
	JoinCluster(db string, c schema.ClusterProperties, config proto.Message) error

	// DecommissionCluster marks a cluster as being decomissioned, moving
	// its shards to other clusters.  Read traffic will continue to be directed
	// to this cluster until the max retention period for this database expires
	DecommissionCluster(db, c string) error

	// UpdateClusterConfig updates the configurtion for a cluster
	UpdateClusterConfig(db, c string, config proto.Message) error

	// CommitChanges commits and propagates any unapplied changes
	CommitChanges(version int, opts CommitOptions) error

	// GetPendingChanges gets pending placement changes
	GetPendingChanges() (int, *schema.Placement, *schema.PlacementChanges, error)
}

StoragePlacement handles mapping shards

func NewStoragePlacement

func NewStoragePlacement(kv kv.Store, key string, opts StoragePlacementOptions) (StoragePlacement, error)

NewStoragePlacement creates a new StoragePlacement around a given config store

type StoragePlacementOptions

type StoragePlacementOptions interface {
	// Clock is the clock to use in placement
	GetClock() clock.Clock
	Clock(c clock.Clock) StoragePlacementOptions

	// Logger is the logger to use in placement
	GetLogger() xlog.Logger
	Logger(l xlog.Logger) StoragePlacementOptions
}

StoragePlacementOptions are options to building a storage placement

func NewStoragePlacementOptions

func NewStoragePlacementOptions() StoragePlacementOptions

NewStoragePlacementOptions creates new StoragePlacementOptions

Jump to

Keyboard shortcuts

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