Documentation ¶
Index ¶
- Constants
- Variables
- type AllocPolicy
- type DiskMgr
- func (d *DiskMgr) AllocChunks(ctx context.Context, policy *AllocPolicy) (ret []proto.DiskID, err error)
- func (d *DiskMgr) AllocDiskID(ctx context.Context) (proto.DiskID, error)
- func (d *DiskMgr) Apply(ctx context.Context, operTypes []int32, datas [][]byte, ...) error
- func (d *DiskMgr) CheckDiskInfoDuplicated(ctx context.Context, info *blobnode.DiskInfo) bool
- func (d *DiskMgr) Close()
- func (d *DiskMgr) Flush(ctx context.Context) error
- func (d *DiskMgr) GetDiskInfo(ctx context.Context, id proto.DiskID) (*blobnode.DiskInfo, error)
- func (d *DiskMgr) GetHeartbeatChangeDisks() []HeartbeatEvent
- func (d *DiskMgr) GetModuleName() string
- func (d *DiskMgr) IsDiskWritable(ctx context.Context, id proto.DiskID) (bool, error)
- func (d *DiskMgr) IsDroppingDisk(ctx context.Context, id proto.DiskID) (bool, error)
- func (d *DiskMgr) IsFrequentHeatBeat(id proto.DiskID, HeartbeatNotifyIntervalS int) (bool, error)
- func (d *DiskMgr) ListDiskInfo(ctx context.Context, opt *clustermgr.ListOptionArgs) (*clustermgr.ListDiskRet, error)
- func (d *DiskMgr) ListDroppingDisk(ctx context.Context) ([]*blobnode.DiskInfo, error)
- func (d *DiskMgr) LoadData(ctx context.Context) error
- func (d *DiskMgr) NotifyLeaderChange(ctx context.Context, leader uint64, host string)
- func (d *DiskMgr) RefreshExpireTime()
- func (d *DiskMgr) Report(ctx context.Context, region string, clusterID proto.ClusterID, isLeader string)
- func (d *DiskMgr) SetModuleName(module string)
- func (d *DiskMgr) SetStatus(ctx context.Context, id proto.DiskID, status proto.DiskStatus, isCommit bool) error
- func (d *DiskMgr) Stat(ctx context.Context) *clustermgr.SpaceStatInfo
- func (d *DiskMgr) SwitchReadonly(diskID proto.DiskID, readonly bool) error
- type DiskMgrAPI
- type DiskMgrConfig
- type HeartbeatEvent
Constants ¶
View Source
const ( OperTypeAddDisk = iota + 1 OperTypeSetDiskStatus OperTypeDroppingDisk OperTypeDroppedDisk OperTypeHeartbeatDiskInfo OperTypeSwitchReadonly OperTypeAdminUpdateDisk )
View Source
const (
DiskIDScopeName = "diskid"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AllocPolicy ¶
type DiskMgr ¶
type DiskMgr struct { DiskMgrConfig // contains filtered or unexported fields }
func New ¶
func New(scopeMgr scopemgr.ScopeMgrAPI, db *normaldb.NormalDB, cfg DiskMgrConfig) (*DiskMgr, error)
func (*DiskMgr) AllocChunks ¶
func (d *DiskMgr) AllocChunks(ctx context.Context, policy *AllocPolicy) (ret []proto.DiskID, err error)
AllocChunk return available chunks in data center
func (*DiskMgr) AllocDiskID ¶
func (*DiskMgr) CheckDiskInfoDuplicated ¶
func (*DiskMgr) GetDiskInfo ¶
func (*DiskMgr) GetHeartbeatChangeDisks ¶
func (d *DiskMgr) GetHeartbeatChangeDisks() []HeartbeatEvent
func (*DiskMgr) GetModuleName ¶
func (*DiskMgr) IsDiskWritable ¶
func (*DiskMgr) IsDroppingDisk ¶
func (*DiskMgr) IsFrequentHeatBeat ¶
judge disk heartbeat interval whether small than HeartbeatNotifyIntervalS
func (*DiskMgr) ListDiskInfo ¶
func (d *DiskMgr) ListDiskInfo(ctx context.Context, opt *clustermgr.ListOptionArgs) (*clustermgr.ListDiskRet, error)
ListDiskInfo return disk info with specified query condition
func (*DiskMgr) ListDroppingDisk ¶
func (*DiskMgr) NotifyLeaderChange ¶
DiskMgr do nothing when leader change
func (*DiskMgr) RefreshExpireTime ¶
func (d *DiskMgr) RefreshExpireTime()
func (*DiskMgr) SetModuleName ¶
func (*DiskMgr) Stat ¶
func (d *DiskMgr) Stat(ctx context.Context) *clustermgr.SpaceStatInfo
Stat return disk statistic info of a cluster
type DiskMgrAPI ¶
type DiskMgrAPI interface { // AllocDiskID return a unused disk id AllocDiskID(ctx context.Context) (proto.DiskID, error) // GetDiskInfo return disk info, it return ErrDiskNotFound if disk not found GetDiskInfo(ctx context.Context, id proto.DiskID) (*blobnode.DiskInfo, error) // CheckDiskInfoDuplicated return true if disk info already exit, like host and path duplicated CheckDiskInfoDuplicated(ctx context.Context, info *blobnode.DiskInfo) bool // IsDiskWritable judge disk if writable, disk status unmoral or readonly or heartbeat timeout will return true IsDiskWritable(ctx context.Context, id proto.DiskID) (bool, error) // SetStatus change disk status, in some case, change status is not allow // like change repairing/repaired/dropped into normal SetStatus(ctx context.Context, id proto.DiskID, status proto.DiskStatus, isCommit bool) error // IsDroppingDisk return true if the specified disk is dropping IsDroppingDisk(ctx context.Context, id proto.DiskID) (bool, error) // ListDroppingDisk return all dropping disk info ListDroppingDisk(ctx context.Context) ([]*blobnode.DiskInfo, error) // AllocChunk return available chunks in data center AllocChunks(ctx context.Context, policy *AllocPolicy) ([]proto.DiskID, error) // ListDiskInfo ListDiskInfo(ctx context.Context, opt *clustermgr.ListOptionArgs) (*clustermgr.ListDiskRet, error) // Stat return disk statistic info of a cluster Stat(ctx context.Context) *clustermgr.SpaceStatInfo // SwitchReadonly can switch disk's readonly or writable SwitchReadonly(diskID proto.DiskID, readonly bool) error // GetHeartbeatChangeDisks return any heartbeat change disks GetHeartbeatChangeDisks() []HeartbeatEvent }
type DiskMgrConfig ¶
type DiskMgrConfig struct { RefreshIntervalS int `json:"refresh_interval_s"` RackAware bool `json:"rack_aware"` HostAware bool `json:"host_aware"` HeartbeatExpireIntervalS int `json:"heartbeat_expire_interval_s"` FlushIntervalS int `json:"flush_interval_s"` ApplyConcurrency uint32 `json:"apply_concurrency"` BlobNodeConfig blobnode.Config `json:"blob_node_config"` AllocTolerateBuffer int64 `json:"alloc_tolerate_buffer"` EnsureIndex bool `json:"ensure_index"` IDC []string `json:"-"` CodeModes []codemode.CodeMode `json:"-"` ChunkSize int64 `json:"-"` }
type HeartbeatEvent ¶
Click to show internal directories.
Click to hide internal directories.