proto

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 35 Imported by: 42

Documentation

Index

Constants

View Source
const (
	// Admin APIs
	AdminGetMasterApiList                     = "/admin/getMasterApiList"
	AdminSetApiQpsLimit                       = "/admin/setApiQpsLimit"
	AdminGetApiQpsLimit                       = "/admin/getApiQpsLimit"
	AdminRemoveApiQpsLimit                    = "/admin/rmApiQpsLimit"
	AdminGetCluster                           = "/admin/getCluster"
	AdminSetClusterInfo                       = "/admin/setClusterInfo"
	AdminGetMonitorPushAddr                   = "/admin/getMonitorPushAddr"
	AdminGetClusterDataNodes                  = "/admin/cluster/getAllDataNodes"
	AdminGetClusterMetaNodes                  = "/admin/cluster/getAllMetaNodes"
	AdminGetDataPartition                     = "/dataPartition/get"
	AdminLoadDataPartition                    = "/dataPartition/load"
	AdminCreateDataPartition                  = "/dataPartition/create"
	AdminCreatePreLoadDataPartition           = "/dataPartition/createPreLoad"
	AdminDecommissionDataPartition            = "/dataPartition/decommission"
	AdminDiagnoseDataPartition                = "/dataPartition/diagnose"
	AdminResetDataPartitionDecommissionStatus = "/dataPartition/resetDecommissionStatus"
	AdminQueryDataPartitionDecommissionStatus = "/dataPartition/queryDecommissionStatus"
	AdminCheckReplicaMeta                     = "/dataPartition/checkReplicaMeta"
	AdminRecoverReplicaMeta                   = "/dataPartition/recoverReplicaMeta"
	AdminRecoverBackupDataReplica             = "/dataPartition/recoverBackupDataReplica"
	AdminDeleteDataReplica                    = "/dataReplica/delete"
	AdminAddDataReplica                       = "/dataReplica/add"
	AdminDeleteVol                            = "/vol/delete"
	AdminUpdateVol                            = "/vol/update"
	AdminVolShrink                            = "/vol/shrink"
	AdminVolExpand                            = "/vol/expand"
	AdminVolForbidden                         = "/vol/forbidden"
	AdminVolEnableAuditLog                    = "/vol/auditlog"
	AdminVolSetDpRepairBlockSize              = "/vol/setDpRepairBlockSize"
	AdminCreateVol                            = "/admin/createVol"
	AdminGetVol                               = "/admin/getVol"
	AdminClusterFreeze                        = "/cluster/freeze"
	AdminClusterForbidMpDecommission          = "/cluster/forbidMetaPartitionDecommission"
	AdminClusterStat                          = "/cluster/stat"
	AdminSetCheckDataReplicasEnable           = "/cluster/setCheckDataReplicasEnable"
	AdminGetIP                                = "/admin/getIp"
	AdminCreateMetaPartition                  = "/metaPartition/create"
	AdminSetMetaNodeThreshold                 = "/threshold/set"
	AdminSetMasterVolDeletionDelayTime        = "/volDeletionDelayTime/set"
	AdminListVols                             = "/vol/list"
	AdminSetNodeInfo                          = "/admin/setNodeInfo"
	AdminGetNodeInfo                          = "/admin/getNodeInfo"
	AdminGetAllNodeSetGrpInfo                 = "/admin/getDomainInfo"
	AdminGetNodeSetGrpInfo                    = "/admin/getDomainNodeSetGrpInfo"
	AdminGetIsDomainOn                        = "/admin/getIsDomainOn"
	AdminUpdateNodeSetCapcity                 = "/admin/updateNodeSetCapcity"
	AdminUpdateNodeSetId                      = "/admin/updateNodeSetId"
	AdminUpdateNodeSetNodeSelector            = "/admin/updateNodeSetNodeSelector"
	AdminUpdateDomainDataUseRatio             = "/admin/updateDomainDataRatio"
	AdminUpdateZoneExcludeRatio               = "/admin/updateZoneExcludeRatio"
	AdminSetNodeRdOnly                        = "/admin/setNodeRdOnly"
	AdminSetDpRdOnly                          = "/admin/setDpRdOnly"
	AdminSetConfig                            = "/admin/setConfig"
	AdminGetConfig                            = "/admin/getConfig"
	AdminDataPartitionChangeLeader            = "/dataPartition/changeleader"
	AdminChangeMasterLeader                   = "/master/changeleader"
	AdminOpFollowerPartitionsRead             = "/master/opFollowerPartitionRead"
	AdminUpdateDecommissionLimit              = "/admin/updateDecommissionLimit"
	AdminQueryDecommissionLimit               = "/admin/queryDecommissionLimit"
	AdminQueryDecommissionFailedDisk          = "/admin/queryDecommissionFailedDisk"
	AdminAbortDecommissionDisk                = "/admin/abortDecommissionDisk"
	AdminResetDataPartitionRestoreStatus      = "/admin/resetDataPartitionRestoreStatus"
	// #nosec G101
	AdminQueryDecommissionToken = "/admin/queryDecommissionToken"
	AdminSetFileStats           = "/admin/setFileStatsEnable"
	AdminGetFileStats           = "/admin/getFileStatsEnable"
	AdminGetClusterValue        = "/admin/getClusterValue"
	AdminSetClusterUuidEnable   = "/admin/setClusterUuidEnable"
	AdminGetClusterUuid         = "/admin/getClusterUuid"
	AdminGenerateClusterUuid    = "/admin/generateClusterUuid"
	AdminSetDpDiscard           = "/admin/setDpDiscard"
	AdminGetDiscardDp           = "/admin/getDiscardDp"

	AdminSetConLcNodeNum  = "/admin/setConLcNodeNum"
	AdminGetAllLcNodeInfo = "/admin/getAllLcNodeInfo"

	AdminLcNode = "/admin/lcnode"

	AdminUpdateDecommissionDiskLimit = "/admin/updateDecommissionDiskLimit"
	AdminEnableAutoDecommissionDisk  = "/admin/enableAutoDecommissionDisk"
	AdminQueryAutoDecommissionDisk   = "/admin/queryAutoDecommissionDisk"
	// graphql master api
	AdminClusterAPI               = "/api/cluster"
	AdminUserAPI                  = "/api/user"
	AdminVolumeAPI                = "/api/volume"
	AdminSetDiskBrokenThreshold   = "/admin/setDiskBrokenThreshold"
	AdminQueryDiskBrokenThreshold = "/admin/queryDiskBrokenThreshold"
	// graphql coonsole api
	ConsoleIQL        = "/iql"
	ConsoleLoginAPI   = "/login"
	ConsoleMonitorAPI = "/cfs_monitor"
	ConsoleFile       = "/file"
	ConsoleFileDown   = "/file/down"
	ConsoleFileUpload = "/file/upload"

	// Client APIs
	ClientDataPartitions = "/client/partitions"
	ClientVol            = "/client/vol"
	ClientMetaPartition  = "/metaPartition/get"
	ClientVolStat        = "/client/volStat"
	ClientMetaPartitions = "/client/metaPartitions"

	// qos api
	QosGetStatus           = "/qos/getStatus"
	QosGetClientsLimitInfo = "/qos/getClientsInfo"
	QosGetZoneLimitInfo    = "/qos/getZoneLimit" // include disk enable
	QosUpdate              = "/qos/update"       // include disk enable
	QosUpdateMagnify       = "/qos/updateMagnify"
	QosUpdateClientParam   = "/qos/updateClientParam"
	QosUpdateZoneLimit     = "/qos/updateZoneLimit" // include disk enable
	QosUpload              = "/admin/qosUpload"
	QosUpdateMasterLimit   = "/qos/masterLimit"

	// acl api
	AdminACL = "/admin/aclOp"
	// uid api
	AdminUid = "/admin/uidOp"

	// raft node APIs
	AddRaftNode    = "/raftNode/add"
	RemoveRaftNode = "/raftNode/remove"
	RaftStatus     = "/get/raftStatus"

	AddDataNode                        = "/dataNode/add"
	DecommissionDataNode               = "/dataNode/decommission"
	QueryDataNodeDecoProgress          = "/dataNode/queryDecommissionProgress"
	QueryDataNodeDecoFailedDps         = "/dataNode/queryDecommissionFailedDps"
	MigrateDataNode                    = "/dataNode/migrate"
	PauseDecommissionDataNode          = "/dataNode/pauseDecommission"
	CancelDecommissionDataNode         = "/dataNode/cancelDecommission"
	ResetDecommissionDataNodeStatus    = "/dataNode/resetDecommissionStatus"
	DecommissionDisk                   = "/disk/decommission"
	RecommissionDisk                   = "/disk/recommission"
	QueryDiskDecoProgress              = "/disk/queryDecommissionProgress"
	DeleteDecommissionDiskRecord       = "/disk/deleteDecommissionDiskRecord"
	PauseDecommissionDisk              = "/disk/pauseDecommission"
	CancelDecommissionDisk             = "/disk/cancelDecommission"
	ResetDecommissionDiskStatus        = "/disk/resetDecommissionStatus"
	QueryDecommissionDiskDecoFailedDps = "/disk/queryDecommissionFailedDps"
	QueryBadDisks                      = "/disk/queryBadDisks"
	RestoreStoppedAutoDecommissionDisk = "/disk/restoreStoppedAutoDecommissionDisk"
	QueryAllDecommissionDisk           = "/disk/queryAllDecommissionDisk"
	RecoverBadDisk                     = "/disk/recoverBadDisk"
	QueryBadDiskRecoverProgress        = "/disk/queryBadDiskRecoverProgress"
	DeleteBackupDirectories            = "/disk/deleteBackupDirectories"
	QueryBackupDirectories             = "/disk/queryBackupDirectories"
	GetDataNode                        = "/dataNode/get"
	AddMetaNode                        = "/metaNode/add"
	DecommissionMetaNode               = "/metaNode/decommission"
	MigrateMetaNode                    = "/metaNode/migrate"
	GetMetaNode                        = "/metaNode/get"
	AdminUpdateMetaNode                = "/metaNode/update"
	AdminUpdateDataNode                = "/dataNode/update"
	AdminGetInvalidNodes               = "/invalid/nodes"
	AdminLoadMetaPartition             = "/metaPartition/load"
	AdminDiagnoseMetaPartition         = "/metaPartition/diagnose"
	AdminDecommissionMetaPartition     = "/metaPartition/decommission"
	AdminChangeMetaPartitionLeader     = "/metaPartition/changeleader"
	AdminBalanceMetaPartitionLeader    = "/metaPartition/balanceLeader"
	AdminAddMetaReplica                = "/metaReplica/add"
	AdminDeleteMetaReplica             = "/metaReplica/delete"
	AdminPutDataPartitions             = "/dataPartitions/set"

	// admin multi version snapshot
	AdminCreateVersion     = "/multiVer/create"
	AdminDelVersion        = "/multiVer/del"
	AdminGetVersionInfo    = "/multiVer/get"
	AdminGetAllVersionInfo = "/multiVer/getAll"
	AdminGetVolVer         = "/vol/getVer"
	AdminSetVerStrategy    = "/vol/SetVerStrategy"

	// S3 lifecycle configuration APIS
	SetBucketLifecycle    = "/s3/setLifecycle"
	GetBucketLifecycle    = "/s3/getLifecycle"
	DeleteBucketLifecycle = "/s3/deleteLifecycle"

	AddLcNode = "/lcNode/add"

	QueryDisableDisk = "/dataNode/queryDisableDisk"
	// Operation response
	GetMetaNodeTaskResponse = "/metaNode/response" // Method: 'POST', ContentType: 'application/json'
	GetDataNodeTaskResponse = "/dataNode/response" // Method: 'POST', ContentType: 'application/json'
	GetLcNodeTaskResponse   = "/lcNode/response"   // Method: 'POST', ContentType: 'application/json'

	GetTopologyView = "/topo/get"
	UpdateZone      = "/zone/update"
	GetAllZones     = "/zone/list"
	GetAllNodeSets  = "/nodeSet/list"
	GetNodeSet      = "/nodeSet/get"
	UpdateNodeSet   = "/nodeSet/update"

	// Header keys
	SkipOwnerValidation = "Skip-Owner-Validation"
	ForceDelete         = "Force-Delete"

	// APIs for user management
	UserCreate          = "/user/create"
	UserDelete          = "/user/delete"
	UserUpdate          = "/user/update"
	UserUpdatePolicy    = "/user/updatePolicy"
	UserRemovePolicy    = "/user/removePolicy"
	UserDeleteVolPolicy = "/user/deleteVolPolicy"
	UserGetInfo         = "/user/info"
	UserGetAKInfo       = "/user/akInfo"
	UserTransferVol     = "/user/transferVol"
	UserList            = "/user/list"
	UsersOfVol          = "/vol/users"
	// graphql api for header
	HeadAuthorized  = "Authorization"
	ParamAuthorized = "_authorization"
	UserKey         = "_user_key"
	UserInfoKey     = "_user_info_key"
	// quota
	QuotaCreate = "/quota/create"
	QuotaUpdate = "/quota/update"
	QuotaDelete = "/quota/delete"
	QuotaList   = "/quota/list"
	QuotaGet    = "/quota/get"
	// QuotaBatchModifyPath = "/quota/batchModifyPath"
	QuotaListAll = "/quota/listAll"
	// trash
	AdminSetTrashInterval              = "/vol/setTrashInterval"
	AdminSetVolAccessTimeValidInterval = "/vol/setAccessTimeValidInterval"

	// s3 qos api
	S3QoSSet                     = "/s3/qos/set"
	S3QoSGet                     = "/s3/qos/get"
	S3QoSDelete                  = "/s3/qos/delete"
	AdminEnablePersistAccessTime = "/vol/enablePersistAccessTime"
)

api

View Source
const (
	TimeFormat                 = "2006-01-02 15:04:05"
	DefaultDirChildrenNumLimit = 20000000
	MinDirChildrenNumLimit     = 1000000
)
View Source
const (
	QosStateNormal   uint8 = 0x01
	QosStateHitLimit uint8 = 0x02

	MinIopsLimit uint64 = 3
	MinFLowLimit uint64 = 128 * util.KB
)
View Source
const (
	IopsReadType  uint32 = 0x01
	IopsWriteType uint32 = 0x02
	FlowReadType  uint32 = 0x03
	FlowWriteType uint32 = 0x04
)
View Source
const (
	QosDefaultBurst                   = 1600000
	QosDefaultClientCnt        uint32 = 100
	QosDefaultDiskMaxFLowLimit int    = 0x7FFFFFFF
	QosDefaultDiskMaxIoLimit   int    = 100000
)
View Source
const (
	PartitionTypeNormal  = 0
	PartitionTypeCache   = 1
	PartitionTypePreLoad = 2
)
View Source
const (
	VolumeTypeHot  = 0
	VolumeTypeCold = 1
)
View Source
const (
	NoCache = 0
	RCache  = 1
	RWCache = 2
)
View Source
const (
	InitialDecommission uint32 = iota
	ManualDecommission
	AutoDecommission
	QueryDecommission // used for querying decommission progress for ManualDecommission and AutoDecommission
	AutoAddReplica
	ManualAddReplica
)
View Source
const (
	TaskFailed       = 2
	TaskStart        = 0
	TaskSucceeds     = 1
	TaskRunning      = 3
	ResponseInterval = 5
	ResponseTimeOut  = 100
	MaxSendCount     = 5
)
View Source
const (
	APIRsc    = "API"
	APIAccess = "access"

	ClientMessage   = "Token"
	OwnerVOLRsc     = "OwnerVOL"
	NoneOwnerVOLRsc = "NoneOwnerVOL"
	VOLAccess       = "*"
)
View Source
const (
	// Client APIs
	ClientGetTicket = "/client/getticket"

	// Admin APIs
	AdminCreateKey  = "/admin/createkey"
	AdminDeleteKey  = "/admin/deletekey"
	AdminGetKey     = "/admin/getkey"
	AdminAddCaps    = "/admin/addcaps"
	AdminDeleteCaps = "/admin/deletecaps"
	AdminGetCaps    = "/admin/getcaps"

	// raft node APIs
	AdminAddRaftNode    = "/admin/addraftnode"
	AdminRemoveRaftNode = "/admin/removeraftnode"

	// Object node APIs
	OSAddCaps    = "/os/addcaps"
	OSDeleteCaps = "/os/deletecaps"
	OSGetCaps    = "/os/getcaps"
)

api

View Source
const (
	// AuthServiceID defines ticket for authnode access (not supported)
	AuthServiceID = "AuthService"

	// MasterServiceID defines ticket for master access
	MasterServiceID = "MasterService"

	// MetaServiceID defines ticket for metanode access (not supported)
	MetaServiceID = "MetanodeService"

	// DataServiceID defines ticket for datanode access (not supported)
	DataServiceID = "DatanodeService"

	// ObjectServiceID defines ticket for objectnode access
	ObjectServiceID = "ObjectService"
)
View Source
const (
	MasterNode = "master"
	MetaNode   = "metanode"
	DataNode   = "datanode"
)
View Source
const (
	ErrCodeSuccess = iota
	ErrCodeInternalError
	ErrCodeParamError
	ErrCodeInvalidCfg
	ErrCodePersistenceByRaft
	ErrCodeMarshalData
	ErrCodeUnmarshalData
	ErrCodeVolNotExists
	ErrCodeVolHasDeleted
	ErrCodeVolNotDelete
	ErrCodeMetaPartitionNotExists
	ErrCodeDataPartitionNotExists
	ErrCodeDataNodeNotExists
	ErrCodeMetaNodeNotExists
	ErrCodeDuplicateVol
	ErrCodeActiveDataNodesTooLess
	ErrCodeActiveMetaNodesTooLess
	ErrCodeInvalidMpStart
	ErrCodeNoAvailDataPartition
	ErrCodeReshuffleArray
	ErrCodeIllegalDataReplica
	ErrCodeMissingReplica
	ErrCodeHasOneMissingReplica
	ErrCodeNoDataNodeToWrite
	ErrCodeNoMetaNodeToWrite
	ErrCodeCannotBeOffLine
	ErrCodeNoDataNodeToCreateDataPartition
	ErrCodeNoZoneToCreateDataPartition
	ErrCodeNoNodeSetToCreateDataPartition
	ErrCodeNoNodeSetToCreateMetaPartition
	ErrCodeNoMetaNodeToCreateMetaPartition
	ErrCodeIllegalMetaReplica
	ErrCodeNoEnoughReplica
	ErrCodeNoLeader
	ErrCodeVolAuthKeyNotMatch
	ErrCodeAuthKeyStoreError
	ErrCodeAuthAPIAccessGenRespError
	ErrCodeAuthRaftNodeGenRespError
	ErrCodeAuthOSCapsOpGenRespError
	ErrCodeAuthReqRedirectError
	ErrCodeAccessKeyNotExists
	ErrCodeInvalidTicket
	ErrCodeInvalidClientIDKey
	ErrCodeExpiredTicket
	ErrCodeMasterAPIGenRespError
	ErrCodeDuplicateUserID
	ErrCodeUserNotExists
	ErrCodeReadBodyError
	ErrCodeVolPolicyNotExists
	ErrCodeDuplicateAccessKey
	ErrCodeHaveNoPolicy
	ErrCodeNoZoneToCreateMetaPartition
	ErrCodeZoneNotExists
	ErrCodeOwnVolExists
	ErrCodeSuperAdminExists
	ErrCodeInvalidUserID
	ErrCodeInvalidUserType
	ErrCodeNoPermission
	ErrCodeTokenNotExist
	ErrCodeInvalidAccessKey
	ErrCodeInvalidSecretKey
	ErrCodeIsOwner
	ErrCodeZoneNumError
	ErrCodeVersionOpError
	ErrCodeNodeSetNotExists
)

http response error code and error message definitions

View Source
const (
	RootIno    = uint64(1)
	SummaryKey = "cbfs.dir.summary"
	QuotaKey   = "qa"
)
View Source
const (
	FlagsSyncWrite int = 1 << iota
	FlagsAppend
	FlagsCache
)
View Source
const (
	FlagsSnapshotDel int = 1 << iota
	FlagsSnapshotDelDir
	FlagsVerAll
)
View Source
const (
	TxCommit int = 1 << iota
	TxRollback
)
View Source
const (
	AttrMode uint32 = 1 << iota
	AttrUid
	AttrGid
	AttrModifyTime
	AttrAccessTime
)
View Source
const (
	HeaderAcceptEncoding  = "x-cfs-Accept-Encoding"
	HeaderContentEncoding = "x-cfs-Content-Encoding"
)
View Source
const (
	RuleEnabled  string = "Enabled"
	RuleDisabled string = "Disabled"
)
View Source
const (
	// Mandatory
	MountPoint int = iota
	VolName
	Owner
	Master
	// Optional
	LogDir
	WarnLogDir
	LogLevel
	ProfPort
	IcacheTimeout
	LookupValid
	AttrValid
	ReadRate
	WriteRate
	EnSyncWrite
	AutoInvalData
	Rdonly
	WriteCache
	KeepCache
	FollowerRead
	Authenticate
	ClientKey
	TicketHost
	EnableHTTPS
	CertFile
	AccessKey
	SecretKey
	DisableDcache
	SubDir
	FsyncOnClose
	MaxCPUs
	EnableXattr
	NearRead
	EnablePosixACL
	EnableSummary
	EnableUnixPermission
	RequestTimeout

	// adls
	VolType
	EbsEndpoint
	EbsServerPath
	CacheAction
	EbsBlockSize
	EnableBcache
	BcacheDir
	BcacheFilterFiles
	BcacheBatchCnt
	BcacheCheckIntervalS
	ReadThreads
	WriteThreads
	MetaSendTimeout
	BuffersTotalLimit
	MaxStreamerLimit
	EnableAudit

	LocallyProf
	MinWriteAbleDataPartitionCnt
	FileSystemName

	// snapshot
	SnapshotReadVerSeq

	DisableMountSubtype
	StreamRetryTimeOut
	BufferChanSize
	MaxMountOption
)

For client

View Source
const (
	MasterAddr       = "masterAddr"
	ListenPort       = "listen"
	ObjectNodeDomain = "objectNodeDomain"
	BindIpKey        = "bindIp"
)

For server

View Source
const (
	ProtoMagic           uint8 = 0xFF
	OpInitResultCode     uint8 = 0x00
	OpCreateExtent       uint8 = 0x01
	OpMarkDelete         uint8 = 0x02
	OpWrite              uint8 = 0x03
	OpRead               uint8 = 0x04
	OpStreamRead         uint8 = 0x05
	OpStreamFollowerRead uint8 = 0x06
	OpGetAllWatermarks   uint8 = 0x07

	OpNotifyReplicasToRepair         uint8 = 0x08
	OpExtentRepairRead               uint8 = 0x09
	OpBroadcastMinAppliedID          uint8 = 0x0A
	OpRandomWrite                    uint8 = 0x0F
	OpGetAppliedId                   uint8 = 0x10
	OpGetPartitionSize               uint8 = 0x11
	OpSyncRandomWrite                uint8 = 0x12
	OpSyncWrite                      uint8 = 0x13
	OpReadTinyDeleteRecord           uint8 = 0x14
	OpTinyExtentRepairRead           uint8 = 0x15
	OpGetMaxExtentIDAndPartitionSize uint8 = 0x16
	OpSnapshotExtentRepairRead       uint8 = 0x17
	OpSnapshotExtentRepairRsp        uint8 = 0x18

	// Operations: Client -> MetaNode.
	OpMetaCreateInode   uint8 = 0x20
	OpMetaUnlinkInode   uint8 = 0x21
	OpMetaCreateDentry  uint8 = 0x22
	OpMetaDeleteDentry  uint8 = 0x23
	OpMetaOpen          uint8 = 0x24
	OpMetaLookup        uint8 = 0x25
	OpMetaReadDir       uint8 = 0x26
	OpMetaInodeGet      uint8 = 0x27
	OpMetaBatchInodeGet uint8 = 0x28
	OpMetaExtentsAdd    uint8 = 0x29
	OpMetaExtentsDel    uint8 = 0x2A
	OpMetaExtentsList   uint8 = 0x2B
	OpMetaUpdateDentry  uint8 = 0x2C
	OpMetaTruncate      uint8 = 0x2D
	OpMetaLinkInode     uint8 = 0x2E
	OpMetaEvictInode    uint8 = 0x2F
	OpMetaSetattr       uint8 = 0x30
	OpMetaReleaseOpen   uint8 = 0x31

	// Operations: MetaNode Leader -> MetaNode Follower
	OpMetaFreeInodesOnRaftFollower uint8 = 0x32

	OpMetaDeleteInode        uint8 = 0x33 // delete specified inode immediately and do not remove data.
	OpMetaBatchExtentsAdd    uint8 = 0x34 // for extents batch attachment
	OpMetaSetXAttr           uint8 = 0x35
	OpMetaGetXAttr           uint8 = 0x36
	OpMetaRemoveXAttr        uint8 = 0x37
	OpMetaListXAttr          uint8 = 0x38
	OpMetaBatchGetXAttr      uint8 = 0x39
	OpMetaExtentAddWithCheck uint8 = 0x3A // Append extent key with discard extents check
	OpMetaReadDirLimit       uint8 = 0x3D
	OpMetaLockDir            uint8 = 0x3E

	// Operations: Master -> MetaNode
	OpCreateMetaPartition           uint8 = 0x40
	OpMetaNodeHeartbeat             uint8 = 0x41
	OpDeleteMetaPartition           uint8 = 0x42
	OpUpdateMetaPartition           uint8 = 0x43
	OpLoadMetaPartition             uint8 = 0x44
	OpDecommissionMetaPartition     uint8 = 0x45
	OpAddMetaPartitionRaftMember    uint8 = 0x46
	OpRemoveMetaPartitionRaftMember uint8 = 0x47
	OpMetaPartitionTryToLeader      uint8 = 0x48

	// Quota
	OpMetaBatchSetInodeQuota    uint8 = 0x50
	OpMetaBatchDeleteInodeQuota uint8 = 0x51
	OpMetaGetInodeQuota         uint8 = 0x52
	OpQuotaCreateInode          uint8 = 0x53
	OpQuotaCreateDentry         uint8 = 0x54

	OpLcNodeHeartbeat      uint8 = 0x55
	OpLcNodeScan           uint8 = 0x56
	OpLcNodeSnapshotVerDel uint8 = 0x5B

	// backUp
	OpBatchLockNormalExtent   uint8 = 0x57
	OpBatchUnlockNormalExtent uint8 = 0x58
	OpBackupRead              uint8 = 0x59
	OpBackupWrite             uint8 = 0x5A

	// Operations: Master -> DataNode
	OpCreateDataPartition           uint8 = 0x60
	OpDeleteDataPartition           uint8 = 0x61
	OpLoadDataPartition             uint8 = 0x62
	OpDataNodeHeartbeat             uint8 = 0x63
	OpReplicateFile                 uint8 = 0x64
	OpDeleteFile                    uint8 = 0x65
	OpDecommissionDataPartition     uint8 = 0x66
	OpAddDataPartitionRaftMember    uint8 = 0x67
	OpRemoveDataPartitionRaftMember uint8 = 0x68
	OpDataPartitionTryToLeader      uint8 = 0x69
	OpQos                           uint8 = 0x6A
	OpStopDataPartitionRepair       uint8 = 0x6B
	OpRecoverDataReplicaMeta        uint8 = 0x6C
	OpRecoverBackupDataReplica      uint8 = 0x6D
	OpRecoverBadDisk                uint8 = 0x6E
	OpQueryBadDiskRecoverProgress   uint8 = 0x6F
	OpDeleteBackupDirectories       uint8 = 0x80

	// Operations: MultipartInfo
	OpCreateMultipart  uint8 = 0x70
	OpGetMultipart     uint8 = 0x71
	OpAddMultipartPart uint8 = 0x72
	OpRemoveMultipart  uint8 = 0x73
	OpListMultiparts   uint8 = 0x74

	OpBatchDeleteExtent   uint8 = 0x75 // SDK to MetaNode
	OpGcBatchDeleteExtent uint8 = 0x76 // SDK to MetaNode
	OpGetExpiredMultipart uint8 = 0x77

	// Operations: MetaNode Leader -> MetaNode Follower
	OpMetaBatchDeleteInode  uint8 = 0x90
	OpMetaBatchDeleteDentry uint8 = 0x91
	OpMetaBatchUnlinkInode  uint8 = 0x92
	OpMetaBatchEvictInode   uint8 = 0x93

	// Transaction Operations: Client -> MetaNode.
	OpMetaTxCreate       uint8 = 0xA0
	OpMetaTxCreateInode  uint8 = 0xA1
	OpMetaTxUnlinkInode  uint8 = 0xA2
	OpMetaTxCreateDentry uint8 = 0xA3
	OpTxCommit           uint8 = 0xA4
	OpTxRollback         uint8 = 0xA5
	OpTxCommitRM         uint8 = 0xA6
	OpTxRollbackRM       uint8 = 0xA7
	OpMetaTxDeleteDentry uint8 = 0xA8
	OpMetaTxUpdateDentry uint8 = 0xA9
	OpMetaTxLinkInode    uint8 = 0xAA
	OpMetaTxGet          uint8 = 0xAB

	// Operations: Client -> MetaNode.
	OpMetaGetUniqID uint8 = 0xAC

	// Multi version snapshot
	OpRandomWriteAppend     uint8 = 0xB1
	OpSyncRandomWriteAppend uint8 = 0xB2
	OpRandomWriteVer        uint8 = 0xB3
	OpSyncRandomWriteVer    uint8 = 0xB4
	OpSyncRandomWriteVerRsp uint8 = 0xB5
	OpTryWriteAppend        uint8 = 0xB6
	OpSyncTryWriteAppend    uint8 = 0xB7
	OpVersionOp             uint8 = 0xB8

	// Commons
	OpNoSpaceErr uint8 = 0xEE
	OpForbidErr  uint8 = 0xEF
	OpDirQuota   uint8 = 0xF1

	OpConflictExtentsErr uint8 = 0xF2
	OpIntraGroupNetErr   uint8 = 0xF3
	OpArgMismatchErr     uint8 = 0xF4
	OpNotExistErr        uint8 = 0xF5
	OpDiskNoSpaceErr     uint8 = 0xF6
	OpDiskErr            uint8 = 0xF7
	OpErr                uint8 = 0xF8
	OpAgain              uint8 = 0xF9
	OpExistErr           uint8 = 0xFA
	OpInodeFullErr       uint8 = 0xFB
	OpTryOtherAddr       uint8 = 0xFC
	OpNotPerm            uint8 = 0xFD
	OpNotEmpty           uint8 = 0xFE
	OpOk                 uint8 = 0xF0
	OpAgainVerionList    uint8 = 0xEF

	OpPing                  uint8 = 0xFF
	OpMetaUpdateXAttr       uint8 = 0x3B
	OpMetaReadDirOnly       uint8 = 0x3C
	OpUploadPartConflictErr uint8 = 0x3D

	// ebs obj meta
	OpMetaObjExtentAdd       uint8 = 0xDD
	OpMetaObjExtentsList     uint8 = 0xDE
	OpMetaExtentsEmpty       uint8 = 0xDF
	OpMetaBatchObjExtentsAdd uint8 = 0xD0
	OpMetaClearInodeCache    uint8 = 0xD1

	OpMetaBatchSetXAttr uint8 = 0xD2
	OpMetaGetAllXAttr   uint8 = 0xD3

	OpTxInodeInfoNotExistErr  uint8 = 0xE0
	OpTxConflictErr           uint8 = 0xE1
	OpTxDentryInfoNotExistErr uint8 = 0xE2
	OpTxRbInodeNotExistErr    uint8 = 0xE3
	OpTxRbDentryNotExistErr   uint8 = 0xE4
	OpTxInfoNotExistErr       uint8 = 0xE5
	OpTxInternalErr           uint8 = 0xE6
	OpTxCommitItemErr         uint8 = 0xE7
	OpTxRollbackItemErr       uint8 = 0xE8
	OpTxRollbackUnknownRbType uint8 = 0xE9
	OpTxTimeoutErr            uint8 = 0xEA
	OpTxSetStateErr           uint8 = 0xEB
	OpTxCommitErr             uint8 = 0xEC
	OpTxRollbackErr           uint8 = 0xED
	OpTxUnknownOp             uint8 = 0xEE
	// multiVersion to dp/mp
	OpVersionOperation uint8 = 0xD5
	OpSplitMarkDelete  uint8 = 0xD6
	OpTryOtherExtent   uint8 = 0xD7

	// io speed limit
	OpLimitedIoErr          uint8 = 0xB1
	OpReadRepairExtentAgain uint8 = 0xEF
	OpStoreClosed           uint8 = 0xB2

	// get access time
	OpMetaInodeAccessTimeGet uint8 = 0xB2

	OpReachMaxExtentsErr uint8 = 0xB3
)

Operations

View Source
const (
	WriteDeadlineTime                         = 5
	ReadDeadlineTime                          = 5
	SyncSendTaskDeadlineTime                  = 30
	NoReadDeadlineTime                        = -1
	BatchDeleteExtentReadDeadLineTime         = 120
	GetAllWatermarksDeadLineTime              = 60
	DefaultClusterLoadFactor          float64 = 10
	MultiVersionFlag                          = 0x80
	VersionListFlag                           = 0x40
)
View Source
const (
	CreateVersion        = 1
	DeleteVersion        = 2
	CreateVersionPrepare = 3
	CreateVersionCommit  = 4
	SyncBatchVersionList = 5
)

multi version operation

View Source
const (
	VersionInit            = 0
	VersionWorking         = 1
	VersionWorkingTimeOut  = 2
	VersionWorkingAbnormal = 3
	VersionWorkingFinished = 4
)

stage of version building

View Source
const (
	VersionNormal         = 1
	VersionDeleted        = 2
	VersionDeleting       = 3
	VersionDeleteAbnormal = 4
	VersionPrepare        = 5
)

status of version

View Source
const (
	TinyExtentType   = 0
	NormalExtentType = 1
)
View Source
const (
	NormalCreateDataPartition         = 0
	DecommissionedCreateDataPartition = 1
)
View Source
const (
	FlowLimit       = "f"
	QPSLimit        = "q"
	ConcurrentLimit = "c"
	S3Nodes         = "s3nodes"
	DefaultUid      = "default"
)
View Source
const (
	Recovering  = 0
	ReadOnly    = 1
	ReadWrite   = 2
	Unavailable = -1
)

The following defines the status of a disk or a partition.

View Source
const (
	VolStatusNormal     uint8 = 0
	VolStatusMarkDelete uint8 = 1
)

volume status

View Source
const (
	DefaultTransactionTimeout      = 1  // minutes
	MaxTransactionTimeout          = 60 // minutes
	DefaultTxConflictRetryNum      = 10
	MaxTxConflictRetryNum          = 100
	DefaultTxConflictRetryInterval = 20   // ms
	MaxTxConflictRetryInterval     = 1000 // ms
	MinTxConflictRetryInterval     = 10   // ms
	DefaultTxDeleteTime            = 120
	ClearOrphanTxTime              = 3600
	DefaultAccessTimeValidInterval = 3600 * 24
	MinAccessTimeValidInterval     = 3600 * 12
)
View Source
const (
	TxTypeUndefined uint32 = iota
	TxTypeCreate
	TxTypeMkdir
	TxTypeRemove
	TxTypeRename
	TxTypeMknod
	TxTypeSymlink
	TxTypeLink
)
View Source
const (
	TxStateInit int32 = iota
	TxStatePreCommit
	TxStateCommit
	TxStateRollback
	TxStateCommitDone
	TxStateRollbackDone
	TxStateFailed
)
View Source
const (
	AddrSplit = "/"
)
View Source
const (
	CfgHttpPoolSize = "httpPoolSize"
)
View Source
const DefaultDpRepairBlockSize = 128 * util.KB
View Source
const (
	DefaultZoneName = "default"
)
View Source
const InitInode = 0
View Source
const (
	LFClient = 1 // low frequency client
)

Variables

View Source
var (
	ErrSuc                    = errors.New("success")
	ErrInternalError          = errors.New("internal error")
	ErrParamError             = errors.New("parameter error")
	ErrInvalidCfg             = errors.New("bad configuration file")
	ErrPersistenceByRaft      = errors.New("persistence by raft occurred error")
	ErrMarshalData            = errors.New("marshal data error")
	ErrUnmarshalData          = errors.New("unmarshal data error")
	ErrVolNotExists           = errors.New("vol not exists")
	ErrMetaPartitionNotExists = errors.New("meta partition not exists")
	ErrDataPartitionNotExists = errors.New("data partition not exists")
	ErrDataNodeNotExists      = errors.New("data node not exists")
	ErrMetaNodeNotExists      = errors.New("meta node not exists")
	ErrDuplicateVol           = errors.New("duplicate vol")
	ErrActiveDataNodesTooLess = errors.New("no enough active data node")
	ErrActiveMetaNodesTooLess = errors.New("no enough active meta node")
	ErrInvalidMpStart         = errors.New("invalid meta partition start value")
	ErrNoAvailDataPartition   = errors.New("no available data partition")
	ErrReshuffleArray         = errors.New("the array to be reshuffled is nil")

	ErrIllegalDataReplica = errors.New("data replica is illegal")

	ErrMissingReplica       = errors.New("a missing data replica is found")
	ErrHasOneMissingReplica = errors.New("there is a missing replica")

	ErrNoDataNodeToWrite = errors.New("No data node available for creating a data partition")
	ErrNoMetaNodeToWrite = errors.New("No meta node available for creating a meta partition")

	ErrCannotBeOffLine                         = errors.New("cannot take the data replica offline")
	ErrNoDataNodeToCreateDataPartition         = errors.New("no enough data nodes for creating a data partition")
	ErrNoZoneToCreateDataPartition             = errors.New("no zone available for creating a data partition")
	ErrNoZoneToCreateMetaPartition             = errors.New("no zone available for creating a meta partition")
	ErrNoNodeSetToCreateDataPartition          = errors.New("no node set available for creating a data partition, no node set has enough data node to allocate partitions")
	ErrNoNodeSetToCreateMetaPartition          = errors.New("no node set available for creating a meta partition, no node set has enough meta node to allocate partitions")
	ErrNoMetaNodeToCreateMetaPartition         = errors.New("no enough meta nodes for creating a meta partition")
	ErrIllegalMetaReplica                      = errors.New("illegal meta replica")
	ErrNoEnoughReplica                         = errors.New("no enough replicas")
	ErrNoLeader                                = errors.New("no leader")
	ErrVolAuthKeyNotMatch                      = errors.New("client and server auth key do not match")
	ErrAuthKeyStoreError                       = errors.New("auth keystore error")
	ErrAuthAPIAccessGenRespError               = errors.New("auth API access response error")
	ErrAuthOSCapsOpGenRespError                = errors.New("auth Object Storage node API response error")
	ErrKeyNotExists                            = errors.New("key not exists")
	ErrDuplicateKey                            = errors.New("duplicate key")
	ErrAccessKeyNotExists                      = errors.New("access key not exists")
	ErrInvalidTicket                           = errors.New("invalid ticket")
	ErrInvalidClientIDKey                      = errors.New("invalid clientIDKey")
	ErrExpiredTicket                           = errors.New("expired ticket")
	ErrMasterAPIGenRespError                   = errors.New("master API generate response error")
	ErrDuplicateUserID                         = errors.New("duplicate user id")
	ErrUserNotExists                           = errors.New("user not exists")
	ErrReadBodyError                           = errors.New("read request body failed")
	ErrVolPolicyNotExists                      = errors.New("vol policy not exists")
	ErrDuplicateAccessKey                      = errors.New("duplicate access key")
	ErrHaveNoPolicy                            = errors.New("no vol policy")
	ErrZoneNotExists                           = errors.New("zone not exists")
	ErrOwnVolExists                            = errors.New("own vols not empty")
	ErrSuperAdminExists                        = errors.New("super administrator exists ")
	ErrInvalidUserID                           = errors.New("invalid user ID")
	ErrInvalidUserType                         = errors.New("invalid user type")
	ErrNoPermission                            = errors.New("no permission")
	ErrTokenNotFound                           = errors.New("token not found")
	ErrInvalidAccessKey                        = errors.New("invalid access key")
	ErrInvalidSecretKey                        = errors.New("invalid secret key")
	ErrIsOwner                                 = errors.New("user owns the volume")
	ErrZoneNum                                 = errors.New("zone num not qualified")
	ErrNoNodeSetToUpdateDecommissionLimit      = errors.New("no node set available for updating decommission limit")
	ErrNoNodeSetToQueryDecommissionLimitStatus = errors.New("no node set available for query decommission limit status")
	ErrNoNodeSetToDecommission                 = errors.New("no node set available to decommission ")
	ErrVolNoAvailableSpace                     = errors.New("vol has no available space")
	ErrVolNoCacheAndRule                       = errors.New("vol has no cache and rule")
	ErrNoAclPermission                         = errors.New("acl no permission")
	ErrQuotaNotExists                          = errors.New("quota not exists")
	ErrVolNotDelete                            = errors.New("vol was not previously deleted or already deleted")
	ErrVolHasDeleted                           = errors.New("vol has been deleted")
	ErrCodeVersionOp                           = errors.New("version op failed")
	ErrNoSuchLifecycleConfiguration            = errors.New("The lifecycle configuration does not exist")
	ErrNoNodeSetToUpdateDecommissionDiskFactor = errors.New("no node set available for updating decommission disk factor")
	ErrNoNodeSetToQueryDecommissionDiskLimit   = errors.New("no node set available for query decommission disk limit")
	ErrNodeSetNotExists                        = errors.New("node set not exists")
	ErrCompressFailed                          = errors.New("compress data failed")
	ErrDecompressFailed                        = errors.New("decompress data failed")
	ErrDecommissionDiskErrDPFirst              = errors.New("decommission disk error data partition first")
	ErrAllReplicaUnavailable                   = errors.New("all replica unavailable")
	ErrDiskNotExists                           = errors.New("disk not exists")
	ErrPerformingRestoreReplica                = errors.New("is performing restore replica")
	ErrPerformingDecommission                  = errors.New("one replica is performing decommission")
	ErrWaitForAutoAddReplica                   = errors.New("wait for auto add replica")
	ErrVolNameRegExpNotMatch                   = errors.New("name can only be number and letters")
	ErrSnapshotNotEnabled                      = errors.New("cluster not enable snapshot")
	ErrMemberChange                            = errors.New("raft prev member change is not finished.")
)

err

View Source
var (
	ExtentKeyHeader       = []byte("EKV2")
	ExtentKeyHeaderV3     = []byte("EKV3")
	ExtentKeyHeaderSize   = len(ExtentKeyHeader)
	ExtentLength          = 40
	ExtentKeyChecksumSize = 4
	ExtentVerFieldSize    = 9 // ver(8) and isSplit(1)
	ExtentV2Length        = ExtentKeyHeaderSize + ExtentLength + ExtentKeyChecksumSize
	ExtentV3Length        = ExtentKeyHeaderSize + ExtentLength + ExtentKeyChecksumSize + ExtentVerFieldSize
	InvalidKey            = errors.New("invalid key error")
	InvalidKeyHeader      = errors.New("invalid extent v2 key header error")
	InvalidKeyCheckSum    = errors.New("invalid extent v2 key checksum error")
)
View Source
var (
	GRequestID = time.Now().Unix()<<32 + 1
	Buffers    *buf.BufferPool
)
View Source
var (
	AKRegexp   = regexp.MustCompile("^[a-zA-Z0-9]{16}$")
	SKRegexp   = regexp.MustCompile("^[a-zA-Z0-9]{32}$")
	WriteS3Api = []string{
		"PostObject", "PutObject", "CopyObject", "CreateMultipartUpload", "UploadPart", "UploadPartCopy",
		"CompleteMultipartUpload", "AbortMultipartUpload", "DeleteObjects", "DeleteObject",
	}
)
View Source
var (
	Version    string
	CommitID   string
	BranchName string
	BuildTime  string
)
View Source
var AllActions = []Action{

	OSSGetObjectAction,
	OSSPutObjectAction,
	OSSPostObjectAction,
	OSSCopyObjectAction,
	OSSListObjectsAction,
	OSSDeleteObjectAction,
	OSSDeleteObjectsAction,
	OSSHeadObjectAction,
	OSSCreateBucketAction,
	OSSDeleteBucketAction,
	OSSHeadBucketAction,
	OSSListBucketsAction,
	OSSGetBucketPolicyAction,
	OSSPutBucketPolicyAction,
	OSSDeleteBucketPolicyAction,
	OSSGetBucketPolicyStatusAction,
	OSSGetBucketAclAction,
	OSSPutBucketAclAction,
	OSSGetObjectTorrentAction,
	OSSGetObjectAclAction,
	OSSPutObjectAclAction,
	OSSCreateMultipartUploadAction,
	OSSListMultipartUploadsAction,
	OSSUploadPartAction,
	OSSUploadPartCopyAction,
	OSSListPartsAction,
	OSSCompleteMultipartUploadAction,
	OSSAbortMultipartUploadAction,
	OSSGetBucketLocationAction,
	OSSGetObjectXAttrAction,
	OSSPutObjectXAttrAction,
	OSSListObjectXAttrsAction,
	OSSDeleteObjectXAttrAction,
	OSSGetObjectTaggingAction,
	OSSPutObjectTaggingAction,
	OSSDeleteObjectTaggingAction,
	OSSGetBucketTaggingAction,
	OSSPutBucketTaggingAction,
	OSSDeleteBucketTaggingAction,
	OSSGetBucketLifecycleAction,
	OSSPutBucketLifecycleAction,
	OSSDeleteBucketLifecycleAction,
	OSSGetBucketLifecycleConfigurationAction,
	OSSPutBucketLifecycleConfigurationAction,
	OSSDeleteBucketLifecycleConfigurationAction,
	OSSGetBucketVersioningAction,
	OSSPutBucketVersioningAction,
	OSSListObjectVersionsAction,
	OSSGetObjectLegalHoldAction,
	OSSPutObjectLegalHoldAction,
	OSSGetObjectRetentionAction,
	OSSPutObjectRetentionAction,
	OSSGetBucketEncryptionAction,
	OSSPutBucketEncryptionAction,
	OSSDeleteBucketEncryptionAction,
	OSSGetBucketCorsAction,
	OSSPutBucketCorsAction,
	OSSDeleteBucketCorsAction,
	OSSGetBucketWebsiteAction,
	OSSPutBucketWebsiteAction,
	OSSDeleteBucketWebsiteAction,
	OSSRestoreObjectAction,
	OSSGetPublicAccessBlockAction,
	OSSPutPublicAccessBlockAction,
	OSSDeletePublicAccessBlockAction,
	OSSGetBucketRequestPaymentAction,
	OSSPutBucketRequestPaymentAction,
	OSSGetBucketReplicationAction,
	OSSPutBucketReplicationAction,
	OSSDeleteBucketReplicationAction,
	OSSOptionsObjectAction,
	OSSGetFederationTokenAction,

	POSIXReadAction,
	POSIXWriteAction,

	OSSPutObjectLockConfigurationAction,
	OSSGetObjectLockConfigurationAction,
}
View Source
var Err2CodeMap = map[error]int32{
	ErrSuc:                             ErrCodeSuccess,
	ErrInternalError:                   ErrCodeInternalError,
	ErrParamError:                      ErrCodeParamError,
	ErrInvalidCfg:                      ErrCodeInvalidCfg,
	ErrPersistenceByRaft:               ErrCodePersistenceByRaft,
	ErrMarshalData:                     ErrCodeMarshalData,
	ErrUnmarshalData:                   ErrCodeUnmarshalData,
	ErrVolNotExists:                    ErrCodeVolNotExists,
	ErrMetaPartitionNotExists:          ErrCodeMetaPartitionNotExists,
	ErrDataPartitionNotExists:          ErrCodeDataPartitionNotExists,
	ErrDataNodeNotExists:               ErrCodeDataNodeNotExists,
	ErrMetaNodeNotExists:               ErrCodeMetaNodeNotExists,
	ErrDuplicateVol:                    ErrCodeDuplicateVol,
	ErrActiveDataNodesTooLess:          ErrCodeActiveDataNodesTooLess,
	ErrActiveMetaNodesTooLess:          ErrCodeActiveMetaNodesTooLess,
	ErrInvalidMpStart:                  ErrCodeInvalidMpStart,
	ErrNoAvailDataPartition:            ErrCodeNoAvailDataPartition,
	ErrReshuffleArray:                  ErrCodeReshuffleArray,
	ErrIllegalDataReplica:              ErrCodeIllegalDataReplica,
	ErrMissingReplica:                  ErrCodeMissingReplica,
	ErrHasOneMissingReplica:            ErrCodeHasOneMissingReplica,
	ErrNoDataNodeToWrite:               ErrCodeNoDataNodeToWrite,
	ErrNoMetaNodeToWrite:               ErrCodeNoMetaNodeToWrite,
	ErrCannotBeOffLine:                 ErrCodeCannotBeOffLine,
	ErrNoDataNodeToCreateDataPartition: ErrCodeNoDataNodeToCreateDataPartition,
	ErrNoZoneToCreateDataPartition:     ErrCodeNoZoneToCreateDataPartition,
	ErrNoZoneToCreateMetaPartition:     ErrCodeNoZoneToCreateMetaPartition,
	ErrNoNodeSetToCreateDataPartition:  ErrCodeNoNodeSetToCreateDataPartition,
	ErrNoNodeSetToCreateMetaPartition:  ErrCodeNoNodeSetToCreateMetaPartition,
	ErrNoMetaNodeToCreateMetaPartition: ErrCodeNoMetaNodeToCreateMetaPartition,
	ErrIllegalMetaReplica:              ErrCodeIllegalMetaReplica,
	ErrNoEnoughReplica:                 ErrCodeNoEnoughReplica,
	ErrNoLeader:                        ErrCodeNoLeader,
	ErrVolAuthKeyNotMatch:              ErrCodeVolAuthKeyNotMatch,
	ErrAuthKeyStoreError:               ErrCodeAuthKeyStoreError,
	ErrAuthAPIAccessGenRespError:       ErrCodeAuthAPIAccessGenRespError,
	ErrAuthOSCapsOpGenRespError:        ErrCodeAuthOSCapsOpGenRespError,
	ErrAccessKeyNotExists:              ErrCodeAccessKeyNotExists,
	ErrInvalidTicket:                   ErrCodeInvalidTicket,
	ErrInvalidClientIDKey:              ErrCodeInvalidClientIDKey,
	ErrExpiredTicket:                   ErrCodeExpiredTicket,
	ErrMasterAPIGenRespError:           ErrCodeMasterAPIGenRespError,
	ErrDuplicateUserID:                 ErrCodeDuplicateUserID,
	ErrUserNotExists:                   ErrCodeUserNotExists,
	ErrReadBodyError:                   ErrCodeReadBodyError,
	ErrVolPolicyNotExists:              ErrCodeVolPolicyNotExists,
	ErrDuplicateAccessKey:              ErrCodeDuplicateAccessKey,
	ErrHaveNoPolicy:                    ErrCodeHaveNoPolicy,
	ErrZoneNotExists:                   ErrCodeZoneNotExists,
	ErrOwnVolExists:                    ErrCodeOwnVolExists,
	ErrSuperAdminExists:                ErrCodeSuperAdminExists,
	ErrInvalidUserID:                   ErrCodeInvalidUserID,
	ErrInvalidUserType:                 ErrCodeInvalidUserType,
	ErrNoPermission:                    ErrCodeNoPermission,
	ErrTokenNotFound:                   ErrCodeTokenNotExist,
	ErrInvalidAccessKey:                ErrCodeInvalidAccessKey,
	ErrInvalidSecretKey:                ErrCodeInvalidSecretKey,
	ErrIsOwner:                         ErrCodeIsOwner,
	ErrZoneNum:                         ErrCodeZoneNumError,
	ErrCodeVersionOp:                   ErrCodeVersionOpError,
	ErrNodeSetNotExists:                ErrCodeNodeSetNotExists,
}

Err2CodeMap error map to code

View Source
var GApiInfo map[string]string = map[string]string{
	"admingetmasterapilist":              AdminGetMasterApiList,
	"adminsetapiqpslimit":                AdminSetApiQpsLimit,
	"admingetcluster":                    AdminGetCluster,
	"adminsetclusterinfo":                AdminSetClusterInfo,
	"admingetdatapartition":              AdminGetDataPartition,
	"adminloaddatapartition":             AdminLoadDataPartition,
	"admincreatedatapartition":           AdminCreateDataPartition,
	"admincreatepreloaddatapartition":    AdminCreatePreLoadDataPartition,
	"admindecommissiondatapartition":     AdminDecommissionDataPartition,
	"admindiagnosedatapartition":         AdminDiagnoseDataPartition,
	"admindeletedatareplica":             AdminDeleteDataReplica,
	"adminadddatareplica":                AdminAddDataReplica,
	"admindeletevol":                     AdminDeleteVol,
	"adminupdatevol":                     AdminUpdateVol,
	"adminvolshrink":                     AdminVolShrink,
	"adminvolexpand":                     AdminVolExpand,
	"admincreatevol":                     AdminCreateVol,
	"admingetvol":                        AdminGetVol,
	"adminclusterfreeze":                 AdminClusterFreeze,
	"adminclusterforbidmpdecommission":   AdminClusterForbidMpDecommission,
	"adminclusterstat":                   AdminClusterStat,
	"admingetip":                         AdminGetIP,
	"admincreatemetapartition":           AdminCreateMetaPartition,
	"adminsetmetanodethreshold":          AdminSetMetaNodeThreshold,
	"adminsetmastervoldeletiondelaytime": AdminSetMasterVolDeletionDelayTime,
	"adminlistvols":                      AdminListVols,
	"adminsetnodeinfo":                   AdminSetNodeInfo,
	"admingetnodeinfo":                   AdminGetNodeInfo,
	"admingetallnodesetgrpinfo":          AdminGetAllNodeSetGrpInfo,
	"admingetnodesetgrpinfo":             AdminGetNodeSetGrpInfo,
	"admingetisdomainon":                 AdminGetIsDomainOn,
	"adminupdatenodesetcapcity":          AdminUpdateNodeSetCapcity,
	"adminupdatenodesetid":               AdminUpdateNodeSetId,
	"adminupdatedomaindatauseratio":      AdminUpdateDomainDataUseRatio,
	"adminupdatezoneexcluderatio":        AdminUpdateZoneExcludeRatio,
	"adminsetnoderdonly":                 AdminSetNodeRdOnly,
	"adminsetdprdonly":                   AdminSetDpRdOnly,
	"admindatapartitionchangeleader":     AdminDataPartitionChangeLeader,
	"adminsetdpdiscard":                  AdminSetDpDiscard,
	"admingetdiscarddp":                  AdminGetDiscardDp,

	"clientdatapartitions":   ClientDataPartitions,
	"clientvol":              ClientVol,
	"clientmetapartition":    ClientMetaPartition,
	"clientvolstat":          ClientVolStat,
	"clientmetapartitions":   ClientMetaPartitions,
	"qosgetstatus":           QosGetStatus,
	"qosgetclientslimitinfo": QosGetClientsLimitInfo,
	"qosgetzonelimitinfo":    QosGetZoneLimitInfo,
	"qosupdate":              QosUpdate,

	"qosupdateclientparam":            QosUpdateClientParam,
	"qosupdatezonelimit":              QosUpdateZoneLimit,
	"qosupload":                       QosUpload,
	"qosupdatemasterlimit":            QosUpdateMasterLimit,
	"addraftnode":                     AddRaftNode,
	"removeraftnode":                  RemoveRaftNode,
	"raftstatus":                      RaftStatus,
	"adddatanode":                     AddDataNode,
	"decommissiondatanode":            DecommissionDataNode,
	"migratedatanode":                 MigrateDataNode,
	"canceldecommissiondatanode":      PauseDecommissionDataNode,
	"decommissiondisk":                DecommissionDisk,
	"getdatanode":                     GetDataNode,
	"addmetanode":                     AddMetaNode,
	"decommissionmetanode":            DecommissionMetaNode,
	"migratemetanode":                 MigrateMetaNode,
	"getmetanode":                     GetMetaNode,
	"adminupdatemetanode":             AdminUpdateMetaNode,
	"adminupdatedatanode":             AdminUpdateDataNode,
	"admingetinvalidnodes":            AdminGetInvalidNodes,
	"adminloadmetapartition":          AdminLoadMetaPartition,
	"admindiagnosemetapartition":      AdminDiagnoseMetaPartition,
	"admindecommissionmetapartition":  AdminDecommissionMetaPartition,
	"adminchangemetapartitionleader":  AdminChangeMetaPartitionLeader,
	"adminbalancemetapartitionleader": AdminBalanceMetaPartitionLeader,
	"adminaddmetareplica":             AdminAddMetaReplica,
	"admindeletemetareplica":          AdminDeleteMetaReplica,
	"getmetanodetaskresponse":         GetMetaNodeTaskResponse,
	"getdatanodetaskresponse":         GetDataNodeTaskResponse,
	"gettopologyview":                 GetTopologyView,
	"updatezone":                      UpdateZone,
	"getallzones":                     GetAllZones,
	"usercreate":                      UserCreate,
	"userdelete":                      UserDelete,
	"userupdate":                      UserUpdate,
	"userupdatepolicy":                UserUpdatePolicy,
	"userremovepolicy":                UserRemovePolicy,
	"userdeletevolpolicy":             UserDeleteVolPolicy,
	"usergetinfo":                     UserGetInfo,
	"usergetakinfo":                   UserGetAKInfo,
	"usertransfervol":                 UserTransferVol,
	"userlist":                        UserList,
	"usersofvol":                      UsersOfVol,
}
View Source
var GTxMaskMap = map[string]TxOpMask{
	"off":     TxOpMaskOff,
	"create":  TxOpMaskCreate,
	"mkdir":   TxOpMaskMkdir,
	"remove":  TxOpMaskRemove,
	"rename":  TxOpMaskRename,
	"mknod":   TxOpMaskMknod,
	"symlink": TxOpMaskSymlink,
	"link":    TxOpMaskLink,
	"all":     TxOpMaskAll,
}
View Source
var MsgType2ResourceMap = map[MsgType]string{
	MsgAuthCreateKeyReq:      "auth:createkey",
	MsgAuthDeleteKeyReq:      "auth:deletekey",
	MsgAuthGetKeyReq:         "auth:getkey",
	MsgAuthAddCapsReq:        "auth:addcaps",
	MsgAuthDeleteCapsReq:     "auth:deletecaps",
	MsgAuthGetCapsReq:        "auth:getcaps",
	MsgAuthAddRaftNodeReq:    "auth:addnode",
	MsgAuthRemoveRaftNodeReq: "auth:removenode",
	MsgAuthOSAddCapsReq:      "auth:osaddcaps",
	MsgAuthOSDeleteCapsReq:   "auth:osdeletecaps",
	MsgAuthOSGetCapsReq:      "auth:osgetcaps",

	MsgMasterFetchVolViewReq: "master:getvol",

	MsgMasterClusterFreezeReq:    "master:clusterfreeze",
	MsgMasterAddRaftNodeReq:      "master:addraftnode",
	MsgMasterRemoveRaftNodeReq:   "master:removeraftnode",
	MsgMasterSetNodeInfoReq:      "master:setnodeinfo",
	MsgMasterSetNodeRdOnlyReq:    "master:sernoderdonly",
	MsgMasterAutoDecommissionReq: "master:autodecommission",

	MsgMasterCreateVolReq: "master:createvol",
	MsgMasterDeleteVolReq: "master:deletevol",
	MsgMasterUpdateVolReq: "master:updatevol",
	MsgMasterVolShrinkReq: "master:volshrink",
	MsgMasterVolExpandReq: "master:volexpand",

	MsgMasterLoadMetaPartitionReq:         "master:loadmetapartition",
	MsgMasterDecommissionMetaPartitionReq: "master:decommissionmetapartition",
	MsgMasterChangeMetaPartitionLeaderReq: "master:changemetapartitionleader",
	MsgMasterCreateMetaPartitionReq:       "master:createmetapartition",
	MsgMasterAddMetaReplicaReq:            "master:addmetareplica",
	MsgMasterDeleteMetaReplicaReq:         "master:deletemetareplica",
	MsgMasterQosUpdateReq:                 "master:qosupdate",
	MsgMasterQosUpdateZoneLimitReq:        "master:qosupdatezonelimit",
	MsgMasterQosUpdateMasterLimitReq:      "master:qosupdatemasterlimit",
	MsgMasterQosUpdateClientParamReq:      "master:qosupdateclientparam",

	MsgMasterCreateDataPartitionReq:       "master:createdatapartition",
	MsgMasterDataPartitionChangeLeaderReq: "master:changedatapartitionleader",
	MsgMasterLoadDataPartitionReq:         "master:loaddatapartition",
	MsgMasterDecommissionDataPartitionReq: "master:decommissiondatapartition",
	MsgMasterAddDataReplicaReq:            "master:adddatareplica",
	MsgMasterDeleteDataReplicaReq:         "master:removedatareplica",
	MsgMasterSetDpRdOnlyReq:               "master:setdprdonly",
	MsgMasterReportLackDataPartitions:     "master:reportLackDataPartitions",

	MsgMasterAddMetaNodeReq:          "master:addmetanode",
	MsgMasterDecommissionMetaNodeReq: "master:decommissionmetanode",
	MsgMasterMigrateMetaNodeReq:      "master:migratemetanode",
	MsgMasterSetMetaNodeThresholdReq: "master:setmetanodethreshold",
	MsgMasterUpdateMetaNodeReq:       "master:updatemetanode",

	MsgMasterAddDataNodeReq:                "master:adddatannode",
	MsgMasterDecommissionDataNodeReq:       "master:decommissiondatannode",
	MsgMasterMigrateDataNodeReq:            "master:migratedatannode",
	MsgMasterCancelDecommissionDataNodeReq: "master:canceldecommissiondatannode",
	MsgMasterDecommissionDiskReq:           "master:decommissiondisk",
	MsgMasterUpdateNodeSetCapcityReq:       "master:updatenodesetcapcity",
	MsgMasterUpdateNodeSetIdReq:            "master:updatenodesetid",
	MsgMasterUpdateDomainDataUseRatioReq:   "master:updatedomaindatauseratio",
	MsgMasterUpdateZoneExcludeRatioReq:     "master:updatezoneexcluderatio",
	MsgMasterRecommissionDiskReq:           "master:recommissiondisk",

	MsgMasterUserCreateReq:          "master:usercreate",
	MsgMasterUserDeleteReq:          "master:userdelete",
	MsgMasterUserUpdateReq:          "master:userupdate",
	MsgMasterUserUpdatePolicyReq:    "master:userupdatepolicy",
	MsgMasterUserRemovePolicyReq:    "master:userremotepolicy",
	MsgMasterUserDeleteVolPolicyReq: "master:userdeletevolpolicy",
	MsgMasterUserTransferVolReq:     "master:usertransfervol",

	MsgMasterUpdateZoneReq: "master:updatezone",
}

MsgType2ResourceMap define the mapping from message type to resource

Functions

func CheckAPIAccessCaps added in v1.5.0

func CheckAPIAccessCaps(ticket *cryptoutil.Ticket, rscType string, mp MsgType, action string) (err error)

CheckAPIAccessCaps checks capability

func CheckVOLAccessCaps added in v1.5.0

func CheckVOLAccessCaps(ticket *cryptoutil.Ticket, volName string, action string, accessNode string) (err error)

func DumpVersion added in v1.34.0

func DumpVersion(role string) string

func ExtractAPIAccessTicket added in v1.5.0

func ExtractAPIAccessTicket(req *APIAccessReq, key []byte) (ticket cryptoutil.Ticket, ts int64, err error)

ExtractAPIAccessTicket verify ticket validity

func ExtractIDAndAuthKey added in v1.34.0

func ExtractIDAndAuthKey(authIDKey string) (id string, authKey []byte, err error)

func ExtractTicket added in v1.5.0

func ExtractTicket(str string, key []byte) (ticket cryptoutil.Ticket, err error)

func GenAuthIDKey added in v1.34.0

func GenAuthIDKey(id string, authKey []byte) (authIDKey string, err error)

func GenerateRequestID

func GenerateRequestID() int64

GenerateRequestID generates the request ID.

func GetDataFromResp added in v1.5.0

func GetDataFromResp(body []byte, key []byte) (plaintext []byte, err error)

GetDataFromResp extract data from response

func GetDpType added in v1.34.0

func GetDpType(volType int, isPreload bool) int

func GetHttpTransporter added in v1.34.0

func GetHttpTransporter(cfg *HttpCfg) *http.Transport

func GetMaskString added in v1.34.0

func GetMaskString(mask TxOpMask) (maskStr string)

func GetStatusStr added in v1.34.0

func GetStatusStr(status uint8) string

func InitBufferPool added in v1.34.0

func InitBufferPool(bufLimit int64)

func InitBufferPoolEx added in v1.34.0

func InitBufferPoolEx(bufLimit int64, chanSize int)

func InitMountOptions added in v1.34.0

func InitMountOptions(opts []MountOption)

func IsAncestor added in v1.34.0

func IsAncestor(parent, child string) bool

func IsCacheDp added in v1.34.0

func IsCacheDp(typ int) bool

func IsCold added in v1.34.0

func IsCold(typ int) bool

func IsDir

func IsDir(mode uint32) bool

IsDir checks if the mode is dir.

func IsHot added in v1.34.0

func IsHot(typ int) bool

func IsNormalDp added in v1.34.0

func IsNormalDp(typ int) bool

func IsNormalExtentType added in v1.34.0

func IsNormalExtentType(extentType uint8) bool

func IsPreLoadDp added in v1.34.0

func IsPreLoadDp(typ int) bool

func IsRegular

func IsRegular(mode uint32) bool

IsRegular checks if the mode is regular.

func IsS3PutApi added in v1.34.0

func IsS3PutApi(api string) bool
func IsSymlink(mode uint32) bool

IsSymlink checks if the mode is symlink.

func IsTinyExtentType added in v1.34.0

func IsTinyExtentType(extentType uint8) bool

func IsValidAK added in v1.34.0

func IsValidAK(ak string) bool

func IsValidClientID added in v1.5.0

func IsValidClientID(id string) (err error)

IsValidClientID determine the validity of a clientID

func IsValidMsgReqType added in v1.5.0

func IsValidMsgReqType(serviceID string, msgType MsgType) (err error)

IsValidMsgReqType determine the validity of a message type

func IsValidSK added in v1.34.0

func IsValidSK(sk string) bool

func IsValidServiceID added in v1.5.0

func IsValidServiceID(serviceID string) (err error)

IsValidServiceID determine the validity of a serviceID

func MaskContains added in v1.34.0

func MaskContains(mask TxOpMask, subMask TxOpMask) bool

func MergeSplitKey added in v1.34.0

func MergeSplitKey(inodeID uint64, ekRefMap *sync.Map, sMap *sync.Map) (err error)

func Mode

func Mode(osMode os.FileMode) uint32

Mode returns the fileMode.

func OsMode

func OsMode(mode uint32) os.FileMode

OsMode returns os.FileMode.

func OsModeType added in v1.34.0

func OsModeType(mode uint32) os.FileMode

Returns os.FileMode masked by os.ModeType

func ParseErrorCode added in v1.34.0

func ParseErrorCode(code int32) error

func ParseFromId added in v1.34.0

func ParseFromId(sID uint64) (dpID uint64, extID uint64)

func ParseMountOptions added in v1.34.0

func ParseMountOptions(opts []MountOption, cfg *config.Config)

func ParseVerifier added in v1.5.0

func ParseVerifier(verifier string, key []byte) (ts int64, err error)

ParseVerifier checks the verifier structure for replay attack mitigation

func QosTypeString added in v1.34.0

func QosTypeString(factorType uint32) string

func ReadFull

func ReadFull(c net.Conn, buf *[]byte, readSize int) (err error)

ReadFull is a wrapper function of io.ReadFull.

func SendBytes added in v1.5.0

func SendBytes(client *http.Client, target string, data []byte) (res []byte, err error)

SendBytes send raw bytes target in http/https protocol

func SendData added in v1.5.0

func SendData(client *http.Client, target string, data interface{}) (res []byte, err error)

SendData sends data to target

func TxMaskToType added in v1.34.0

func TxMaskToType(mask TxOpMask) (txType uint32)

func UnmarshalHTTPReply added in v1.34.0

func UnmarshalHTTPReply(body []byte, result interface{}) error

func VerifyAPIAccessReqIDs added in v1.5.0

func VerifyAPIAccessReqIDs(req *APIAccessReq) (err error)

VerifyAPIAccessReqIDs verify the req IDs

func VerifyAPIRespComm added in v1.5.0

func VerifyAPIRespComm(apiResp *APIAccessResp, msg MsgType, clientID string, serviceID string, ts int64) (err error)

VerifyAPIRespComm client verifies commond attributes returned from server

func VerifyTicketRespComm added in v1.5.0

func VerifyTicketRespComm(ticketResp *AuthGetTicketResp, msg MsgType, clientID string, serviceID string, ts int64) (err error)

VerifyTicketRespComm verifies the ticket respose from server

Types

type AKUser added in v1.34.0

type AKUser struct {
	AccessKey string `json:"access_key" graphql:"access_key"`
	UserID    string `json:"user_id" graphql:"user_id"`
	Password  string `json:"password" graphql:"password"`
}

type APIAccessReq added in v1.5.0

type APIAccessReq struct {
	Type      MsgType `json:"type"`
	ClientID  string  `json:"client_id"`
	ServiceID string  `json:"service_id"`
	Verifier  string  `json:"verifier"`
	Ticket    string  `json:"ticket"`
}

APIAccessReq defines the request for access restful api use Timestamp as verifier for MITM mitigation verifier is also used to verify the server identity

type APIAccessResp added in v1.5.0

type APIAccessResp struct {
	Type      MsgType `json:"type"`
	ClientID  string  `json:"client_id"`
	ServiceID string  `json:"service_id"`
	Verifier  int64   `json:"verifier"`
}

APIAccessResp defines the response for access restful api use Timestamp as verifier for MITM mitigation verifier is also used to verify the server identity

type AclIpInfo added in v1.34.0

type AclIpInfo struct {
	Ip    string
	CTime int64
}

type AclRsp added in v1.34.0

type AclRsp struct {
	Info    string
	OK      bool
	List    []*AclIpInfo
	Reserve string
}

type Action added in v1.34.0

type Action string
const (
	ActionPrefix      = "action:"
	OSSActionPrefix   = ActionPrefix + "oss:"
	POSIXActionPrefix = ActionPrefix + "posix:"

	// Object actions
	OSSGetObjectAction     Action = OSSActionPrefix + "GetObject"
	OSSPutObjectAction     Action = OSSActionPrefix + "PutObject"
	OSSPostObjectAction    Action = OSSActionPrefix + "PostObject"
	OSSCopyObjectAction    Action = OSSActionPrefix + "CopyObject"
	OSSListObjectsAction   Action = OSSActionPrefix + "ListObjects"
	OSSDeleteObjectAction  Action = OSSActionPrefix + "DeleteObject"
	OSSDeleteObjectsAction Action = OSSActionPrefix + "DeleteObjects"
	OSSHeadObjectAction    Action = OSSActionPrefix + "HeadObject"

	// Bucket actions
	OSSCreateBucketAction Action = OSSActionPrefix + "CreateBucket"
	OSSDeleteBucketAction Action = OSSActionPrefix + "DeleteBucket"
	OSSHeadBucketAction   Action = OSSActionPrefix + "HeadBucket"
	OSSListBucketsAction  Action = OSSActionPrefix + "ListBuckets"

	// Bucket policy actions
	OSSGetBucketPolicyAction       Action = OSSActionPrefix + "GetBucketPolicy"
	OSSPutBucketPolicyAction       Action = OSSActionPrefix + "PutBucketPolicy"
	OSSDeleteBucketPolicyAction    Action = OSSActionPrefix + "DeleteBucketPolicy"
	OSSGetBucketPolicyStatusAction Action = OSSActionPrefix + "GetBucketPolicyStatus" // unsupported

	// Bucket ACL actions
	OSSGetBucketAclAction Action = OSSActionPrefix + "GetBucketAcl"
	OSSPutBucketAclAction Action = OSSActionPrefix + "PutBucketAcl"

	// Bucket CORS actions
	OSSGetBucketCorsAction    Action = OSSActionPrefix + "GetBucketCors"
	OSSPutBucketCorsAction    Action = OSSActionPrefix + "PutBucketCors"
	OSSDeleteBucketCorsAction Action = OSSActionPrefix + "DeleteBucketCors"
	OSSOptionsObjectAction    Action = OSSActionPrefix + "OptionsObject"

	// Object torrent actions
	OSSGetObjectTorrentAction Action = OSSActionPrefix + "GetObjectTorrent" // unsupported

	// Object ACL actions
	OSSGetObjectAclAction Action = OSSActionPrefix + "GetObjectAcl"
	OSSPutObjectAclAction Action = OSSActionPrefix + "PutObjectAcl"

	// Multipart actions
	OSSCreateMultipartUploadAction   Action = OSSActionPrefix + "CreateMultipartUpload"
	OSSListMultipartUploadsAction    Action = OSSActionPrefix + "ListMultipartUploads"
	OSSUploadPartAction              Action = OSSActionPrefix + "UploadPart"
	OSSUploadPartCopyAction          Action = OSSActionPrefix + "UploadPartCopy" // unsupported
	OSSListPartsAction               Action = OSSActionPrefix + "ListParts"
	OSSCompleteMultipartUploadAction Action = OSSActionPrefix + "CompleteMultipartUpload"
	OSSAbortMultipartUploadAction    Action = OSSActionPrefix + "AbortMultipartUpload"

	// Bucket location
	OSSGetBucketLocationAction Action = OSSActionPrefix + "GetBucketLocation"

	// Object extend attributes (xattr)
	OSSGetObjectXAttrAction    Action = OSSActionPrefix + "GetObjectXAttr"
	OSSPutObjectXAttrAction    Action = OSSActionPrefix + "PutObjectXAttr"
	OSSListObjectXAttrsAction  Action = OSSActionPrefix + "ListObjectXAttrs"
	OSSDeleteObjectXAttrAction Action = OSSActionPrefix + "DeleteObjectXAttr"

	// Object tagging actions
	OSSGetObjectTaggingAction    Action = OSSActionPrefix + "GetObjectTagging"
	OSSPutObjectTaggingAction    Action = OSSActionPrefix + "PutObjectTagging"
	OSSDeleteObjectTaggingAction Action = OSSActionPrefix + "DeleteObjectTagging"

	// Bucket tagging actions
	OSSGetBucketTaggingAction    Action = OSSActionPrefix + "GetBucketTagging"
	OSSPutBucketTaggingAction    Action = OSSActionPrefix + "PutBucketTagging"
	OSSDeleteBucketTaggingAction Action = OSSActionPrefix + "DeleteBucketTagging"

	// Bucket lifecycle actions
	OSSGetBucketLifecycleAction                 Action = OSSActionPrefix + "GetBucketLifecycle"    // unsupported
	OSSPutBucketLifecycleAction                 Action = OSSActionPrefix + "PutBucketLifecycle"    // unsupported
	OSSDeleteBucketLifecycleAction              Action = OSSActionPrefix + "DeleteBucketLifecycle" // unsupported
	OSSGetBucketLifecycleConfigurationAction    Action = OSSActionPrefix + "GetBucketLifecycleConfiguration"
	OSSPutBucketLifecycleConfigurationAction    Action = OSSActionPrefix + "PutBucketLifecycleConfiguration"
	OSSDeleteBucketLifecycleConfigurationAction Action = OSSActionPrefix + "DeleteBucketLifecycleConfiguration"

	// Object storage version actions
	OSSGetBucketVersioningAction Action = OSSActionPrefix + "GetBucketVersioning" // unsupported
	OSSPutBucketVersioningAction Action = OSSActionPrefix + "PutBucketVersioning" // unsupported
	OSSListObjectVersionsAction  Action = OSSActionPrefix + "ListObjectVersions"  // unsupported

	// Object legal hold actions
	OSSGetObjectLegalHoldAction Action = OSSActionPrefix + "GetObjectLegalHold" // unsupported
	OSSPutObjectLegalHoldAction Action = OSSActionPrefix + "PutObjectLegalHold" // unsupported

	// Object retention actions
	OSSGetObjectRetentionAction Action = OSSActionPrefix + "GetObjectRetention" // unsupported
	OSSPutObjectRetentionAction Action = OSSActionPrefix + "PutObjectRetention" // unsupported

	// Bucket encryption actions
	OSSGetBucketEncryptionAction    Action = OSSActionPrefix + "GetBucketEncryption"    // unsupported
	OSSPutBucketEncryptionAction    Action = OSSActionPrefix + "PutBucketEncryption"    // unsupported
	OSSDeleteBucketEncryptionAction Action = OSSActionPrefix + "DeleteBucketEncryption" // unsupported

	// Bucket website actions
	OSSGetBucketWebsiteAction    Action = OSSActionPrefix + "GetBucketWebsite"    // unsupported
	OSSPutBucketWebsiteAction    Action = OSSActionPrefix + "PutBucketWebsite"    // unsupported
	OSSDeleteBucketWebsiteAction Action = OSSActionPrefix + "DeleteBucketWebsite" // unsupported

	// Object restore actions
	OSSRestoreObjectAction Action = OSSActionPrefix + "RestoreObject" // unsupported

	// Public access block actions
	OSSGetPublicAccessBlockAction    Action = OSSActionPrefix + "GetPublicAccessBlock"   // unsupported
	OSSPutPublicAccessBlockAction    Action = OSSActionPrefix + "PutPublicAccessBlock"   // unsupported
	OSSDeletePublicAccessBlockAction Action = OSSActionPrefix + "DeletePulicAccessBlock" // unuspported

	// Bucket request payment actions
	OSSGetBucketRequestPaymentAction Action = OSSActionPrefix + "GetBucketRequestPayment" // unsupported
	OSSPutBucketRequestPaymentAction Action = OSSActionPrefix + "PutBucketRequestPayment" // unsupported

	// Bucket replication actions
	OSSGetBucketReplicationAction    Action = OSSActionPrefix + "GetBucketReplicationAction"    // unsupported
	OSSPutBucketReplicationAction    Action = OSSActionPrefix + "PutBucketReplicationAction"    // unsupported
	OSSDeleteBucketReplicationAction Action = OSSActionPrefix + "DeleteBucketReplicationAction" // unsupported

	// STS actions
	OSSGetFederationTokenAction Action = OSSActionPrefix + "GetFederationToken"

	// constants for POSIX file system interface
	POSIXReadAction  Action = POSIXActionPrefix + "Read"
	POSIXWriteAction Action = POSIXActionPrefix + "Write"

	// Object Lock actions
	OSSPutObjectLockConfigurationAction Action = OSSActionPrefix + "PutObjectLockConfiguration"
	OSSGetObjectLockConfigurationAction Action = OSSActionPrefix + "GetObjectLockConfiguration"

	NoneAction Action = ""
)

func ParseAction added in v1.34.0

func ParseAction(str string) Action

func (Action) IsNone added in v1.34.0

func (a Action) IsNone() bool

func (Action) Name added in v1.34.0

func (a Action) Name() string

func (Action) String added in v1.34.0

func (a Action) String() string

type Actions added in v1.34.0

type Actions []Action

func BuiltinPermissionActions added in v1.34.0

func BuiltinPermissionActions(perm Permission) Actions

func (Actions) Contains added in v1.34.0

func (actions Actions) Contains(action Action) bool

func (Actions) Len added in v1.34.0

func (actions Actions) Len() int

type AddDataPartitionRaftMemberRequest added in v1.4.0

type AddDataPartitionRaftMemberRequest struct {
	PartitionId uint64
	AddPeer     Peer
}

AddDataPartitionRaftMemberRequest defines the request of add raftMember a data partition.

type AddMetaPartitionRaftMemberRequest added in v1.4.0

type AddMetaPartitionRaftMemberRequest struct {
	PartitionId uint64
	AddPeer     Peer
}

AddMetaPartitionRaftMemberRequest defines the request of add raftMember a meta partition.

type AddMultipartPartRequest added in v1.5.0

type AddMultipartPartRequest struct {
	VolName     string             `json:"vol"`
	PartitionId uint64             `json:"pid"`
	Path        string             `json:"path"`
	MultipartId string             `json:"mid"`
	Part        *MultipartPartInfo `json:"part"`
}

type AdminTask

type AdminTask struct {
	ID           string
	PartitionID  uint64
	OpCode       uint8
	OperatorAddr string
	Status       int8
	SendTime     int64
	CreateTime   int64
	SendCount    uint8
	Request      interface{}
	Response     interface{}
	RequestID    string
}

AdminTask defines the administration task.

func NewAdminTask

func NewAdminTask(opCode uint8, opAddr string, request interface{}) (t *AdminTask)

NewAdminTask returns a new adminTask.

func NewAdminTaskEx added in v1.34.0

func NewAdminTaskEx(opCode uint8, opAddr string, request interface{}, reqID string) (t *AdminTask)

NewAdminTaskEx returns a new adminTask.

func (*AdminTask) CheckTaskNeedSend

func (t *AdminTask) CheckTaskNeedSend() (needRetry bool)

CheckTaskNeedSend checks if the task needs to be sent out.

func (*AdminTask) CheckTaskTimeOut

func (t *AdminTask) CheckTaskTimeOut() (notResponse bool)

CheckTaskTimeOut checks if the task is timed out.

func (*AdminTask) IdString added in v1.34.0

func (t *AdminTask) IdString() string

func (*AdminTask) IsHeartbeatTask

func (t *AdminTask) IsHeartbeatTask() bool

IsHeartbeatTask returns if the task is a heartbeat task.

func (*AdminTask) IsTaskFailed

func (t *AdminTask) IsTaskFailed() (isFail bool)

IsTaskFailed returns if the task failed.

func (*AdminTask) IsTaskSuccessful

func (t *AdminTask) IsTaskSuccessful() (isSuccess bool)

IsTaskSuccessful returns if the task has been executed successful.

func (*AdminTask) IsUrgentTask

func (t *AdminTask) IsUrgentTask() bool

IsUrgentTask returns if the task is urgent.

func (*AdminTask) SetStatus

func (t *AdminTask) SetStatus(status int8)

SetStatus sets the status of the task.

func (*AdminTask) ToString

func (t *AdminTask) ToString() (msg string)

ToString returns the string format of the task.

type AppendExtentKeyRequest

type AppendExtentKeyRequest struct {
	VolName     string    `json:"vol"`
	PartitionID uint64    `json:"pid"`
	Inode       uint64    `json:"ino"`
	Extent      ExtentKey `json:"ek"`
}

AppendExtentKeyRequest defines the request to append an extent key.

type AppendExtentKeyWithCheckRequest added in v1.34.0

type AppendExtentKeyWithCheckRequest struct {
	VolName        string      `json:"vol"`
	PartitionID    uint64      `json:"pid"`
	Inode          uint64      `json:"ino"`
	Extent         ExtentKey   `json:"ek"`
	DiscardExtents []ExtentKey `json:"dek"`
	VerSeq         uint64      `json:"seq"`
	IsSplit        bool
}

type AppendExtentKeysRequest added in v1.5.0

type AppendExtentKeysRequest struct {
	VolName     string      `json:"vol"`
	PartitionId uint64      `json:"pid"`
	Inode       uint64      `json:"ino"`
	Extents     []ExtentKey `json:"eks"`
}

AppendExtentKeysRequest defines the request to append an extent key.

type AppendMultipartResponse added in v1.34.0

type AppendMultipartResponse struct {
	Status   uint8  `json:"status"`
	Update   bool   `json:"update"`
	OldInode uint64 `json:"oldinode"`
}

type AppendObjExtentKeysRequest added in v1.34.0

type AppendObjExtentKeysRequest struct {
	VolName     string         `json:"vol"`
	PartitionID uint64         `json:"pid"`
	Inode       uint64         `json:"ino"`
	Extents     []ObjExtentKey `json:"ek"`
}

AppendObjExtentKeyRequest defines the request to append an obj extent key.

type AuthAPIAccessReq added in v1.5.0

type AuthAPIAccessReq struct {
	APIReq  APIAccessReq     `json:"api_req"`
	KeyInfo keystore.KeyInfo `json:"key_info"`
}

AuthAPIAccessReq defines Auth API request

type AuthAPIAccessResp added in v1.5.0

type AuthAPIAccessResp struct {
	APIResp   APIAccessResp    `json:"api_resp"`
	KeyInfo   keystore.KeyInfo `json:"key_info"`
	AuthIDKey string           `json:"auth_id_key"`
}

AuthAPIAccessResp defines the response for creating an key in authnode

func ParseAuthAPIAccessResp added in v1.5.0

func ParseAuthAPIAccessResp(body []byte, key []byte) (resp AuthAPIAccessResp, err error)

ParseAuthAPIAccessResp parse and validate the auth api access resp

type AuthGetTicketReq added in v1.5.0

type AuthGetTicketReq struct {
	Type      MsgType `json:"type"`
	ClientID  string  `json:"client_id"`
	ServiceID string  `json:"service_id"`
	Verifier  string  `json:"verifier"`
}

AuthGetTicketReq defines the message from client to authnode use Timestamp as verifier for MITM mitigation verifier is also used to verify the server identity

type AuthGetTicketResp added in v1.5.0

type AuthGetTicketResp struct {
	Type       MsgType              `json:"type"`
	ClientID   string               `json:"client_id"`
	ServiceID  string               `json:"service_id"`
	Verifier   int64                `json:"verifier"`
	Ticket     string               `json:"ticket"`
	SessionKey cryptoutil.CryptoKey `json:"session_key"`
}

AuthGetTicketResp defines the message from authnode to client

func ParseAuthGetTicketResp added in v1.5.0

func ParseAuthGetTicketResp(body []byte, key []byte) (resp AuthGetTicketResp, err error)

ParseAuthGetTicketResp parse and validate the auth get ticket resp

type AuthOSAccessKeyReq added in v1.5.0

type AuthOSAccessKeyReq struct {
	APIReq APIAccessReq           `json:"api_req"`
	AKCaps keystore.AccessKeyCaps `json:"access_key_caps"`
}

AuthAPIAccessKeystoreReq defines Auth API for put/delete Access Keystore vols

type AuthOSAccessKeyResp added in v1.5.0

type AuthOSAccessKeyResp struct {
	APIResp APIAccessResp          `json:"api_resp"`
	AKCaps  keystore.AccessKeyCaps `json:"access_key_caps"`
}

AuthAPIAccessKeystoreResp defines the response for put/delete Access Keystore vols

func ParseAuthOSAKResp added in v1.5.0

func ParseAuthOSAKResp(body []byte, key []byte) (resp AuthOSAccessKeyResp, err error)

type AuthRaftNodeInfo added in v1.5.0

type AuthRaftNodeInfo struct {
	ID   uint64 `json:"id"`
	Addr string `json:"addr"`
}

AuthRaftNodeInfo defines raft node information

type AuthRaftNodeReq added in v1.5.0

type AuthRaftNodeReq struct {
	APIReq       APIAccessReq     `json:"api_req"`
	RaftNodeInfo AuthRaftNodeInfo `json:"node_info"`
}

AuthRaftNodeReq defines Auth API request for add/remove a raft node

type AuthRaftNodeResp added in v1.5.0

type AuthRaftNodeResp struct {
	APIResp APIAccessResp `json:"api_resp"`
	Msg     string        `json:"msg"`
}

AuthRaftNodeResp defines Auth API response for add/remove a raft node

func ParseAuthRaftNodeResp added in v1.5.0

func ParseAuthRaftNodeResp(body []byte, key []byte) (resp AuthRaftNodeResp, err error)

ParseAuthRaftNodeResp parse and validate the auth raft node resp

type BackupDataPartitionInfo added in v1.34.0

type BackupDataPartitionInfo struct {
	Addr        string
	Disk        string
	PartitionID uint64
}

type BadDiskInfo added in v1.34.0

type BadDiskInfo struct {
	Address              string
	Path                 string
	TotalPartitionCnt    int
	DiskErrPartitionList []uint64
}

type BadDiskInfos added in v1.34.0

type BadDiskInfos struct {
	BadDisks []BadDiskInfo
}

type BadDiskRecoverProgress added in v1.34.0

type BadDiskRecoverProgress struct {
	TotalPartitionsNum   int
	BadDataPartitions    []uint64
	BadDataPartitionsNum int
	Status               string
}

type BadDiskStat added in v1.34.0

type BadDiskStat struct {
	DiskPath             string
	TotalPartitionCnt    int
	DiskErrPartitionList []uint64
}

type BadPartitionRepairView added in v1.34.0

type BadPartitionRepairView struct {
	Path           string
	PartitionInfos []DpRepairInfo
}

type BadPartitionView added in v1.5.0

type BadPartitionView struct {
	Path         string
	PartitionIDs []uint64
}

type BadReplicaMetaInfo added in v1.34.0

type BadReplicaMetaInfo struct {
	PartitionId uint64
	Replica     string
	BadPeer     []Peer
	ExpectPeer  []Peer
}

type BadReplicaMetaResponse added in v1.34.0

type BadReplicaMetaResponse struct {
	Infos []BadReplicaMetaInfo
}

type BatchDeleteDentryRequest added in v1.34.0

type BatchDeleteDentryRequest struct {
	VolName     string   `json:"vol"`
	PartitionID uint64   `json:"pid"`
	ParentID    uint64   `json:"pino"`
	Dens        []Dentry `json:"dens"`
	FullPaths   []string `json:"fullPaths"`
}

type BatchDeleteDentryResponse added in v1.34.0

type BatchDeleteDentryResponse struct {
	ParentID uint64 `json:"pino"`
	Items    []*struct {
		Inode  uint64 `json:"ino"`
		Status uint8  `json:"status"`
	} `json:"items"`
}

BatchDeleteDentryResponse defines the response to the request of deleting a dentry.

type BatchDeleteMetaserverQuotaResponse added in v1.34.0

type BatchDeleteMetaserverQuotaResponse struct {
	InodeRes map[uint64]uint8 `json:"inores"`
}

type BatchDeleteMetaserverQuotaReuqest added in v1.34.0

type BatchDeleteMetaserverQuotaReuqest struct {
	PartitionId uint64   `json:"pid"`
	Inodes      []uint64 `json:"ino"`
	QuotaId     uint32   `json:"qid"`
}

type BatchDentries added in v1.34.0

type BatchDentries struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewBatchDentries added in v1.34.0

func NewBatchDentries() *BatchDentries

func (*BatchDentries) Append added in v1.34.0

func (f *BatchDentries) Append(dentry *ScanDentry)

func (*BatchDentries) BatchGetAndClear added in v1.34.0

func (f *BatchDentries) BatchGetAndClear() (map[uint64]*ScanDentry, []uint64)

func (*BatchDentries) Len added in v1.34.0

func (f *BatchDentries) Len() int

type BatchEvictInodeRequest added in v1.34.0

type BatchEvictInodeRequest struct {
	VolName     string   `json:"vol"`
	PartitionID uint64   `json:"pid"`
	Inodes      []uint64 `json:"inos"`
	FullPaths   []string `json:"fullPaths"`
}

EvictInodeRequest defines the request to evict some inode.

type BatchGetXAttrRequest added in v1.5.0

type BatchGetXAttrRequest struct {
	VolName     string   `json:"vol"`
	PartitionId uint64   `json:"pid"`
	Inodes      []uint64 `json:"inos"`
	Keys        []string `json:"keys"`
	VerSeq      uint64   `json:"seq"`
}

type BatchGetXAttrResponse added in v1.5.0

type BatchGetXAttrResponse struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	XAttrs      []*XAttrInfo
}

type BatchInodeGetRequest

type BatchInodeGetRequest struct {
	VolName     string   `json:"vol"`
	PartitionID uint64   `json:"pid"`
	Inodes      []uint64 `json:"inos"`
	VerSeq      uint64   `json:"seq"`
}

BatchInodeGetRequest defines the request to get the inode in batch.

type BatchInodeGetResponse

type BatchInodeGetResponse struct {
	Infos []*InodeInfo `json:"infos"`
}

BatchInodeGetResponse defines the response to the request of getting the inode in batch.

type BatchSetMetaserverQuotaResponse added in v1.34.0

type BatchSetMetaserverQuotaResponse struct {
	InodeRes map[uint64]uint8 `json:"inores"`
}

type BatchSetMetaserverQuotaReuqest added in v1.34.0

type BatchSetMetaserverQuotaReuqest struct {
	PartitionId uint64   `json:"pid"`
	Inodes      []uint64 `json:"ino"`
	QuotaId     uint32   `json:"qid"`
	IsRoot      bool     `json:"root"`
}

type BatchSetXAttrRequest added in v1.34.0

type BatchSetXAttrRequest struct {
	VolName     string            `json:"vol"`
	PartitionId uint64            `json:"pid"`
	Inode       uint64            `json:"ino"`
	Attrs       map[string]string `json:"attrs"`
}

type BatchUnlinkInodeRequest added in v1.34.0

type BatchUnlinkInodeRequest struct {
	VolName     string   `json:"vol"`
	PartitionID uint64   `json:"pid"`
	Inodes      []uint64 `json:"inos"`
	FullPaths   []string `json:"fullPaths"`
}

UnlinkInodeRequest defines the request to unlink an inode.

type BatchUnlinkInodeResponse added in v1.34.0

type BatchUnlinkInodeResponse struct {
	Items []*struct {
		Info   *InodeInfo `json:"info"`
		Status uint8      `json:"status"`
	} `json:"items"`
}

batch UnlinkInodeResponse defines the response to the request of unlinking an inode.

type Blob added in v1.34.0

type Blob struct {
	MinBid uint64
	Count  uint64
	Vid    uint64
}

type ClearInodeCacheRequest added in v1.34.0

type ClearInodeCacheRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
}

type ClearInodeCacheResponse added in v1.34.0

type ClearInodeCacheResponse struct {
	Info *InodeInfo `json:"info"`
}

type ClientLimitInfo added in v1.34.0

type ClientLimitInfo struct {
	UsedLimit  uint64
	UsedBuffer uint64
	Used       uint64
	Need       uint64
}

type ClientReportLimitInfo added in v1.34.0

type ClientReportLimitInfo struct {
	ID        uint64
	FactorMap map[uint32]*ClientLimitInfo
	Host      string
	Status    uint8
	Version   *VersionInfo
	// contains filtered or unexported fields
}

func NewClientReportLimitInfo added in v1.34.0

func NewClientReportLimitInfo() *ClientReportLimitInfo

type ClusterIP added in v1.34.0

type ClusterIP struct {
	Cluster string
	// MetaNodeDeleteBatchCount 	int
	// MetaNodeDeleteWorkerSleepMs int
	// DataNodeDeleteLimitRate     int
	// DataNodeAutoRepairLimitRate int
	// Ip 							string
	EbsAddr string
}

type ClusterInfo

type ClusterInfo struct {
	Cluster                     string
	Ip                          string
	MetaNodeDeleteBatchCount    uint64
	MetaNodeDeleteWorkerSleepMs uint64
	DataNodeDeleteLimitRate     uint64
	DataNodeAutoRepairLimitRate uint64
	DpMaxRepairErrCnt           uint64
	DirChildrenNumLimit         uint32
	EbsAddr                     string
	ServicePath                 string
	ClusterUuid                 string
	ClusterUuidEnable           bool
}

ClusterInfo defines the cluster infomation.

type ClusterNodeInfo added in v1.34.0

type ClusterNodeInfo struct {
	// BatchCount          int
	LoadFactor string
}

ClusterNode defines the structure of a cluster node

type ClusterStatInfo added in v1.34.0

type ClusterStatInfo struct {
	DataNodeStatInfo *NodeStatInfo
	MetaNodeStatInfo *NodeStatInfo
	ZoneStatInfo     map[string]*ZoneStat
}

type ClusterView added in v1.5.0

type ClusterView struct {
	Name                         string
	CreateTime                   string
	LeaderAddr                   string
	DisableAutoAlloc             bool
	ForbidMpDecommission         bool
	MetaNodeThreshold            float32
	Applied                      uint64
	MaxDataPartitionID           uint64
	MaxMetaNodeID                uint64
	MaxMetaPartitionID           uint64
	VolDeletionDelayTimeHour     int64
	MarkDiskBrokenThreshold      float64
	EnableAutoDpMetaRepair       bool
	AutoDpMetaRepairParallelCnt  int
	EnableAutoDecommission       bool
	AutoDecommissionDiskInterval string
	DecommissionLimit            uint64
	DecommissionDiskLimit        uint32
	DpRepairTimeout              string
	DpBackupTimeout              string
	DpTimeout                    string
	DataNodeStatInfo             *NodeStatInfo
	MetaNodeStatInfo             *NodeStatInfo
	VolStatInfo                  []*VolStatInfo
	BadPartitionIDs              []BadPartitionView
	BadMetaPartitionIDs          []BadPartitionView
	MasterNodes                  []NodeView
	MetaNodes                    []NodeView
	DataNodes                    []NodeView
}

ClusterView provides the view of a cluster.

type CreateDataPartitionRequest

type CreateDataPartitionRequest struct {
	PartitionTyp        int
	PartitionId         uint64
	PartitionSize       int
	ReplicaNum          int
	VolumeId            string
	IsRandomWrite       bool
	Members             []Peer
	Hosts               []string
	CreateType          int
	LeaderSize          int
	DecommissionedDisks []string
	IsMultiVer          bool
	VerSeq              uint64
}

CreateDataPartitionRequest defines the request to create a data partition.

type CreateDataPartitionResponse

type CreateDataPartitionResponse struct {
	PartitionId uint64
	Status      uint8
	Result      string
}

CreateDataPartitionResponse defines the response to the request of creating a data partition.

type CreateDentryRequest

type CreateDentryRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	ParentID    uint64 `json:"pino"`
	Inode       uint64 `json:"ino"`
	Name        string `json:"name"`
	Mode        uint32 `json:"mode"`
	RequestExtend
}

type CreateInodeRequest

type CreateInodeRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Mode        uint32 `json:"mode"`
	Uid         uint32 `json:"uid"`
	Gid         uint32 `json:"gid"`
	Target      []byte `json:"tgt"`
	RequestExtend
}

type CreateInodeResponse

type CreateInodeResponse struct {
	Info *InodeInfo `json:"info"`
}

CreateInodeResponse defines the response to the request of creating an inode.

type CreateMetaPartitionRequest

type CreateMetaPartitionRequest struct {
	MetaId      string
	VolName     string
	Start       uint64
	End         uint64
	PartitionID uint64
	Members     []Peer
	VerSeq      uint64
}

CreateMetaPartitionRequest defines the request to create a meta partition.

type CreateMetaPartitionResponse

type CreateMetaPartitionResponse struct {
	VolName     string
	PartitionID uint64
	Status      uint8
	Result      string
}

CreateMetaPartitionResponse defines the response to the request of creating a meta partition.

type CreateMultipartRequest added in v1.5.0

type CreateMultipartRequest struct {
	VolName     string            `json:"vol"`
	PartitionId uint64            `json:"pid"`
	Path        string            `json:"path"`
	Extend      map[string]string `json:"extend"`
}

type CreateMultipartResponse added in v1.5.0

type CreateMultipartResponse struct {
	Info *MultipartInfo `json:"info"`
}

type CreateNameSpaceRequest

type CreateNameSpaceRequest struct {
	Name string
}

CreateNameSpaceRequest defines the request to create a name space.

type CreateNameSpaceResponse

type CreateNameSpaceResponse struct {
	Status int
	Result string
}

CreateNameSpaceResponse defines the response to the request of creating a name space.

type DataDecommissionProgress added in v1.34.0

type DataDecommissionProgress struct {
	Status        uint32
	StatusMessage string
	Progress      string
	FailedDps     []FailedDpInfo
	IgnoreDps     []IgnoreDecommissionDP
	ResidualDps   []IgnoreDecommissionDP
}

type DataNodeDisksRequest added in v1.34.0

type DataNodeDisksRequest struct{}

type DataNodeDisksResponse added in v1.34.0

type DataNodeDisksResponse struct{}

type DataNodeHeartbeatResponse

type DataNodeHeartbeatResponse struct {
	Total                uint64
	Used                 uint64
	Available            uint64
	TotalPartitionSize   uint64 // volCnt * volsize
	RemainingCapacity    uint64 // remaining capacity to create partition
	CreatedPartitionCnt  uint32
	MaxCapacity          uint64 // maximum capacity to create partition
	StartTime            int64
	ZoneName             string
	PartitionReports     []*DataPartitionReport
	Status               uint8
	Result               string
	AllDisks             []string
	BadDisks             []string           // Keep this old field for compatibility
	BadDiskStats         []BadDiskStat      // key: disk path
	CpuUtil              float64            `json:"cpuUtil"`
	IoUtils              map[string]float64 `json:"ioUtil"`
	BackupDataPartitions []BackupDataPartitionInfo
	DiskOpLog            []OpLog
	DpOpLog              []OpLog
}

DataNodeHeartbeatResponse defines the response to the data node heartbeat.

type DataNodeInfo added in v1.5.0

type DataNodeInfo struct {
	Total                                 uint64 `json:"TotalWeight"`
	Used                                  uint64 `json:"UsedWeight"`
	AvailableSpace                        uint64
	ID                                    uint64
	ZoneName                              string `json:"Zone"`
	Addr                                  string
	DomainAddr                            string
	ReportTime                            time.Time
	IsActive                              bool
	ToBeOffline                           bool
	IsWriteAble                           bool
	UsageRatio                            float64 // used / total space
	SelectedTimes                         uint64  // number times that this datanode has been selected as the location for a data partition.
	DataPartitionReports                  []*DataPartitionReport
	DataPartitionCount                    uint32
	NodeSetID                             uint64
	PersistenceDataPartitions             []uint64
	PersistenceDataPartitionsWithDiskPath []DataPartitionDiskInfo
	BadDisks                              []string
	RdOnly                                bool
	CanAllocPartition                     bool
	MaxDpCntLimit                         uint32             `json:"maxDpCntLimit"`
	CpuUtil                               float64            `json:"cpuUtil"`
	IoUtils                               map[string]float64 `json:"ioUtil"`
	DecommissionedDisk                    []string
	BackupDataPartitions                  []uint64
}

DataNode stores all the information about a data node

type DataNodeQosResponse added in v1.34.0

type DataNodeQosResponse struct {
	IopsRLimit uint64
	IopsWLimit uint64
	FlowRlimit uint64
	FlowWlimit uint64
	Status     uint8
	Result     string
}

type DataPartitionDecommissionRequest

type DataPartitionDecommissionRequest struct {
	PartitionId uint64
	RemovePeer  Peer
	AddPeer     Peer
}

DataPartitionDecommissionRequest defines the request of decommissioning a data partition.

type DataPartitionDiagnosis added in v1.34.0

type DataPartitionDiagnosis struct {
	InactiveDataNodes           []string
	CorruptDataPartitionIDs     []uint64
	LackReplicaDataPartitionIDs []uint64
	RepFileCountDifferDpIDs     []uint64
	RepUsedSizeDifferDpIDs      []uint64
	ExcessReplicaDpIDs          []uint64
	// BadDataPartitionIDs         []BadPartitionView
	BadDataPartitionInfos       []BadPartitionRepairView
	BadReplicaDataPartitionIDs  []uint64
	DiskErrorDataPartitionInfos DiskErrPartitionView
}

data partition diagnosis represents the inactive data nodes, corrupt data partitions, and data partitions lack of replicas

type DataPartitionDiskInfo added in v1.34.0

type DataPartitionDiskInfo struct {
	PartitionId uint64
	Disk        string
}

type DataPartitionInfo added in v1.5.0

type DataPartitionInfo struct {
	PartitionID              uint64
	PartitionTTL             int64
	PartitionType            int
	LastLoadedTime           int64
	ReplicaNum               uint8
	Status                   int8
	Recover                  bool
	Replicas                 []*DataReplica
	Hosts                    []string // host addresses
	Peers                    []Peer
	Zones                    []string
	NodeSets                 []uint64
	MissingNodes             map[string]int64 // key: address of the missing node, value: when the node is missing
	VolName                  string
	VolID                    uint64
	OfflinePeerID            uint64
	FileInCoreMap            map[string]*FileInCore
	IsRecover                bool
	FilesWithMissingReplica  map[string]int64 // key: file name, value: last time when a missing replica is found
	SingleDecommissionStatus uint32
	SingleDecommissionAddr   string
	RdOnly                   bool
	IsDiscard                bool
	Forbidden                bool
}

DataPartition represents the structure of storing the file contents.

type DataPartitionReport added in v1.34.0

type DataPartitionReport struct {
	VolName                    string
	PartitionID                uint64
	PartitionStatus            int
	Total                      uint64
	Used                       uint64
	DiskPath                   string
	IsLeader                   bool
	ExtentCount                int
	NeedCompare                bool
	DecommissionRepairProgress float64
	LocalPeers                 []Peer
	TriggerDiskError           bool
}

DataPartitionReport defines the partition report.

type DataPartitionResponse

type DataPartitionResponse struct {
	PartitionType int
	PartitionID   uint64
	Status        int8
	ReplicaNum    uint8
	Hosts         []string
	LeaderAddr    string
	Epoch         uint64
	IsRecover     bool
	PartitionTTL  int64
	IsDiscard     bool
}

DataPartitionResponse defines the response from a data node to the master that is related to a data partition.

type DataPartitionsView

type DataPartitionsView struct {
	DataPartitions []*DataPartitionResponse
	VolReadOnly    bool // to notify client no readwrite dp
}

DataPartitionsView defines the view of a data partition

func NewDataPartitionsView

func NewDataPartitionsView() (dataPartitionsView *DataPartitionsView)

type DataReplica added in v1.5.0

type DataReplica struct {
	Addr                       string
	DomainAddr                 string
	ReportTime                 int64
	FileCount                  uint32
	Status                     int8
	HasLoadResponse            bool   // if there is any response when loading
	Total                      uint64 `json:"TotalSize"`
	Used                       uint64 `json:"UsedSize"`
	IsLeader                   bool
	NeedsToCompare             bool
	DiskPath                   string
	DecommissionRepairProgress float64
	LocalPeers                 []Peer
	TriggerDiskError           bool
}

DataReplica represents the replica of a data partition

type DecommissionDataPartitionInfo added in v1.34.0

type DecommissionDataPartitionInfo struct {
	PartitionId        uint64
	ReplicaNum         uint8
	Status             string
	SpecialStep        string
	Retry              int
	RaftForce          bool
	Recover            bool
	SrcAddress         string
	SrcDiskPath        string
	DstAddress         string
	Term               uint64
	Replicas           []string
	ErrorMessage       string
	NeedRollbackTimes  uint32
	DecommissionType   string
	RestoreReplicaType string
	IsDiscard          bool
	RecoverStartTime   string
}

type DecommissionDiskInfo added in v1.34.0

type DecommissionDiskInfo struct {
	SrcAddr      string
	DiskPath     string
	ProgressInfo DecommissionProgress
}

type DecommissionDiskLimitDetail added in v1.34.0

type DecommissionDiskLimitDetail struct {
	NodeSetId uint64
	Limit     int
}

type DecommissionDisksResponse added in v1.34.0

type DecommissionDisksResponse struct {
	Infos []DecommissionDiskInfo
}

type DecommissionFailedDiskInfo added in v1.34.0

type DecommissionFailedDiskInfo struct {
	SrcAddr               string
	DiskPath              string
	DecommissionRaftForce bool
	DecommissionTimes     uint8
	DecommissionDpTotal   int
	IsAutoDecommission    bool
}

type DecommissionProgress added in v1.34.0

type DecommissionProgress struct {
	StatusMessage string
	Progress      string
	FailedDps     []FailedDpInfo
	IgnoreDps     []IgnoreDecommissionDP
	ResidualDps   []IgnoreDecommissionDP
	StartTime     string
}

type DecommissionTokenStatus added in v1.34.0

type DecommissionTokenStatus struct {
	NodesetID                   uint64
	CurTokenNum                 int32
	MaxTokenNum                 int32
	RunningDp                   []uint64
	TotalDP                     int
	ManualDecommissionDisk      []string
	ManualDecommissionDiskTotal int
	AutoDecommissionDisk        []string
	AutoDecommissionDiskTotal   int
	MaxDiskTokenNum             uint32
	RunningDisk                 []string
}

type DecommissionedDisks added in v1.34.0

type DecommissionedDisks struct {
	Node  string
	Disks []string
}

type DelExtentKeyRequest added in v1.34.0

type DelExtentKeyRequest struct {
	VolName     string      `json:"vol"`
	PartitionID uint64      `json:"pid"`
	Inode       uint64      `json:"ino"`
	Extents     []ExtentKey `json:"ek"`
}

type DelExtentParam added in v1.34.0

type DelExtentParam struct {
	*ExtentKey
	IsSnapshotDeletion bool
}

type DelVerRequest added in v1.34.0

type DelVerRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	VerSeq      uint64 `json:"ver"`
}

type DeleteBackupDirectoriesRequest added in v1.34.0

type DeleteBackupDirectoriesRequest struct {
	DiskPath string
}

type DeleteDataPartitionRequest

type DeleteDataPartitionRequest struct {
	DataPartitionType string
	PartitionId       uint64
	PartitionSize     int
	Force             bool
	DecommissionType  uint32
}

DeleteDataPartitionRequest defines the request to delete a data partition.

type DeleteDataPartitionResponse

type DeleteDataPartitionResponse struct {
	Status      uint8
	Result      string
	PartitionId uint64
}

DeleteDataPartitionResponse defines the response to the request of deleting a data partition.

type DeleteDentryRequest

type DeleteDentryRequest struct {
	VolName         string `json:"vol"`
	PartitionID     uint64 `json:"pid"`
	ParentID        uint64 `json:"pino"`
	Name            string `json:"name"`
	InodeCreateTime int64  `json:"inodeCreateTime"`
	Verseq          uint64 `json:"ver"`
	RequestExtend
}

DeleteDentryRequest define the request tp delete a dentry.

type DeleteDentryResponse

type DeleteDentryResponse struct {
	Inode uint64 `json:"ino"`
}

DeleteDentryResponse defines the response to the request of deleting a dentry.

type DeleteFileRequest

type DeleteFileRequest struct {
	VolId uint64
	Name  string
}

DeleteFileRequest defines the request to delete a file.

type DeleteFileResponse

type DeleteFileResponse struct {
	Status uint8
	Result string
	VolId  uint64
	Name   string
}

DeleteFileResponse defines the response to the request of deleting a file.

type DeleteInodeBatchRequest added in v1.34.0

type DeleteInodeBatchRequest struct {
	VolName     string   `json:"vol"`
	PartitionId uint64   `json:"pid"`
	Inodes      []uint64 `json:"ino"`
	FullPaths   []string `json:"fullPaths"`
}

DeleteInodeRequest defines the request to delete an inode.

type DeleteInodeRequest added in v1.5.0

type DeleteInodeRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	RequestExtend
}

DeleteInodeRequest defines the request to delete an inode.

type DeleteMetaPartitionRequest

type DeleteMetaPartitionRequest struct {
	PartitionID uint64
}

DeleteMetaPartitionRequest defines the request of deleting a meta partition.

type DeleteMetaPartitionResponse

type DeleteMetaPartitionResponse struct {
	PartitionID uint64
	Status      uint8
	Result      string
}

DeleteMetaPartitionResponse defines the response to the request of deleting a meta partition.

type Dentry

type Dentry struct {
	Name  string `json:"name"`
	Inode uint64 `json:"ino"`
	Type  uint32 `json:"type"`
}

Dentry defines the dentry struct.

func (Dentry) String

func (d Dentry) String() string

String returns the string format of the dentry.

type DentryInfo added in v1.34.0

type DentryInfo struct {
	Name  string `json:"name"`
	Inode uint64 `json:"inode"`
	// contains filtered or unexported fields
}

func (*DentryInfo) Expiration added in v1.34.0

func (info *DentryInfo) Expiration() int64

func (*DentryInfo) SetExpiration added in v1.34.0

func (info *DentryInfo) SetExpiration(e int64)

type DetryInfo added in v1.34.0

type DetryInfo struct {
	Inode  uint64 `json:"ino"`
	Mode   uint32 `json:"mode"`
	VerSeq uint64 `json:"seq"`
	IsDel  bool   `json:"isDel"`
}

type DiscardDataPartitionInfos added in v1.34.0

type DiscardDataPartitionInfos struct {
	DiscardDps []DataPartitionInfo
}

type DiskErrPartitionView added in v1.34.0

type DiskErrPartitionView struct {
	DiskErrReplicas map[uint64][]DiskErrReplicaInfo
}

type DiskErrReplicaInfo added in v1.34.0

type DiskErrReplicaInfo struct {
	Addr string
	Disk string
}

type DomainNodeSetGrpInfoList added in v1.34.0

type DomainNodeSetGrpInfoList struct {
	DomainOn              bool
	DataRatioLimit        float64
	ZoneExcludeRatioLimit float64
	NeedDomain            bool
	ExcludeZones          []string
	DomainNodeSetGrpInfo  []*SimpleNodeSetGrpInfoList
}

type DpRepairInfo added in v1.34.0

type DpRepairInfo struct {
	PartitionID                uint64
	DecommissionRepairProgress float64
}

type EmptyExtentKeyRequest added in v1.34.0

type EmptyExtentKeyRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
}

type EvictInodeRequest

type EvictInodeRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	RequestExtend
}

EvictInodeRequest defines the request to evict an inode.

type ExpirationConfig added in v1.34.0

type ExpirationConfig struct {
	Date *time.Time
	Days int
}

type ExpiredMultipartInfo added in v1.34.0

type ExpiredMultipartInfo struct {
	Path        string   `json:"path"`
	MultipartId string   `json:"mid"`
	Inodes      []uint64 `json:"inodes"`
}

type ExtSnapInfo added in v1.34.0

type ExtSnapInfo struct {
	VerSeq  uint64
	IsSplit bool
	ModGen  uint64
}

type ExtentKey

type ExtentKey struct {
	FileOffset   uint64 // offset in file
	PartitionId  uint64
	ExtentId     uint64
	ExtentOffset uint64 // offset in extent like tiny extent offset large than 0,normal is 0
	Size         uint32 // real size that inode used on the extent,it's size may be part of extent real size, such as tinyExt
	CRC          uint32
	// snapshot
	SnapInfo *ExtSnapInfo
}

ExtentKey defines the extent key struct.

func (*ExtentKey) AddModGen added in v1.34.0

func (k *ExtentKey) AddModGen()

func (*ExtentKey) CheckSum added in v1.34.0

func (k *ExtentKey) CheckSum(v3 bool) uint32

func (*ExtentKey) Copy

func (k *ExtentKey) Copy() btree.Item

Marshal marshals the extent key.

func (*ExtentKey) Equals added in v1.34.0

func (k *ExtentKey) Equals(ek *ExtentKey) bool

func (*ExtentKey) GenerateId added in v1.34.0

func (k *ExtentKey) GenerateId() uint64

func (*ExtentKey) GetExtentKey

func (k *ExtentKey) GetExtentKey() (m string)

TODO remove

func (*ExtentKey) GetModGen added in v1.34.0

func (k *ExtentKey) GetModGen() uint64

func (*ExtentKey) GetSeq added in v1.34.0

func (k *ExtentKey) GetSeq() uint64

func (*ExtentKey) IsCoveredWithDiffSeq added in v1.34.0

func (k *ExtentKey) IsCoveredWithDiffSeq(rightKey *ExtentKey) bool

func (*ExtentKey) IsEqual added in v1.34.0

func (k *ExtentKey) IsEqual(rightKey *ExtentKey) bool

func (*ExtentKey) IsFileInSequence added in v1.34.0

func (k *ExtentKey) IsFileInSequence(rightKey *ExtentKey) bool

func (*ExtentKey) IsSameExtent added in v1.34.0

func (k *ExtentKey) IsSameExtent(rightKey *ExtentKey) bool

func (*ExtentKey) IsSequenceWithDiffSeq added in v1.34.0

func (k *ExtentKey) IsSequenceWithDiffSeq(rightKey *ExtentKey) bool

func (*ExtentKey) IsSequenceWithSameSeq added in v1.34.0

func (k *ExtentKey) IsSequenceWithSameSeq(rightKey *ExtentKey) bool

func (*ExtentKey) IsSplit added in v1.34.0

func (k *ExtentKey) IsSplit() bool

func (*ExtentKey) Less

func (k *ExtentKey) Less(than btree.Item) bool

Less defines the less comparator.

func (*ExtentKey) Marshal

func (k *ExtentKey) Marshal() (m string)

func (*ExtentKey) MarshalBinary

func (k *ExtentKey) MarshalBinary(v3 bool) ([]byte, error)

MarshalBinary marshals the binary format of the extent key.

func (*ExtentKey) MarshalBinaryExt added in v1.34.0

func (k *ExtentKey) MarshalBinaryExt(data []byte)

func (*ExtentKey) MarshalBinaryWithCheckSum added in v1.34.0

func (k *ExtentKey) MarshalBinaryWithCheckSum(v3 bool) ([]byte, error)

marshal extentkey to []bytes with v2 of magic head

func (*ExtentKey) SetSeq added in v1.34.0

func (k *ExtentKey) SetSeq(seq uint64)

func (*ExtentKey) SetSplit added in v1.34.0

func (k *ExtentKey) SetSplit(split bool)

func (ExtentKey) String

func (k ExtentKey) String() string

String returns the string format of the extentKey.

func (*ExtentKey) UnMarshal

func (k *ExtentKey) UnMarshal(m string) (err error)

TODO remove

func (*ExtentKey) UnmarshalBinary

func (k *ExtentKey) UnmarshalBinary(buf *bytes.Buffer, v3 bool) (err error)

UnmarshalBinary unmarshals the binary format of the extent key.

func (*ExtentKey) UnmarshalBinaryWithCheckSum added in v1.34.0

func (k *ExtentKey) UnmarshalBinaryWithCheckSum(buf *bytes.Buffer) (err error)

unmarshal extentkey from bytes.Buffer with checksum

type FailedDpInfo added in v1.34.0

type FailedDpInfo struct {
	PartitionID uint64
	ErrMsg      string
}

type File

type File struct {
	Name     string
	Crc      uint32
	Size     uint32
	Modified int64
	ApplyID  uint64
}

File defines the file struct.

type FileInCore added in v1.5.0

type FileInCore struct {
	Name          string
	LastModify    int64
	MetadataArray []*FileMetadata
}

FileInCore define file in data partition

type FileMetadata added in v1.5.0

type FileMetadata struct {
	Crc     uint32
	LocAddr string
	Size    uint32
	ApplyID uint64
}

FileMetadata defines the file metadata on a dataNode

type FilterConfig added in v1.34.0

type FilterConfig struct {
	Prefix string
}

type GcFlag added in v1.34.0

type GcFlag uint8
const (
	GcNormal GcFlag = iota
	GcMarkFlag
	GcDeleteFlag
)

func (GcFlag) String added in v1.34.0

func (g GcFlag) String() string

type GcLockExtents added in v1.34.0

type GcLockExtents struct {
	IsCreate   bool
	BeforeTime string
	Eks        []*ExtentKey
	Flag       GcFlag
}

type GeneralResp added in v1.34.0

type GeneralResp struct {
	Message string
	Code    int32
}

func Success added in v1.34.0

func Success(msg string) *GeneralResp

type GetAllXAttrRequest added in v1.34.0

type GetAllXAttrRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	VerSeq      uint64 `json:"seq"`
}

type GetAllXAttrResponse added in v1.34.0

type GetAllXAttrResponse struct {
	VolName     string            `json:"vol"`
	PartitionId uint64            `json:"pid"`
	Inode       uint64            `json:"ino"`
	Attrs       map[string]string `json:"attrs"`
}

type GetExpiredMultipartRequest added in v1.34.0

type GetExpiredMultipartRequest struct {
	VolName     string `json:"vol"`
	Prefix      string `json:"path"`
	Days        int    `json:"days"`
	PartitionId uint64 `json:"pid"`
}

type GetExpiredMultipartResponse added in v1.34.0

type GetExpiredMultipartResponse struct {
	Infos []*ExpiredMultipartInfo `json:"infos"`
}

type GetExtentsRequest

type GetExtentsRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	VerSeq      uint64 `json:"seq"`
	VerAll      bool
}

GetExtentsRequest defines the reques to get extents.

type GetExtentsResponse

type GetExtentsResponse struct {
	Generation uint64      `json:"gen"`
	Size       uint64      `json:"sz"`
	Extents    []ExtentKey `json:"eks"`
	LayerInfo  []LayerInfo `json:"layer"`
	Status     int
}

GetExtentsResponse defines the response to the request of getting extents.

type GetInodeQuotaRequest added in v1.34.0

type GetInodeQuotaRequest struct {
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
}

type GetInodeQuotaResponse added in v1.34.0

type GetInodeQuotaResponse struct {
	MetaQuotaInfoMap map[uint32]*MetaQuotaInfo
}

type GetMultipartRequest added in v1.5.0

type GetMultipartRequest struct {
	VolName     string `json:"vol"`
	Path        string `json:"path"`
	PartitionId uint64 `json:"pid"`
	MultipartId string `json:"mid"`
}

type GetMultipartResponse added in v1.5.0

type GetMultipartResponse struct {
	Info *MultipartInfo `json:"info"`
}

type GetObjExtentsResponse added in v1.34.0

type GetObjExtentsResponse struct {
	Generation uint64         `json:"gen"`
	Size       uint64         `json:"sz"`
	Extents    []ExtentKey    `json:"eks"`
	ObjExtents []ObjExtentKey `json:"objeks"`
}

GetObjExtentsResponse defines the response to the request of getting obj extents.

type GetUniqIDRequest added in v1.34.0

type GetUniqIDRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Num         uint32 `json:"num"`
}

type GetUniqIDResponse added in v1.34.0

type GetUniqIDResponse struct {
	Start uint64 `json:"start"`
}

type GetXAttrRequest added in v1.5.0

type GetXAttrRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	Key         string `json:"key"`
	VerSeq      uint64 `json:"seq"`
}

type GetXAttrResponse added in v1.5.0

type GetXAttrResponse struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	Key         string `json:"key"`
	Value       string `json:"val"`
}

type HTTPAuthReply added in v1.5.0

type HTTPAuthReply = HTTPReply

HTTPAuthReply uniform response structure

func ParseAuthReply added in v1.5.0

func ParseAuthReply(body []byte) (jobj HTTPAuthReply, err error)

ParseAuthReply parse the response from auth

type HTTPReply

type HTTPReply struct {
	Code int32       `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

HTTPReply uniform response structure

type HTTPReplyRaw added in v1.34.0

type HTTPReplyRaw struct {
	Code int32           `json:"code"`
	Msg  string          `json:"msg"`
	Data json.RawMessage `json:"data"`
}

func (*HTTPReplyRaw) Bytes added in v1.34.0

func (raw *HTTPReplyRaw) Bytes() []byte

func (*HTTPReplyRaw) Int64 added in v1.34.0

func (raw *HTTPReplyRaw) Int64() (int64, error)

func (*HTTPReplyRaw) Result added in v1.34.0

func (raw *HTTPReplyRaw) Result(result interface{}) error

func (*HTTPReplyRaw) String added in v1.34.0

func (raw *HTTPReplyRaw) String() string

func (*HTTPReplyRaw) Success added in v1.34.0

func (raw *HTTPReplyRaw) Success() error

func (*HTTPReplyRaw) Uint64 added in v1.34.0

func (raw *HTTPReplyRaw) Uint64() (uint64, error)

func (*HTTPReplyRaw) Unmarshal added in v1.34.0

func (raw *HTTPReplyRaw) Unmarshal(body []byte) error

type HeartBeatRequest

type HeartBeatRequest struct {
	CurrTime   int64
	MasterAddr string
	FLReadVols []string
	QosToDataNode
	FileStatsEnable bool
	UidLimitToMetaNode
	QuotaHeartBeatInfos
	TxInfos
	ForbiddenVols        []string
	DisableAuditVols     []string
	DecommissionDisks    []string // NOTE: for datanode
	VolDpRepairBlockSize map[string]uint64
	DpBackupTimeout      string
}

HeartBeatRequest define the heartbeat request.

type HttpCfg added in v1.34.0

type HttpCfg struct {
	PoolSize int
}

type IgnoreDecommissionDP added in v1.34.0

type IgnoreDecommissionDP struct {
	PartitionID uint64
	ErrMsg      string
}

type InodeAccessTime added in v1.34.0

type InodeAccessTime struct {
	Inode      uint64    `json:"ino"`
	AccessTime time.Time `json:"at"`
}

type InodeGetAccessTimeResponse added in v1.34.0

type InodeGetAccessTimeResponse struct {
	Info *InodeAccessTime `json:"inodeAT"`
}

type InodeGetRequest

type InodeGetRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	VerSeq      uint64 `json:"seq"`
	VerAll      bool   `json:"verAll"`
}

InodeGetRequest defines the request to get the inode.

type InodeGetResponse

type InodeGetResponse struct {
	Info   *InodeInfo  `json:"info"`
	LayAll []InodeInfo `json:"layerInfo"`
}

InodeGetResponse defines the response to the InodeGetRequest.

type InodeGetSplitRequest added in v1.34.0

type InodeGetSplitRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	VerSeq      uint64 `json:"seq"`
	VerAll      bool   `json:"verAll"`
}

InodeGetRequest defines the request to get the inode.

type InodeGetSplitResponse added in v1.34.0

type InodeGetSplitResponse struct {
	Info   *InodeSplitInfo  `json:"info"`
	LayAll []InodeSplitInfo `json:"layerInfo"`
}

InodeGetResponse defines the response to the InodeGetRequest.

type InodeGetWithPersistAccessTimeResponse added in v1.34.0

type InodeGetWithPersistAccessTimeResponse struct {
	Info              *InodeInfo `json:"info"`
	PersistAccessTime time.Time  `json:"pat"`
}

type InodeInfo

type InodeInfo struct {
	Inode      uint64                    `json:"ino"`
	Mode       uint32                    `json:"mode"`
	Nlink      uint32                    `json:"nlink"`
	Size       uint64                    `json:"sz"`
	Uid        uint32                    `json:"uid"`
	Gid        uint32                    `json:"gid"`
	Generation uint64                    `json:"gen"`
	ModifyTime time.Time                 `json:"mt"`
	CreateTime time.Time                 `json:"ct"`
	AccessTime time.Time                 `json:"at"`
	Target     []byte                    `json:"tgt"`
	QuotaInfos map[uint32]*MetaQuotaInfo `json:"qifs"`
	VerSeq     uint64                    `json:"seq"`

	PersistAccessTime time.Time `json:"pat"`
	// contains filtered or unexported fields
}

InodeInfo defines the inode struct.

func (*InodeInfo) Expiration added in v1.34.0

func (info *InodeInfo) Expiration() int64

func (*InodeInfo) SetExpiration added in v1.34.0

func (info *InodeInfo) SetExpiration(e int64)

func (*InodeInfo) String

func (info *InodeInfo) String() string

String returns the string format of the inode.

type InodeSplitInfo added in v1.34.0

type InodeSplitInfo struct {
	Inode    uint64          `json:"ino"`
	SplitArr []SimpleExtInfo `json:"splitInfo"`
	VerSeq   uint64          `json:"seq"`
}

InodeInfo defines the inode struct.

type LayerInfo added in v1.34.0

type LayerInfo struct {
	LayerIdx uint32      `json:"layerIdx"`
	Info     *InodeInfo  `json:"info"`
	Eks      []ExtentKey `json:"eks"`
}

type LcConfiguration added in v1.34.0

type LcConfiguration struct {
	VolName string
	Rules   []*Rule
}

func (*LcConfiguration) GenEnabledRuleTasks added in v1.34.0

func (lcConf *LcConfiguration) GenEnabledRuleTasks() []*RuleTask

type LcNodeHeartbeatResponse added in v1.34.0

type LcNodeHeartbeatResponse struct {
	Status                uint8
	Result                string
	LcTaskCountLimit      int
	LcScanningTasks       map[string]*LcNodeRuleTaskResponse
	SnapshotScanningTasks map[string]*SnapshotVerDelTaskResponse
}

LcNodeHeartbeatResponse defines the response to the lc node heartbeat.

type LcNodeRuleTaskRequest added in v1.34.0

type LcNodeRuleTaskRequest struct {
	MasterAddr string
	LcNodeAddr string
	Task       *RuleTask
}

type LcNodeRuleTaskResponse added in v1.34.0

type LcNodeRuleTaskResponse struct {
	ID         string
	LcNode     string
	StartTime  *time.Time
	EndTime    *time.Time
	UpdateTime *time.Time
	Done       bool
	Status     uint8
	Result     string
	LcNodeRuleTaskStatistics
}

type LcNodeRuleTaskStatistics added in v1.34.0

type LcNodeRuleTaskStatistics struct {
	Volume               string
	RuleId               string
	TotalInodeScannedNum int64
	FileScannedNum       int64
	DirScannedNum        int64
	ExpiredNum           int64
	ErrorSkippedNum      int64
}

type LimitRsp2Client added in v1.34.0

type LimitRsp2Client struct {
	ID            uint64
	Enable        bool
	ReqPeriod     uint32
	HitTriggerCnt uint8
	FactorMap     map[uint32]*ClientLimitInfo
	Magnify       map[uint32]uint32
	Version       *VersionInfo
	// contains filtered or unexported fields
}

func NewLimitRsp2Client added in v1.34.0

func NewLimitRsp2Client() *LimitRsp2Client

type LinkInodeRequest

type LinkInodeRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	UniqID      uint64 `json:"uiq"`
	IsRename    bool   `json:"rename"`
	RequestExtend
}

LinkInodeRequest defines the request to link an inode.

type LinkInodeResponse

type LinkInodeResponse struct {
	Info *InodeInfo `json:"info"`
}

LinkInodeResponse defines the response to the request of linking an inode.

type ListMasterQuotaResponse added in v1.34.0

type ListMasterQuotaResponse struct {
	Quotas []*QuotaInfo
}

type ListMultipartRequest added in v1.5.0

type ListMultipartRequest struct {
	VolName           string `json:"vol"`
	PartitionId       uint64 `json:"pid"`
	Marker            string `json:"mk"`
	MultipartIdMarker string `json:"mmk"`
	Max               uint64 `json:"max"`
	Delimiter         string `json:"dm"`
	Prefix            string `json:"pf"`
}

type ListMultipartResponse added in v1.5.0

type ListMultipartResponse struct {
	Multiparts []*MultipartInfo `json:"mps"`
}

type ListXAttrRequest added in v1.5.0

type ListXAttrRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	VerSeq      uint64 `json:"seq"`
}

type ListXAttrResponse added in v1.5.0

type ListXAttrResponse struct {
	VolName     string   `json:"vol"`
	PartitionId uint64   `json:"pid"`
	Inode       uint64   `json:"ino"`
	XAttrs      []string `json:"xattrs"`
}

type LoadDataPartitionRequest

type LoadDataPartitionRequest struct {
	PartitionId uint64
}

LoadDataPartitionRequest defines the request of loading a data partition.

type LoadDataPartitionResponse

type LoadDataPartitionResponse struct {
	PartitionId       uint64
	Used              uint64
	PartitionSnapshot []*File
	Status            uint8
	PartitionStatus   int
	Result            string
	VolName           string
}

LoadDataPartitionResponse defines the response to the request of loading a data partition.

type LoadMetaPartitionMetricRequest

type LoadMetaPartitionMetricRequest struct {
	PartitionID uint64
	Start       uint64
	End         uint64
}

LoadMetaPartitionMetricRequest defines the request of loading the meta partition metrics.

type LoadMetaPartitionMetricResponse

type LoadMetaPartitionMetricResponse struct {
	Start    uint64
	End      uint64
	MaxInode uint64
	Status   uint8
	Result   string
}

LoadMetaPartitionMetricResponse defines the response to the request of loading the meta partition metrics.

type LockDirRequest added in v1.34.0

type LockDirRequest struct {
	VolName     string    `json:"vol"`
	PartitionId uint64    `json:"pid"`
	Inode       uint64    `json:"ino"`
	LockId      int64     `json:"lockId"`
	Lease       uint64    `json:"lease"`
	SubmitTime  time.Time `json:"submitTime"`
}

type LockDirResponse added in v1.34.0

type LockDirResponse struct {
	LockId int64 `json:"lockId"`
	Status uint8 `json:"status"`
}

type LookupRequest

type LookupRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	ParentID    uint64 `json:"pino"`
	Name        string `json:"name"`
	VerSeq      uint64 `json:"seq"`
	VerAll      bool   `json:"verAll"`
}

LookupRequest defines the request for lookup.

type LookupResponse

type LookupResponse struct {
	Inode  uint64      `json:"ino"`
	Mode   uint32      `json:"mode"`
	VerSeq uint64      `json:"seq"`
	LayAll []DetryInfo `json:"layerInfo"`
}

LookupResponse defines the response for the loopup request.

type MasterAPIAccessResp added in v1.5.0

type MasterAPIAccessResp struct {
	APIResp APIAccessResp `json:"api_resp"`
	Data    []byte        `json:"data"`
}

MasterAPIAccessResp defines the response for getting meta partition

type MetaNodeHeartbeatResponse

type MetaNodeHeartbeatResponse struct {
	ZoneName             string
	Total                uint64
	MemUsed              uint64
	MetaPartitionReports []*MetaPartitionReport
	Status               uint8
	Result               string
	CpuUtil              float64 `json:"cpuUtil"`
}

MetaNodeHeartbeatResponse defines the response to the meta node heartbeat request.

type MetaNodeInfo added in v1.5.0

type MetaNodeInfo struct {
	ID                        uint64
	Addr                      string
	DomainAddr                string
	IsActive                  bool
	IsWriteAble               bool
	ZoneName                  string `json:"Zone"`
	MaxMemAvailWeight         uint64 `json:"MaxMemAvailWeight"`
	Total                     uint64 `json:"TotalWeight"`
	Used                      uint64 `json:"UsedWeight"`
	Ratio                     float64
	SelectCount               uint64
	Threshold                 float32
	ReportTime                time.Time
	MetaPartitionCount        int
	NodeSetID                 uint64
	PersistenceMetaPartitions []uint64
	RdOnly                    bool
	CanAllowPartition         bool
	MaxMpCntLimit             uint32
	CpuUtil                   float64 `json:"cpuUtil"`
}

MetaNode defines the structure of a meta node

type MetaPartitionDecommissionRequest

type MetaPartitionDecommissionRequest struct {
	PartitionID uint64
	VolName     string
	RemovePeer  Peer
	AddPeer     Peer
}

MetaPartitionDecommissionRequest defines the request of decommissioning a meta partition.

type MetaPartitionDecommissionResponse

type MetaPartitionDecommissionResponse struct {
	PartitionID uint64
	VolName     string
	Status      uint8
	Result      string
}

MetaPartitionDecommissionResponse defines the response to the request of decommissioning a meta partition.

type MetaPartitionDiagnosis added in v1.34.0

type MetaPartitionDiagnosis struct {
	InactiveMetaNodes                          []string
	CorruptMetaPartitionIDs                    []uint64
	LackReplicaMetaPartitionIDs                []uint64
	BadMetaPartitionIDs                        []BadPartitionView
	BadReplicaMetaPartitionIDs                 []uint64
	ExcessReplicaMetaPartitionIDs              []uint64
	InodeCountNotEqualReplicaMetaPartitionIDs  []uint64
	MaxInodeNotEqualReplicaMetaPartitionIDs    []uint64
	DentryCountNotEqualReplicaMetaPartitionIDs []uint64
}

meta partition diagnosis represents the inactive meta nodes, corrupt meta partitions, and meta partitions lack of replicas

type MetaPartitionInfo added in v1.5.0

type MetaPartitionInfo struct {
	PartitionID   uint64
	Start         uint64
	End           uint64
	MaxInodeID    uint64
	InodeCount    uint64
	DentryCount   uint64
	VolName       string
	Replicas      []*MetaReplicaInfo
	ReplicaNum    uint8
	Status        int8
	IsRecover     bool
	Hosts         []string
	Peers         []Peer
	Zones         []string
	NodeSets      []uint64
	OfflinePeerID uint64
	MissNodes     map[string]int64
	LoadResponse  []*MetaPartitionLoadResponse
	Forbidden     bool
}

MetaPartition defines the structure of a meta partition

type MetaPartitionLoadRequest

type MetaPartitionLoadRequest struct {
	PartitionID uint64
}

MetaPartitionLoadRequest defines the request to load meta partition.

type MetaPartitionLoadResponse

type MetaPartitionLoadResponse struct {
	PartitionID uint64
	DoCompare   bool
	ApplyID     uint64
	CommittedID uint64
	MaxInode    uint64
	DentryCount uint64
	InodeCount  uint64
	Addr        string
}

MetaPartitionLoadResponse defines the response to the request of loading meta partition.

type MetaPartitionReport

type MetaPartitionReport struct {
	PartitionID      uint64
	Start            uint64
	End              uint64
	Status           int
	Size             uint64
	MaxInodeID       uint64
	IsLeader         bool
	VolName          string
	InodeCnt         uint64
	DentryCnt        uint64
	TxCnt            uint64
	TxRbInoCnt       uint64
	TxRbDenCnt       uint64
	FreeListLen      uint64
	UidInfo          []*UidReportSpaceInfo
	QuotaReportInfos []*QuotaReportInfo
}

MetaPartitionReport defines the meta partition report.

type MetaPartitionView

type MetaPartitionView struct {
	PartitionID uint64
	Start       uint64
	End         uint64
	MaxInodeID  uint64
	InodeCount  uint64
	DentryCount uint64
	FreeListLen uint64
	TxCnt       uint64
	TxRbInoCnt  uint64
	TxRbDenCnt  uint64
	IsRecover   bool
	Members     []string
	LeaderAddr  string
	Status      int8
}

MetaPartitionView defines the view of a meta partition

func NewMetaPartitionView

func NewMetaPartitionView(partitionID, start, end uint64, status int8) (mpView *MetaPartitionView)

type MetaQuotaInfo added in v1.34.0

type MetaQuotaInfo struct {
	RootInode bool `json:"rid"`
}

type MetaQuotaInfos added in v1.34.0

type MetaQuotaInfos struct {
	QuotaInfoMap map[uint32]*MetaQuotaInfo
	sync.RWMutex
}

type MetaReplicaInfo added in v1.5.0

type MetaReplicaInfo struct {
	Addr        string
	DomainAddr  string
	MaxInodeID  uint64
	ReportTime  int64
	Status      int8 // unavailable, readOnly, readWrite
	IsLeader    bool
	InodeCount  uint64
	MaxInode    uint64
	DentryCount uint64
}

MetaReplica defines the replica of a meta partition

type MountOption added in v1.34.0

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

func NewMountOptions added in v1.34.0

func NewMountOptions() []MountOption

func (*MountOption) GetBool added in v1.34.0

func (opt *MountOption) GetBool() bool

func (*MountOption) GetInt64 added in v1.34.0

func (opt *MountOption) GetInt64() int64

func (*MountOption) GetString added in v1.34.0

func (opt *MountOption) GetString() string

func (MountOption) String added in v1.34.0

func (opt MountOption) String() string

type MountOptions added in v1.34.0

type MountOptions struct {
	Config                       *config.Config
	MountPoint                   string
	Volname                      string
	Owner                        string
	Master                       string
	Logpath                      string
	Loglvl                       string
	Profport                     string
	LocallyProf                  bool
	IcacheTimeout                int64
	LookupValid                  int64
	AttrValid                    int64
	ReadRate                     int64
	WriteRate                    int64
	EnSyncWrite                  int64
	AutoInvalData                int64
	UmpDatadir                   string
	Rdonly                       bool
	WriteCache                   bool
	KeepCache                    bool
	FollowerRead                 bool
	Authenticate                 bool
	TicketMess                   auth.TicketMess
	TokenKey                     string
	AccessKey                    string
	SecretKey                    string
	DisableDcache                bool
	SubDir                       string
	FsyncOnClose                 bool
	MaxCPUs                      int64
	EnableXattr                  bool
	NearRead                     bool
	EnablePosixACL               bool
	EnableQuota                  bool
	EnableTransaction            string
	TxTimeout                    int64
	TxConflictRetryNum           int64
	TxConflictRetryInterval      int64
	VolType                      int
	EbsEndpoint                  string
	EbsServicePath               string
	CacheAction                  int
	CacheThreshold               int
	EbsBlockSize                 int
	EnableBcache                 bool
	BcacheDir                    string
	BcacheFilterFiles            string
	BcacheCheckIntervalS         int64
	BcacheBatchCnt               int64
	ReadThreads                  int64
	WriteThreads                 int64
	EnableSummary                bool
	EnableUnixPermission         bool
	NeedRestoreFuse              bool
	MetaSendTimeout              int64
	BuffersTotalLimit            int64
	BufferChanSize               int64
	MaxStreamerLimit             int64
	EnableAudit                  bool
	RequestTimeout               int64
	MinWriteAbleDataPartitionCnt int
	FileSystemName               string
	// TrashInterval                       int64
	TrashDeleteExpiredDirGoroutineLimit int64
	TrashRebuildGoroutineLimit          int64

	VerReadSeq uint64
	// disable mount subtype
	DisableMountSubtype bool
	// stream retry timeout
	StreamRetryTimeout int
}

type MsgType added in v1.5.0

type MsgType uint32

MsgType defines the type of req/resp for message

const (
	// MsgAuthBase define the starting value for auth message
	MsgAuthBase MsgType = 0x100000

	// MsgAuthTicketReq request type for an auth ticket
	MsgAuthTicketReq MsgType = MsgAuthBase + 0x10000

	// MsgAuthTicketResp respose type for an auth ticket
	MsgAuthTicketResp MsgType = MsgAuthBase + 0x10001

	// MsgMasterTicketReq request type for a master ticket
	MsgMasterTicketReq MsgType = MsgAuthBase + 0x20000

	// MsgMasterTicketResp response type for a master ticket
	MsgMasterTicketResp MsgType = MsgAuthBase + 0x20001

	// MsgMetaTicketReq request type for a metanode ticket
	MsgMetaTicketReq MsgType = MsgAuthBase + 0x30000

	// MsgMetaTicketResp response type for a metanode ticket
	MsgMetaTicketResp MsgType = MsgAuthBase + 0x30001

	// MsgDataTicketReq request type for a datanode ticket
	MsgDataTicketReq MsgType = MsgAuthBase + 0x40000

	// MsgDataTicketResp response type for a datanode ticket
	MsgDataTicketResp MsgType = MsgAuthBase + 0x40001

	// MsgAuthCreateKeyReq request type for authnode add key
	MsgAuthCreateKeyReq MsgType = MsgAuthBase + 0x51000

	// MsgAuthCreateKeyResp response type for authnode add key
	MsgAuthCreateKeyResp MsgType = MsgAuthBase + 0x51001

	// MsgAuthDeleteKeyReq request type for authnode delete key
	MsgAuthDeleteKeyReq MsgType = MsgAuthBase + 0x52000

	// MsgAuthDeleteKeyResp response type for authnode delete key
	MsgAuthDeleteKeyResp MsgType = MsgAuthBase + 0x52001

	// MsgAuthGetKeyReq request type for authnode get key info
	MsgAuthGetKeyReq MsgType = MsgAuthBase + 0x53000

	// MsgAuthGetKeyResp response type for authnode get key info
	MsgAuthGetKeyResp MsgType = MsgAuthBase + 0x53001

	// MsgAuthAddCapsReq request type for authnode add caps
	MsgAuthAddCapsReq MsgType = MsgAuthBase + 0x54000

	// MsgAuthAddCapsResp response type for authnode add caps
	MsgAuthAddCapsResp MsgType = MsgAuthBase + 0x54001

	// MsgAuthDeleteCapsReq request type for authnode add caps
	MsgAuthDeleteCapsReq MsgType = MsgAuthBase + 0x55000

	// MsgAuthDeleteCapsResp response type for authnode add caps
	MsgAuthDeleteCapsResp MsgType = MsgAuthBase + 0x55001

	// MsgAuthGetCapsReq request type for authnode add caps
	MsgAuthGetCapsReq MsgType = MsgAuthBase + 0x56000

	// MsgAuthGetCapsResp response type for authnode add caps
	MsgAuthGetCapsResp MsgType = MsgAuthBase + 0x56001

	// MsgAuthAddRaftNodeReq request type for authnode add node
	MsgAuthAddRaftNodeReq MsgType = MsgAuthBase + 0x57000

	// MsgAuthAddRaftNodeResp response type for authnode remove node
	MsgAuthAddRaftNodeResp MsgType = MsgAuthBase + 0x57001

	// MsgAuthRemoveRaftNodeReq request type for authnode remove node
	MsgAuthRemoveRaftNodeReq MsgType = MsgAuthBase + 0x58000

	// MsgAuthRemoveRaftNodeResp response type for authnode remove node
	MsgAuthRemoveRaftNodeResp MsgType = MsgAuthBase + 0x58001

	// MsgAuthOSAddCapsReq request type from ObjectNode to add caps
	MsgAuthOSAddCapsReq MsgType = MsgAuthBase + 0x61000

	// MsgAuthOSAddCapsResp request type from ObjectNode to add caps
	MsgAuthOSAddCapsResp MsgType = MsgAuthBase + 0x61001

	// MsgAuthOSDeleteCapsReq request type from ObjectNode to delete caps
	MsgAuthOSDeleteCapsReq MsgType = MsgAuthBase + 0x62000

	// MsgAuthOSDeleteCapsResp request type from ObjectNode to delete caps
	MsgAuthOSDeleteCapsResp MsgType = MsgAuthBase + 0x62001

	// MsgAuthOSGetCapsReq request type from ObjectNode to get caps
	MsgAuthOSGetCapsReq MsgType = MsgAuthBase + 0x63000

	// MsgAuthOSGetCapsResp response type from ObjectNode to get caps
	MsgAuthOSGetCapsResp MsgType = MsgAuthBase + 0x63001

	// MsgMasterAPIAccessReq request type for master api access
	MsgMasterAPIAccessReq MsgType = 0x60000

	// MsgMasterAPIAccessResp response type for master api access
	MsgMasterAPIAccessResp MsgType = 0x60001

	// Master API ClientVol
	MsgMasterFetchVolViewReq MsgType = MsgMasterAPIAccessReq + 0x10000

	// Master API cluster management
	MsgMasterClusterFreezeReq    MsgType = MsgMasterAPIAccessReq + 0x20100
	MsgMasterAddRaftNodeReq      MsgType = MsgMasterAPIAccessReq + 0x20200
	MsgMasterRemoveRaftNodeReq   MsgType = MsgMasterAPIAccessReq + 0x20300
	MsgMasterSetNodeInfoReq      MsgType = MsgMasterAPIAccessReq + 0x20400
	MsgMasterSetNodeRdOnlyReq    MsgType = MsgMasterAPIAccessReq + 0x20500
	MsgMasterAutoDecommissionReq MsgType = MsgMasterAPIAccessReq + 0x20600

	// Master API volume management
	MsgMasterCreateVolReq MsgType = MsgMasterAPIAccessReq + 0x30100
	MsgMasterDeleteVolReq MsgType = MsgMasterAPIAccessReq + 0x30200
	MsgMasterUpdateVolReq MsgType = MsgMasterAPIAccessReq + 0x30300
	MsgMasterVolShrinkReq MsgType = MsgMasterAPIAccessReq + 0x30400
	MsgMasterVolExpandReq MsgType = MsgMasterAPIAccessReq + 0x30500

	// Master API meta partition management
	MsgMasterLoadMetaPartitionReq         MsgType = MsgMasterAPIAccessReq + 0x40100
	MsgMasterDecommissionMetaPartitionReq MsgType = MsgMasterAPIAccessReq + 0x40200
	MsgMasterChangeMetaPartitionLeaderReq MsgType = MsgMasterAPIAccessReq + 0x40300
	MsgMasterCreateMetaPartitionReq       MsgType = MsgMasterAPIAccessReq + 0x40400
	MsgMasterAddMetaReplicaReq            MsgType = MsgMasterAPIAccessReq + 0x40500
	MsgMasterDeleteMetaReplicaReq         MsgType = MsgMasterAPIAccessReq + 0x40600
	MsgMasterQosUpdateReq                 MsgType = MsgMasterAPIAccessReq + 0x40700
	MsgMasterQosUpdateZoneLimitReq        MsgType = MsgMasterAPIAccessReq + 0x40800
	MsgMasterQosUpdateMasterLimitReq      MsgType = MsgMasterAPIAccessReq + 0x40900
	MsgMasterQosUpdateClientParamReq      MsgType = MsgMasterAPIAccessReq + 0x40a00

	// Master API data partition management
	MsgMasterCreateDataPartitionReq       MsgType = MsgMasterAPIAccessReq + 0x50100
	MsgMasterDataPartitionChangeLeaderReq MsgType = MsgMasterAPIAccessReq + 0x50200
	MsgMasterLoadDataPartitionReq         MsgType = MsgMasterAPIAccessReq + 0x50300
	MsgMasterDecommissionDataPartitionReq MsgType = MsgMasterAPIAccessReq + 0x50400
	MsgMasterAddDataReplicaReq            MsgType = MsgMasterAPIAccessReq + 0x50500
	MsgMasterDeleteDataReplicaReq         MsgType = MsgMasterAPIAccessReq + 0x50600
	MsgMasterSetDpRdOnlyReq               MsgType = MsgMasterAPIAccessReq + 0x50700
	MsgMasterReportLackDataPartitions     MsgType = MsgMasterAPIAccessReq + 0x50800

	// Master API meta node management
	MsgMasterAddMetaNodeReq          MsgType = MsgMasterAPIAccessReq + 0x60100
	MsgMasterDecommissionMetaNodeReq MsgType = MsgMasterAPIAccessReq + 0x60200
	MsgMasterMigrateMetaNodeReq      MsgType = MsgMasterAPIAccessReq + 0x60300
	MsgMasterSetMetaNodeThresholdReq MsgType = MsgMasterAPIAccessReq + 0x60400
	MsgMasterUpdateMetaNodeReq       MsgType = MsgMasterAPIAccessReq + 0x60500

	// Master API data node management
	MsgMasterAddDataNodeReq                MsgType = MsgMasterAPIAccessReq + 0x70100
	MsgMasterDecommissionDataNodeReq       MsgType = MsgMasterAPIAccessReq + 0x70200
	MsgMasterMigrateDataNodeReq            MsgType = MsgMasterAPIAccessReq + 0x70300
	MsgMasterCancelDecommissionDataNodeReq MsgType = MsgMasterAPIAccessReq + 0x70400
	MsgMasterDecommissionDiskReq           MsgType = MsgMasterAPIAccessReq + 0x70500
	MsgMasterUpdateNodeSetCapcityReq       MsgType = MsgMasterAPIAccessReq + 0x70600
	MsgMasterUpdateNodeSetIdReq            MsgType = MsgMasterAPIAccessReq + 0x70700
	MsgMasterUpdateDomainDataUseRatioReq   MsgType = MsgMasterAPIAccessReq + 0x70800
	MsgMasterUpdateZoneExcludeRatioReq     MsgType = MsgMasterAPIAccessReq + 0x70900
	MsgMasterRecommissionDiskReq           MsgType = MsgMasterAPIAccessReq + 0x70a00

	// Master API user management
	MsgMasterUserCreateReq          MsgType = MsgMasterAPIAccessReq + 0x80100
	MsgMasterUserDeleteReq          MsgType = MsgMasterAPIAccessReq + 0x80200
	MsgMasterUserUpdateReq          MsgType = MsgMasterAPIAccessReq + 0x80300
	MsgMasterUserUpdatePolicyReq    MsgType = MsgMasterAPIAccessReq + 0x80400
	MsgMasterUserRemovePolicyReq    MsgType = MsgMasterAPIAccessReq + 0x80500
	MsgMasterUserDeleteVolPolicyReq MsgType = MsgMasterAPIAccessReq + 0x80600
	MsgMasterUserTransferVolReq     MsgType = MsgMasterAPIAccessReq + 0x80700

	// Master API zone management
	MsgMasterUpdateZoneReq MsgType = MsgMasterAPIAccessReq + 0x90100
)

type MultiVersionOpRequest added in v1.34.0

type MultiVersionOpRequest struct {
	VolumeID   string
	VerSeq     uint64
	Op         uint8
	Addr       string
	VolVerList []*VolVersionInfo
}

MultiVersionOpRequest defines the request of

type MultiVersionOpResponse added in v1.34.0

type MultiVersionOpResponse struct {
	VolumeID string
	Addr     string
	Op       uint8
	VerSeq   uint64
	Status   uint8
	Result   string
}

MultiVersionOpResponse defines the response to the request of l.

type MultipartInfo added in v1.5.0

type MultipartInfo struct {
	ID       string               `json:"id"`
	Path     string               `json:"path"`
	InitTime time.Time            `json:"itime"`
	Parts    []*MultipartPartInfo `json:"parts"`
	Extend   map[string]string    `json:"extend"`
}

type MultipartPartInfo added in v1.5.0

type MultipartPartInfo struct {
	ID         uint16    `json:"id"`
	Inode      uint64    `json:"ino"`
	MD5        string    `json:"md5"`
	Size       uint64    `json:"sz"`
	UploadTime time.Time `json:"ut"`
}

type NodeSetInfo added in v1.34.0

type NodeSetInfo struct {
	ID           uint64
	ZoneName     string
	Capacity     int
	DataUseRatio float64
	MetaUseRatio float64
	MetaUsed     uint64
	MetaTotal    uint64
	MetaNodes    []*MetaNodeInfo
	DataUsed     uint64
	DataTotal    uint64
	DataNodes    []*DataNodeInfo
}

type NodeSetStat added in v1.34.0

type NodeSetStat struct {
	ID                  uint64
	Capacity            int
	Zone                string
	CanAllocMetaNodeCnt int
	CanAllocDataNodeCnt int
	MetaNodeNum         int
	DataNodeNum         int
}

type NodeSetStatInfo added in v1.34.0

type NodeSetStatInfo struct {
	ID                  uint64
	Capacity            int
	Zone                string
	CanAllocMetaNodeCnt int
	CanAllocDataNodeCnt int
	MetaNodes           []*NodeStatView
	DataNodes           []*NodeStatView
	DataNodeSelector    string
	MetaNodeSelector    string
}

type NodeSetView added in v1.34.0

type NodeSetView struct {
	DataNodeLen int
	MetaNodeLen int
	MetaNodes   []NodeView
	DataNodes   []NodeView
}

type NodeStatInfo added in v1.5.0

type NodeStatInfo struct {
	TotalGB     uint64
	UsedGB      uint64
	IncreasedGB int64
	UsedRatio   string
	AvailGB     uint64
}

type NodeStatView added in v1.34.0

type NodeStatView struct {
	Addr       string
	Status     bool
	DomainAddr string
	ID         uint64
	IsWritable bool
	Total      uint64
	Used       uint64
	Avail      uint64
}

type NodeView added in v1.5.0

type NodeView struct {
	Addr       string
	IsActive   bool
	DomainAddr string
	ID         uint64
	IsWritable bool
}

NodeView provides the view of the data or meta node.

type Nonce added in v1.5.0

type Nonce uint64

Nonce defines the nonce to mitigate the replay attack

type OSSSecure added in v1.5.0

type OSSSecure struct {
	AccessKey string
	SecretKey string
}

type ObjExtentKey added in v1.34.0

type ObjExtentKey struct {
	Cid        uint64 // cluster id
	CodeMode   uint8  // EC encode and decode mode
	BlobSize   uint32 // block size
	BlobsLen   uint32 // blob array length
	Size       uint64 // objExtentKey size
	Blobs      []Blob
	FileOffset uint64 // obj offset in file
	Crc        uint32
	// snapshot
	VerSeq uint64
	ModGen uint64
}

ObjExtentKey defines the extent key struct.

func (*ObjExtentKey) Copy added in v1.34.0

func (k *ObjExtentKey) Copy() btree.Item

Marshal marshals the obj extent key.

func (*ObjExtentKey) IsEquals added in v1.34.0

func (k *ObjExtentKey) IsEquals(obj *ObjExtentKey) bool

func (*ObjExtentKey) Less added in v1.34.0

func (k *ObjExtentKey) Less(than btree.Item) bool

Less defines the less comparator.

func (*ObjExtentKey) MarshalBinary added in v1.34.0

func (k *ObjExtentKey) MarshalBinary() ([]byte, error)

MarshalBinary marshals the binary format of the extent key.

func (ObjExtentKey) String added in v1.34.0

func (k ObjExtentKey) String() string

String returns the string format of the extentKey.

func (*ObjExtentKey) UnmarshalBinary added in v1.34.0

func (k *ObjExtentKey) UnmarshalBinary(buf *bytes.Buffer) (err error)

type OpLog added in v1.34.0

type OpLog struct {
	Name  string
	Op    string
	Count int32
}

type Packet

type Packet struct {
	Magic              uint8
	ExtentType         uint8 // the highest bit be set while rsp to client if version not consistent then Verseq be valid
	Opcode             uint8
	ResultCode         uint8
	RemainingFollowers uint8
	CRC                uint32
	Size               uint32
	ArgLen             uint32
	KernelOffset       uint64
	PartitionID        uint64
	ExtentID           uint64
	ExtentOffset       int64
	ReqID              int64
	Arg                []byte // for create or append ops, the data contains the address
	Data               []byte
	StartT             int64

	HasPrepare bool
	VerSeq     uint64 // only used in mod request to datanode
	VerList    []*VolVersionInfo
	// contains filtered or unexported fields
}

Packet defines the packet structure.

func NewPacket

func NewPacket() *Packet

NewPacket returns a new packet.

func NewPacketReqID

func NewPacketReqID() *Packet

NewPacketReqID returns a new packet with ReqID assigned.

func (*Packet) AddMesgLog added in v1.4.0

func (p *Packet) AddMesgLog(m string)

func (*Packet) GetCopy added in v1.34.0

func (p *Packet) GetCopy() *Packet

func (*Packet) GetOpMsg

func (p *Packet) GetOpMsg() (m string)

GetOpMsg returns the operation type.

func (*Packet) GetOpMsgWithReqAndResult added in v1.34.0

func (p *Packet) GetOpMsgWithReqAndResult() (m string)

func (*Packet) GetReqID

func (p *Packet) GetReqID() int64

func (*Packet) GetResultMsg

func (p *Packet) GetResultMsg() (m string)

GetResultMsg returns the result message.

func (*Packet) GetStoreType

func (p *Packet) GetStoreType() (m string)

GetStoreType returns the store type.

func (*Packet) GetUniqueLogId

func (p *Packet) GetUniqueLogId() (m string)

GetUniqueLogId returns the unique log ID.

func (*Packet) IsBatchDeleteExtents added in v1.34.0

func (p *Packet) IsBatchDeleteExtents() bool

func (*Packet) IsBatchLockNormalExtents added in v1.34.0

func (p *Packet) IsBatchLockNormalExtents() bool

func (*Packet) IsBatchUnlockNormalExtents added in v1.34.0

func (p *Packet) IsBatchUnlockNormalExtents() bool

func (*Packet) IsForwardPkt

func (p *Packet) IsForwardPkt() bool

IsForwardPkt returns if the packet is the forward packet (a packet that will be forwarded to the followers).

func (*Packet) IsRandomWrite added in v1.34.0

func (p *Packet) IsRandomWrite() bool

func (*Packet) IsReadOperation added in v1.34.0

func (p *Packet) IsReadOperation() bool

func (*Packet) IsVersionList added in v1.34.0

func (p *Packet) IsVersionList() bool

func (*Packet) IsWriteOperation added in v1.34.0

func (p *Packet) IsWriteOperation() bool

func (*Packet) LogMessage

func (p *Packet) LogMessage(action, remote string, start int64, err error) (m string)

LogMessage logs the given message.

func (*Packet) MarshalData

func (p *Packet) MarshalData(v interface{}) error

MarshalData marshals the packet data.

func (*Packet) MarshalHeader

func (p *Packet) MarshalHeader(out []byte)

MarshalHeader marshals the packet header.

func (*Packet) MarshalVersionSlice added in v1.34.0

func (p *Packet) MarshalVersionSlice() (data []byte, err error)

func (*Packet) PacketErrorWithBody

func (p *Packet) PacketErrorWithBody(code uint8, reply []byte)

PacketErrorWithBody sets the packet with error code whose body is filled with the given data.

func (*Packet) PacketOkReply

func (p *Packet) PacketOkReply()

PacketOkReply sets the result code as OpOk, and sets the body as empty.

func (*Packet) PacketOkWithBody

func (p *Packet) PacketOkWithBody(reply []byte)

PacketOkWithBody sets the result code as OpOk, and sets the body with the give data.

func (*Packet) PacketOkWithByte added in v1.34.0

func (p *Packet) PacketOkWithByte(reply []byte)

attention use for tmp byte arr, eg: json marshal data

func (*Packet) ReadFromConn

func (p *Packet) ReadFromConn(c net.Conn, timeoutSec int) (err error)

ReadFromConn reads the data from the given connection.

func (*Packet) ReadFromConnWithVer added in v1.34.0

func (p *Packet) ReadFromConnWithVer(c net.Conn, timeoutSec int) (err error)

ReadFromConn reads the data from the given connection. Recognize the version bit and parse out version, to avoid version field rsp back , the rsp of random write from datanode with replace OpRandomWriteVer to OpRandomWriteVerRsp

func (*Packet) SetPacketHasPrepare added in v1.4.0

func (p *Packet) SetPacketHasPrepare()

func (*Packet) SetPacketRePrepare added in v1.4.0

func (p *Packet) SetPacketRePrepare()

func (*Packet) ShouldRetry

func (p *Packet) ShouldRetry() bool

ShallRetry returns if we should retry the packet.

func (*Packet) ShouldRetryWithVersionList added in v1.34.0

func (p *Packet) ShouldRetryWithVersionList() bool

ShallRetry returns if we should retry the packet.

func (*Packet) String

func (p *Packet) String() string

func (*Packet) UnmarshalData

func (p *Packet) UnmarshalData(v interface{}) error

UnmarshalData unmarshals the packet data.

func (*Packet) UnmarshalHeader

func (p *Packet) UnmarshalHeader(in []byte) error

UnmarshalHeader unmarshals the packet header.

func (*Packet) UnmarshalVersionSlice added in v1.34.0

func (p *Packet) UnmarshalVersionSlice(cnt int, d []byte) error

func (*Packet) WriteToConn

func (p *Packet) WriteToConn(c net.Conn) (err error)

WriteToConn writes through the given connection.

func (*Packet) WriteToNoDeadLineConn

func (p *Packet) WriteToNoDeadLineConn(c net.Conn) (err error)

WriteToNoDeadLineConn writes through the connection without deadline.

type Peer

type Peer struct {
	ID   uint64 `json:"id"`
	Addr string `json:"addr"`
}

Peer defines the peer of the node id and address.

type Permission added in v1.34.0

type Permission string
const (
	// prefixes for value organization
	PermissionPrefix        Permission = "perm:"
	BuiltinPermissionPrefix Permission = PermissionPrefix + "builtin:"
	CustomPermissionPrefix  Permission = PermissionPrefix + "custom:"

	// constants for builtin permissions
	BuiltinPermissionReadOnly Permission = BuiltinPermissionPrefix + "ReadOnly"
	BuiltinPermissionWritable Permission = BuiltinPermissionPrefix + "Writable"

	// constants for unknown permission
	NonePermission Permission = ""
)

func NewCustomPermission added in v1.34.0

func NewCustomPermission(name string) Permission

func ParsePermission added in v1.34.0

func ParsePermission(value string) Permission

func (Permission) IsBuiltin added in v1.34.0

func (p Permission) IsBuiltin() bool

func (Permission) IsCustom added in v1.34.0

func (p Permission) IsCustom() bool

func (Permission) IsNone added in v1.34.0

func (p Permission) IsNone() bool

func (Permission) MatchSubdir added in v1.34.0

func (p Permission) MatchSubdir(subdir string) bool

func (Permission) ReadableString added in v1.34.0

func (p Permission) ReadableString() string

func (Permission) String added in v1.34.0

func (p Permission) String() string

func (Permission) Valid added in v1.34.0

func (p Permission) Valid() bool

type QosToDataNode added in v1.34.0

type QosToDataNode struct {
	EnableDiskQos     bool
	QosIopsReadLimit  uint64
	QosIopsWriteLimit uint64
	QosFlowReadLimit  uint64
	QosFlowWriteLimit uint64
}

type QuotaCreateDentryRequest added in v1.34.0

type QuotaCreateDentryRequest struct {
	VolName     string   `json:"vol"`
	PartitionID uint64   `json:"pid"`
	ParentID    uint64   `json:"pino"`
	Inode       uint64   `json:"ino"`
	Name        string   `json:"name"`
	Mode        uint32   `json:"mode"`
	QuotaIds    []uint32 `json:"qids"`
	VerSeq      uint64   `json:"seq"`
	RequestExtend
}

CreateDentryRequest defines the request to create a dentry.

type QuotaCreateInodeRequest added in v1.34.0

type QuotaCreateInodeRequest struct {
	VolName     string   `json:"vol"`
	PartitionID uint64   `json:"pid"`
	Mode        uint32   `json:"mode"`
	Uid         uint32   `json:"uid"`
	Gid         uint32   `json:"gid"`
	Target      []byte   `json:"tgt"`
	QuotaIds    []uint32 `json:"qids"`
	RequestExtend
}

CreateInodeRequest defines the request to create an inode.

type QuotaHeartBeatInfo added in v1.34.0

type QuotaHeartBeatInfo struct {
	VolName     string
	QuotaId     uint32
	LimitedInfo QuotaLimitedInfo
	Enable      bool
}

type QuotaHeartBeatInfos added in v1.34.0

type QuotaHeartBeatInfos struct {
	QuotaHbInfos []*QuotaHeartBeatInfo
}

type QuotaInfo added in v1.34.0

type QuotaInfo struct {
	VolName     string
	QuotaId     uint32
	CTime       int64
	PathInfos   []QuotaPathInfo
	LimitedInfo QuotaLimitedInfo
	UsedInfo    QuotaUsedInfo
	MaxFiles    uint64
	MaxBytes    uint64
	Rsv         string
}

func (*QuotaInfo) IsOverQuotaBytes added in v1.34.0

func (quotaInfo *QuotaInfo) IsOverQuotaBytes() (isOver bool)

func (*QuotaInfo) IsOverQuotaFiles added in v1.34.0

func (quotaInfo *QuotaInfo) IsOverQuotaFiles() (isOver bool)

type QuotaLimitedInfo added in v1.34.0

type QuotaLimitedInfo struct {
	LimitedFiles bool
	LimitedBytes bool
}

type QuotaPathInfo added in v1.34.0

type QuotaPathInfo struct {
	FullPath    string
	RootInode   uint64
	PartitionId uint64
}

type QuotaReportInfo added in v1.34.0

type QuotaReportInfo struct {
	QuotaId  uint32
	UsedInfo QuotaUsedInfo
}

type QuotaUsedInfo added in v1.34.0

type QuotaUsedInfo struct {
	UsedFiles int64
	UsedBytes int64
}

func (*QuotaUsedInfo) Add added in v1.34.0

func (usedInfo *QuotaUsedInfo) Add(info *QuotaUsedInfo)

type ReadDirLimitRequest added in v1.34.0

type ReadDirLimitRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	ParentID    uint64 `json:"pino"`
	Marker      string `json:"marker"`
	Limit       uint64 `json:"limit"`
	VerSeq      uint64 `json:"seq"`
	VerOpt      uint8  `json:"VerOpt"`
}

ReadDirLimitRequest defines the request to read dir with limited dentries.

type ReadDirLimitResponse added in v1.34.0

type ReadDirLimitResponse struct {
	Children []Dentry `json:"children"`
}

type ReadDirOnlyRequest added in v1.34.0

type ReadDirOnlyRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	ParentID    uint64 `json:"pino"`
	VerSeq      uint64 `json:"seq"`
}

type ReadDirOnlyResponse added in v1.34.0

type ReadDirOnlyResponse struct {
	Children []Dentry `json:"children"`
}

type ReadDirRequest

type ReadDirRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	ParentID    uint64 `json:"pino"`
	VerSeq      uint64 `json:"seq"`
}

ReadDirRequest defines the request to read dir.

type ReadDirResponse

type ReadDirResponse struct {
	Children []Dentry `json:"children"`
}

ReadDirResponse defines the response to the request of reading dir.

type RecoverBackupDataReplicaRequest added in v1.34.0

type RecoverBackupDataReplicaRequest struct {
	PartitionId uint64
	Disk        string
}

type RecoverBadDiskRequest added in v1.34.0

type RecoverBadDiskRequest struct {
	DiskPath string
}

type RecoverDataReplicaMetaRequest added in v1.34.0

type RecoverDataReplicaMetaRequest struct {
	PartitionId uint64
	Peers       []Peer
	Hosts       []string
}

type RegisterMetaNodeResp

type RegisterMetaNodeResp struct {
	ID uint64
}

RegisterMetaNodeResp defines the response to register a meta node.

type RemoveDataPartitionRaftMemberRequest added in v1.4.0

type RemoveDataPartitionRaftMemberRequest struct {
	PartitionId uint64
	RemovePeer  Peer
	Force       bool
	AutoRemove  bool
}

RemoveDataPartitionRaftMemberRequest defines the request of add raftMember a data partition.

type RemoveMetaPartitionRaftMemberRequest added in v1.4.0

type RemoveMetaPartitionRaftMemberRequest struct {
	PartitionId uint64
	RemovePeer  Peer
}

RemoveMetaPartitionRaftMemberRequest defines the request of add raftMember a meta partition.

type RemoveMultipartRequest added in v1.5.0

type RemoveMultipartRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Path        string `json:"path"`
	MultipartId string `json:"mid"`
}

type RemoveXAttrRequest added in v1.5.0

type RemoveXAttrRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	Key         string `json:"key"`
	VerSeq      uint64 `json:"seq"`
}

type RequestExtend added in v1.34.0

type RequestExtend struct {
	FullPaths []string `json:"fullPaths"`
}

func (*RequestExtend) GetFullPath added in v1.34.0

func (r *RequestExtend) GetFullPath() string

NOTE: batch request may have multi full path values, but other request only have one

type Rule added in v1.34.0

type Rule struct {
	Expire *ExpirationConfig
	Filter *FilterConfig
	ID     string
	Status string
}

type RuleTask added in v1.34.0

type RuleTask struct {
	Id      string
	VolName string
	Rule    *Rule
}

type S3QoSResponse added in v1.34.0

type S3QoSResponse struct {
	ApiLimitConf map[string]*UserLimitConf `json:"user_limit_conf"` // api --> userLimitConf
	Nodes        uint64                    `json:"nodes"`
}

type S3QosRequest added in v1.34.0

type S3QosRequest struct {
	Uid   string `json:"uid"`
	Api   string `json:"api"`
	Type  string `json:"type"`
	Quota uint64 `json:"quota"`
	Nodes uint64 `json:"nodes"`
}

type ScanDentry added in v1.34.0

type ScanDentry struct {
	ParentId uint64 `json:"pid"`   // FileID value of the parent inode.
	Inode    uint64 `json:"inode"` // FileID value of the current inode.
	Name     string `json:"name"`  // Name of the current dentry.
	Path     string `json:"path"`  // Path of the current dentry.
	Type     uint32 `json:"type"`  // Type of the current dentry.
}

type ServiceID added in v1.5.0

type ServiceID uint32

ServiceID defines the type of tickets

type SetAttrRequest

type SetAttrRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	Mode        uint32 `json:"mode"`
	Uid         uint32 `json:"uid"`
	Gid         uint32 `json:"gid"`
	ModifyTime  int64  `json:"mt"`
	AccessTime  int64  `json:"at"`
	Valid       uint32 `json:"valid"`
	VerSeq      uint64 `json:"seq"`
}

SetAttrRequest defines the request to set attribute.

type SetMasterQuotaReuqest added in v1.34.0

type SetMasterQuotaReuqest struct {
	VolName   string          `json:"vol"`
	PathInfos []QuotaPathInfo `json:"pinfos"`
	MaxFiles  uint64          `json:"mf"`
	MaxBytes  uint64          `json:"mbyte"`
}

type SetXAttrRequest added in v1.5.0

type SetXAttrRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	Key         string `json:"key"`
	Value       string `json:"val"`
}

type SimpleExtInfo added in v1.34.0

type SimpleExtInfo struct {
	ID          uint64
	PartitionID uint32
	ExtentID    uint32
}

type SimpleNodeSetGrpInfo added in v1.34.0

type SimpleNodeSetGrpInfo struct {
	ID          uint64
	Status      uint8
	NodeSetInfo []NodeSetInfo
}

type SimpleNodeSetGrpInfoList added in v1.34.0

type SimpleNodeSetGrpInfoList struct {
	DomainId             uint64
	Status               uint8
	SimpleNodeSetGrpInfo []*SimpleNodeSetGrpInfo
}

type SimpleVolView

type SimpleVolView struct {
	ID                      uint64
	Name                    string
	Owner                   string
	ZoneName                string
	DpReplicaNum            uint8
	MpReplicaNum            uint8
	InodeCount              uint64
	DentryCount             uint64
	MaxMetaPartitionID      uint64
	Status                  uint8
	Capacity                uint64 // GB
	RwDpCnt                 int
	MpCnt                   int
	DpCnt                   int
	FollowerRead            bool
	NeedToLowerReplica      bool
	Authenticate            bool
	CrossZone               bool
	DefaultPriority         bool
	DomainOn                bool
	CreateTime              string
	DeleteLockTime          int64
	EnableToken             bool
	EnablePosixAcl          bool
	EnableQuota             bool
	EnableTransactionV1     string
	EnableTransaction       string
	TxTimeout               int64
	TxConflictRetryNum      int64
	TxConflictRetryInterval int64
	TxOpLimit               int
	Description             string
	DpSelectorName          string
	DpSelectorParm          string
	DefaultZonePrior        bool
	DpReadOnlyWhenVolFull   bool

	VolType          int
	ObjBlockSize     int
	CacheCapacity    uint64
	CacheAction      int
	CacheThreshold   int
	CacheHighWater   int
	CacheLowWater    int
	CacheLruInterval int
	CacheTtl         int
	CacheRule        string
	PreloadCapacity  uint64
	Uids             []UidSimpleInfo
	TrashInterval    int64

	// multi version snapshot
	LatestVer               uint64
	Forbidden               bool
	DisableAuditLog         bool
	DeleteExecTime          time.Time
	DpRepairBlockSize       uint64
	EnableAutoDpMetaRepair  bool
	AccessTimeInterval      int64
	EnablePersistAccessTime bool
}

SimpleVolView defines the simple view of a volume

type SnapshotStatistics added in v1.34.0

type SnapshotStatistics struct {
	VolName         string
	VerSeq          uint64
	TotalInodeNum   int64
	FileNum         int64
	DirNum          int64
	ErrorSkippedNum int64
}

type SnapshotVerDelTask added in v1.34.0

type SnapshotVerDelTask struct {
	Id             string
	VolName        string
	VolVersionInfo *VolVersionInfo
}

type SnapshotVerDelTaskRequest added in v1.34.0

type SnapshotVerDelTaskRequest struct {
	MasterAddr string
	LcNodeAddr string
	Task       *SnapshotVerDelTask
}

type SnapshotVerDelTaskResponse added in v1.34.0

type SnapshotVerDelTaskResponse struct {
	ID                 string
	LcNode             string
	StartTime          *time.Time
	EndTime            *time.Time
	UpdateTime         *time.Time
	Done               bool
	Status             uint8
	Result             string
	SnapshotVerDelTask *SnapshotVerDelTask
	SnapshotStatistics
}

type StopDataPartitionRepairRequest added in v1.34.0

type StopDataPartitionRepairRequest struct {
	PartitionId uint64
	Stop        bool
}

type StopDataPartitionRepairResponse added in v1.34.0

type StopDataPartitionRepairResponse struct {
	Status      uint8
	Result      string
	PartitionId uint64
}

DeleteDataPartitionResponse defines the response to the request of deleting a data partition.

type SummaryInfo added in v1.34.0

type SummaryInfo struct {
	Files   int64 `json:"files"`
	Subdirs int64 `json:"subdirs"`
	Fbytes  int64 `json:"fbytes"`
}

type TinyExtentDeleteRecord

type TinyExtentDeleteRecord struct {
	FileOffset   uint64
	PartitionId  uint64
	ExtentId     uint64
	ExtentOffset uint64
	Size         uint32
	CRC          uint32
}

type TopologyView added in v1.34.0

type TopologyView struct {
	Zones []*ZoneView
}

TopologyView provides the view of the topology view of the cluster

type TransactionInfo added in v1.34.0

type TransactionInfo struct {
	TxID       string // "metapartitionId_atomicId", if empty, mp should be TM, otherwise it will be RM
	TxType     uint32
	TmID       int64
	CreateTime int64 // time.Now()
	Timeout    int64 // minutes
	State      int32
	DoneTime   int64 // time.now()
	RMFinish   bool  // used to check whether tx success on target rm.
	// once insert to txTree, not change inode & dentry ifo
	TxInodeInfos  map[uint64]*TxInodeInfo
	TxDentryInfos map[string]*TxDentryInfo
	LastCheckTime int64
}

func NewTransactionInfo added in v1.34.0

func NewTransactionInfo(timeout int64, txType uint32) *TransactionInfo

func NewTxInfoBItem added in v1.34.0

func NewTxInfoBItem(txId string) *TransactionInfo

func (*TransactionInfo) CanDelete added in v1.34.0

func (tx *TransactionInfo) CanDelete() bool

func (*TransactionInfo) Copy added in v1.34.0

func (txInfo *TransactionInfo) Copy() btree.Item

Copy returns a copy of the inode.

func (*TransactionInfo) Finish added in v1.34.0

func (tx *TransactionInfo) Finish() bool

func (*TransactionInfo) GetCopy added in v1.34.0

func (txInfo *TransactionInfo) GetCopy() *TransactionInfo

func (*TransactionInfo) GetInfo added in v1.34.0

func (txInfo *TransactionInfo) GetInfo() string

func (*TransactionInfo) GroupByMp added in v1.34.0

func (tx *TransactionInfo) GroupByMp() map[uint64]*TxMpInfo

func (*TransactionInfo) IsDone added in v1.34.0

func (tx *TransactionInfo) IsDone() bool

func (*TransactionInfo) IsExpired added in v1.34.0

func (txInfo *TransactionInfo) IsExpired() (expired bool)

func (*TransactionInfo) IsInitialized added in v1.34.0

func (txInfo *TransactionInfo) IsInitialized() bool

func (*TransactionInfo) Less added in v1.34.0

func (txInfo *TransactionInfo) Less(than btree.Item) bool

Less tests whether the current TransactionInfo item is less than the given one. This method is necessary fot B-Tree item implementation.

func (*TransactionInfo) Marshal added in v1.34.0

func (txInfo *TransactionInfo) Marshal() (result []byte, err error)

func (*TransactionInfo) NeedClearOrphan added in v1.34.0

func (tx *TransactionInfo) NeedClearOrphan() bool

func (*TransactionInfo) SetCreateInodeId added in v1.34.0

func (tx *TransactionInfo) SetCreateInodeId(ino uint64)

func (*TransactionInfo) SetFinish added in v1.34.0

func (tx *TransactionInfo) SetFinish()

func (*TransactionInfo) String added in v1.34.0

func (txInfo *TransactionInfo) String() string

func (*TransactionInfo) Unmarshal added in v1.34.0

func (txInfo *TransactionInfo) Unmarshal(raw []byte) (err error)

type TruncateRequest

type TruncateRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	Size        uint64 `json:"sz"`
	RequestExtend
}

TruncateRequest defines the request to truncate.

type TxApplyRMRequest added in v1.34.0

type TxApplyRMRequest struct {
	VolName          string `json:"vol"`
	PartitionID      uint64 `json:"pid"`
	*TransactionInfo `json:"tx"`
}

type TxApplyRequest added in v1.34.0

type TxApplyRequest struct {
	TxID        string `json:"tx"`
	TmID        uint64 `json:"tmid"`
	TxApplyType int    `json:"type"`
}

type TxCreateDentryRequest added in v1.34.0

type TxCreateDentryRequest struct {
	VolName     string           `json:"vol"`
	PartitionID uint64           `json:"pid"`
	ParentID    uint64           `json:"pino"`
	Inode       uint64           `json:"ino"`
	Name        string           `json:"name"`
	Mode        uint32           `json:"mode"`
	QuotaIds    []uint32         `json:"qids"`
	TxInfo      *TransactionInfo `json:"tx"`
	RequestExtend
}

TxCreateDentryRequest defines the request to create a dentry.

func (*TxCreateDentryRequest) GetInfo added in v1.34.0

func (tx *TxCreateDentryRequest) GetInfo() string

type TxCreateDentryResponse added in v1.34.0

type TxCreateDentryResponse struct {
	TxInfo *TransactionInfo `json:"tx"`
}

type TxCreateInodeRequest added in v1.34.0

type TxCreateInodeRequest struct {
	VolName     string           `json:"vol"`
	PartitionID uint64           `json:"pid"`
	Mode        uint32           `json:"mode"`
	Uid         uint32           `json:"uid"`
	Gid         uint32           `json:"gid"`
	Target      []byte           `json:"tgt"`
	QuotaIds    []uint32         `json:"qids"`
	TxInfo      *TransactionInfo `json:"tx"`
	RequestExtend
}

TxCreateInodeRequest defines the request to create an inode with transaction info.

type TxCreateInodeResponse added in v1.34.0

type TxCreateInodeResponse struct {
	Info   *InodeInfo       `json:"info"`
	TxInfo *TransactionInfo `json:"tx"`
}

TxCreateInodeResponse defines the response with transaction info to the request of creating an inode.

type TxCreateRequest added in v1.34.0

type TxCreateRequest struct {
	VolName          string `json:"vol"`
	PartitionID      uint64 `json:"pid"`
	*TransactionInfo `json:"tx"`
}

type TxCreateResponse added in v1.34.0

type TxCreateResponse struct {
	TxInfo *TransactionInfo `json:"tx"`
}

type TxDeleteDentryRequest added in v1.34.0

type TxDeleteDentryRequest struct {
	VolName     string           `json:"vol"`
	PartitionID uint64           `json:"pid"`
	ParentID    uint64           `json:"pino"`
	Name        string           `json:"name"`
	Ino         uint64           `json:"ino"`
	TxInfo      *TransactionInfo `json:"tx"`
	RequestExtend
}

func (*TxDeleteDentryRequest) GetInfo added in v1.34.0

func (tx *TxDeleteDentryRequest) GetInfo() string

type TxDeleteDentryResponse added in v1.34.0

type TxDeleteDentryResponse struct {
	Inode uint64 `json:"ino"`
}

type TxDentryApplyRequest added in v1.34.0

type TxDentryApplyRequest struct {
	TxID string `json:"txid"`
	// DenKey      string `json:"denkey"`
	Pid         uint64 `json:"pid"`
	Name        string `json:"name"`
	TxApplyType int    `json:"type"`
	ApplyFrom   uint32 `json:"from"`
}

type TxDentryInfo added in v1.34.0

type TxDentryInfo struct {
	ParentId   uint64 // FileID value of the parent inode.
	Name       string // Name of the current dentry.
	MpMembers  string
	TxID       string
	MpID       uint64
	CreateTime int64 // time.Now().Unix()
	Timeout    int64
}

func NewTxDentryInfo added in v1.34.0

func NewTxDentryInfo(members string, parentId uint64, name string, mpID uint64) *TxDentryInfo

func (*TxDentryInfo) GetKey added in v1.34.0

func (info *TxDentryInfo) GetKey() string

func (*TxDentryInfo) GetTxId added in v1.34.0

func (info *TxDentryInfo) GetTxId() (string, error)

func (*TxDentryInfo) Marshal added in v1.34.0

func (info *TxDentryInfo) Marshal() (result []byte, err error)

func (*TxDentryInfo) SetCreateTime added in v1.34.0

func (info *TxDentryInfo) SetCreateTime(createTime int64)

func (*TxDentryInfo) SetTimeout added in v1.34.0

func (info *TxDentryInfo) SetTimeout(timeout int64)

func (*TxDentryInfo) SetTxId added in v1.34.0

func (info *TxDentryInfo) SetTxId(txID string)

func (*TxDentryInfo) String added in v1.34.0

func (info *TxDentryInfo) String() string

func (*TxDentryInfo) Unmarshal added in v1.34.0

func (info *TxDentryInfo) Unmarshal(raw []byte) (err error)

type TxGetInfoRequest added in v1.34.0

type TxGetInfoRequest struct {
	VolName string `json:"vol"`
	TxID    string `json:"txid"`
	Pid     uint64 `json:"pid"`
}

type TxGetInfoResponse added in v1.34.0

type TxGetInfoResponse struct {
	TxInfo *TransactionInfo `json:"tx"`
}

type TxInfo added in v1.34.0

type TxInfo struct {
	Volume     string
	Mask       TxOpMask
	OpLimitVal int
}

type TxInfos added in v1.34.0

type TxInfos struct {
	TxInfo []*TxInfo
}

type TxInodeApplyRequest added in v1.34.0

type TxInodeApplyRequest struct {
	TxID        string `json:"txid"`
	Inode       uint64 `json:"ino"`
	TxApplyType int    `json:"type"`
	ApplyFrom   uint32 `json:"from"`
}

type TxInodeInfo added in v1.34.0

type TxInodeInfo struct {
	Ino        uint64
	MpID       uint64
	CreateTime int64 // time.Now().Unix()
	Timeout    int64
	TxID       string
	MpMembers  string
}

func NewTxInodeInfo added in v1.34.0

func NewTxInodeInfo(members string, ino uint64, mpID uint64) *TxInodeInfo

func (*TxInodeInfo) GetKey added in v1.34.0

func (info *TxInodeInfo) GetKey() uint64

func (*TxInodeInfo) Marshal added in v1.34.0

func (info *TxInodeInfo) Marshal() (result []byte, err error)

func (*TxInodeInfo) SetCreateTime added in v1.34.0

func (info *TxInodeInfo) SetCreateTime(createTime int64)

func (*TxInodeInfo) SetTimeout added in v1.34.0

func (info *TxInodeInfo) SetTimeout(timeout int64)

func (*TxInodeInfo) SetTxId added in v1.34.0

func (info *TxInodeInfo) SetTxId(txID string)

func (*TxInodeInfo) String added in v1.34.0

func (info *TxInodeInfo) String() string

func (*TxInodeInfo) Unmarshal added in v1.34.0

func (info *TxInodeInfo) Unmarshal(raw []byte) (err error)

type TxLinkInodeRequest added in v1.34.0

type TxLinkInodeRequest struct {
	VolName     string           `json:"vol"`
	PartitionID uint64           `json:"pid"`
	Inode       uint64           `json:"ino"`
	TxInfo      *TransactionInfo `json:"tx"`
	RequestExtend
}

func (*TxLinkInodeRequest) GetInfo added in v1.34.0

func (tx *TxLinkInodeRequest) GetInfo() string

type TxLinkInodeResponse added in v1.34.0

type TxLinkInodeResponse struct {
	Info *InodeInfo `json:"info"`
}

type TxMpInfo added in v1.34.0

type TxMpInfo struct {
	MpId          uint64
	Members       string
	TxInodeInfos  map[uint64]*TxInodeInfo
	TxDentryInfos map[string]*TxDentryInfo
}

type TxOpMask added in v1.34.0

type TxOpMask uint8
const (
	TxOpMaskOff TxOpMask = 0x00
	TxOpMaskAll TxOpMask = 0x7F
	TxPause     TxOpMask = 0xFF
)
const (
	TxOpMaskCreate TxOpMask = 0x01 << iota
	TxOpMaskMkdir
	TxOpMaskRemove
	TxOpMaskRename
	TxOpMaskMknod
	TxOpMaskSymlink
	TxOpMaskLink
)

func GetMaskFromString added in v1.34.0

func GetMaskFromString(maskStr string) (mask TxOpMask, err error)

type TxPack added in v1.34.0

type TxPack interface {
	GetInfo() string
}

type TxSetStateRequest added in v1.34.0

type TxSetStateRequest struct {
	TxID  string `json:"tx"`
	State int32  `json:"state"`
}

type TxUnlinkInodeRequest added in v1.34.0

type TxUnlinkInodeRequest struct {
	VolName     string           `json:"vol"`
	PartitionID uint64           `json:"pid"`
	Inode       uint64           `json:"ino"`
	Evict       bool             `json:"evict"`
	TxInfo      *TransactionInfo `json:"tx"`
	RequestExtend
}

func (*TxUnlinkInodeRequest) GetInfo added in v1.34.0

func (tx *TxUnlinkInodeRequest) GetInfo() string

type TxUnlinkInodeResponse added in v1.34.0

type TxUnlinkInodeResponse struct {
	Info   *InodeInfo       `json:"info"`
	TxInfo *TransactionInfo `json:"tx"`
}

type TxUpdateDentryRequest added in v1.34.0

type TxUpdateDentryRequest struct {
	VolName     string           `json:"vol"`
	PartitionID uint64           `json:"pid"`
	ParentID    uint64           `json:"pino"`
	Name        string           `json:"name"`
	Inode       uint64           `json:"ino"`    // new inode number
	OldIno      uint64           `json:"oldIno"` // new inode number
	TxInfo      *TransactionInfo `json:"tx"`
	RequestExtend
}

func (*TxUpdateDentryRequest) GetInfo added in v1.34.0

func (tx *TxUpdateDentryRequest) GetInfo() string

type TxUpdateDentryResponse added in v1.34.0

type TxUpdateDentryResponse struct {
	Inode uint64 `json:"ino"` // old inode number
}

type UidLimitToMetaNode added in v1.34.0

type UidLimitToMetaNode struct {
	UidLimitInfo []*UidSpaceInfo
}

type UidReportSpaceInfo added in v1.34.0

type UidReportSpaceInfo struct {
	Uid   uint32
	Size  uint64
	Rsv   string
	MTime int64
}

type UidSimpleInfo added in v1.34.0

type UidSimpleInfo struct {
	UID     uint32
	Limited bool
}

type UidSpaceInfo added in v1.34.0

type UidSpaceInfo struct {
	VolName   string
	Uid       uint32
	CTime     int64
	Enabled   bool
	Limited   bool
	UsedSize  uint64
	LimitSize uint64
	Rsv       string
}

type UidSpaceRsp added in v1.34.0

type UidSpaceRsp struct {
	Info        string
	OK          bool
	UidSpaceArr []*UidSpaceInfo
	Reserve     string
}

type UnlinkInodeRequest

type UnlinkInodeRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	UniqID      uint64 `json:"uid"` // for request dedup
	VerSeq      uint64 `json:"ver"`
	DenVerSeq   uint64 `json:"denVer"`
	RequestExtend
}

UnlinkInodeRequest defines the request to unlink an inode.

type UnlinkInodeResponse

type UnlinkInodeResponse struct {
	Info *InodeInfo `json:"info"`
}

UnlinkInodeResponse defines the response to the request of unlinking an inode.

type UpdateDentryRequest

type UpdateDentryRequest struct {
	VolName     string `json:"vol"`
	PartitionID uint64 `json:"pid"`
	ParentID    uint64 `json:"pino"`
	Name        string `json:"name"`
	Inode       uint64 `json:"ino"` // new inode number
	RequestExtend
}

UpdateDentryRequest defines the request to update a dentry.

type UpdateDentryResponse

type UpdateDentryResponse struct {
	Inode uint64 `json:"ino"` // old inode number
}

UpdateDentryResponse defines the response to the request of updating a dentry.

type UpdateMasterQuotaReuqest added in v1.34.0

type UpdateMasterQuotaReuqest struct {
	VolName  string `json:"vol"`
	QuotaId  uint32 `json:"qid"`
	MaxFiles uint64 `json:"mf"`
	MaxBytes uint64 `json:"mbyte"`
}

type UpdateMetaPartitionRequest

type UpdateMetaPartitionRequest struct {
	PartitionID uint64
	VolName     string
	Start       uint64
	End         uint64
}

UpdateMetaPartitionRequest defines the request to update a meta partition.

type UpdateMetaPartitionResponse

type UpdateMetaPartitionResponse struct {
	PartitionID uint64
	VolName     string
	End         uint64
	Status      uint8
	Result      string
}

UpdateMetaPartitionResponse defines the response to the request of updating the meta partition.

type UpdateSummaryInfoRequest added in v1.34.0

type UpdateSummaryInfoRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	Key         string `json:"key"`
	FileInc     int64  `json:"fileinc"`
	DirInc      int64  `json:"dirinc"`
	ByteInc     int64  `json:"byteinc"`
}

type UpdateXAttrRequest added in v1.34.0

type UpdateXAttrRequest struct {
	VolName     string `json:"vol"`
	PartitionId uint64 `json:"pid"`
	Inode       uint64 `json:"ino"`
	Key         string `json:"key"`
	Value       string `json:"val"`
}

type UserCreateParam added in v1.34.0

type UserCreateParam struct {
	ID          string   `json:"id"`
	Password    string   `json:"pwd"`
	AccessKey   string   `json:"ak"`
	SecretKey   string   `json:"sk"`
	Type        UserType `json:"type"`
	Description string   `json:"description"`
}

type UserInfo added in v1.34.0

type UserInfo struct {
	UserID      string       `json:"user_id" graphql:"user_id"`
	AccessKey   string       `json:"access_key" graphql:"access_key"`
	SecretKey   string       `json:"secret_key" graphql:"secret_key"`
	Policy      *UserPolicy  `json:"policy" graphql:"policy"`
	UserType    UserType     `json:"user_type" graphql:"user_type"`
	CreateTime  string       `json:"create_time" graphql:"create_time"`
	Description string       `json:"description" graphql:"description"`
	Mu          sync.RWMutex `json:"-" graphql:"-"`
	EMPTY       bool         // graphql need ???
}

func NewUserInfo added in v1.34.0

func NewUserInfo() *UserInfo

func (*UserInfo) String added in v1.34.0

func (i *UserInfo) String() string

type UserLimitConf added in v1.34.0

type UserLimitConf struct {
	BandWidthQuota  map[string]uint64 `json:"band_width_quota"` // uid --> BytesPS
	QPSQuota        map[string]uint64 `json:"qps_quota"`        // uid --> QPS
	ConcurrentQuota map[string]uint64 `json:"concurrent_quota"` // uid --> concurrency
}

type UserPermRemoveParam added in v1.34.0

type UserPermRemoveParam struct {
	UserID string `json:"user_id"`
	Volume string `json:"volume"`
}

func NewUserPermRemoveParam added in v1.34.0

func NewUserPermRemoveParam(userID, volmue string) *UserPermRemoveParam

type UserPermUpdateParam added in v1.34.0

type UserPermUpdateParam struct {
	UserID string   `json:"user_id"`
	Volume string   `json:"volume"`
	Subdir string   `json:"subdir"`
	Policy []string `json:"policy"`
}

func NewUserPermUpdateParam added in v1.34.0

func NewUserPermUpdateParam(userID, volmue string) *UserPermUpdateParam

func (*UserPermUpdateParam) SetPolicy added in v1.34.0

func (param *UserPermUpdateParam) SetPolicy(policy string)

type UserPolicy added in v1.34.0

type UserPolicy struct {
	OwnVols        []string            `json:"own_vols" graphql:"own_vols"`
	AuthorizedVols map[string][]string `json:"authorized_vols" graphql:"-"` // mapping: volume -> actions
	// contains filtered or unexported fields
}

func CleanPolicy added in v1.34.0

func CleanPolicy(policy *UserPolicy) (newUserPolicy *UserPolicy)

func NewUserPolicy added in v1.34.0

func NewUserPolicy() *UserPolicy

func (*UserPolicy) Add added in v1.34.0

func (policy *UserPolicy) Add(addPolicy *UserPolicy)

func (*UserPolicy) AddAuthorizedVol added in v1.34.0

func (policy *UserPolicy) AddAuthorizedVol(volume string, policies []string)

func (*UserPolicy) AddOwnVol added in v1.34.0

func (policy *UserPolicy) AddOwnVol(volume string)

func (*UserPolicy) Delete added in v1.34.0

func (policy *UserPolicy) Delete(deletePolicy *UserPolicy)

func (*UserPolicy) IsAuthorized added in v1.34.0

func (policy *UserPolicy) IsAuthorized(volume, subdir string, action Action) bool

func (*UserPolicy) IsAuthorizedS3 added in v1.34.0

func (policy *UserPolicy) IsAuthorizedS3(volume, api string) bool

func (*UserPolicy) IsOwn added in v1.34.0

func (policy *UserPolicy) IsOwn(volume string) bool

func (*UserPolicy) RemoveAuthorizedVol added in v1.34.0

func (policy *UserPolicy) RemoveAuthorizedVol(volume string)

func (*UserPolicy) RemoveOwnVol added in v1.34.0

func (policy *UserPolicy) RemoveOwnVol(volume string)

func (*UserPolicy) SetActions added in v1.34.0

func (policy *UserPolicy) SetActions(volume string, actions Actions)

func (*UserPolicy) SetPerm added in v1.34.0

func (policy *UserPolicy) SetPerm(volume string, perm Permission)

type UserTransferVolParam added in v1.34.0

type UserTransferVolParam struct {
	Volume  string `json:"volume"`
	UserSrc string `json:"user_src"`
	UserDst string `json:"user_dst"`
	Force   bool   `json:"force"`
}

type UserType added in v1.34.0

type UserType uint8
const (
	UserTypeInvalid UserType = 0x0
	UserTypeRoot    UserType = 0x1
	UserTypeAdmin   UserType = 0x2
	UserTypeNormal  UserType = 0x3
)

func UserTypeFromString added in v1.34.0

func UserTypeFromString(name string) UserType

func (UserType) String added in v1.34.0

func (u UserType) String() string

func (UserType) Valid added in v1.34.0

func (u UserType) Valid() bool

type UserUpdateParam added in v1.34.0

type UserUpdateParam struct {
	UserID      string   `json:"user_id"`
	AccessKey   string   `json:"access_key"`
	SecretKey   string   `json:"secret_key"`
	Type        UserType `json:"type"`
	Password    string   `json:"password"`
	Description string   `json:"description"`
}

type VersionInfo added in v1.34.0

type VersionInfo struct {
	Role    string
	Version string
	Branch  string
	Commit  string
	Build   string
}

func GetVersion added in v1.34.0

func GetVersion(role string) *VersionInfo

func (VersionInfo) ToMap added in v1.34.0

func (v VersionInfo) ToMap() map[string]string

type VolInfo added in v1.34.0

type VolInfo struct {
	Name                  string
	Owner                 string
	CreateTime            int64
	Status                uint8
	TotalSize             uint64
	UsedSize              uint64
	DpReadOnlyWhenVolFull bool
}

func NewVolInfo added in v1.34.0

func NewVolInfo(name, owner string, createTime int64, status uint8, totalSize, usedSize uint64, dpReadOnlyWhenVolFull bool) *VolInfo

type VolStatInfo

type VolStatInfo struct {
	Name                  string
	TotalSize             uint64
	UsedSize              uint64
	UsedRatio             string
	CacheTotalSize        uint64
	CacheUsedSize         uint64
	CacheUsedRatio        string
	EnableToken           bool
	InodeCount            uint64
	TxCnt                 uint64
	TxRbInoCnt            uint64
	TxRbDenCnt            uint64
	DpReadOnlyWhenVolFull bool
	TrashInterval         int64 `json:"TrashIntervalV2"`
}

type VolUser added in v1.34.0

type VolUser struct {
	Vol     string       `json:"vol"`
	UserIDs []string     `json:"user_id"`
	Mu      sync.RWMutex `json:"-" graphql:"-"`
}

type VolVersionInfo added in v1.34.0

type VolVersionInfo struct {
	Ver     uint64 // unixMicro of createTime used as version
	DelTime int64
	Status  uint8 // building,normal,deleted,abnormal
}

func (*VolVersionInfo) String added in v1.34.0

func (vv *VolVersionInfo) String() string

type VolVersionInfoList added in v1.34.0

type VolVersionInfoList struct {
	VerList         []*VolVersionInfo // ascend
	Strategy        VolumeVerStrategy
	TemporaryVerMap map[uint64]*VolVersionInfo
	RWLock          sync.RWMutex
}

func (*VolVersionInfoList) GetLastVer added in v1.34.0

func (v *VolVersionInfoList) GetLastVer() uint64

func (*VolVersionInfoList) GetLastVolVerInfo added in v1.34.0

func (v *VolVersionInfoList) GetLastVolVerInfo() *VolVersionInfo

func (*VolVersionInfoList) GetNextNewerVer added in v1.34.0

func (v *VolVersionInfoList) GetNextNewerVer(ver uint64) (verSeq uint64, err error)

func (*VolVersionInfoList) GetNextOlderVer added in v1.34.0

func (v *VolVersionInfoList) GetNextOlderVer(ver uint64) (verSeq uint64, err error)

type VolView

type VolView struct {
	Name           string
	Owner          string
	Status         uint8
	FollowerRead   bool
	MetaPartitions []*MetaPartitionView
	DataPartitions []*DataPartitionResponse
	DomainOn       bool
	OSSSecure      *OSSSecure
	CreateTime     int64
	DeleteLockTime int64
	CacheTTL       int
	VolType        int
}

VolView defines the view of a volume

func NewVolView

func NewVolView(name string, status uint8, followerRead bool, createTime int64, cacheTTL int, volType int, deleteLockTime int64) (view *VolView)

func (*VolView) SetOSSSecure added in v1.5.0

func (v *VolView) SetOSSSecure(accessKey, secretKey string)

func (*VolView) SetOwner added in v1.5.0

func (v *VolView) SetOwner(owner string)

type VolumeVerInfo added in v1.34.0

type VolumeVerInfo struct {
	Name             string
	VerSeq           uint64
	VerSeqPrepare    uint64
	VerPrepareStatus uint8
	Enabled          bool
}

type VolumeVerStrategy added in v1.34.0

type VolumeVerStrategy struct {
	KeepVerCnt  int
	Periodic    int
	Enable      bool
	ForceUpdate bool
	UTime       time.Time
}

func (*VolumeVerStrategy) GetPeriodic added in v1.34.0

func (v *VolumeVerStrategy) GetPeriodic() int

func (*VolumeVerStrategy) GetPeriodicSecond added in v1.34.0

func (v *VolumeVerStrategy) GetPeriodicSecond() int

func (*VolumeVerStrategy) TimeUp added in v1.34.0

func (v *VolumeVerStrategy) TimeUp(curTime time.Time) bool

type XAttrInfo added in v1.5.0

type XAttrInfo struct {
	Inode  uint64
	XAttrs map[string]string
}

func (XAttrInfo) Get added in v1.34.0

func (info XAttrInfo) Get(key string) []byte

func (XAttrInfo) String added in v1.5.0

func (info XAttrInfo) String() string

func (XAttrInfo) VisitAll added in v1.34.0

func (info XAttrInfo) VisitAll(visitor func(key string, value []byte) bool)

type ZoneNodesStat added in v1.34.0

type ZoneNodesStat struct {
	Total         float64 `json:"TotalGB"`
	Used          float64 `json:"UsedGB"`
	Avail         float64 `json:"AvailGB"`
	UsedRatio     float64
	TotalNodes    int
	WritableNodes int
}

type ZoneStat added in v1.34.0

type ZoneStat struct {
	DataNodeStat *ZoneNodesStat
	MetaNodeStat *ZoneNodesStat
}

type ZoneView added in v1.34.0

type ZoneView struct {
	Name                string
	Status              string
	DataNodesetSelector string
	MetaNodesetSelector string
	NodeSet             map[uint64]*NodeSetView
}

ZoneView define the view of zone

Jump to

Keyboard shortcuts

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