Documentation
¶
Overview ¶
@author Couchbase <info@couchbase.com> @copyright 2015 Couchbase, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
@author Couchbase <info@couchbase.com> @copyright 2015 Couchbase, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func RegisterManager(mgr Manager, errorPolicy revrpc.BabysitErrorPolicy) error
- type AutofailoverManager
- type Cancel
- type CancelTaskReq
- type DefragmentedUtilizationInfo
- type DefragmentedUtilizationReply
- type GetCurrentTopologyReq
- type GetTaskListReq
- type HealthInfo
- type Manager
- type NodeID
- type NodeInfo
- type Priority
- type RecoveryType
- type Revision
- type ServerlessManager
- type Task
- type TaskList
- type TaskStatus
- type TaskType
- type Topology
- type TopologyChange
- type TopologyChangeType
- type Void
Constants ¶
const ( TaskTypeRebalance = TaskType("task-rebalance") TaskTypePrepared = TaskType("task-prepared") )
const ( TaskStatusRunning = TaskStatus("task-running") TaskStatusFailed = TaskStatus("task-failed") )
const ( RecoveryTypeFull = RecoveryType("recovery-full") RecoveryTypeDelta = RecoveryType("recovery-delta") )
const ( TopologyChangeTypeRebalance = TopologyChangeType("topology-change-rebalance") TopologyChangeTypeFailover = TopologyChangeType("topology-change-failover") )
Variables ¶
Functions ¶
func RegisterManager ¶
func RegisterManager(mgr Manager, errorPolicy revrpc.BabysitErrorPolicy) error
Types ¶
type AutofailoverManager ¶
type AutofailoverManager interface {
// returns HealthInfo if the service considers itself overall
// healthy and error otherwise
HealthCheck() (*HealthInfo, error)
// returns nil if the auto failover is safe from the service
// perspective for the NodeID's passed, and error otherwise
IsSafe(nodeUUIDs []NodeID) error
}
type CancelTaskReq ¶
type DefragmentedUtilizationInfo ¶ added in v0.1.3
type DefragmentedUtilizationReply ¶ added in v0.1.3
type DefragmentedUtilizationReply struct {
Info *DefragmentedUtilizationInfo
}
For some strange reason golang jsonrpc doesn't allow to return any marshallable type except struct. So we have to wrap map returned by the service into structure to deal with this peculiarity.
type GetCurrentTopologyReq ¶
type GetTaskListReq ¶
type HealthInfo ¶
type HealthInfo struct {
// number of the disk failures encountered since the
// start of the service executable
DiskFailures int `json:"diskFailures"`
}
type Manager ¶
type Manager interface {
GetNodeInfo() (*NodeInfo, error)
Shutdown() error
GetTaskList(rev Revision, cancel Cancel) (*TaskList, error)
CancelTask(id string, rev Revision) error
GetCurrentTopology(rev Revision, cancel Cancel) (*Topology, error)
PrepareTopologyChange(change TopologyChange) error
StartTopologyChange(change TopologyChange) error
}
type RecoveryType ¶
type RecoveryType string
type ServerlessManager ¶ added in v0.1.3
type ServerlessManager interface {
// returns projected utilization stats if the service would
// be defragmented
GetDefragmentedUtilization() (*DefragmentedUtilizationInfo, error)
}
type Task ¶
type Task struct {
Rev Revision `json:"rev"`
ID string `json:"id"`
Type TaskType `json:"type"`
Status TaskStatus `json:"status"`
IsCancelable bool `json:"isCancelable"`
Progress float64 `json:"progress"`
DetailedProgress map[NodeID]float64 `json:"detailedProgress,omitempty"`
Description string `json:"description,omitempty"`
ErrorMessage string `json:"errorMessage,omitempty"`
Extra map[string]interface{} `json:"extra"`
}
type TaskStatus ¶
type TaskStatus string
type TopologyChange ¶
type TopologyChange struct {
ID string `json:"id"`
CurrentTopologyRev Revision `json:"currentTopologyRev"`
Type TopologyChangeType `json:"type"`
KeepNodes []struct {
NodeInfo NodeInfo `json:"nodeInfo"`
RecoveryType RecoveryType `json:"recoveryType"`
} `json:"keepNodes"`
EjectNodes []NodeInfo `json:"ejectNodes"`
}
type TopologyChangeType ¶
type TopologyChangeType string