Documentation ¶
Index ¶
- Variables
- type Address
- type AliasMetadata
- type BoundAddress
- type ClusterBlocks
- type ClusterChangedEvent
- type ClusterService
- type ClusterState
- type ClusterStateUpdateTask
- type CoordinationState
- type Index
- type IndexAbstractionAlias
- type IndexMetadata
- type IndexMetadataState
- type IndexRoutingTable
- type IndexShardRoutingTable
- type Join
- type MappingMetadata
- type Metadata
- type Node
- type Nodes
- type OnDiskState
- type PersistedState
- type RoutingNode
- type RoutingNodes
- type RoutingTable
- type ShardId
- type ShardRouting
- type VoteCollection
- type VotingConfiguration
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EmptyMetadata = Metadata{ Indices: map[string]IndexMetadata{}, } )
View Source
var ( NoOnDiskState = OnDiskState{ Metadata: EmptyMetadata, } )
Functions ¶
This section is empty.
Types ¶
type AliasMetadata ¶
type AliasMetadata struct {
Alias string
}
type BoundAddress ¶
type BoundAddress struct { }
type ClusterBlocks ¶
type ClusterBlocks struct { }
type ClusterChangedEvent ¶
type ClusterChangedEvent struct { State ClusterState PrevState ClusterState }
func (*ClusterChangedEvent) IndicesDeleted ¶
func (e *ClusterChangedEvent) IndicesDeleted() []Index
type ClusterService ¶
type ClusterService interface { State() *ClusterState SubmitStateUpdateTask(task ClusterStateUpdateTask) }
type ClusterState ¶
type ClusterState struct { Version int64 StateUUID string Name string Nodes *Nodes Metadata Metadata //Blocks ClusterBlocks RoutingTable RoutingTable }
ClusterState
func ClusterStateFromBytes ¶
func ClusterStateFromBytes(b []byte, localNode Node) *ClusterState
func (*ClusterState) ToBytes ¶
func (c *ClusterState) ToBytes() []byte
type ClusterStateUpdateTask ¶
type ClusterStateUpdateTask func(s ClusterState) ClusterState
type CoordinationState ¶
type CoordinationState struct { LocalNode *Node PersistedState PersistedState Term int64 // 원래는 PersistedState에서 관리, 임시로 CoordinationState 여기서 관리하도록 JoinVotes *VoteCollection PublishVotes *VoteCollection ElectionWon bool }
func (*CoordinationState) IsElectionQuorum ¶
func (c *CoordinationState) IsElectionQuorum(nodes []string) bool
type IndexAbstractionAlias ¶
type IndexAbstractionAlias struct { AliasName string WriteIndex IndexMetadata }
type IndexMetadata ¶
type IndexMetadata struct { Index Index NumberOfShards int //NumberOfReplicas int //Version int64 //State IndexMetadataState Aliases map[string]AliasMetadata Mapping map[string]MappingMetadata }
type IndexMetadataState ¶
type IndexMetadataState int
Metadata
const ( OPEN IndexMetadataState = iota CLOSE )
type IndexRoutingTable ¶
type IndexRoutingTable struct { Index Index Shards map[int]IndexShardRoutingTable }
type IndexShardRoutingTable ¶
type IndexShardRoutingTable struct { ShardId ShardId Primary ShardRouting }
type MappingMetadata ¶
type: "_doc" source: "properties: {}"
type Metadata ¶
type Metadata struct { //ClusterUUID string //Version int64 //Coordination CoordinationMetadata Indices map[string]IndexMetadata //Templates map[string]IndexTemplateMetadata IndicesLookup map[string]IndexAbstractionAlias }
func (*Metadata) FindAliases ¶
func (m *Metadata) FindAliases(aliases []string, concreteIndices []string) map[string][]AliasMetadata
type Node ¶
type Node struct { Name string Id string //ephemeralId string //HostName string HostAddress string }
func NodeFromBytes ¶
type Nodes ¶
type Nodes struct { Nodes map[string]Node DataNodes map[string]Node MasterNodes map[string]Node MasterNodeId string LocalNodeId string }
func (*Nodes) MasterNode ¶
type OnDiskState ¶
type PersistedState ¶
type PersistedState interface { GetLastAcceptedState() *ClusterState SetLastAcceptedState(state *ClusterState) }
type RoutingNode ¶
type RoutingNode struct { NodeId string Shards map[ShardId]ShardRouting ShardsByIndex map[string]map[ShardRouting]struct{} // contains filtered or unexported fields }
func (*RoutingNode) Add ¶
func (n *RoutingNode) Add(shard ShardRouting)
func (*RoutingNode) NumShards ¶
func (n *RoutingNode) NumShards() int
func (*RoutingNode) NumShardsOfIndex ¶
func (n *RoutingNode) NumShardsOfIndex(index string) int
type RoutingNodes ¶
type RoutingNodes struct { NodesToShards map[string]*RoutingNode UnassignedShards []*ShardRouting }
func NewRoutingNodes ¶
func NewRoutingNodes(clusterState ClusterState) *RoutingNodes
type RoutingTable ¶
type RoutingTable struct {
IndicesRouting map[string]IndexRoutingTable
}
type ShardRouting ¶
type VoteCollection ¶
type VoteCollection struct {
// contains filtered or unexported fields
}
VoteCollection
func NewVoteCollection ¶
func NewVoteCollection() *VoteCollection
func (*VoteCollection) AddJoinVote ¶
func (v *VoteCollection) AddJoinVote(join Join) bool
func (*VoteCollection) AddVote ¶
func (v *VoteCollection) AddVote(sourceNode *Node) bool
func (*VoteCollection) IsQuorum ¶
func (v *VoteCollection) IsQuorum(nodes []string) bool
type VotingConfiguration ¶
type VotingConfiguration struct { // nodeIds map[string]bool NodeIds []string }
func NewVotingConfiguration ¶
func NewVotingConfiguration() *VotingConfiguration
Source Files ¶
Click to show internal directories.
Click to hide internal directories.