Documentation ¶
Index ¶
- Constants
- func DivCeil(x, y uint64) uint64
- func GetReqId(ctx context.Context) string
- func NewHexStrUuid() string
- func NvmfSerialNumber(nqn string) string
- func NvmfUuid(nqn string) (string, error)
- func ResTimestamp() string
- func RoundUp(x, y uint64) uint64
- func SetReqId(ctx context.Context) context.Context
- type Allocator
- type BdevQos
- type CnCand
- type DnPdCand
- type GrpcCache
- type Histogram
- type InvalidKeyError
- type Iostat
- type KeyFmt
- func (kf *KeyFmt) AllocLockPath() string
- func (kf *KeyFmt) CnCapCntPrefix(cntlrCnt uint32) string
- func (kf *KeyFmt) CnCapKey(cntlrCnt uint32, sockAddr string) string
- func (kf *KeyFmt) CnCapPrefix() string
- func (kf *KeyFmt) CnEntityKey(sockAddr string) string
- func (kf *KeyFmt) CnEntityPrefix() string
- func (kf *KeyFmt) CnErrKey(hashCode uint32, sockAddr string) string
- func (kf *KeyFmt) CnErrPrefix() string
- func (kf *KeyFmt) CnErrWithHash(hashCode uint32) string
- func (kf *KeyFmt) CnListKey(hashCode uint32, sockAddr string) string
- func (kf *KeyFmt) CnListPrefix() string
- func (kf *KeyFmt) CnListWithHash(hashCode uint32) string
- func (kf *KeyFmt) DaEntityKey(daName string) string
- func (kf *KeyFmt) DaEntityPrefix() string
- func (kf *KeyFmt) DaListKey(daName string) string
- func (kf *KeyFmt) DaListPrefix() string
- func (kf *KeyFmt) DecodeCnCapKey(key string) (uint32, string, error)
- func (kf *KeyFmt) DecodeCnErrKey(key string) (uint32, string, error)
- func (kf *KeyFmt) DecodeCnListKey(key string) (uint32, string, error)
- func (kf *KeyFmt) DecodeDaListKey(key string) (string, error)
- func (kf *KeyFmt) DecodeDnCapKey(key string) (uint64, string, string, error)
- func (kf *KeyFmt) DecodeDnErrKey(key string) (uint32, string, error)
- func (kf *KeyFmt) DecodeDnListKey(key string) (uint32, string, error)
- func (kf *KeyFmt) DnCapKey(freeSize uint64, sockAddr string, pdName string) string
- func (kf *KeyFmt) DnCapPrefix() string
- func (kf *KeyFmt) DnCapSizePrefix(freeSize uint64) string
- func (kf *KeyFmt) DnEntityKey(sockAddr string) string
- func (kf *KeyFmt) DnEntityPrefix() string
- func (kf *KeyFmt) DnErrKey(hashCode uint32, sockAddr string) string
- func (kf *KeyFmt) DnErrPrefix() string
- func (kf *KeyFmt) DnErrWithHash(hashCode uint32) string
- func (kf *KeyFmt) DnListKey(hashCode uint32, sockAddr string) string
- func (kf *KeyFmt) DnListPrefix() string
- func (kf *KeyFmt) DnListWithHash(hashCode uint32) string
- func (kf *KeyFmt) MonitorPrefix() string
- type LisConf
- type LvsInfo
- type NameFmt
- func (nf *NameFmt) AggBdevName(daId string) string
- func (nf *NameFmt) AggBdevPrefix() string
- func (nf *NameFmt) BeLvolFullName(pdId, vdId string) string
- func (nf *NameFmt) BeLvolName(vdId string) string
- func (nf *NameFmt) BeLvolPrefix() string
- func (nf *NameFmt) BeNqnName(vdId string) string
- func (nf *NameFmt) BeNqnPrefix() string
- func (nf *NameFmt) DaLvsName(daId string) string
- func (nf *NameFmt) DaLvsPrefix() string
- func (nf *NameFmt) ExpId(secNvmeName string) string
- func (nf *NameFmt) ExpNqnName(daName, expName string) string
- func (nf *NameFmt) ExpNqnPrefix() string
- func (nf *NameFmt) FeBdevName(vdId string) string
- func (nf *NameFmt) FeNqnName(cntlrId string) string
- func (nf *NameFmt) FeNqnPrefix() string
- func (nf *NameFmt) FeNvmeName(vdId string) string
- func (nf *NameFmt) FeNvmePrefix() string
- func (nf *NameFmt) GrpBdevName(grpId string) string
- func (nf *NameFmt) GrpBdevPrefix() string
- func (nf *NameFmt) PdBdevName(pdId string) string
- func (nf *NameFmt) PdBdevPrefix() string
- func (nf *NameFmt) PdId(pdBdevName string) string
- func (nf *NameFmt) PdLvsName(pdId string) string
- func (nf *NameFmt) PdLvsPrefix() string
- func (nf *NameFmt) Raid0BdevName(grpId string) string
- func (nf *NameFmt) Raid0BdevPrefix() string
- func (nf *NameFmt) SecBdevName(expId string) string
- func (nf *NameFmt) SecNqnName(cntlrId string) string
- func (nf *NameFmt) SecNqnPrefix() string
- func (nf *NameFmt) SecNvmeName(expId string) string
- func (nf *NameFmt) SecNvmeNameToBdevName(secNvmeName string) string
- func (nf *NameFmt) SecNvmePrefix() string
- func (nf *NameFmt) SnapFullName(daId, snapId string) string
- func (nf *NameFmt) SnapFullNamePrefix() string
- func (nf *NameFmt) SnapName(snapId string) string
- type OperationClient
- func (oc *OperationClient) BdevGetHistogram(bdevName string) (*Histogram, error)
- func (oc *OperationClient) BdevGetIostat(bdevName string) (*Iostat, error)
- func (oc *OperationClient) CreateAggBdev(aggBdevName string, grpBdevList []string) error
- func (oc *OperationClient) CreateBeLvol(lvsName, lvolName string, size uint64, ...) error
- func (oc *OperationClient) CreateBeNvmf(beNqnName, beLvolFullName, feNqnName string, lisConf *LisConf) error
- func (oc *OperationClient) CreateDaLvs(daLvsName, aggBdevName string) error
- func (oc *OperationClient) CreateExpPrimaryNvmf(expNqnName, snapFullName, initiatorNqn string, secNqnList []string, ...) error
- func (oc *OperationClient) CreateExpSecNvmf(expNqnName, secBdevName, initiatorNqn string, lisConf *LisConf) error
- func (oc *OperationClient) CreateFeNvme(feNvmeName, beNqnName, feNqnName string, lisConf *LisConf) error
- func (oc *OperationClient) CreateGrpBdev(grpBdevName, raid0BdevName string) error
- func (oc *OperationClient) CreatePdAio(name string, fileName string) error
- func (oc *OperationClient) CreatePdLvs(pdLvsName, bdevName string) error
- func (oc *OperationClient) CreatePdMalloc(name string, size uint64) error
- func (oc *OperationClient) CreatePdNvme(name, realName, trAddr string) error
- func (oc *OperationClient) CreateRaid0Bdev(raid0BdevName string, stripSizeKb uint32, feBdevList []string) error
- func (oc *OperationClient) CreateSecNvme(secNvmeName, expNqnName, secNqnName string, lisConf *LisConf) error
- func (oc *OperationClient) CreateSnap(daLvsName, snapName, oriName string, isClone bool, snapSize uint64) error
- func (oc *OperationClient) DeleteAggBdev(name string) error
- func (oc *OperationClient) DeleteBeLvol(name string) error
- func (oc *OperationClient) DeleteBeNvmf(nqn string) error
- func (oc *OperationClient) DeleteDaLvs(daLvsName string) error
- func (oc *OperationClient) DeleteExpNvmf(nqn string) error
- func (oc *OperationClient) DeleteFeNvme(feNvmeName string) error
- func (oc *OperationClient) DeleteGrpBdev(name string) error
- func (oc *OperationClient) DeletePdBdev(bdevName string) error
- func (oc *OperationClient) DeletePdLvs(lvsName string) error
- func (oc *OperationClient) DeleteRaid0Bdev(name string) error
- func (oc *OperationClient) DeleteSecNvme(secNvmeName string) error
- func (oc *OperationClient) DeleteSnap(name string) error
- func (oc *OperationClient) EnableHistogram(bdevName string) error
- func (oc *OperationClient) ExamineBdev(bdevName string) error
- func (oc *OperationClient) GetAggBdevList(prefix string) ([]string, error)
- func (oc *OperationClient) GetBeLvolList(prefix string) ([]string, error)
- func (oc *OperationClient) GetBeNqnList(prefix string) ([]string, error)
- func (oc *OperationClient) GetDaLvsList(prefix string) ([]string, error)
- func (oc *OperationClient) GetExpNqnList(prefix string) ([]string, error)
- func (oc *OperationClient) GetFeNvmeList(prefix string) ([]string, error)
- func (oc *OperationClient) GetGrpBdevList(prefix string) ([]string, error)
- func (oc *OperationClient) GetLvsInfo(lvsName string) (*LvsInfo, error)
- func (oc *OperationClient) GetPdBdevList(prefix string) ([]string, error)
- func (oc *OperationClient) GetPdLvsList(prefix string) ([]string, error)
- func (oc *OperationClient) GetRaid0BdevList(prefix string) ([]string, error)
- func (oc *OperationClient) GetSecNvmeList(prefix string) ([]string, error)
- func (oc *OperationClient) GetSnapList(prefix string) ([]string, error)
- func (oc *OperationClient) LoadBdevs() error
- func (oc *OperationClient) LoadNvmfs() error
- func (oc *OperationClient) WaitForLvs(daLvsName string) error
- type SpdkClient
- type StmWrapper
- type SyncupManager
Constants ¶
View Source
const ( DefaultEtcdPrefix = "vda" PortalSucceedCode = 0 PortalSucceedMsg = "succeed" PortalInternalErrCode = 1 PortalDupResErrCode = 2 PortalUnknownResErrCode = 3 PortalInvalidParamCode = 4 PortalResBusyErrCode = 5 PortalResRevErrCode = 6 PortalUnknownKeyTypeCode = 7 PortalJsonToMessageErrCode = 8 PortalMessageToByteErrCode = 9 DnSucceedCode = 1 DnSucceedMsg = "succeed" DnOldRevErrCode = 2 DnOutOfSyncErrCode = 3 CnSucceedCode = 1 CnSucceedMsg = "succeed" CnOldRevErrCode = 2 CnOutOfSyncErrCode = 3 ResUninitMsg = "uninit" ResNoInfoMsg = "no info" DefaultVdaPrefix = "vda" DefaultNqnPrefix = "nqn.2016-06.io.vda" MaxHashCode = 0xffff AllocLockTTL = 2 AllocMaxRetry = 10 DefaultSanpName = "%default%" DefaultSanpDescription = "default snap" PortalDefaultListLimit = int64(100) PortalMaxListLimit = int64(1000) MonitorLeaseTimeout = 10 GrpcCacheTTL = 600 GrpcCacheStep = 10 GrpcCacheInterval = 10 )
View Source
const ( SPDK_PAGE_SIZE = uint64(4096) CLUSTER_SIZE_MB = uint64(4) CLUSTER_SIZE = 1024 * 1024 * CLUSTER_SIZE_MB NVMF_MODULE_NUMBER = "VDA_CONTROLLER" )
View Source
const (
MaxReqId = 65536
)
Variables ¶
This section is empty.
Functions ¶
func NewHexStrUuid ¶
func NewHexStrUuid() string
func NvmfSerialNumber ¶
func ResTimestamp ¶
func ResTimestamp() string
Types ¶
type Allocator ¶
type Allocator struct {
// contains filtered or unexported fields
}
func NewAllocator ¶
type InvalidKeyError ¶
type InvalidKeyError struct {
// contains filtered or unexported fields
}
func (*InvalidKeyError) Error ¶
func (e *InvalidKeyError) Error() string
type Iostat ¶
type Iostat struct { TickRate uint64 BytesRead uint64 NumReadOps uint64 BytesWritten uint64 NumWriteOps uint64 BytesUnmapped uint64 NumUnmapOps uint64 ReadLatencyTicks uint64 WriteLatencyTicks uint64 UnmapLatencyTicks uint64 QueueDepthPollingPeriod uint64 QueueDepth uint64 IoTime uint64 WeightedIoTime uint64 }
type KeyFmt ¶
type KeyFmt struct {
// contains filtered or unexported fields
}
func (*KeyFmt) AllocLockPath ¶
func (*KeyFmt) CnCapCntPrefix ¶
func (*KeyFmt) CnCapPrefix ¶
func (*KeyFmt) CnEntityKey ¶
func (*KeyFmt) CnEntityPrefix ¶
func (*KeyFmt) CnErrPrefix ¶
func (*KeyFmt) CnErrWithHash ¶
func (*KeyFmt) CnListPrefix ¶
func (*KeyFmt) CnListWithHash ¶
func (*KeyFmt) DaEntityKey ¶
func (*KeyFmt) DaEntityPrefix ¶
func (*KeyFmt) DaListPrefix ¶
func (*KeyFmt) DecodeCnCapKey ¶
func (*KeyFmt) DecodeCnErrKey ¶
func (*KeyFmt) DecodeCnListKey ¶
func (*KeyFmt) DecodeDnCapKey ¶
func (*KeyFmt) DecodeDnErrKey ¶
func (*KeyFmt) DecodeDnListKey ¶
func (*KeyFmt) DnCapPrefix ¶
func (*KeyFmt) DnCapSizePrefix ¶
func (*KeyFmt) DnEntityKey ¶
func (*KeyFmt) DnEntityPrefix ¶
func (*KeyFmt) DnErrPrefix ¶
func (*KeyFmt) DnErrWithHash ¶
func (*KeyFmt) DnListPrefix ¶
func (*KeyFmt) DnListWithHash ¶
func (*KeyFmt) MonitorPrefix ¶
type NameFmt ¶
type NameFmt struct {
// contains filtered or unexported fields
}
func NewNameFmt ¶
func (*NameFmt) AggBdevName ¶
func (*NameFmt) AggBdevPrefix ¶
func (*NameFmt) BeLvolFullName ¶
func (*NameFmt) BeLvolName ¶
func (*NameFmt) BeLvolPrefix ¶
func (*NameFmt) BeNqnPrefix ¶
func (*NameFmt) DaLvsPrefix ¶
func (*NameFmt) ExpNqnName ¶
func (*NameFmt) ExpNqnPrefix ¶
func (*NameFmt) FeBdevName ¶
func (*NameFmt) FeNqnPrefix ¶
func (*NameFmt) FeNvmeName ¶
func (*NameFmt) FeNvmePrefix ¶
func (*NameFmt) GrpBdevName ¶
func (*NameFmt) GrpBdevPrefix ¶
func (*NameFmt) PdBdevName ¶
func (*NameFmt) PdBdevPrefix ¶
func (*NameFmt) PdLvsPrefix ¶
func (*NameFmt) Raid0BdevName ¶
func (*NameFmt) Raid0BdevPrefix ¶
func (*NameFmt) SecBdevName ¶
func (*NameFmt) SecNqnName ¶
func (*NameFmt) SecNqnPrefix ¶
func (*NameFmt) SecNvmeName ¶
func (*NameFmt) SecNvmeNameToBdevName ¶ added in v0.1.1
func (*NameFmt) SecNvmePrefix ¶
func (*NameFmt) SnapFullName ¶
func (*NameFmt) SnapFullNamePrefix ¶
type OperationClient ¶
type OperationClient struct {
// contains filtered or unexported fields
}
func NewOperationClient ¶
func NewOperationClient(sc *SpdkClient) *OperationClient
func (*OperationClient) BdevGetHistogram ¶ added in v0.1.1
func (oc *OperationClient) BdevGetHistogram(bdevName string) (*Histogram, error)
func (*OperationClient) BdevGetIostat ¶ added in v0.1.1
func (oc *OperationClient) BdevGetIostat(bdevName string) (*Iostat, error)
func (*OperationClient) CreateAggBdev ¶
func (oc *OperationClient) CreateAggBdev(aggBdevName string, grpBdevList []string) error
func (*OperationClient) CreateBeLvol ¶
func (oc *OperationClient) CreateBeLvol(lvsName, lvolName string, size uint64, rwIosPerSec, rwMbytesPerSec, rMbytesPerSec, wMbytesPerSec uint64) error
func (*OperationClient) CreateBeNvmf ¶
func (oc *OperationClient) CreateBeNvmf(beNqnName, beLvolFullName, feNqnName string, lisConf *LisConf) error
func (*OperationClient) CreateDaLvs ¶
func (oc *OperationClient) CreateDaLvs(daLvsName, aggBdevName string) error
func (*OperationClient) CreateExpPrimaryNvmf ¶
func (oc *OperationClient) CreateExpPrimaryNvmf(expNqnName, snapFullName, initiatorNqn string, secNqnList []string, lisConf *LisConf) error
func (*OperationClient) CreateExpSecNvmf ¶
func (oc *OperationClient) CreateExpSecNvmf(expNqnName, secBdevName, initiatorNqn string, lisConf *LisConf) error
func (*OperationClient) CreateFeNvme ¶
func (oc *OperationClient) CreateFeNvme(feNvmeName, beNqnName, feNqnName string, lisConf *LisConf) error
func (*OperationClient) CreateGrpBdev ¶
func (oc *OperationClient) CreateGrpBdev(grpBdevName, raid0BdevName string) error
func (*OperationClient) CreatePdAio ¶
func (oc *OperationClient) CreatePdAio(name string, fileName string) error
func (*OperationClient) CreatePdLvs ¶
func (oc *OperationClient) CreatePdLvs(pdLvsName, bdevName string) error
func (*OperationClient) CreatePdMalloc ¶
func (oc *OperationClient) CreatePdMalloc(name string, size uint64) error
func (*OperationClient) CreatePdNvme ¶
func (oc *OperationClient) CreatePdNvme(name, realName, trAddr string) error
func (*OperationClient) CreateRaid0Bdev ¶
func (oc *OperationClient) CreateRaid0Bdev(raid0BdevName string, stripSizeKb uint32, feBdevList []string) error
func (*OperationClient) CreateSecNvme ¶
func (oc *OperationClient) CreateSecNvme(secNvmeName, expNqnName, secNqnName string, lisConf *LisConf) error
func (*OperationClient) CreateSnap ¶
func (oc *OperationClient) CreateSnap(daLvsName, snapName, oriName string, isClone bool, snapSize uint64) error
func (*OperationClient) DeleteAggBdev ¶
func (oc *OperationClient) DeleteAggBdev(name string) error
func (*OperationClient) DeleteBeLvol ¶
func (oc *OperationClient) DeleteBeLvol(name string) error
func (*OperationClient) DeleteBeNvmf ¶
func (oc *OperationClient) DeleteBeNvmf(nqn string) error
func (*OperationClient) DeleteDaLvs ¶
func (oc *OperationClient) DeleteDaLvs(daLvsName string) error
func (*OperationClient) DeleteExpNvmf ¶
func (oc *OperationClient) DeleteExpNvmf(nqn string) error
func (*OperationClient) DeleteFeNvme ¶
func (oc *OperationClient) DeleteFeNvme(feNvmeName string) error
func (*OperationClient) DeleteGrpBdev ¶
func (oc *OperationClient) DeleteGrpBdev(name string) error
func (*OperationClient) DeletePdBdev ¶
func (oc *OperationClient) DeletePdBdev(bdevName string) error
func (*OperationClient) DeletePdLvs ¶
func (oc *OperationClient) DeletePdLvs(lvsName string) error
func (*OperationClient) DeleteRaid0Bdev ¶
func (oc *OperationClient) DeleteRaid0Bdev(name string) error
func (*OperationClient) DeleteSecNvme ¶
func (oc *OperationClient) DeleteSecNvme(secNvmeName string) error
func (*OperationClient) DeleteSnap ¶
func (oc *OperationClient) DeleteSnap(name string) error
func (*OperationClient) EnableHistogram ¶
func (oc *OperationClient) EnableHistogram(bdevName string) error
func (*OperationClient) ExamineBdev ¶
func (oc *OperationClient) ExamineBdev(bdevName string) error
func (*OperationClient) GetAggBdevList ¶
func (oc *OperationClient) GetAggBdevList(prefix string) ([]string, error)
func (*OperationClient) GetBeLvolList ¶
func (oc *OperationClient) GetBeLvolList(prefix string) ([]string, error)
func (*OperationClient) GetBeNqnList ¶
func (oc *OperationClient) GetBeNqnList(prefix string) ([]string, error)
func (*OperationClient) GetDaLvsList ¶
func (oc *OperationClient) GetDaLvsList(prefix string) ([]string, error)
func (*OperationClient) GetExpNqnList ¶
func (oc *OperationClient) GetExpNqnList(prefix string) ([]string, error)
func (*OperationClient) GetFeNvmeList ¶
func (oc *OperationClient) GetFeNvmeList(prefix string) ([]string, error)
func (*OperationClient) GetGrpBdevList ¶
func (oc *OperationClient) GetGrpBdevList(prefix string) ([]string, error)
func (*OperationClient) GetLvsInfo ¶
func (oc *OperationClient) GetLvsInfo(lvsName string) (*LvsInfo, error)
func (*OperationClient) GetPdBdevList ¶
func (oc *OperationClient) GetPdBdevList(prefix string) ([]string, error)
func (*OperationClient) GetPdLvsList ¶
func (oc *OperationClient) GetPdLvsList(prefix string) ([]string, error)
func (*OperationClient) GetRaid0BdevList ¶
func (oc *OperationClient) GetRaid0BdevList(prefix string) ([]string, error)
func (*OperationClient) GetSecNvmeList ¶
func (oc *OperationClient) GetSecNvmeList(prefix string) ([]string, error)
func (*OperationClient) GetSnapList ¶
func (oc *OperationClient) GetSnapList(prefix string) ([]string, error)
func (*OperationClient) LoadBdevs ¶
func (oc *OperationClient) LoadBdevs() error
func (*OperationClient) LoadNvmfs ¶
func (oc *OperationClient) LoadNvmfs() error
func (*OperationClient) WaitForLvs ¶
func (oc *OperationClient) WaitForLvs(daLvsName string) error
type SpdkClient ¶
type SpdkClient struct {
// contains filtered or unexported fields
}
func NewSpdkClient ¶
func NewSpdkClient(network, address string, timeout time.Duration) *SpdkClient
func (*SpdkClient) Invoke ¶
func (sc *SpdkClient) Invoke(method string, params interface{}, rsp interface{}) error
func (*SpdkClient) Stop ¶
func (sc *SpdkClient) Stop()
type StmWrapper ¶
type StmWrapper struct {
// contains filtered or unexported fields
}
func NewStmWrapper ¶
func NewStmWrapper(etcdCli *clientv3.Client) *StmWrapper
func (*StmWrapper) RunStm ¶
func (sw *StmWrapper) RunStm(apply func(stm concurrency.STM) error, ctx context.Context, name string) error
type SyncupManager ¶
type SyncupManager struct {
// contains filtered or unexported fields
}
func NewSyncupManager ¶
func NewSyncupManager(kf *KeyFmt, sw *StmWrapper, gc *GrpcCache) *SyncupManager
Click to show internal directories.
Click to hide internal directories.