Documentation ¶
Index ¶
- Constants
- type DiskInfoRecord
- type DiskTable
- func (d *DiskTable) AddDisk(info *DiskInfoRecord) error
- func (d *DiskTable) DeleteDisk(diskID proto.DiskID) error
- func (d *DiskTable) GetAllDisks() ([]*DiskInfoRecord, error)
- func (d *DiskTable) GetDisk(diskID proto.DiskID) (info *DiskInfoRecord, err error)
- func (d *DiskTable) ListDisk(opt *clustermgr.ListOptionArgs) ([]*DiskInfoRecord, error)
- func (d *DiskTable) UpdateDisk(diskID proto.DiskID, info *DiskInfoRecord) error
- func (d *DiskTable) UpdateDiskStatus(diskID proto.DiskID, status proto.DiskStatus) error
- type DroppedDiskTable
- type NormalDB
- type ScopeTable
- type ServiceTable
Constants ¶
View Source
const (
DiskInfoVersionNormal = iota + 1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiskInfoRecord ¶
type DiskInfoRecord struct { Version uint8 `json:"-"` DiskID proto.DiskID `json:"disk_id"` ClusterID proto.ClusterID `json:"cluster_id"` Idc string `json:"idc"` Rack string `json:"rack"` Host string `json:"host"` Path string `json:"path"` Status proto.DiskStatus `json:"status"` Readonly bool `json:"readonly"` MaxChunkCnt int64 `json:"max_chunk_cnt"` FreeChunkCnt int64 `json:"free_chunk_cnt"` UsedChunkCnt int64 `json:"used_chunk_cnt"` CreateAt time.Time `json:"create_time"` LastUpdateAt time.Time `json:"last_update_time"` Size int64 `json:"size"` Used int64 `json:"used"` Free int64 `json:"free"` }
type DiskTable ¶
type DiskTable struct {
// contains filtered or unexported fields
}
func (*DiskTable) AddDisk ¶
func (d *DiskTable) AddDisk(info *DiskInfoRecord) error
func (*DiskTable) GetAllDisks ¶
func (d *DiskTable) GetAllDisks() ([]*DiskInfoRecord, error)
return all disk info in memory
func (*DiskTable) GetDisk ¶
func (d *DiskTable) GetDisk(diskID proto.DiskID) (info *DiskInfoRecord, err error)
func (*DiskTable) ListDisk ¶
func (d *DiskTable) ListDisk(opt *clustermgr.ListOptionArgs) ([]*DiskInfoRecord, error)
func (*DiskTable) UpdateDisk ¶
func (d *DiskTable) UpdateDisk(diskID proto.DiskID, info *DiskInfoRecord) error
func (*DiskTable) UpdateDiskStatus ¶
update disk status should remove old index and insert new index
type DroppedDiskTable ¶
type DroppedDiskTable struct {
// contains filtered or unexported fields
}
func OpenDroppedDiskTable ¶
func OpenDroppedDiskTable(db kvstore.KVStore) (*DroppedDiskTable, error)
func (*DroppedDiskTable) AddDroppingDisk ¶
func (d *DroppedDiskTable) AddDroppingDisk(diskId proto.DiskID) error
AddDroppingDisk add a dropping disk
func (*DroppedDiskTable) DroppedDisk ¶
func (d *DroppedDiskTable) DroppedDisk(diskId proto.DiskID) error
DroppedDisk finish dropping in a disk
func (*DroppedDiskTable) GetAllDroppingDisk ¶
func (d *DroppedDiskTable) GetAllDroppingDisk() ([]proto.DiskID, error)
GetAllDroppingDisk return all drop disk in memory
func (*DroppedDiskTable) IsDroppingDisk ¶
func (d *DroppedDiskTable) IsDroppingDisk(diskId proto.DiskID) (exist bool, err error)
GetDroppingDisk find a dropping disk if exist
type ScopeTable ¶
type ScopeTable struct {
// contains filtered or unexported fields
}
func OpenScopeTable ¶
func OpenScopeTable(db kvstore.KVStore) (*ScopeTable, error)
type ServiceTable ¶
type ServiceTable struct {
// contains filtered or unexported fields
}
func OpenServiceTable ¶
func OpenServiceTable(db *NormalDB) *ServiceTable
func (*ServiceTable) Delete ¶
func (s *ServiceTable) Delete(sname, host string) (err error)
Click to show internal directories.
Click to hide internal directories.