Documentation ¶
Index ¶
- Constants
- Variables
- func HandleError(message string, err error, code int, w http.ResponseWriter)
- func UnmarshalTaskResponse(task *proto.AdminTask) (err error)
- func Warn(clusterID, msg string)
- func WarnBySpecialUmpKey(umpKey, msg string)
- type AdminTaskSender
- type Cluster
- func (c *Cluster) ChooseTargetDataHosts(replicaNum int) (hosts []string, err error)
- func (c *Cluster) ChooseTargetMetaHosts(replicaNum int) (hosts []string, peers []proto.Peer, err error)
- func (c *Cluster) CreateMetaPartition(volName string, start, end uint64) (err error)
- func (c *Cluster) CreateMetaPartitionForManual(volName string, start uint64) (err error)
- func (c *Cluster) DataNodeCount() (len int)
- func (c *Cluster) DisOrderArray(oldHosts []string) (newHosts []string, err error)
- func (c *Cluster) GetAvailCarryMetaNodeTab(maxTotal uint64, excludeHosts []string) (nodeTabs NodeTabArrSorterByCarry, availCount int)
- func (c *Cluster) GetMetaNodeMaxTotal() (maxTotal uint64)
- func (c *Cluster) UpdateDataNode(dataNode *DataNode, dps []*proto.PartitionReport)
- func (c *Cluster) UpdateMetaNode(metaNode *MetaNode, metaPartitions []*proto.MetaPartitionReport, ...)
- type ClusterConfig
- type ClusterView
- type DataNode
- type DataNodeView
- type DataPartition
- func (partition *DataPartition) AddMember(replica *DataReplica)
- func (partition *DataPartition) DeleteReplicaByIndex(index int)
- func (partition *DataPartition) GenerateCreateTasks() (tasks []*proto.AdminTask)
- func (partition *DataPartition) GenerateDeleteTask(addr string) (task *proto.AdminTask)
- func (partition *DataPartition) GetAvailableDataReplicas() (replicas []*DataReplica)
- func (partition *DataPartition) HostsToString() (hosts string)
- func (partition *DataPartition) IsInReplicas(host string) (replica *DataReplica, ok bool)
- func (partition *DataPartition) LoadFile(dataNode *DataNode, resp *proto.LoadDataPartitionResponse)
- func (partition *DataPartition) ReleaseDataPartition()
- func (partition *DataPartition) UpdateMetric(vr *proto.PartitionReport, dataNode *DataNode)
- type DataPartitionMap
- type DataPartitionResponse
- type DataPartitionValue
- type DataPartitionsView
- type DataReplica
- func (replica *DataReplica) CheckLocIsAvailContainsDiskError() (avail bool)
- func (replica *DataReplica) CheckMiss(missSec int64) (isMiss bool)
- func (replica *DataReplica) GetReplicaNode() (node *DataNode)
- func (replica *DataReplica) IsActive(timeOutSec int64) bool
- func (replica *DataReplica) IsLive(timeOutSec int64) (avail bool)
- func (replica *DataReplica) SetAlive()
- type FileCrc
- type FileCrcSorterByCount
- type FileInCore
- type FileMetaOnNode
- type IDAllocator
- type LeaderInfo
- type Master
- type MetaNode
- type MetaNodeView
- type MetaPartition
- type MetaPartitionValue
- type MetaPartitionView
- type MetaReplica
- type Metadata
- type MetadataFsm
- func (mf *MetadataFsm) Apply(command []byte, index uint64) (resp interface{}, err error)
- func (mf *MetadataFsm) ApplyMemberChange(confChange *proto.ConfChange, index uint64) (interface{}, error)
- func (mf *MetadataFsm) ApplySnapshot(peers []proto.Peer, iterator proto.SnapIterator) (err error)
- func (mf *MetadataFsm) BatchPut(cmdMap map[string][]byte) (err error)
- func (mf *MetadataFsm) Del(key interface{}) (interface{}, error)
- func (mf *MetadataFsm) DelKeyAndPutIndex(key string, cmdMap map[string][]byte) (err error)
- func (mf *MetadataFsm) Get(key interface{}) (interface{}, error)
- func (mf *MetadataFsm) HandleFatalEvent(err *raft.FatalError)
- func (mf *MetadataFsm) HandleLeaderChange(leader uint64)
- func (mf *MetadataFsm) Put(key, val interface{}) (interface{}, error)
- func (mf *MetadataFsm) RegisterApplyHandler(handler RaftCmdApplyHandler)
- func (mf *MetadataFsm) RegisterApplySnapshotHandler(handler RaftApplySnapshotHandler)
- func (mf *MetadataFsm) RegisterLeaderChangeHandler(handler RaftLeaderChangeHandler)
- func (mf *MetadataFsm) RegisterPeerChangeHandler(handler RaftPeerChangeHandler)
- func (mf *MetadataFsm) Snapshot() (proto.Snapshot, error)
- type MetadataSnapshot
- type Node
- type NodeTab
- type NodeTabArrSorterByCarry
- type Rack
- func (rack *Rack) DataNodeCount() (len int)
- func (rack *Rack) DisOrderArray(oldHosts []string) (newHosts []string, err error)
- func (rack *Rack) GetAvailCarryDataNodeTab(maxTotal uint64, excludeHosts []string, replicaNum int) (nodeTabs NodeTabArrSorterByCarry, availCount int)
- func (rack *Rack) GetDataNode(addr string) (dataNode *DataNode, err error)
- func (rack *Rack) GetDataNodeMaxTotal() (maxTotal uint64)
- func (rack *Rack) PutDataNode(dataNode *DataNode)
- func (rack *Rack) RemoveDataNode(addr string)
- type RaftApplySnapshotHandler
- type RaftCmdApplyHandler
- type RaftLeaderChangeHandler
- type RaftPeerChangeHandler
- type Topology
- type Vol
- type VolStatInfo
- type VolValue
- type VolView
Constants ¶
View Source
const ( MinTaskLen = 30 TaskWorkerInterval = time.Microsecond * time.Duration(200) ForceCloseConnect = true NoCloseConnect = false )
View Source
const ( ColonSplit = ":" CommaSplit = "," CfgPeers = "peers" DataPartitionMissSec = "dataPartitionMissSec" DataPartitionTimeOutSec = "dataPartitionTimeOutSec" EveryLoadDataPartitionCount = "everyLoadDataPartitionCount" FileDelayCheckCrc = "fileDelayCheckCrc" ReplicaNum = "replicaNum" )
View Source
const ( DefaultEveryReleaseDataPartitionCount = 50 DefaultReleaseDataPartitionAfterLoadSeconds = 5 * 60 DefaultReleaseDataPartitionInternalSeconds = 10 DefaultCheckHeartbeatIntervalSeconds = 60 DefaultCheckDataPartitionIntervalSeconds = 60 DefaultFileDelayCheckLackSec = 5 * DefaultCheckHeartbeatIntervalSeconds DefaultFileDelayCheckCrcSec = 20 * DefaultCheckHeartbeatIntervalSeconds NoHeartBeatTimes = 3 DefaultNodeTimeOutSec = NoHeartBeatTimes * DefaultCheckHeartbeatIntervalSeconds DefaultDataPartitionTimeOutSec = 10 * DefaultCheckHeartbeatIntervalSeconds DefaultDataPartitionMissSec = 24 * 3600 DefaultDataPartitionWarnInterval = 60 * 60 LoadDataPartitionWaitTime = 100 DefaultLoadDataPartitionFrequencyTime = 60 * 60 DefaultEveryLoadDataPartitionCount = 50 DefaultMetaPartitionTimeOutSec = 10 * DefaultCheckHeartbeatIntervalSeconds //DefaultMetaPartitionMissSec = 3600 DefaultMetaPartitionWarnInterval = 10 * 60 DefaultMetaPartitionThreshold float32 = 0.75 DefaultMetaPartitionCountOnEachNode = 100 )
View Source
const ( ParaNodeAddr = "addr" ParaName = "name" ParaId = "id" ParaCount = "count" ParaReplicas = "replicas" ParaDataPartitionType = "type" ParaStart = "start" ParaEnable = "enable" ParaThreshold = "threshold" )
View Source
const ( DeleteExcessReplicationErr = "DeleteExcessReplicationErr " AddLackReplicationErr = "AddLackReplicationErr " CheckDataPartitionDiskErrorErr = "CheckDataPartitionDiskErrorErr " GetAvailDataNodeHostsErr = "GetAvailDataNodeHostsErr " GetAvailMetaNodeHostsErr = "GetAvailMetaNodeHostsErr " GetDataReplicaFileCountInfo = "GetDataReplicaFileCountInfo " DataNodeOfflineInfo = "dataNodeOfflineInfo" HandleDataPartitionOfflineErr = "HandleDataPartitionOffLineErr " )
View Source
const ( DefaultMaxMetaPartitionInodeID uint64 = 1<<63 - 1 DefaultMetaPartitionInodeIDStep uint64 = 1 << 24 DefaultMetaNodeReservedMem uint64 = 1 << 32 RuntimeStackBufSize = 4096 NodesAliveRate float32 = 0.5 MinReadWriteDataPartitions = 200 SpaceAvailRate = 0.95 )
View Source
const ( OK = iota Failed )
View Source
const ( VolNormal uint8 = 0 VolMarkDelete uint8 = 1 )
View Source
const ( // Admin APIs AdminGetCluster = "/admin/getCluster" AdminGetDataPartition = "/dataPartition/get" AdminLoadDataPartition = "/dataPartition/load" AdminCreateDataPartition = "/dataPartition/create" AdminDataPartitionOffline = "/dataPartition/offline" AdminDeleteVol = "/vol/delete" AdminCreateVol = "/admin/createVol" AdminGetIp = "/admin/getIp" AdminCreateMP = "/metaPartition/create" AdminSetCompactStatus = "/compactStatus/set" AdminGetCompactStatus = "/compactStatus/get" AdminSetMetaNodeThreshold = "/threshold/set" // Client APIs ClientDataPartitions = "/client/dataPartitions" ClientVol = "/client/vol" ClientMetaPartition = "/client/metaPartition" ClientVolStat = "/client/volStat" //raft node APIs RaftNodeAdd = "/raftNode/add" RaftNodeRemove = "/raftNode/remove" // Node APIs AddDataNode = "/dataNode/add" DataNodeOffline = "/dataNode/offline" GetDataNode = "/dataNode/get" AddMetaNode = "/metaNode/add" MetaNodeOffline = "/metaNode/offline" GetMetaNode = "/metaNode/get" AdminLoadMetaPartition = "/metaPartition/load" AdminMetaPartitionOffline = "/metaPartition/offline" // Operation response MetaNodeResponse = "/metaNode/response" // Method: 'POST', ContentType: 'application/json' DataNodeResponse = "/dataNode/response" // Method: 'POST', ContentType: 'application/json' )
View Source
const ( MaxDataPartitionIDKey = "max_dp_id" MaxMetaPartitionIDKey = "max_mp_id" MaxMetaNodeIDKey = "max_metaNode_id" )
View Source
const ( OpSyncAddMetaNode uint32 = 0x01 OpSyncAddDataNode uint32 = 0x02 OpSyncAddDataPartition uint32 = 0x03 OpSyncAddVol uint32 = 0x04 OpSyncAddMetaPartition uint32 = 0x05 OpSyncUpdateDataPartition uint32 = 0x06 OpSyncUpdateMetaPartition uint32 = 0x07 OpSyncDeleteDataNode uint32 = 0x08 OpSyncDeleteMetaNode uint32 = 0x09 OpSyncAllocDataPartitionID uint32 = 0x0A OpSyncAllocMetaPartitionID uint32 = 0x0B OpSyncAllocMetaNodeID uint32 = 0x0C OpSyncPutCluster uint32 = 0x0D OpSyncUpdateVol uint32 = 0x0E OpSyncDeleteVol uint32 = 0x0F OpSyncDeleteDataPartition uint32 = 0x10 OpSyncDeleteMetaPartition uint32 = 0x11 )
View Source
const ( KeySeparator = "#" MetaNodeAcronym = "mn" DataNodeAcronym = "dn" DataPartitionAcronym = "dp" MetaPartitionAcronym = "mp" VolAcronym = "vol" ClusterAcronym = "c" MetaNodePrefix = KeySeparator + MetaNodeAcronym + KeySeparator DataNodePrefix = KeySeparator + DataNodeAcronym + KeySeparator DataPartitionPrefix = KeySeparator + DataPartitionAcronym + KeySeparator VolPrefix = KeySeparator + VolAcronym + KeySeparator MetaPartitionPrefix = KeySeparator + MetaPartitionAcronym + KeySeparator ClusterPrefix = KeySeparator + ClusterAcronym + KeySeparator )
View Source
const ( ClusterName = "clusterName" ID = "id" IP = "ip" Port = "port" LogLevel = "logLevel" WalDir = "walDir" StoreDir = "storeDir" GroupId = 1 UmpModuleName = "master" CfgRetainLogs = "retainLogs" DefaultRetainLogs = 20000 )
config keys
View Source
const (
Applied = "applied"
)
View Source
const (
ReservedVolCount = 1
)
View Source
const (
UnderlineSeparator = "_"
)
Variables ¶
View Source
var ( NoAvailDataPartition = errors.New("no avail data partition") DataPartitionNotFound = errors.New("data partition not found") RackNotFound = errors.New("rack not found") DataNodeNotFound = errors.New("data node not found") MetaNodeNotFound = errors.New("meta node not found") VolNotFound = errors.New("vol not found") MetaPartitionNotFound = errors.New("meta partition not found") DataReplicaNotFound = errors.New("data replica not found") UnMatchPara = errors.New("para not unmatched") DisOrderArrayErr = errors.New("dis order array is nil") DataReplicaExcessError = errors.New("data replica Excess error") DataReplicaLackError = errors.New("data replica Lack error") DataReplicaHasMissOneError = errors.New("data replica has miss one ,cannot miss any one") NoHaveAnyDataNodeToWrite = errors.New("No have any data node for create data partition") NoHaveAnyMetaNodeToWrite = errors.New("No have any meta node for create meta partition") CannotOffLineErr = errors.New("cannot offline because avail data replica <0") NoAnyDataNodeForCreateDataPartition = errors.New("no have enough data server for create data partition") NoRackForCreateDataPartition = errors.New("no rack for create data partition") NoAnyMetaNodeForCreateMetaPartition = errors.New("no have enough meta server for create meta partition") MetaReplicaExcessError = errors.New("meta partition Replication Excess error") NoHaveMajorityReplica = errors.New("no have majority replica error") NoLeader = errors.New("no leader") ErrBadConfFile = errors.New("BadConfFile") InvalidDataPartitionType = errors.New("invalid data partition type. extent or blob") ParaEnableNotFound = errors.New("para enable not found") )
View Source
var AddrDatabase = make(map[uint64]string)
AddrDatabase ...
Functions ¶
func HandleError ¶
func HandleError(message string, err error, code int, w http.ResponseWriter)
func UnmarshalTaskResponse ¶
func WarnBySpecialUmpKey ¶
func WarnBySpecialUmpKey(umpKey, msg string)
Types ¶
type AdminTaskSender ¶
type AdminTaskSender struct { TaskMap map[string]*proto.AdminTask sync.Mutex // contains filtered or unexported fields }
func NewAdminTaskSender ¶
func NewAdminTaskSender(targetAddr, clusterID string) (sender *AdminTaskSender)
func (*AdminTaskSender) DelTask ¶
func (sender *AdminTaskSender) DelTask(t *proto.AdminTask)
func (*AdminTaskSender) PutTask ¶
func (sender *AdminTaskSender) PutTask(t *proto.AdminTask)
type Cluster ¶
type Cluster struct { Name string // contains filtered or unexported fields }
func (*Cluster) ChooseTargetDataHosts ¶
func (*Cluster) ChooseTargetMetaHosts ¶
func (*Cluster) CreateMetaPartition ¶
func (*Cluster) CreateMetaPartitionForManual ¶
func (*Cluster) DataNodeCount ¶
func (*Cluster) DisOrderArray ¶
func (*Cluster) GetAvailCarryMetaNodeTab ¶
func (c *Cluster) GetAvailCarryMetaNodeTab(maxTotal uint64, excludeHosts []string) (nodeTabs NodeTabArrSorterByCarry, availCount int)
func (*Cluster) GetMetaNodeMaxTotal ¶
func (*Cluster) UpdateDataNode ¶
func (c *Cluster) UpdateDataNode(dataNode *DataNode, dps []*proto.PartitionReport)
if node report data partition infos,so range data partition infos,then update data partition info
func (*Cluster) UpdateMetaNode ¶
func (c *Cluster) UpdateMetaNode(metaNode *MetaNode, metaPartitions []*proto.MetaPartitionReport, threshold bool)
type ClusterConfig ¶
type ClusterConfig struct { FileDelayCheckCrcSec int64 FileDelayCheckLackSec int64 NodeTimeOutSec int64 DataPartitionMissSec int64 DataPartitionTimeOutSec int64 DataPartitionWarnInterval int64 LoadDataPartitionFrequencyTime int64 CheckDataPartitionIntervalSeconds int MetaNodeThreshold float32 // contains filtered or unexported fields }
func NewClusterConfig ¶
func NewClusterConfig() (cfg *ClusterConfig)
type ClusterView ¶
type ClusterView struct { Name string LeaderAddr string CompactStatus bool Applied uint64 MaxDataPartitionID uint64 MaxMetaNodeID uint64 MaxMetaPartitionID uint64 Vols []string MetaNodes []MetaNodeView DataNodes []DataNodeView }
type DataNode ¶
type DataNode struct { MaxDiskAvailWeight uint64 `json:"MaxDiskAvailWeight"` CreatedVolWeights uint64 RemainWeightsForCreateVol uint64 Total uint64 `json:"TotalWeight"` Used uint64 `json:"UsedWeight"` Available uint64 RackName string `json:"Rack"` Addr string ReportTime time.Time sync.RWMutex Ratio float64 SelectCount uint64 Carry float64 Sender *AdminTaskSender DataPartitionCount uint32 // contains filtered or unexported fields }
func NewDataNode ¶
func (*DataNode) IsAvailCarryNode ¶
func (*DataNode) IsWriteAble ¶
func (*DataNode) SelectNodeForWrite ¶
func (dataNode *DataNode) SelectNodeForWrite()
func (*DataNode) UpdateNodeMetric ¶
func (dataNode *DataNode) UpdateNodeMetric(resp *proto.DataNodeHeartBeatResponse)
type DataNodeView ¶
type DataPartition ¶
type DataPartition struct { PartitionID uint64 LastLoadTime int64 ReplicaNum uint8 Status int8 Replicas []*DataReplica PartitionType string PersistenceHosts []string sync.RWMutex FileInCoreMap map[string]*FileInCore MissNodes map[string]int64 VolName string // contains filtered or unexported fields }
func (*DataPartition) AddMember ¶
func (partition *DataPartition) AddMember(replica *DataReplica)
func (*DataPartition) DeleteReplicaByIndex ¶
func (partition *DataPartition) DeleteReplicaByIndex(index int)
func (*DataPartition) GenerateCreateTasks ¶
func (partition *DataPartition) GenerateCreateTasks() (tasks []*proto.AdminTask)
func (*DataPartition) GenerateDeleteTask ¶
func (partition *DataPartition) GenerateDeleteTask(addr string) (task *proto.AdminTask)
func (*DataPartition) GetAvailableDataReplicas ¶
func (partition *DataPartition) GetAvailableDataReplicas() (replicas []*DataReplica)
获取该副本目前有效的node,即Node在汇报心跳正常,并且该Node不是unavailable
func (*DataPartition) HostsToString ¶
func (partition *DataPartition) HostsToString() (hosts string)
func (*DataPartition) IsInReplicas ¶
func (partition *DataPartition) IsInReplicas(host string) (replica *DataReplica, ok bool)
func (*DataPartition) LoadFile ¶
func (partition *DataPartition) LoadFile(dataNode *DataNode, resp *proto.LoadDataPartitionResponse)
func (*DataPartition) ReleaseDataPartition ¶
func (partition *DataPartition) ReleaseDataPartition()
func (*DataPartition) UpdateMetric ¶
func (partition *DataPartition) UpdateMetric(vr *proto.PartitionReport, dataNode *DataNode)
type DataPartitionMap ¶
func NewDataPartitionMap ¶
func NewDataPartitionMap(volName string) (dpMap *DataPartitionMap)
func (*DataPartitionMap) GetDataPartitionsView ¶
func (dpMap *DataPartitionMap) GetDataPartitionsView(minPartitionID uint64) (dpResps []*DataPartitionResponse)
type DataPartitionResponse ¶
type DataPartitionValue ¶
type DataPartitionsView ¶
type DataPartitionsView struct {
DataPartitions []*DataPartitionResponse
}
func NewDataPartitionsView ¶
func NewDataPartitionsView() (dataPartitionsView *DataPartitionsView)
type DataReplica ¶
type DataReplica struct { Addr string ReportTime int64 FileCount uint32 Status int8 LoadPartitionIsResponse bool Total uint64 `json:"TotalSize"` Used uint64 `json:"UsedSize"` // contains filtered or unexported fields }
func NewDataReplica ¶
func NewDataReplica(dataNode *DataNode) (replica *DataReplica)
func (*DataReplica) CheckLocIsAvailContainsDiskError ¶
func (replica *DataReplica) CheckLocIsAvailContainsDiskError() (avail bool)
check replica location is avail ,must IsActive=true and replica.Status!=DataReplicaUnavailable
func (*DataReplica) CheckMiss ¶
func (replica *DataReplica) CheckMiss(missSec int64) (isMiss bool)
func (*DataReplica) GetReplicaNode ¶
func (replica *DataReplica) GetReplicaNode() (node *DataNode)
func (*DataReplica) IsActive ¶
func (replica *DataReplica) IsActive(timeOutSec int64) bool
func (*DataReplica) IsLive ¶
func (replica *DataReplica) IsLive(timeOutSec int64) (avail bool)
func (*DataReplica) SetAlive ¶
func (replica *DataReplica) SetAlive()
type FileCrc ¶
type FileCrc struct {
// contains filtered or unexported fields
}
use struct define File crc and this crc in all File count
func NewFileCrc ¶
type FileCrcSorterByCount ¶
type FileCrcSorterByCount []*FileCrc
func (FileCrcSorterByCount) Len ¶
func (fileCrcArr FileCrcSorterByCount) Len() (length int)
func (FileCrcSorterByCount) Less ¶
func (fileCrcArr FileCrcSorterByCount) Less(i, j int) bool
func (FileCrcSorterByCount) Swap ¶
func (fileCrcArr FileCrcSorterByCount) Swap(i, j int)
type FileInCore ¶
type FileInCore struct { Name string MarkDel bool LastModify int64 Metas []*FileMetaOnNode }
func NewFileInCore ¶
func NewFileInCore(name string) (fc *FileInCore)
type FileMetaOnNode ¶
type FileMetaOnNode struct { Crc uint32 LocAddr string LocIndex uint8 LastObjID uint64 NeedleCnt int Size uint32 }
this struct define chunk file metadata on dataNode
func NewFileMetaOnNode ¶
type IDAllocator ¶
type IDAllocator struct {
// contains filtered or unexported fields
}
type LeaderInfo ¶
type LeaderInfo struct {
// contains filtered or unexported fields
}
type MetaNode ¶
type MetaNode struct { ID uint64 Addr string IsActive bool Sender *AdminTaskSender RackName string `json:"Rack"` MaxMemAvailWeight uint64 `json:"MaxMemAvailWeight"` Total uint64 `json:"TotalWeight"` Used uint64 `json:"UsedWeight"` Ratio float64 SelectCount uint64 Carry float64 Threshold float32 ReportTime time.Time MetaPartitionCount int sync.RWMutex // contains filtered or unexported fields }
func NewMetaNode ¶
func (*MetaNode) IsAvailCarryNode ¶
func (*MetaNode) IsWriteAble ¶
func (*MetaNode) SelectNodeForWrite ¶
func (metaNode *MetaNode) SelectNodeForWrite()
type MetaNodeView ¶
type MetaPartition ¶
type MetaPartition struct { PartitionID uint64 Start uint64 End uint64 MaxNodeID uint64 Replicas []*MetaReplica ReplicaNum uint8 Status int8 PersistenceHosts []string Peers []proto.Peer MissNodes map[string]int64 sync.RWMutex // contains filtered or unexported fields }
func NewMetaPartition ¶
func NewMetaPartition(partitionID, start, end uint64, replicaNum uint8, volName string) (mp *MetaPartition)
func (*MetaPartition) GenerateReplicaTask ¶
func (mp *MetaPartition) GenerateReplicaTask(clusterID, volName string) (tasks []*proto.AdminTask)
func (*MetaPartition) UpdateEnd ¶
func (mp *MetaPartition) UpdateEnd(c *Cluster, end uint64)
func (*MetaPartition) UpdateMetaPartition ¶
func (mp *MetaPartition) UpdateMetaPartition(mgr *proto.MetaPartitionReport, metaNode *MetaNode)
type MetaPartitionValue ¶
type MetaPartitionView ¶
type MetaPartitionView struct { PartitionID uint64 Start uint64 End uint64 Members []string LeaderAddr string Status int8 }
func NewMetaPartitionView ¶
func NewMetaPartitionView(partitionID, start, end uint64, status int8) (mpView *MetaPartitionView)
type MetaReplica ¶
type MetaReplica struct { Addr string ReportTime int64 Status int8 IsLeader bool // contains filtered or unexported fields }
func NewMetaReplica ¶
func NewMetaReplica(start, end uint64, metaNode *MetaNode) (mr *MetaReplica)
type MetadataFsm ¶
type MetadataFsm struct {
// contains filtered or unexported fields
}
func (*MetadataFsm) Apply ¶
func (mf *MetadataFsm) Apply(command []byte, index uint64) (resp interface{}, err error)
func (*MetadataFsm) ApplyMemberChange ¶
func (mf *MetadataFsm) ApplyMemberChange(confChange *proto.ConfChange, index uint64) (interface{}, error)
func (*MetadataFsm) ApplySnapshot ¶
func (mf *MetadataFsm) ApplySnapshot(peers []proto.Peer, iterator proto.SnapIterator) (err error)
func (*MetadataFsm) BatchPut ¶
func (mf *MetadataFsm) BatchPut(cmdMap map[string][]byte) (err error)
func (*MetadataFsm) Del ¶
func (mf *MetadataFsm) Del(key interface{}) (interface{}, error)
func (*MetadataFsm) DelKeyAndPutIndex ¶
func (mf *MetadataFsm) DelKeyAndPutIndex(key string, cmdMap map[string][]byte) (err error)
func (*MetadataFsm) Get ¶
func (mf *MetadataFsm) Get(key interface{}) (interface{}, error)
func (*MetadataFsm) HandleFatalEvent ¶
func (mf *MetadataFsm) HandleFatalEvent(err *raft.FatalError)
func (*MetadataFsm) HandleLeaderChange ¶
func (mf *MetadataFsm) HandleLeaderChange(leader uint64)
func (*MetadataFsm) Put ¶
func (mf *MetadataFsm) Put(key, val interface{}) (interface{}, error)
func (*MetadataFsm) RegisterApplyHandler ¶
func (mf *MetadataFsm) RegisterApplyHandler(handler RaftCmdApplyHandler)
func (*MetadataFsm) RegisterApplySnapshotHandler ¶
func (mf *MetadataFsm) RegisterApplySnapshotHandler(handler RaftApplySnapshotHandler)
func (*MetadataFsm) RegisterLeaderChangeHandler ¶
func (mf *MetadataFsm) RegisterLeaderChangeHandler(handler RaftLeaderChangeHandler)
func (*MetadataFsm) RegisterPeerChangeHandler ¶
func (mf *MetadataFsm) RegisterPeerChangeHandler(handler RaftPeerChangeHandler)
type MetadataSnapshot ¶
type MetadataSnapshot struct {
// contains filtered or unexported fields
}
func (*MetadataSnapshot) ApplyIndex ¶
func (ms *MetadataSnapshot) ApplyIndex() uint64
func (*MetadataSnapshot) Close ¶
func (ms *MetadataSnapshot) Close()
func (*MetadataSnapshot) Next ¶
func (ms *MetadataSnapshot) Next() (data []byte, err error)
type NodeTabArrSorterByCarry ¶
type NodeTabArrSorterByCarry []*NodeTab
func (NodeTabArrSorterByCarry) Len ¶
func (nodeTabs NodeTabArrSorterByCarry) Len() int
func (NodeTabArrSorterByCarry) Less ¶
func (nodeTabs NodeTabArrSorterByCarry) Less(i, j int) bool
func (NodeTabArrSorterByCarry) SetNodeTabCarry ¶
func (nodeTabs NodeTabArrSorterByCarry) SetNodeTabCarry(availCarryCount, replicaNum int)
func (NodeTabArrSorterByCarry) Swap ¶
func (nodeTabs NodeTabArrSorterByCarry) Swap(i, j int)
type Rack ¶
func (*Rack) DataNodeCount ¶
func (*Rack) DisOrderArray ¶
func (*Rack) GetAvailCarryDataNodeTab ¶
func (*Rack) GetDataNode ¶
func (*Rack) GetDataNodeMaxTotal ¶
func (*Rack) PutDataNode ¶
func (*Rack) RemoveDataNode ¶
type RaftApplySnapshotHandler ¶
type RaftApplySnapshotHandler func()
type RaftCmdApplyHandler ¶
type RaftLeaderChangeHandler ¶
type RaftLeaderChangeHandler func(leader uint64)
type RaftPeerChangeHandler ¶
type RaftPeerChangeHandler func(confChange *proto.ConfChange) (err error)
type Topology ¶
type Topology struct {
// contains filtered or unexported fields
}
func NewTopology ¶
func NewTopology() (t *Topology)
type Vol ¶
type Vol struct { Name string VolType string MetaPartitions map[uint64]*MetaPartition Status uint8 sync.RWMutex // contains filtered or unexported fields }
func (*Vol) AddMetaPartition ¶
func (vol *Vol) AddMetaPartition(mp *MetaPartition)
func (*Vol) AddMetaPartitionByRaft ¶
func (vol *Vol) AddMetaPartitionByRaft(mp *MetaPartition)
func (*Vol) LoadDataPartition ¶
func (*Vol) ReleaseDataPartitionsAfterLoad ¶
type VolStatInfo ¶
type VolView ¶
type VolView struct { Name string VolType string MetaPartitions []*MetaPartitionView DataPartitions []*DataPartitionResponse }
func NewVolView ¶
Source Files ¶
- admin_task_sender.go
- cluster.go
- cluster_task.go
- config.go
- const.go
- data_node.go
- data_partition.go
- data_partition_check.go
- data_partition_map.go
- data_replica.go
- errors.go
- filecheck.go
- filecrc.go
- filemeta.go
- handle_admin.go
- handle_client.go
- http_server.go
- id_allocator.go
- master_manager.go
- meta_node.go
- meta_partition.go
- metadata_fsm.go
- metadata_fsm_op.go
- metadata_snapshot.go
- node_select.go
- operate_util.go
- server.go
- topology.go
- vol.go
Click to show internal directories.
Click to hide internal directories.