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 CurrentMaintenanceServer
- type CurrentMaintenanceServerMode
- type CurrentMaintenanceServers
- 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 Servers
- 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 driver.ServerID) (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) PlanServers() Servers
- func (s State) ShardsByDBServers() map[Server]int
- type Supervision
- 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 { MaintenanceServers CurrentMaintenanceServers `json:"MaintenanceServers,omitempty"` Collections CurrentCollections `json:"Collections"` // ServersKnown stores information about ArangoDB servers. ServersKnown map[driver.ServerID]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 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 CurrentMaintenanceServers ¶
type CurrentMaintenanceServers map[Server]CurrentMaintenanceServer
func (CurrentMaintenanceServers) InMaintenance ¶
func (s CurrentMaintenanceServers) InMaintenance(server Server) bool
type DB ¶
type DB struct {
ArangoSync ArangoSyncLazy `json:"arangosync,omitempty"`
}
type Plan ¶
type Plan struct { Collections PlanCollections `json:"Collections"` Databases PlanDatabases `json:"Databases,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 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) PlanServers ¶
PlanServers returns all servers which are part of the plan
func (State) ShardsByDBServers ¶
ShardsByDBServers returns a map of DBServers and the amount of shards they have
type Supervision ¶
type Supervision struct {
Maintenance Timestamp `json:"Maintenance,omitempty"`
}
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
}