clustermgr

package
v0.0.0-...-303e327 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceStatusNormal   = 1
	ServiceStatusSnapshot = 2
)
View Source
const (
	NeedReadIndex   = 1
	NoNeedReadIndex = 2
)
View Source
const (
	BidScopeName             = "bid"
	MaxBidCount              = 100000
	DefaultChunkSize         = 17179869184
	DefaultVolumeReserveSize = 10485760
)

Variables

View Source
var (
	VolInconsistencyMetric = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: "blobstore",
			Subsystem: "clusterMgr",
			Name:      "vol_inconsistent",
			Help:      "volume status or vuid inconsistent",
		},
		[]string{"region", "cluster", "is_leader", "item"},
	)
)

Functions

func NewHandler

func NewHandler(service *Service) *rpc.Router

Types

type Config

type Config struct {
	Region                   string                    `json:"region"`
	IDC                      []string                  `json:"idc"`
	UnavailableIDC           string                    `json:"unavailable_idc"`
	ClusterID                proto.ClusterID           `json:"cluster_id"`
	Readonly                 bool                      `json:"readonly"`
	VolumeMgrConfig          volumemgr.VolumeMgrConfig `json:"volume_mgr_config"`
	DBPath                   string                    `json:"db_path"`
	NormalDBPath             string                    `json:"normal_db_path"`
	NormalDBOption           kvstore.RocksDBOption     `json:"normal_db_option"`
	KvDBPath                 string                    `json:"kv_db_path"`
	KvDBOption               kvstore.RocksDBOption     `json:"kv_db_option"`
	CodeModePolicies         []codemode.Policy         `json:"code_mode_policies"`
	ClusterCfg               map[string]interface{}    `json:"cluster_config"`
	RaftConfig               RaftConfig                `json:"raft_config"`
	DiskMgrConfig            diskmgr.DiskMgrConfig     `json:"disk_mgr_config"`
	ClusterReportIntervalS   int                       `json:"cluster_report_interval_s"`
	ConsulAgentAddr          string                    `json:"consul_agent_addr"`
	HeartbeatNotifyIntervalS int                       `json:"heartbeat_notify_interval_s"`
	MaxHeartbeatNotifyNum    int                       `json:"max_heartbeat_notify_num"`
	ChunkSize                uint64                    `json:"chunk_size"`
	MetricReportIntervalM    int                       `json:"metric_report_interval_m"`
	ConsistentCheckIntervalM int                       `json:"consistent_check_interval_m"`

	cmd.Config
}

type RaftConfig

type RaftConfig struct {
	RaftDBPath       string                `json:"raft_db_path"`
	RaftDBOption     kvstore.RocksDBOption `json:"raft_db_option"`
	SnapshotPatchNum int                   `json:"snapshot_patch_num"`
	ServerConfig     raftserver.Config     `json:"server_config"`
	RaftNodeConfig   base.RaftNodeConfig   `json:"raft_node_config"`
}

type Service

type Service struct {
	ConfigMgr  *configmgr.ConfigMgr
	ScopeMgr   *scopemgr.ScopeMgr
	ServiceMgr *servicemgr.ServiceMgr
	// Note: DiskMgr should always list before volumeMgr
	// cause DiskMgr applier LoadData should be call first, or VolumeMgr LoadData may return error with disk not found
	DiskMgr   *diskmgr.DiskMgr
	VolumeMgr *volumemgr.VolumeMgr
	KvMgr     *kvmgr.KvMgr

	*Config
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) (*Service, error)

func (*Service) AdminDiskUpdate

func (s *Service) AdminDiskUpdate(c *rpc.Context)

func (*Service) AdminUpdateVolume

func (s *Service) AdminUpdateVolume(c *rpc.Context)

func (*Service) AdminUpdateVolumeUnit

func (s *Service) AdminUpdateVolumeUnit(c *rpc.Context)

func (*Service) Apply

func (s *Service) Apply(data [][]byte, index uint64) error

func (*Service) ApplyMemberChange

func (s *Service) ApplyMemberChange(cc raftserver.ConfChange, index uint64) error

func (*Service) ApplySnapshot

func (s *Service) ApplySnapshot(meta raftserver.SnapshotMeta, st raftserver.Snapshot) error

func (*Service) BidAlloc

func (s *Service) BidAlloc(c *rpc.Context)

func (*Service) ChunkReport

func (s *Service) ChunkReport(c *rpc.Context)

func (*Service) ChunkSetCompact

func (s *Service) ChunkSetCompact(c *rpc.Context)

func (*Service) Close

func (s *Service) Close()

func (*Service) ConfigDelete

func (s *Service) ConfigDelete(c *rpc.Context)

func (*Service) ConfigGet

func (s *Service) ConfigGet(c *rpc.Context)

Get config: /config/get?key=enable_delete

func (*Service) ConfigSet

func (s *Service) ConfigSet(c *rpc.Context)

func (*Service) DiskAccess

func (s *Service) DiskAccess(c *rpc.Context)

func (*Service) DiskAdd

func (s *Service) DiskAdd(c *rpc.Context)

func (*Service) DiskDrop

func (s *Service) DiskDrop(c *rpc.Context)

func (*Service) DiskDropped

func (s *Service) DiskDropped(c *rpc.Context)

func (*Service) DiskDroppingList

func (s *Service) DiskDroppingList(c *rpc.Context)

func (*Service) DiskHeartbeat

func (s *Service) DiskHeartbeat(c *rpc.Context)

func (*Service) DiskIdAlloc

func (s *Service) DiskIdAlloc(c *rpc.Context)

func (*Service) DiskInfo

func (s *Service) DiskInfo(c *rpc.Context)

func (*Service) DiskList

func (s *Service) DiskList(c *rpc.Context)

func (*Service) DiskSet

func (s *Service) DiskSet(c *rpc.Context)

func (*Service) Handler

func (s *Service) Handler(w http.ResponseWriter, req *http.Request, f func(http.ResponseWriter, *http.Request))

func (*Service) KvDelete

func (s *Service) KvDelete(c *rpc.Context)

func (*Service) KvGet

func (s *Service) KvGet(c *rpc.Context)

Get get value

func (*Service) KvList

func (s *Service) KvList(c *rpc.Context)

func (*Service) KvSet

func (s *Service) KvSet(c *rpc.Context)

func (*Service) LeaderChange

func (s *Service) LeaderChange(leader uint64, host string)

func (*Service) LeadershipTransfer

func (s *Service) LeadershipTransfer(c *rpc.Context)

func (*Service) MemberAdd

func (s *Service) MemberAdd(c *rpc.Context)

func (*Service) MemberRemove

func (s *Service) MemberRemove(c *rpc.Context)

func (*Service) ServiceGet

func (s *Service) ServiceGet(c *rpc.Context)

func (*Service) ServiceHeartbeat

func (s *Service) ServiceHeartbeat(c *rpc.Context)

func (*Service) ServiceList

func (s *Service) ServiceList(c *rpc.Context)

func (*Service) ServiceRegister

func (s *Service) ServiceRegister(c *rpc.Context)

func (*Service) ServiceUnregister

func (s *Service) ServiceUnregister(c *rpc.Context)

func (*Service) Snapshot

func (s *Service) Snapshot() (raftserver.Snapshot, error)

func (*Service) SnapshotDump

func (s *Service) SnapshotDump(c *rpc.Context)

SnapshotDump will dump all data using snapshot

func (*Service) Stat

func (s *Service) Stat(c *rpc.Context)

func (*Service) V2VolumeList

func (s *Service) V2VolumeList(c *rpc.Context)

func (*Service) VolumeAlloc

func (s *Service) VolumeAlloc(c *rpc.Context)

transport to primary and params check

func (*Service) VolumeAllocatedList

func (s *Service) VolumeAllocatedList(c *rpc.Context)

func (*Service) VolumeGet

func (s *Service) VolumeGet(c *rpc.Context)

func (*Service) VolumeList

func (s *Service) VolumeList(c *rpc.Context)

func (*Service) VolumeLock

func (s *Service) VolumeLock(c *rpc.Context)

func (*Service) VolumeRetain

func (s *Service) VolumeRetain(c *rpc.Context)

func (*Service) VolumeUnitAlloc

func (s *Service) VolumeUnitAlloc(c *rpc.Context)

func (*Service) VolumeUnitList

func (s *Service) VolumeUnitList(c *rpc.Context)

func (*Service) VolumeUnitRelease

func (s *Service) VolumeUnitRelease(c *rpc.Context)

direct use blobnode client release chunk

func (*Service) VolumeUnlock

func (s *Service) VolumeUnlock(c *rpc.Context)

func (*Service) VolumeUpdate

func (s *Service) VolumeUpdate(c *rpc.Context)

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
persistence

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL