curvebs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// file type
	INODE_DIRECTORY         = "INODE_DIRECTORY"
	INODE_PAGEFILE          = "INODE_PAGEFILE"
	INODE_APPENDFILE        = "INODE_APPENDFILE"
	INODE_APPENDECFILE      = "INODE_APPENDECFILE"
	INODE_SNAPSHOT_PAGEFILE = "INODE_SNAPSHOT_PAGEFILE"

	// file status
	FILE_CREATED             = "kFileCreated"
	FILE_DELETING            = "kFileDeleting"
	FILE_CLONING             = "kFileCloning"
	FILE_CLONEMETA_INSTALLED = "kFileCloneMetaInstalled"
	FILE_CLONED              = "kFileCloned"
	FILE_BEIING_CLONED       = "kFileBeingCloned"

	// throttle type
	IOPS_TOTAL = "IOPS_TOTAL"
	IOPS_READ  = "IOPS_READ"
	IOPS_WRITE = "IOPS_WRITE"
	BPS_TOTAL  = "BPS_TOTAL"
	BPS_READ   = "BPS_READ"
	BPS_WRITE  = "BPS_WRITE"

	// apis
	GET_FILE_ALLOC_SIZE_FUNC = "GetAllocatedSize"
	LIST_DIR_FUNC            = "ListDir"
	GET_FILE_INFO            = "GetFileInfo"
	GET_FILE_SIZE            = "GetFileSize"
)
View Source
const (
	// invalid type
	INVALID = "INVALID"

	// logical pool type
	PAGEFILE_TYPE     = "PAGEFILE"
	APPENDFILE_TYPE   = "APPENDFILE"
	APPENDECFILE_TYPE = "APPENDECFILE"

	// logical pool allocate status
	ALLOW_STATUS = "ALLOW"
	DENY_STATUS  = "DENY"

	// chunkserver status
	READWRITE_STATUS = "READWRITE"
	PENDDING_STATUS  = "PENDDING"
	RETIRED_STATUS   = "RETIRED"

	// chunkserver disk status
	DISKNORMAL_STATUS = "DISKNORMAL"
	DISKERROR_STATUS  = "DISKERROR"

	// chunkserver online status
	ONLINE_STATUS   = "ONLINE"
	OFFLINE_STATUS  = "OFFLINE"
	UNSTABLE_STATUS = "UNSTABLE"

	// apis
	LIST_PHYSICAL_POOL_FUNC          = "ListPhysicalPool"
	LIST_LOGICAL_POOL_FUNC           = "ListLogicalPool"
	LIST_POOL_ZONE_FUNC              = "ListPoolZone"
	LIST_ZONE_SERVER_FUNC            = "ListZoneServer"
	LIST_CHUNKSERVER_FUNC            = "ListChunkServer"
	GET_CHUNKSERVER_IN_CLUSTER_FUNC  = "GetChunkServerInCluster"
	GET_COPYSET_IN_CHUNKSERVER_FUNC  = "GetCopySetsInChunkServer"
	GET_CHUNKSERVER_LIST_IN_COPYSETS = "GetChunkServerListInCopySets"
	GET_COPYSETS_IN_CLUSTER          = "GetCopySetsInCluster"
	GET_LOGICAL_POOL                 = "GetLogicalPool"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkServer

type ChunkServer struct {
	Id           uint32 `json:"id" binding:"required"`
	DiskType     string `json:"diskType" binding:"required"`
	HostIp       string `json:"hostIp" binding:"required"`
	Port         uint32 `json:"port" binding:"required"`
	Status       string `json:"status" binding:"required"`
	DiskStatus   string `json:"diskStatus" binding:"required"`
	OnlineStatus string `json:"onlineStatus" binding:"required"`
	MountPoint   string `json:"mountPoint" binding:"required"`
	DiskCapacity string `json:"diskCapacity" binding:"required"`
	DiskUsed     string `json:"diskUsed" binding:"required"`
	ExternalIp   string `json:"externalIp"`
}

type ChunkServerLocation

type ChunkServerLocation struct {
	ChunkServerId uint32 `json:"chunkServerId" binding:"required"`
	HostIp        string `json:"hostIp" binding:"required"`
	Port          uint32 `josn:"port" binding:"required"`
	ExternalIp    string `json:"externalIp"`
}

type CopySetInfo

type CopySetInfo struct {
	LogicalPoolId      uint32 `json:"logicalPoolId" binding:"required"`
	CopysetId          uint32 `json:"copysetId" binding:"required"`
	Scanning           bool   `json:"scanning"`
	LastScanSec        uint64 `json:"lastScanSec"`
	LastScanConsistent bool   `json:"lastScanConsistent"`
}

type CopySetServerInfo

type CopySetServerInfo struct {
	CopysetId uint32                `json:"copysetId" binding:"required"`
	CsLocs    []ChunkServerLocation `json:"csLocs" binding:"required"`
}

type FileInfo

type FileInfo struct {
	Id                   uint64           `json:"id"`
	FileName             string           `json:"fileName"`
	ParentId             uint64           `json:"parentId"`
	FileType             string           `json:"fileType"`
	Owner                string           `json:"owner"`
	ChunkSize            uint32           `json:"chunkSize"`
	SegmentSize          uint32           `json:"segmentSize"`
	Length               uint64           `json:"length"`
	AllocateSize         uint64           `json:"alloc"`
	Ctime                string           `json:"ctime"`
	SeqNum               uint64           `json:"seqNum"`
	FileStatus           string           `json:"fileStatus"`
	OriginalFullPathName string           `json:"originalFullPathName"`
	CloneSource          string           `json:"cloneSource"`
	CloneLength          uint64           `json:"cloneLength"`
	StripeUnit           uint64           `json:"stripeUnit"`
	StripeCount          uint64           `json:"stripeCount"`
	ThrottleParams       []ThrottleParams `json:"throttleParams"`
	Epoch                uint64           `json:"epoch"`
}

type GetChunkServerInCluster

type GetChunkServerInCluster struct {
	Request *topology.GetChunkServerInClusterRequest
	// contains filtered or unexported fields
}

get chunkserver in cluster

func (*GetChunkServerInCluster) NewRpcClient

func (rpc *GetChunkServerInCluster) NewRpcClient(cc grpc.ClientConnInterface)

func (*GetChunkServerInCluster) Stub_Func

func (rpc *GetChunkServerInCluster) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type GetChunkServerListInCopySets

type GetChunkServerListInCopySets struct {
	Request *topology.GetChunkServerListInCopySetsRequest
	// contains filtered or unexported fields
}

get chunkserver list in copysets

func (*GetChunkServerListInCopySets) NewRpcClient

func (*GetChunkServerListInCopySets) Stub_Func

func (rpc *GetChunkServerListInCopySets) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type GetCopySetsInChunkServer

type GetCopySetsInChunkServer struct {
	Request *topology.GetCopySetsInChunkServerRequest
	// contains filtered or unexported fields
}

get copysets on chunkserver

func (*GetCopySetsInChunkServer) NewRpcClient

func (rpc *GetCopySetsInChunkServer) NewRpcClient(cc grpc.ClientConnInterface)

func (*GetCopySetsInChunkServer) Stub_Func

func (rpc *GetCopySetsInChunkServer) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type GetCopySetsInCluster

type GetCopySetsInCluster struct {
	Request *topology.GetCopySetsInClusterRequest
	// contains filtered or unexported fields
}

get copysets in cluster

func (*GetCopySetsInCluster) NewRpcClient

func (rpc *GetCopySetsInCluster) NewRpcClient(cc grpc.ClientConnInterface)

func (*GetCopySetsInCluster) Stub_Func

func (rpc *GetCopySetsInCluster) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type GetFileAllocatedSize

type GetFileAllocatedSize struct {
	Request *nameserver2.GetAllocatedSizeRequest
	// contains filtered or unexported fields
}

get file(include dir) allocated space

func (*GetFileAllocatedSize) NewRpcClient

func (rpc *GetFileAllocatedSize) NewRpcClient(cc grpc.ClientConnInterface)

func (*GetFileAllocatedSize) Stub_Func

func (rpc *GetFileAllocatedSize) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type GetFileInfo

type GetFileInfo struct {
	Request *nameserver2.GetFileInfoRequest
	// contains filtered or unexported fields
}

get volume

func (*GetFileInfo) NewRpcClient

func (rpc *GetFileInfo) NewRpcClient(cc grpc.ClientConnInterface)

func (*GetFileInfo) Stub_Func

func (rpc *GetFileInfo) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type GetFileSize

type GetFileSize struct {
	Request *nameserver2.GetFileSizeRequest
	// contains filtered or unexported fields
}

nameserver2 get file/dir size

func (*GetFileSize) NewRpcClient

func (rpc *GetFileSize) NewRpcClient(cc grpc.ClientConnInterface)

func (*GetFileSize) Stub_Func

func (rpc *GetFileSize) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type GetLogicalPool

type GetLogicalPool struct {
	Request *topology.GetLogicalPoolRequest
	// contains filtered or unexported fields
}

get logical pool

func (*GetLogicalPool) NewRpcClient

func (rpc *GetLogicalPool) NewRpcClient(cc grpc.ClientConnInterface)

func (*GetLogicalPool) Stub_Func

func (rpc *GetLogicalPool) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type ListChunkServer

type ListChunkServer struct {
	Request *topology.ListChunkServerRequest
	// contains filtered or unexported fields
}

list chunkservers of server

func (*ListChunkServer) NewRpcClient

func (rpc *ListChunkServer) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListChunkServer) Stub_Func

func (rpc *ListChunkServer) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type ListDir

type ListDir struct {
	Request *nameserver2.ListDirRequest
	// contains filtered or unexported fields
}

list volume in dir

func (*ListDir) NewRpcClient

func (rpc *ListDir) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListDir) Stub_Func

func (rpc *ListDir) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type ListLogicalPoolRpc

type ListLogicalPoolRpc struct {
	Request *topology.ListLogicalPoolRequest
	// contains filtered or unexported fields
}

list logical pool

func (*ListLogicalPoolRpc) NewRpcClient

func (rpc *ListLogicalPoolRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListLogicalPoolRpc) Stub_Func

func (rpc *ListLogicalPoolRpc) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type ListPhysicalPoolRpc

type ListPhysicalPoolRpc struct {
	Request *topology.ListPhysicalPoolRequest
	// contains filtered or unexported fields
}

topology list physical pool

func (*ListPhysicalPoolRpc) NewRpcClient

func (rpc *ListPhysicalPoolRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListPhysicalPoolRpc) Stub_Func

func (rpc *ListPhysicalPoolRpc) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type ListPoolZonesRpc

type ListPoolZonesRpc struct {
	Request *topology.ListPoolZoneRequest
	// contains filtered or unexported fields
}

list zones of logical pool

func (*ListPoolZonesRpc) NewRpcClient

func (rpc *ListPoolZonesRpc) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListPoolZonesRpc) Stub_Func

func (rpc *ListPoolZonesRpc) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type ListZoneServer

type ListZoneServer struct {
	Request *topology.ListZoneServerRequest
	// contains filtered or unexported fields
}

list servers of zone

func (*ListZoneServer) NewRpcClient

func (rpc *ListZoneServer) NewRpcClient(cc grpc.ClientConnInterface)

func (*ListZoneServer) Stub_Func

func (rpc *ListZoneServer) Stub_Func(ctx context.Context, opt ...grpc.CallOption) (interface{}, error)

type LogicalPool

type LogicalPool struct {
	Id             uint32 `json:"id" binding:"required"`
	Name           string `json:"name" binding:"required"`
	PhysicalPoolId uint32 `json:"physicalPoolId" binding:"required"`
	Type           string `json:"type" binding:"required"`
	CreateTime     string `json:"createTime" binding:"required"`
	AllocateStatus string `json:"allocateStatus" binding:"required"`
	ScanEnable     bool   `json:"scanEnable"`
}

type MdsClient

type MdsClient struct {
	// contains filtered or unexported fields
}

func NewMdsClient

func NewMdsClient(option MdsClientOption) *MdsClient

func (*MdsClient) GetChunkServerInCluster

func (cli *MdsClient) GetChunkServerInCluster() ([]ChunkServer, error)

func (*MdsClient) GetChunkServerListInCopySets

func (cli *MdsClient) GetChunkServerListInCopySets(logicalPoolId uint32, copysetIds []uint32) ([]CopySetServerInfo, error)

func (*MdsClient) GetCopySetsInChunkServer

func (cli *MdsClient) GetCopySetsInChunkServer(ip string, port uint32) ([]CopySetInfo, error)

func (*MdsClient) GetCopySetsInCluster

func (cli *MdsClient) GetCopySetsInCluster() ([]CopySetInfo, error)

func (*MdsClient) GetFileAllocatedSize

func (cli *MdsClient) GetFileAllocatedSize(filename string) (uint64, map[uint32]uint64, error)

func (*MdsClient) GetFileInfo

func (cli *MdsClient) GetFileInfo(filename, owner, sig string, date uint64) (FileInfo, error)

func (*MdsClient) GetFileSize

func (cli *MdsClient) GetFileSize(fileName string) (uint64, error)

func (*MdsClient) GetLogicalPool

func (cli *MdsClient) GetLogicalPool(poolId uint32) (LogicalPool, error)

func (*MdsClient) ListChunkServer

func (cli *MdsClient) ListChunkServer(serverId uint32) ([]ChunkServer, error)

func (*MdsClient) ListDir

func (cli *MdsClient) ListDir(filename, owner, sig string, date uint64) ([]FileInfo, error)

func (*MdsClient) ListLogicalPool

func (cli *MdsClient) ListLogicalPool() ([]LogicalPool, error)

func (*MdsClient) ListPhysicalPool

func (cli *MdsClient) ListPhysicalPool() ([]PhysicalPool, error)

func (*MdsClient) ListPoolZone

func (cli *MdsClient) ListPoolZone(poolId uint32) ([]Zone, error)

list zones of physical pool

func (*MdsClient) ListZoneServer

func (cli *MdsClient) ListZoneServer(zoneId uint32) ([]Server, error)

list servers of zone

type MdsClientOption

type MdsClientOption struct {
	TimeoutMs  int
	RetryTimes uint32
	Addrs      []string
}

type PhysicalPool

type PhysicalPool struct {
	Id   uint32 `json:"id" binding:"required"`
	Name string `json:"name" binding:"required"`
	Desc string `json:"desc"`
}

type Server

type Server struct {
	Id               uint32 `json:"id" binding:"required"`
	HostName         string `json:"hostName" binding:"required"`
	InternalIp       string `json:"internalIp" binding:"required"`
	InternalPort     uint32 `json:"internalPort" binding:"required"`
	ExternalIp       string `json:"externalIp" binding:"required"`
	ExternalPort     uint32 `json:"externalPort" binding:"required"`
	ZoneId           uint32 `json:"zoneId" binding:"required"`
	ZoneName         string `json:"zoneName" binding:"required"`
	PhysicalPoolId   uint32 `json:"physicalPoolId" binding:"required"`
	PhysicalPoolName string `json:"physicalName" binding:"required"`
	Desc             string `json:"desc"`
}

type ThrottleParams

type ThrottleParams struct {
	Type        string `json:"type"`
	Limit       uint64 `json:"limit"`
	Burst       uint64 `json:"burst"`
	BurstLength uint64 `json:"burstLength"`
}

type Zone

type Zone struct {
	Id               uint32 `json:"id" binding:"required"`
	Name             string `json:"name" binding:"required"`
	PhysicalPoolId   uint32 `json:"physicalPoolId" binding:"required"`
	PhysicalPoolName string `json:"physicalName" binding:"required"`
	Desc             string `json:"desc"`
}

Jump to

Keyboard shortcuts

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