Documentation
¶
Index ¶
- type ArangoSync
- type ArangoSyncIncomingState
- type ArangoSyncLazy
- type ArangoSyncOutgoingState
- type ArangoSyncState
- type CollectionShardDetail
- type CollectionShardDetails
- type Current
- type CurrentCollections
- type CurrentDBCollection
- type CurrentDBCollections
- type CurrentDBShard
- type CurrentMaintenanceDBServers
- type CurrentMaintenanceServer
- type CurrentMaintenanceServerMode
- type DB
- type DumpState
- type Exists
- type Job
- type JobID
- type JobPhase
- type Jobs
- type Plan
- type PlanCollection
- func (a PlanCollection) GetName(d string) string
- func (a *PlanCollection) GetReplicationFactor(shard string) ReplicationFactor
- func (a *PlanCollection) GetWriteConcern(def int) int
- func (a *PlanCollection) GetWriteConcernP() *int
- func (a *PlanCollection) IsDBServerInShards(name Server) bool
- func (a *PlanCollection) IsDBServerLeader(name Server) bool
- type PlanCollections
- type PlanDBCollections
- type PlanDatabase
- type PlanDatabases
- type ReplicationFactor
- type Root
- type Server
- type ServerKnown
- type ServerMap
- type Servers
- type ShardCountDetails
- type ShardDetails
- type ShardFilter
- type ShardStatus
- type Shards
- type ShardsSyncStatus
- type State
- func (s State) CountShards() int
- func (s State) Filter(f ShardFilter) CollectionShardDetails
- func (s State) GetCollectionDatabaseByID(id string) (string, bool)
- func (s State) GetDBServerWithLowestShards() Server
- func (s State) GetRebootID(id Server) (int, bool)
- func (s State) GetShardDetailsByID(id string) (ShardDetails, bool)
- func (s State) GetShardsStatus() map[string]bool
- func (s State) IsShardInSync(db, col, shard string, servers Servers) bool
- func (s State) PlanLeaderServers() Servers
- func (s State) PlanLeaderServersWithFailOver() Servers
- func (s State) PlanServerUsage(id Server) ShardCountDetails
- func (s State) PlanServers() Servers
- func (s State) ShardsByDBServers() map[Server]ShardCountDetails
- type Supervision
- type SupervisionHealthServer
- type SupervisionHealthServerStatus
- type SupervisionHealthServerSyncStatus
- type Target
- type TargetHotBackup
- type Timestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArangoSync ¶
type ArangoSync struct {
State ArangoSyncState `json:"synchronizationState"`
}
func (*ArangoSync) IsSyncInProgress ¶
func (a *ArangoSync) IsSyncInProgress() bool
type ArangoSyncIncomingState ¶
type ArangoSyncIncomingState struct {
State *string `json:"state,omitempty"`
}
type ArangoSyncLazy ¶
type ArangoSyncLazy struct {
Error error
*ArangoSync
}
ArangoSyncLazy allows failure during load of the Sync state
func (*ArangoSyncLazy) UnmarshalJSON ¶
func (a *ArangoSyncLazy) UnmarshalJSON(bytes []byte) error
type ArangoSyncOutgoingState ¶
type ArangoSyncOutgoingState struct {
Targets Exists `json:"targets,omitempty"`
}
type ArangoSyncState ¶
type ArangoSyncState struct {
Incoming ArangoSyncIncomingState `json:"incoming"`
Outgoing ArangoSyncOutgoingState `json:"outgoing"`
}
type CollectionShardDetail ¶
type CollectionShardDetails ¶
type CollectionShardDetails []CollectionShardDetail
func GetDBServerBlockingRestartShards ¶
func GetDBServerBlockingRestartShards(s State, serverID Server) CollectionShardDetails
func GetDBServerShardsNotInSync ¶
func GetDBServerShardsNotInSync(s State, serverID Server) CollectionShardDetails
type Current ¶
type Current struct {
MaintenanceDBServers CurrentMaintenanceDBServers `json:"MaintenanceDBServers,omitempty"`
Collections CurrentCollections `json:"Collections"`
// ServersKnown stores information about ArangoDB servers.
ServersKnown ServerMap[ServerKnown] `json:"ServersKnown,omitempty"`
}
type CurrentCollections ¶
type CurrentCollections map[string]CurrentDBCollections
CurrentCollections is a map of database name to collections
func (CurrentCollections) IsDBServerPresent ¶
func (a CurrentCollections) IsDBServerPresent(name Server) bool
type CurrentDBCollection ¶
type CurrentDBCollection map[string]CurrentDBShard
CurrentDBCollection is a map of Shard name to Shard details
func (CurrentDBCollection) IsDBServerPresent ¶
func (a CurrentDBCollection) IsDBServerPresent(name Server) bool
type CurrentDBCollections ¶
type CurrentDBCollections map[string]CurrentDBCollection
CurrentDBCollections is a map of collection name to shards
func (CurrentDBCollections) IsDBServerPresent ¶
func (a CurrentDBCollections) IsDBServerPresent(name Server) bool
type CurrentDBShard ¶
type CurrentDBShard struct {
Servers Servers `json:"servers,omitempty"`
}
type CurrentMaintenanceDBServers ¶
type CurrentMaintenanceDBServers map[Server]CurrentMaintenanceServer
func (CurrentMaintenanceDBServers) InMaintenance ¶
func (s CurrentMaintenanceDBServers) InMaintenance(server Server) bool
type CurrentMaintenanceServer ¶
type CurrentMaintenanceServer struct {
Mode *CurrentMaintenanceServerMode `json:"Mode,omitempty"`
Until Timestamp `json:"Until,omitempty"`
}
func (*CurrentMaintenanceServer) InMaintenance ¶
func (s *CurrentMaintenanceServer) InMaintenance() bool
type CurrentMaintenanceServerMode ¶
type CurrentMaintenanceServerMode string
const (
CurrentMaintenanceServerModeMaintenance CurrentMaintenanceServerMode = "maintenance"
)
type DB ¶
type DB struct {
ArangoSync ArangoSyncLazy `json:"arangosync,omitempty"`
}
type Plan ¶
type Plan struct {
Collections PlanCollections `json:"Collections"`
Databases PlanDatabases `json:"Databases,omitempty"`
DBServers ServerMap[string] `json:"DBServers,omitempty"`
Coordinators ServerMap[string] `json:"Coordinators,omitempty"`
}
type PlanCollection ¶
type PlanCollection struct {
Name *string `json:"name"`
Shards Shards `json:"shards"`
// deprecated
// MinReplicationFactor is deprecated, but we have to support it for backward compatibility
MinReplicationFactor *int `json:"minReplicationFactor,omitempty"`
WriteConcern *int `json:"writeConcern,omitempty"`
ReplicationFactor *ReplicationFactor `json:"replicationFactor,omitempty"`
DistributeShardsLike *string `json:"distributeShardsLike,omitempty"`
}
func (PlanCollection) GetName ¶
func (a PlanCollection) GetName(d string) string
func (*PlanCollection) GetReplicationFactor ¶
func (a *PlanCollection) GetReplicationFactor(shard string) ReplicationFactor
func (*PlanCollection) GetWriteConcern ¶
func (a *PlanCollection) GetWriteConcern(def int) int
func (*PlanCollection) GetWriteConcernP ¶
func (a *PlanCollection) GetWriteConcernP() *int
func (*PlanCollection) IsDBServerInShards ¶
func (a *PlanCollection) IsDBServerInShards(name Server) bool
func (*PlanCollection) IsDBServerLeader ¶
func (a *PlanCollection) IsDBServerLeader(name Server) bool
type PlanCollections ¶
type PlanCollections map[string]PlanDBCollections
PlanCollections is a map of database name to collections
func (PlanCollections) IsDBServerLeader ¶
func (a PlanCollections) IsDBServerLeader(name Server) bool
func (PlanCollections) IsDBServerPresent ¶
func (a PlanCollections) IsDBServerPresent(name Server) bool
type PlanDBCollections ¶
type PlanDBCollections map[string]PlanCollection
PlanDBCollections is a map of collection name to collection details
func (PlanDBCollections) CountShards ¶
func (a PlanDBCollections) CountShards() int
func (PlanDBCollections) IsDBServerInCollections ¶
func (a PlanDBCollections) IsDBServerInCollections(name Server) bool
func (PlanDBCollections) IsDBServerLeaderInCollections ¶
func (a PlanDBCollections) IsDBServerLeaderInCollections(name Server) bool
type PlanDatabase ¶
type PlanDatabase struct {
ID string `json:"id"`
}
type PlanDatabases ¶
type PlanDatabases map[string]PlanDatabase
type ReplicationFactor ¶
type ReplicationFactor int
const ( UnknownReplicationFactor ReplicationFactor = -1000 SatelliteReplicationFactor ReplicationFactor = -100 )
func (*ReplicationFactor) IsNil ¶
func (r *ReplicationFactor) IsNil() bool
func (*ReplicationFactor) IsSatellite ¶
func (r *ReplicationFactor) IsSatellite() bool
func (*ReplicationFactor) IsUnknown ¶
func (r *ReplicationFactor) IsUnknown() bool
func (*ReplicationFactor) UnmarshalJSON ¶
func (r *ReplicationFactor) UnmarshalJSON(bytes []byte) error
type ServerKnown ¶
type ServerKnown struct {
// RebootID is an incremental value which describes how many times server was restarted.
RebootID int `json:"rebootId"`
}
ServerKnown stores information about single ArangoDB server.
type ShardCountDetails ¶
type ShardCountDetails struct {
Leader, Follower int
}
func (ShardCountDetails) Add ¶
func (s ShardCountDetails) Add(leader bool) ShardCountDetails
func (ShardCountDetails) Count ¶
func (s ShardCountDetails) Count() int
type ShardDetails ¶
type ShardFilter ¶
func FilterDBServerShardRestart ¶
func FilterDBServerShardRestart(serverID Server) ShardFilter
func FilterDBServerShardsNotInSync ¶
func FilterDBServerShardsNotInSync(serverID Server) ShardFilter
func NegateFilter ¶
func NegateFilter(in ShardFilter) ShardFilter
type ShardStatus ¶
type ShardStatus struct {
IsSynced bool
}
type ShardsSyncStatus ¶
func (ShardsSyncStatus) NotInSyncSince ¶
func (s ShardsSyncStatus) NotInSyncSince(t time.Duration) []string
NotInSyncSince returns a list of shards that have not been in sync for at least t.
type State ¶
type State struct {
Supervision Supervision `json:"Supervision"`
Plan Plan `json:"Plan"`
Current Current `json:"Current"`
Target Target `json:"Target"`
}
func (State) CountShards ¶
func (State) Filter ¶
func (s State) Filter(f ShardFilter) CollectionShardDetails
func (State) GetCollectionDatabaseByID ¶
GetCollectionDatabaseByID find Database name by Collection ID
func (State) GetDBServerWithLowestShards ¶
GetDBServerWithLowestShards returns the DBServer with the lowest amount of shards
func (State) GetRebootID ¶
GetRebootID returns reboot ID for a given server ID. returns false when a server ID does not exist in cache.
func (State) GetShardDetailsByID ¶
func (s State) GetShardDetailsByID(id string) (ShardDetails, bool)
GetShardDetailsByID returns the ShardDetails for a given ShardID. If the ShardID is not found, the second return value is false
func (State) GetShardsStatus ¶
func (State) IsShardInSync ¶
func (State) PlanLeaderServers ¶
PlanLeaderServers returns all servers which are part of the plan as a leader
func (State) PlanLeaderServersWithFailOver ¶
PlanLeaderServersWithFailOver returns all servers which are part of the plan as a leader and can fail over
func (State) PlanServerUsage ¶
func (s State) PlanServerUsage(id Server) ShardCountDetails
PlanServerUsage returns number of the shards and replicas by a server
func (State) PlanServers ¶
PlanServers returns all servers which are part of the plan
func (State) ShardsByDBServers ¶
func (s State) ShardsByDBServers() map[Server]ShardCountDetails
ShardsByDBServers returns a map of DBServers and the amount of shards they have
type Supervision ¶
type Supervision struct {
Maintenance Timestamp `json:"Maintenance,omitempty"`
Health ServerMap[SupervisionHealthServer] `json:"Health,omitempty"`
}
type SupervisionHealthServer ¶
type SupervisionHealthServer struct {
Status SupervisionHealthServerStatus `json:"Status,omitempty"`
SyncStatus SupervisionHealthServerSyncStatus `json:"SyncStatus,omitempty"`
}
func (SupervisionHealthServer) IsHealthy ¶
func (s SupervisionHealthServer) IsHealthy() bool
type SupervisionHealthServerStatus ¶
type SupervisionHealthServerStatus string
const (
SupervisionHealthServerStatusGood SupervisionHealthServerStatus = "GOOD"
)
type SupervisionHealthServerSyncStatus ¶
type SupervisionHealthServerSyncStatus string
const (
SupervisionHealthServerSyncStatusServing SupervisionHealthServerSyncStatus = "SERVING"
)
type Target ¶
type Target struct {
JobToDo Jobs `json:"ToDo,omitempty"`
JobPending Jobs `json:"Pending,omitempty"`
JobFailed Jobs `json:"Failed,omitempty"`
JobFinished Jobs `json:"Finished,omitempty"`
CleanedServers Servers `json:"CleanedServers,omitempty"`
ToBeCleanedServers Servers `json:"ToBeCleanedServers,omitempty"`
HotBackup TargetHotBackup `json:"HotBackup,omitempty"`
}
type TargetHotBackup ¶
type TargetHotBackup struct {
Create Timestamp `json:"Create,omitempty"`
}
type Timestamp ¶
type Timestamp struct {
// contains filtered or unexported fields
}