Documentation ¶
Index ¶
- func AllocateVolume(dn *DataNode, grpcDialOption grpc.DialOption, vid needle.VolumeId, ...) error
- func DistributedOperation(locations []operation.Location, op func(location operation.Location) error) error
- func ExistCopies() stateIndicator
- func GetWritableRemoteReplications(s *storage.Store, grpcDialOption grpc.DialOption, volumeId needle.VolumeId, ...) (remoteLocations []operation.Location, err error)
- func NewVolumesBinaryState(name volumeState, rp *super_block.ReplicaPlacement, indicator stateIndicator) *volumesBinaryState
- func NoCopies() stateIndicator
- func ReplicatedDelete(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOption, ...) (size types.Size, err error)
- func ReplicatedWrite(masterFn operation.GetMasterFn, grpcDialOption grpc.DialOption, ...) (isUnchanged bool, err error)
- type AllocateVolumeResult
- type Collection
- func (c *Collection) DeleteVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType)
- func (c *Collection) GetOrCreateVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType) *VolumeLayout
- func (c *Collection) ListVolumeServers() (nodes []*DataNode)
- func (c *Collection) Lookup(vid needle.VolumeId) []*DataNode
- func (c *Collection) String() string
- type Configuration
- type DataCenter
- type DataNode
- func (dn *DataNode) AddOrUpdateEcShard(s *erasure_coding.EcVolumeInfo)
- func (dn *DataNode) AddOrUpdateVolume(v storage.VolumeInfo) (isNew, isChangedRO bool)
- func (dn *DataNode) AdjustMaxVolumeCounts(maxVolumeCounts map[string]uint32)
- func (dn *DataNode) DeleteEcShard(s *erasure_coding.EcVolumeInfo)
- func (dn *DataNode) DeltaUpdateEcShards(newShards, deletedShards []*erasure_coding.EcVolumeInfo)
- func (dn *DataNode) DeltaUpdateVolumes(newVolumes, deletedVolumes []storage.VolumeInfo)
- func (dn *DataNode) GetDataCenter() *DataCenter
- func (dn *DataNode) GetEcShards() (ret []*erasure_coding.EcVolumeInfo)
- func (dn *DataNode) GetRack() *Rack
- func (dn *DataNode) GetTopology() *Topology
- func (dn *DataNode) GetVolumeIds() string
- func (dn *DataNode) GetVolumes() (ret []storage.VolumeInfo)
- func (dn *DataNode) GetVolumesById(id needle.VolumeId) (vInfo storage.VolumeInfo, err error)
- func (dn *DataNode) HasEcShards(volumeId needle.VolumeId) (found bool)
- func (dn *DataNode) HasVolumesById(volumeId needle.VolumeId) (hasVolumeId bool)
- func (dn *DataNode) MatchLocation(ip string, port int) bool
- func (dn *DataNode) ServerAddress() pb.ServerAddress
- func (dn *DataNode) String() string
- func (dn *DataNode) ToDataNodeInfo() *master_pb.DataNodeInfo
- func (dn *DataNode) ToMap() interface{}
- func (dn *DataNode) UpdateEcShards(actualShards []*erasure_coding.EcVolumeInfo) (newShards, deletedShards []*erasure_coding.EcVolumeInfo)
- func (dn *DataNode) UpdateVolumes(actualVolumes []storage.VolumeInfo) (newVolumes, deletedVolumes, changeRO []storage.VolumeInfo)
- func (dn *DataNode) Url() string
- type Disk
- func (d *Disk) AddOrUpdateEcShard(s *erasure_coding.EcVolumeInfo)
- func (d *Disk) AddOrUpdateVolume(v storage.VolumeInfo) (isNew, isChangedRO bool)
- func (d *Disk) DeleteEcShard(s *erasure_coding.EcVolumeInfo)
- func (d *Disk) FreeSpace() int64
- func (d *Disk) GetDataCenter() *DataCenter
- func (d *Disk) GetEcShards() (ret []*erasure_coding.EcVolumeInfo)
- func (d *Disk) GetRack() *Rack
- func (d *Disk) GetTopology() *Topology
- func (d *Disk) GetVolumeIds() string
- func (d *Disk) GetVolumes() (ret []storage.VolumeInfo)
- func (d *Disk) GetVolumesById(id needle.VolumeId) (storage.VolumeInfo, error)
- func (d *Disk) HasVolumesById(id needle.VolumeId) (hasVolumeId bool)
- func (d *Disk) String() string
- func (d *Disk) ToDiskInfo() *master_pb.DiskInfo
- func (d *Disk) ToMap() interface{}
- type DiskUsageCounts
- type DiskUsages
- type DistributedOperationResult
- type EcShardLocations
- type MaxVolumeIdCommand
- type Node
- type NodeId
- type NodeImpl
- func (n *NodeImpl) AvailableSpaceFor(option *VolumeGrowOption) int64
- func (n *NodeImpl) Children() (ret []Node)
- func (n *NodeImpl) CollectDeadNodeAndFullVolumes(freshThreshHold int64, volumeSizeLimit uint64, growThreshold float64)
- func (n *NodeImpl) GetDiskUsages() *DiskUsages
- func (n *NodeImpl) GetMaxVolumeId() needle.VolumeId
- func (n *NodeImpl) GetTopology() *Topology
- func (n *NodeImpl) GetValue() interface{}
- func (n *NodeImpl) Id() NodeId
- func (n *NodeImpl) IsDataCenter() bool
- func (n *NodeImpl) IsDataNode() bool
- func (n *NodeImpl) IsRack() bool
- func (n *NodeImpl) LinkChildNode(node Node)
- func (n *NodeImpl) Parent() Node
- func (n *NodeImpl) PickNodesByWeight(numberOfNodes int, option *VolumeGrowOption, ...) (firstNode Node, restNodes []Node, err error)
- func (n *NodeImpl) ReserveOneVolume(r int64, option *VolumeGrowOption) (assignedNode *DataNode, err error)
- func (n *NodeImpl) SetParent(node Node)
- func (n *NodeImpl) String() string
- func (n *NodeImpl) UnlinkChildNode(nodeId NodeId)
- func (n *NodeImpl) UpAdjustDiskUsageDelta(deltaDiskUsages *DiskUsages)
- func (n *NodeImpl) UpAdjustMaxVolumeId(vid needle.VolumeId)
- type Rack
- type RemoteResult
- type Topology
- func (t *Topology) DataNodeRegistration(dcName, rackName string, dn *DataNode)
- func (t *Topology) DeleteCollection(collectionName string)
- func (t *Topology) DeleteEcCollection(collection string)
- func (t *Topology) DeleteLayout(collectionName string, rp *super_block.ReplicaPlacement, ttl *needle.TTL, ...)
- func (t *Topology) FindCollection(collectionName string) (*Collection, bool)
- func (t *Topology) GetOrCreateDataCenter(dcName string) *DataCenter
- func (t *Topology) GetVolumeLayout(collectionName string, rp *super_block.ReplicaPlacement, ttl *needle.TTL, ...) *VolumeLayout
- func (t *Topology) HasWritableVolume(option *VolumeGrowOption) bool
- func (t *Topology) IncrementalSyncDataNodeEcShards(newEcShards, deletedEcShards []*master_pb.VolumeEcShardInformationMessage, ...)
- func (t *Topology) IncrementalSyncDataNodeRegistration(newVolumes, deletedVolumes []*master_pb.VolumeShortInformationMessage, ...)
- func (t *Topology) IsLeader() bool
- func (t *Topology) Leader() (pb.ServerAddress, error)
- func (t *Topology) ListCollections(includeNormalVolumes, includeEcVolumes bool) (ret []string)
- func (t *Topology) ListEcServersByCollection(collection string) (dataNodes []pb.ServerAddress)
- func (t *Topology) Lookup(collection string, vid needle.VolumeId) (dataNodes []*DataNode)
- func (t *Topology) LookupEcShards(vid needle.VolumeId) (locations *EcShardLocations, found bool)
- func (t *Topology) NextVolumeId() (needle.VolumeId, error)
- func (t *Topology) PickForWrite(count uint64, option *VolumeGrowOption) (string, uint64, *VolumeLocationList, error)
- func (t *Topology) RegisterEcShards(ecShardInfos *erasure_coding.EcVolumeInfo, dn *DataNode)
- func (t *Topology) RegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode)
- func (t *Topology) SetVolumeCapacityFull(volumeInfo storage.VolumeInfo) bool
- func (t *Topology) SetVolumeCrowded(volumeInfo storage.VolumeInfo)
- func (t *Topology) StartRefreshWritableVolumes(grpcDialOption grpc.DialOption, garbageThreshold float64, ...)
- func (t *Topology) SyncDataNodeEcShards(shardInfos []*master_pb.VolumeEcShardInformationMessage, dn *DataNode) (newShards, deletedShards []*erasure_coding.EcVolumeInfo)
- func (t *Topology) SyncDataNodeRegistration(volumes []*master_pb.VolumeInformationMessage, dn *DataNode) (newVolumes, deletedVolumes []storage.VolumeInfo)
- func (t *Topology) ToMap() interface{}
- func (t *Topology) ToTopologyInfo() *master_pb.TopologyInfo
- func (t *Topology) ToVolumeLocations() (volumeLocations []*master_pb.VolumeLocation)
- func (t *Topology) ToVolumeMap() interface{}
- func (t *Topology) UnRegisterDataNode(dn *DataNode)
- func (t *Topology) UnRegisterEcShards(ecShardInfos *erasure_coding.EcVolumeInfo, dn *DataNode)
- func (t *Topology) UnRegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode)
- func (t *Topology) Vacuum(grpcDialOption grpc.DialOption, garbageThreshold float64, volumeId uint32, ...)
- type VolumeGrowOption
- type VolumeGrowRequest
- type VolumeGrowth
- type VolumeLayout
- func (vl *VolumeLayout) AddGrowRequest()
- func (vl *VolumeLayout) DoneGrowRequest()
- func (vl *VolumeLayout) EnsureCorrectWritables(v *storage.VolumeInfo)
- func (vl *VolumeLayout) GetActiveVolumeCount(option *VolumeGrowOption) (active, crowded int)
- func (vl *VolumeLayout) HasGrowRequest() bool
- func (vl *VolumeLayout) ListVolumeServers() (nodes []*DataNode)
- func (vl *VolumeLayout) Lookup(vid needle.VolumeId) []*DataNode
- func (vl *VolumeLayout) PickForWrite(count uint64, option *VolumeGrowOption) (*needle.VolumeId, uint64, *VolumeLocationList, error)
- func (vl *VolumeLayout) RegisterVolume(v *storage.VolumeInfo, dn *DataNode)
- func (vl *VolumeLayout) SetVolumeAvailable(dn *DataNode, vid needle.VolumeId, isReadOnly bool) bool
- func (vl *VolumeLayout) SetVolumeCapacityFull(vid needle.VolumeId) bool
- func (vl *VolumeLayout) SetVolumeCrowded(vid needle.VolumeId)
- func (vl *VolumeLayout) SetVolumeUnavailable(dn *DataNode, vid needle.VolumeId) bool
- func (vl *VolumeLayout) ShouldGrowVolumes(option *VolumeGrowOption) bool
- func (vl *VolumeLayout) Stats() *VolumeLayoutStats
- func (vl *VolumeLayout) String() string
- func (vl *VolumeLayout) ToMap() map[string]interface{}
- func (vl *VolumeLayout) UnRegisterVolume(v *storage.VolumeInfo, dn *DataNode)
- type VolumeLayoutStats
- type VolumeLocationList
- func (dnll *VolumeLocationList) Copy() *VolumeLocationList
- func (dnll *VolumeLocationList) Head() *DataNode
- func (dnll *VolumeLocationList) Length() int
- func (dnll *VolumeLocationList) Refresh(freshThreshHold int64)
- func (dnll *VolumeLocationList) Remove(loc *DataNode) bool
- func (dnll *VolumeLocationList) Rest() []*DataNode
- func (dnll *VolumeLocationList) Set(loc *DataNode)
- func (dnll *VolumeLocationList) Stats(vid needle.VolumeId, freshThreshHold int64) (size uint64, fileCount int)
- func (dnll *VolumeLocationList) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocateVolume ¶
func AllocateVolume(dn *DataNode, grpcDialOption grpc.DialOption, vid needle.VolumeId, option *VolumeGrowOption) error
func DistributedOperation ¶
func ExistCopies ¶
func ExistCopies() stateIndicator
func NewVolumesBinaryState ¶
func NewVolumesBinaryState(name volumeState, rp *super_block.ReplicaPlacement, indicator stateIndicator) *volumesBinaryState
func ReplicatedDelete ¶
Types ¶
type AllocateVolumeResult ¶
type AllocateVolumeResult struct {
Error string
}
type Collection ¶
type Collection struct { Name string // contains filtered or unexported fields }
func NewCollection ¶
func NewCollection(name string, volumeSizeLimit uint64, replicationAsMin bool) *Collection
func (*Collection) DeleteVolumeLayout ¶
func (c *Collection) DeleteVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType)
func (*Collection) GetOrCreateVolumeLayout ¶
func (c *Collection) GetOrCreateVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType) *VolumeLayout
func (*Collection) ListVolumeServers ¶
func (c *Collection) ListVolumeServers() (nodes []*DataNode)
func (*Collection) String ¶
func (c *Collection) String() string
type Configuration ¶
type Configuration struct { XMLName xml.Name `xml:"Configuration"` Topo topology `xml:"Topology"` // contains filtered or unexported fields }
func (*Configuration) String ¶
func (c *Configuration) String() string
type DataCenter ¶
type DataCenter struct {
NodeImpl
}
func NewDataCenter ¶
func NewDataCenter(id string) *DataCenter
func (*DataCenter) GetOrCreateRack ¶
func (dc *DataCenter) GetOrCreateRack(rackName string) *Rack
func (*DataCenter) ToDataCenterInfo ¶
func (dc *DataCenter) ToDataCenterInfo() *master_pb.DataCenterInfo
func (*DataCenter) ToMap ¶
func (dc *DataCenter) ToMap() interface{}
type DataNode ¶
type DataNode struct { NodeImpl Ip string Port int GrpcPort int PublicUrl string LastSeen int64 // unix time in seconds Counter int // in race condition, the previous dataNode was not dead }
func NewDataNode ¶
func (*DataNode) AddOrUpdateEcShard ¶
func (dn *DataNode) AddOrUpdateEcShard(s *erasure_coding.EcVolumeInfo)
func (*DataNode) AddOrUpdateVolume ¶
func (dn *DataNode) AddOrUpdateVolume(v storage.VolumeInfo) (isNew, isChangedRO bool)
func (*DataNode) AdjustMaxVolumeCounts ¶
func (*DataNode) DeleteEcShard ¶
func (dn *DataNode) DeleteEcShard(s *erasure_coding.EcVolumeInfo)
func (*DataNode) DeltaUpdateEcShards ¶
func (dn *DataNode) DeltaUpdateEcShards(newShards, deletedShards []*erasure_coding.EcVolumeInfo)
func (*DataNode) DeltaUpdateVolumes ¶
func (dn *DataNode) DeltaUpdateVolumes(newVolumes, deletedVolumes []storage.VolumeInfo)
func (*DataNode) GetDataCenter ¶
func (dn *DataNode) GetDataCenter() *DataCenter
func (*DataNode) GetEcShards ¶
func (dn *DataNode) GetEcShards() (ret []*erasure_coding.EcVolumeInfo)
func (*DataNode) GetTopology ¶
func (*DataNode) GetVolumeIds ¶
GetVolumeIds returns the human readable volume ids limited to count of max 100.
func (*DataNode) GetVolumes ¶
func (dn *DataNode) GetVolumes() (ret []storage.VolumeInfo)
func (*DataNode) GetVolumesById ¶
func (*DataNode) HasEcShards ¶
func (*DataNode) HasVolumesById ¶
func (*DataNode) ServerAddress ¶
func (dn *DataNode) ServerAddress() pb.ServerAddress
func (*DataNode) ToDataNodeInfo ¶
func (dn *DataNode) ToDataNodeInfo() *master_pb.DataNodeInfo
func (*DataNode) UpdateEcShards ¶
func (dn *DataNode) UpdateEcShards(actualShards []*erasure_coding.EcVolumeInfo) (newShards, deletedShards []*erasure_coding.EcVolumeInfo)
func (*DataNode) UpdateVolumes ¶
func (dn *DataNode) UpdateVolumes(actualVolumes []storage.VolumeInfo) (newVolumes, deletedVolumes, changeRO []storage.VolumeInfo)
UpdateVolumes detects new/deleted/changed volumes on a volume server used in master to notify master clients of these changes.
type Disk ¶
type Disk struct { NodeImpl // contains filtered or unexported fields }
func (*Disk) AddOrUpdateEcShard ¶
func (d *Disk) AddOrUpdateEcShard(s *erasure_coding.EcVolumeInfo)
func (*Disk) AddOrUpdateVolume ¶
func (d *Disk) AddOrUpdateVolume(v storage.VolumeInfo) (isNew, isChangedRO bool)
func (*Disk) DeleteEcShard ¶
func (d *Disk) DeleteEcShard(s *erasure_coding.EcVolumeInfo)
func (*Disk) GetDataCenter ¶
func (d *Disk) GetDataCenter() *DataCenter
func (*Disk) GetEcShards ¶
func (d *Disk) GetEcShards() (ret []*erasure_coding.EcVolumeInfo)
func (*Disk) GetTopology ¶
func (*Disk) GetVolumeIds ¶
GetVolumeIds returns the human readable volume ids limited to count of max 100.
func (*Disk) GetVolumes ¶
func (d *Disk) GetVolumes() (ret []storage.VolumeInfo)
func (*Disk) GetVolumesById ¶
func (*Disk) ToDiskInfo ¶
type DiskUsageCounts ¶
type DiskUsageCounts struct {
// contains filtered or unexported fields
}
func (*DiskUsageCounts) FreeSpace ¶
func (a *DiskUsageCounts) FreeSpace() int64
type DiskUsages ¶
func (*DiskUsages) FreeSpace ¶
func (d *DiskUsages) FreeSpace() (freeSpace int64)
func (*DiskUsages) GetMaxVolumeCount ¶
func (d *DiskUsages) GetMaxVolumeCount() (maxVolumeCount int64)
func (*DiskUsages) ToDiskInfo ¶
func (d *DiskUsages) ToDiskInfo() map[string]*master_pb.DiskInfo
type DistributedOperationResult ¶
func (DistributedOperationResult) Error ¶
func (dr DistributedOperationResult) Error() error
type EcShardLocations ¶
type EcShardLocations struct { Collection string Locations [erasure_coding.TotalShardsCount][]*DataNode }
func NewEcShardLocations ¶
func NewEcShardLocations(collection string) *EcShardLocations
func (*EcShardLocations) AddShard ¶
func (loc *EcShardLocations) AddShard(shardId erasure_coding.ShardId, dn *DataNode) (added bool)
func (*EcShardLocations) DeleteShard ¶
func (loc *EcShardLocations) DeleteShard(shardId erasure_coding.ShardId, dn *DataNode) (deleted bool)
type MaxVolumeIdCommand ¶
func NewMaxVolumeIdCommand ¶
func NewMaxVolumeIdCommand(value needle.VolumeId) *MaxVolumeIdCommand
func (*MaxVolumeIdCommand) Apply ¶
func (c *MaxVolumeIdCommand) Apply(server raft.Server) (interface{}, error)
deprecatedCommandApply represents the old interface to apply a command to the server.
func (*MaxVolumeIdCommand) CommandName ¶
func (c *MaxVolumeIdCommand) CommandName() string
func (*MaxVolumeIdCommand) Persist ¶
func (s *MaxVolumeIdCommand) Persist(sink hashicorpRaft.SnapshotSink) error
func (*MaxVolumeIdCommand) Release ¶
func (s *MaxVolumeIdCommand) Release()
type Node ¶
type Node interface { Id() NodeId String() string AvailableSpaceFor(option *VolumeGrowOption) int64 ReserveOneVolume(r int64, option *VolumeGrowOption) (*DataNode, error) UpAdjustDiskUsageDelta(deltaDiskUsages *DiskUsages) UpAdjustMaxVolumeId(vid needle.VolumeId) GetDiskUsages() *DiskUsages GetMaxVolumeId() needle.VolumeId SetParent(Node) LinkChildNode(node Node) UnlinkChildNode(nodeId NodeId) CollectDeadNodeAndFullVolumes(freshThreshHold int64, volumeSizeLimit uint64, growThreshold float64) IsDataNode() bool IsRack() bool IsDataCenter() bool Children() []Node Parent() Node GetValue() interface{} //get reference to the topology,dc,rack,datanode }
type NodeImpl ¶
func (*NodeImpl) AvailableSpaceFor ¶
func (n *NodeImpl) AvailableSpaceFor(option *VolumeGrowOption) int64
func (*NodeImpl) CollectDeadNodeAndFullVolumes ¶
func (*NodeImpl) GetDiskUsages ¶
func (n *NodeImpl) GetDiskUsages() *DiskUsages
func (*NodeImpl) GetMaxVolumeId ¶
func (*NodeImpl) GetTopology ¶
func (*NodeImpl) IsDataCenter ¶
func (*NodeImpl) IsDataNode ¶
func (*NodeImpl) LinkChildNode ¶
func (*NodeImpl) PickNodesByWeight ¶
func (n *NodeImpl) PickNodesByWeight(numberOfNodes int, option *VolumeGrowOption, filterFirstNodeFn func(dn Node) error) (firstNode Node, restNodes []Node, err error)
the first node must satisfy filterFirstNodeFn(), the rest nodes must have one free slot
func (*NodeImpl) ReserveOneVolume ¶
func (n *NodeImpl) ReserveOneVolume(r int64, option *VolumeGrowOption) (assignedNode *DataNode, err error)
func (*NodeImpl) UnlinkChildNode ¶
func (*NodeImpl) UpAdjustDiskUsageDelta ¶
func (n *NodeImpl) UpAdjustDiskUsageDelta(deltaDiskUsages *DiskUsages)
func (*NodeImpl) UpAdjustMaxVolumeId ¶
type Rack ¶
type Rack struct {
NodeImpl
}
func (*Rack) GetOrCreateDataNode ¶
func (*Rack) ToRackInfo ¶
type RemoteResult ¶
type Topology ¶
type Topology struct { NodeImpl Sequence sequence.Sequencer Configuration *Configuration RaftServer raft.Server HashicorpRaft *hashicorpRaft.Raft // contains filtered or unexported fields }
func NewTopology ¶
func (*Topology) DataNodeRegistration ¶
func (*Topology) DeleteCollection ¶
func (*Topology) DeleteEcCollection ¶
func (*Topology) DeleteLayout ¶
func (t *Topology) DeleteLayout(collectionName string, rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType)
func (*Topology) FindCollection ¶
func (t *Topology) FindCollection(collectionName string) (*Collection, bool)
func (*Topology) GetOrCreateDataCenter ¶
func (t *Topology) GetOrCreateDataCenter(dcName string) *DataCenter
func (*Topology) GetVolumeLayout ¶
func (t *Topology) GetVolumeLayout(collectionName string, rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType) *VolumeLayout
func (*Topology) HasWritableVolume ¶
func (t *Topology) HasWritableVolume(option *VolumeGrowOption) bool
deprecated
func (*Topology) IncrementalSyncDataNodeEcShards ¶
func (t *Topology) IncrementalSyncDataNodeEcShards(newEcShards, deletedEcShards []*master_pb.VolumeEcShardInformationMessage, dn *DataNode)
func (*Topology) IncrementalSyncDataNodeRegistration ¶
func (t *Topology) IncrementalSyncDataNodeRegistration(newVolumes, deletedVolumes []*master_pb.VolumeShortInformationMessage, dn *DataNode)
func (*Topology) ListCollections ¶
func (*Topology) ListEcServersByCollection ¶
func (t *Topology) ListEcServersByCollection(collection string) (dataNodes []pb.ServerAddress)
func (*Topology) LookupEcShards ¶
func (t *Topology) LookupEcShards(vid needle.VolumeId) (locations *EcShardLocations, found bool)
func (*Topology) PickForWrite ¶
func (t *Topology) PickForWrite(count uint64, option *VolumeGrowOption) (string, uint64, *VolumeLocationList, error)
func (*Topology) RegisterEcShards ¶
func (t *Topology) RegisterEcShards(ecShardInfos *erasure_coding.EcVolumeInfo, dn *DataNode)
func (*Topology) RegisterVolumeLayout ¶
func (t *Topology) RegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode)
func (*Topology) SetVolumeCapacityFull ¶
func (t *Topology) SetVolumeCapacityFull(volumeInfo storage.VolumeInfo) bool
func (*Topology) SetVolumeCrowded ¶
func (t *Topology) SetVolumeCrowded(volumeInfo storage.VolumeInfo)
func (*Topology) StartRefreshWritableVolumes ¶
func (*Topology) SyncDataNodeEcShards ¶
func (t *Topology) SyncDataNodeEcShards(shardInfos []*master_pb.VolumeEcShardInformationMessage, dn *DataNode) (newShards, deletedShards []*erasure_coding.EcVolumeInfo)
func (*Topology) SyncDataNodeRegistration ¶
func (t *Topology) SyncDataNodeRegistration(volumes []*master_pb.VolumeInformationMessage, dn *DataNode) (newVolumes, deletedVolumes []storage.VolumeInfo)
func (*Topology) ToTopologyInfo ¶
func (t *Topology) ToTopologyInfo() *master_pb.TopologyInfo
func (*Topology) ToVolumeLocations ¶
func (t *Topology) ToVolumeLocations() (volumeLocations []*master_pb.VolumeLocation)
func (*Topology) ToVolumeMap ¶
func (t *Topology) ToVolumeMap() interface{}
func (*Topology) UnRegisterDataNode ¶
func (*Topology) UnRegisterEcShards ¶
func (t *Topology) UnRegisterEcShards(ecShardInfos *erasure_coding.EcVolumeInfo, dn *DataNode)
func (*Topology) UnRegisterVolumeLayout ¶
func (t *Topology) UnRegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode)
type VolumeGrowOption ¶
type VolumeGrowOption struct { Collection string `json:"collection,omitempty"` ReplicaPlacement *super_block.ReplicaPlacement `json:"replication,omitempty"` Ttl *needle.TTL `json:"ttl,omitempty"` DiskType types.DiskType `json:"disk,omitempty"` Preallocate int64 `json:"preallocate,omitempty"` DataCenter string `json:"dataCenter,omitempty"` Rack string `json:"rack,omitempty"` DataNode string `json:"dataNode,omitempty"` MemoryMapMaxSizeMb uint32 `json:"memoryMapMaxSizeMb,omitempty"` }
func (*VolumeGrowOption) String ¶
func (o *VolumeGrowOption) String() string
func (*VolumeGrowOption) Threshold ¶
func (o *VolumeGrowOption) Threshold() float64
type VolumeGrowRequest ¶
type VolumeGrowRequest struct { Option *VolumeGrowOption Count int ErrCh chan error }
type VolumeGrowth ¶
type VolumeGrowth struct {
// contains filtered or unexported fields
}
func NewDefaultVolumeGrowth ¶
func NewDefaultVolumeGrowth() *VolumeGrowth
func (*VolumeGrowth) AutomaticGrowByType ¶
func (vg *VolumeGrowth) AutomaticGrowByType(option *VolumeGrowOption, grpcDialOption grpc.DialOption, topo *Topology, targetCount int) (count int, err error)
func (*VolumeGrowth) GrowByCountAndType ¶
func (vg *VolumeGrowth) GrowByCountAndType(grpcDialOption grpc.DialOption, targetCount int, option *VolumeGrowOption, topo *Topology) (counter int, err error)
type VolumeLayout ¶
type VolumeLayout struct {
// contains filtered or unexported fields
}
mapping from volume to its locations, inverted from server to volume
func NewVolumeLayout ¶
func NewVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType types.DiskType, volumeSizeLimit uint64, replicationAsMin bool) *VolumeLayout
func (*VolumeLayout) AddGrowRequest ¶
func (vl *VolumeLayout) AddGrowRequest()
func (*VolumeLayout) DoneGrowRequest ¶
func (vl *VolumeLayout) DoneGrowRequest()
func (*VolumeLayout) EnsureCorrectWritables ¶
func (vl *VolumeLayout) EnsureCorrectWritables(v *storage.VolumeInfo)
func (*VolumeLayout) GetActiveVolumeCount ¶
func (vl *VolumeLayout) GetActiveVolumeCount(option *VolumeGrowOption) (active, crowded int)
func (*VolumeLayout) HasGrowRequest ¶
func (vl *VolumeLayout) HasGrowRequest() bool
func (*VolumeLayout) ListVolumeServers ¶
func (vl *VolumeLayout) ListVolumeServers() (nodes []*DataNode)
func (*VolumeLayout) PickForWrite ¶
func (vl *VolumeLayout) PickForWrite(count uint64, option *VolumeGrowOption) (*needle.VolumeId, uint64, *VolumeLocationList, error)
func (*VolumeLayout) RegisterVolume ¶
func (vl *VolumeLayout) RegisterVolume(v *storage.VolumeInfo, dn *DataNode)
func (*VolumeLayout) SetVolumeAvailable ¶
func (*VolumeLayout) SetVolumeCapacityFull ¶
func (vl *VolumeLayout) SetVolumeCapacityFull(vid needle.VolumeId) bool
func (*VolumeLayout) SetVolumeCrowded ¶
func (vl *VolumeLayout) SetVolumeCrowded(vid needle.VolumeId)
func (*VolumeLayout) SetVolumeUnavailable ¶
func (vl *VolumeLayout) SetVolumeUnavailable(dn *DataNode, vid needle.VolumeId) bool
func (*VolumeLayout) ShouldGrowVolumes ¶
func (vl *VolumeLayout) ShouldGrowVolumes(option *VolumeGrowOption) bool
func (*VolumeLayout) Stats ¶
func (vl *VolumeLayout) Stats() *VolumeLayoutStats
func (*VolumeLayout) String ¶
func (vl *VolumeLayout) String() string
func (*VolumeLayout) ToMap ¶
func (vl *VolumeLayout) ToMap() map[string]interface{}
func (*VolumeLayout) UnRegisterVolume ¶
func (vl *VolumeLayout) UnRegisterVolume(v *storage.VolumeInfo, dn *DataNode)
type VolumeLayoutStats ¶
type VolumeLocationList ¶
type VolumeLocationList struct {
// contains filtered or unexported fields
}
func NewVolumeLocationList ¶
func NewVolumeLocationList() *VolumeLocationList
func (*VolumeLocationList) Copy ¶
func (dnll *VolumeLocationList) Copy() *VolumeLocationList
func (*VolumeLocationList) Head ¶
func (dnll *VolumeLocationList) Head() *DataNode
func (*VolumeLocationList) Length ¶
func (dnll *VolumeLocationList) Length() int
func (*VolumeLocationList) Refresh ¶
func (dnll *VolumeLocationList) Refresh(freshThreshHold int64)
func (*VolumeLocationList) Remove ¶
func (dnll *VolumeLocationList) Remove(loc *DataNode) bool
func (*VolumeLocationList) Rest ¶
func (dnll *VolumeLocationList) Rest() []*DataNode
func (*VolumeLocationList) Set ¶
func (dnll *VolumeLocationList) Set(loc *DataNode)
func (*VolumeLocationList) String ¶
func (dnll *VolumeLocationList) String() string
Source Files ¶
- allocate_volume.go
- cluster_commands.go
- collection.go
- configuration.go
- data_center.go
- data_node.go
- data_node_ec.go
- disk.go
- disk_ec.go
- node.go
- rack.go
- store_replicate.go
- topology.go
- topology_ec.go
- topology_event_handling.go
- topology_map.go
- topology_vacuum.go
- volume_growth.go
- volume_layout.go
- volume_location_list.go
Click to show internal directories.
Click to hide internal directories.