Documentation ¶
Index ¶
- Constants
- Variables
- func FileExist(name string) bool
- type DataCenter
- type DataNode
- type DataRack
- type IDC
- type ManageServer
- func (s *ManageServer) AllocateVolume(dn *DataNode, vid util.VIDType, option *volume.GrowOption) error
- func (s *ManageServer) ClusterStatusHandler(w http.ResponseWriter, r *http.Request)
- func (s *ManageServer) DirStatusHandler(w http.ResponseWriter, r *http.Request)
- func (s *ManageServer) GrowVolume(option *volume.GrowOption) (int, error)
- func (s *ManageServer) RegistRouter()
- func (s *ManageServer) SendHeartbeat(stream pb.Seaweed_SendHeartbeatServer) error
- func (s *ManageServer) StartServer() bool
- func (s *ManageServer) StatusHandler(w http.ResponseWriter, r *http.Request)
- func (s *ManageServer) VolGrowHandler(w http.ResponseWriter, r *http.Request)
- type Member
- type RaftNode
- func (rc *RaftNode) IsIDRemoved(id uint64) bool
- func (s *RaftNode) Lookup(key string) (string, bool)
- func (rc *RaftNode) NewMembers(advertise, cluster string) error
- func (rc *RaftNode) Process(ctx context.Context, m raftpb.Message) error
- func (s *RaftNode) Propose(k string, v string)
- func (rc *RaftNode) ReadCommitC() <-chan *string
- func (rc *RaftNode) ReadErrorC() <-chan error
- func (rc *RaftNode) ReadStatus() (stat util.ClusterStatusResult)
- func (rc *RaftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus)
- func (rc *RaftNode) ReportUnreachable(id uint64)
- func (rc *RaftNode) WriteProposeC() chan<- string
- func (rc *RaftNode) WriteSnapshotter() chan<- *snap.Snapshotter
Constants ¶
View Source
const ( ElectionTickTime int = 10 // ElectionTickTime 选举超时 HeartbeatTickTime int = 5 // HeartbeatTickTime 心跳超时 MaxSizePerMsg uint64 = 4194304 // MaxSizePerMsg 每包最大值 )
Variables ¶
View Source
var DefaultCenterName = "DefaultCenter"
View Source
var DefaultRackName = "DefaultRack"
View Source
var (
MaxVolumeID = "max_volume_id"
)
Functions ¶
Types ¶
type DataCenter ¶
type DataCenter struct { DataRack map[string]*DataRack `json:"Racks"` // contains filtered or unexported fields }
func NewDataCenter ¶
func NewDataCenter() *DataCenter
type DataNode ¶
type DataNode struct { sync.RWMutex VolumeInfos map[util.VIDType]*volume.VolumeInfo Ip string `json:"-"` Port int `json:"-"` PublicUrl string `json:"-"` // contains filtered or unexported fields }
func NewDataNode ¶
func (*DataNode) AddVolume ¶
func (dn *DataNode) AddVolume(v *volume.VolumeInfo)
type DataRack ¶
type IDC ¶
type IDC struct { DataCenters map[string]*DataCenter `json:"DataCenters"` // contains filtered or unexported fields }
type ManageServer ¶
type ManageServer struct { MetaFolder *string VolumeSizeLimitMB *uint Cluster *string Advertise *string MaxCPU *int Router *mux.Router RNode *RaftNode IDCMtx sync.RWMutex IDC IDC DefaultReplicaPlacement *string }
ManageServer 管理节点结构
func NewManageServer ¶
func NewManageServer() *ManageServer
func (*ManageServer) AllocateVolume ¶
func (s *ManageServer) AllocateVolume(dn *DataNode, vid util.VIDType, option *volume.GrowOption) error
func (*ManageServer) ClusterStatusHandler ¶
func (s *ManageServer) ClusterStatusHandler(w http.ResponseWriter, r *http.Request)
ClusterStatusHandler cluster status
func (*ManageServer) DirStatusHandler ¶
func (s *ManageServer) DirStatusHandler(w http.ResponseWriter, r *http.Request)
DirStatusHandler dir status
func (*ManageServer) GrowVolume ¶
func (s *ManageServer) GrowVolume(option *volume.GrowOption) (int, error)
func (*ManageServer) SendHeartbeat ¶
func (s *ManageServer) SendHeartbeat(stream pb.Seaweed_SendHeartbeatServer) error
SendHeartbeat 处理心跳入口
func (*ManageServer) StartServer ¶
func (s *ManageServer) StartServer() bool
StartServer start a rpc and http service
func (*ManageServer) StatusHandler ¶
func (s *ManageServer) StatusHandler(w http.ResponseWriter, r *http.Request)
StatusHandler Server status
func (*ManageServer) VolGrowHandler ¶
func (s *ManageServer) VolGrowHandler(w http.ResponseWriter, r *http.Request)
type RaftNode ¶
type RaftNode struct {
// contains filtered or unexported fields
}
RaftNode A key-value stream backed by raft
func (*RaftNode) NewMembers ¶
func (*RaftNode) ReadCommitC ¶
ReadCommitC Read commitC
func (*RaftNode) ReadStatus ¶
func (rc *RaftNode) ReadStatus() (stat util.ClusterStatusResult)
ReadStatus Read node status
func (*RaftNode) ReportSnapshot ¶
func (rc *RaftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus)
ReportSnapshot Report Snapshot
func (*RaftNode) ReportUnreachable ¶
ReportUnreachable Report Unreachable
func (*RaftNode) WriteProposeC ¶
WriteProposeC Write Propose
func (*RaftNode) WriteSnapshotter ¶
func (rc *RaftNode) WriteSnapshotter() chan<- *snap.Snapshotter
WriteProposeC Write Propose
Click to show internal directories.
Click to hide internal directories.