Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DefaultStorageConfig = StorageConfig{
StorageType: storageTypeDynamo,
StorageRegion: defaultRegion,
StorageTable: defaultTable,
StorageTag: defaultTag,
UpdateFrequencySeconds: defaultUpdateFrequencySeconds,
UpdateTtlSeconds: defaultUpdateTtlSeconds,
ForcedHostname: defaultForcedHostname,
}
)
Functions ¶
func GetTaskArn ¶ added in v1.1.0
func InitDistributorConfigs ¶
Types ¶
type AWSTaskMetadata ¶ added in v1.1.0
type AWSTaskMetadata struct {
TaskARN string
}
type Controller ¶
type Controller struct { Distributor ShardDistributor ShardConfig StorageConfig map[string]interface{} sync.RWMutex }
Controller represents persistence and work sharing elements
type ControllerConfig ¶
type ControllerConfig struct { //Name string ShardConfig StorageConfig StorageConfig NodeName string }
ControllerConfig contains cluster and node based configuration data
func DefaultControllerConfig ¶
func DefaultControllerConfig() *ControllerConfig
DefaultControllerConfig generates a default configuration based on a local dynamo instance
type NodeStateManager ¶
interface to get node state in the cluster
func GetDefaultNodeStateManager ¶
func GetDefaultNodeStateManager(identity string, configData StorageConfig) (NodeStateManager, error)
type ShardConfig ¶
type ShardConfig struct { Identity string `json:"identity"` NumShards int `json:"clusterShardNumber"` OwnedShards []string `json:"ownedShards"` }
ShardConfig represents the shard ownership of each node
type ShardDistributor ¶
type ShardDistributor interface { // Stop shuts down any resources used Stop() // Updates //return the ShardConfig channel Updates() ShardUpdater // Peers returns the list of healthy nodes Nodes() []string // Identity returns the identity of this node Identity() string // UpdateNumberShards sets a new number of shards, rehashes shards and publishes updates UpdateNumberShards(numShards int) }
ShardDistributor defines
func GetDefaultHashDistributor ¶
func GetDefaultHashDistributor(identity string, numShards int, configData StorageConfig) (ShardDistributor, error)
type ShardStatus ¶
ShardStatus represents a single shard's status
type ShardUpdater ¶
type ShardUpdater chan ShardConfig
ShardUpdater will return a ShardConfig whenever the configuration changes
type SimpleHashDistributor ¶
type SimpleHashDistributor struct { ShardConfig sync.Mutex // contains filtered or unexported fields }
func (*SimpleHashDistributor) Identity ¶
func (c *SimpleHashDistributor) Identity() string
Identity returns the note Identity that SimpleHashDistributor locate
func (*SimpleHashDistributor) Nodes ¶
func (c *SimpleHashDistributor) Nodes() []string
Nodes returns list of nodes
func (*SimpleHashDistributor) Stop ¶
func (c *SimpleHashDistributor) Stop()
Stop releases any resources
func (*SimpleHashDistributor) UpdateNumberShards ¶
func (c *SimpleHashDistributor) UpdateNumberShards(numShards int)
func (*SimpleHashDistributor) Updates ¶
func (c *SimpleHashDistributor) Updates() ShardUpdater
Updates returns the channel that SimpleHashDistributor will send ShardConfig updates on