meta

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenRetryInterval = 5 * time.Millisecond
	OpenRetryLimit    = 1000
)
View Source
const (
	SendRetryLimit    = 100
	SendRetryInterval = 100 * time.Millisecond
	SendTimeLimit     = 20 * time.Second
)
View Source
const (
	HostsSeparator                = ","
	RefreshMetaPartitionsInterval = time.Minute * 5
)
View Source
const (
	MaxMountRetryLimit = 5
	MountRetryInterval = time.Second * 5

	/*
	 * Minimum interval of forceUpdateMetaPartitions in seconds,
	 * i.e. only one force update request is allowed every 5 sec.
	 */
	MinForceUpdateMetaPartitionsInterval = 5
)
View Source
const (
	BatchIgetRespBuf = 1000
)
View Source
const (
	MaxSendToMaster = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncTaskErrorFunc

type AsyncTaskErrorFunc func(err error)

func (AsyncTaskErrorFunc) OnError

func (f AsyncTaskErrorFunc) OnError(err error)

type MetaConfig

type MetaConfig struct {
	Volume           string
	Owner            string
	Masters          []string
	Authenticate     bool
	TicketMess       auth.TicketMess
	TokenKey         string
	ValidateOwner    bool
	OnAsyncTaskError AsyncTaskErrorFunc
}

type MetaConn

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

func (*MetaConn) String

func (mc *MetaConn) String() string

type MetaPartition

type MetaPartition struct {
	PartitionID uint64
	Start       uint64
	End         uint64
	Members     []string
	LeaderAddr  string
	Status      int8
}

func (*MetaPartition) Copy

func (mp *MetaPartition) Copy() btree.Item

func (*MetaPartition) Less

func (this *MetaPartition) Less(than btree.Item) bool

func (*MetaPartition) String

func (mp *MetaPartition) String() string

type MetaWrapper

type MetaWrapper struct {
	sync.RWMutex

	Ticket auth.Ticket
	// contains filtered or unexported fields
}

func NewMetaWrapper

func NewMetaWrapper(config *MetaConfig) (*MetaWrapper, error)

func (*MetaWrapper) AddMultipartPart_ll added in v1.5.0

func (mw *MetaWrapper) AddMultipartPart_ll(multipartId string, parentId uint64, partId uint16, size uint64, md5 string, inode uint64) error

func (*MetaWrapper) AppendExtentKey

func (mw *MetaWrapper) AppendExtentKey(inode uint64, ek proto.ExtentKey) error

Used as a callback by stream sdk

func (*MetaWrapper) AppendExtentKeys added in v1.5.0

func (mw *MetaWrapper) AppendExtentKeys(inode uint64, eks []proto.ExtentKey) error

AppendExtentKeys append multiple extent key into specified inode with single request.

func (*MetaWrapper) BatchGetXAttr added in v1.5.0

func (mw *MetaWrapper) BatchGetXAttr(inodes []uint64, keys []string) ([]*proto.XAttrInfo, error)

func (*MetaWrapper) BatchInodeGet

func (mw *MetaWrapper) BatchInodeGet(inodes []uint64) []*proto.InodeInfo

func (*MetaWrapper) Close added in v1.5.0

func (mw *MetaWrapper) Close() error

func (*MetaWrapper) Cluster

func (mw *MetaWrapper) Cluster() string

func (*MetaWrapper) Create_ll

func (mw *MetaWrapper) Create_ll(parentID uint64, name string, mode, uid, gid uint32, target []byte) (*proto.InodeInfo, error)

func (*MetaWrapper) Delete_ll

func (mw *MetaWrapper) Delete_ll(parentID uint64, name string, isDir bool) (*proto.InodeInfo, error)

* Note that the return value of InodeInfo might be nil without error, * and the caller should make sure InodeInfo is valid before using it.

func (*MetaWrapper) DentryCreate_ll added in v1.5.0

func (mw *MetaWrapper) DentryCreate_ll(parentID uint64, name string, inode uint64, mode uint32) error

func (*MetaWrapper) DentryUpdate_ll added in v1.5.0

func (mw *MetaWrapper) DentryUpdate_ll(parentID uint64, name string, inode uint64) (oldInode uint64, err error)

func (*MetaWrapper) Evict

func (mw *MetaWrapper) Evict(inode uint64) error

func (*MetaWrapper) GetExtents

func (mw *MetaWrapper) GetExtents(inode uint64) (gen uint64, size uint64, extents []proto.ExtentKey, err error)

func (*MetaWrapper) GetMultipart_ll added in v1.5.0

func (mw *MetaWrapper) GetMultipart_ll(multipartId string, parentId uint64) (info *proto.MultipartInfo, err error)

func (*MetaWrapper) GetRootIno

func (mw *MetaWrapper) GetRootIno(subdir string) (uint64, error)

func (*MetaWrapper) InitMultipart_ll added in v1.5.0

func (mw *MetaWrapper) InitMultipart_ll(path string, parentId uint64) (multipartId string, err error)

func (*MetaWrapper) InodeCreate_ll added in v1.5.0

func (mw *MetaWrapper) InodeCreate_ll(mode, uid, gid uint32, target []byte) (*proto.InodeInfo, error)

func (*MetaWrapper) InodeDelete_ll added in v1.5.0

func (mw *MetaWrapper) InodeDelete_ll(inode uint64) error

InodeDelete_ll is a low-level api that removes specified inode immediately and do not effect extent data managed by this inode.

func (*MetaWrapper) InodeGet_ll

func (mw *MetaWrapper) InodeGet_ll(inode uint64) (*proto.InodeInfo, error)
func (mw *MetaWrapper) InodeLink_ll(inode uint64) (*proto.InodeInfo, error)

InodeUnlink_ll is a low-level api that makes specified inode link value +1.

func (mw *MetaWrapper) InodeUnlink_ll(inode uint64) (*proto.InodeInfo, error)

InodeUnlink_ll is a low-level api that makes specified inode link value -1.

func (mw *MetaWrapper) Link(parentID uint64, name string, ino uint64) (*proto.InodeInfo, error)

func (*MetaWrapper) ListMultipart_ll added in v1.5.0

func (mw *MetaWrapper) ListMultipart_ll(prefix, delimiter, keyMarker string, multipartIdMarker string, maxUploads uint64) (sessionResponse []*proto.MultipartInfo, err error)

func (*MetaWrapper) LocalIP added in v1.4.0

func (mw *MetaWrapper) LocalIP() string

func (*MetaWrapper) Lookup_ll

func (mw *MetaWrapper) Lookup_ll(parentID uint64, name string) (inode uint64, mode uint32, err error)

func (*MetaWrapper) OSSSecure added in v1.5.0

func (mw *MetaWrapper) OSSSecure() (accessKey, secretKey string)

func (*MetaWrapper) ReadDir_ll

func (mw *MetaWrapper) ReadDir_ll(parentID uint64) ([]proto.Dentry, error)

func (*MetaWrapper) RemoveMultipart_ll added in v1.5.0

func (mw *MetaWrapper) RemoveMultipart_ll(multipartID string, parentId uint64) error

func (*MetaWrapper) Rename_ll

func (mw *MetaWrapper) Rename_ll(srcParentID uint64, srcName string, dstParentID uint64, dstName string) (err error)

func (*MetaWrapper) Setattr

func (mw *MetaWrapper) Setattr(inode uint64, valid, mode, uid, gid uint32) error

func (*MetaWrapper) Statfs

func (mw *MetaWrapper) Statfs() (total, used uint64)

func (*MetaWrapper) TokenType

func (mw *MetaWrapper) TokenType() int8

func (*MetaWrapper) Truncate

func (mw *MetaWrapper) Truncate(inode, size uint64) error

func (*MetaWrapper) VolCreateTime

func (mw *MetaWrapper) VolCreateTime() int64

func (*MetaWrapper) XAttrDel_ll added in v1.5.0

func (mw *MetaWrapper) XAttrDel_ll(inode uint64, name string) error

XAttrDel_ll is a low-level meta api that deletes specified xattr.

func (*MetaWrapper) XAttrGet_ll added in v1.5.0

func (mw *MetaWrapper) XAttrGet_ll(inode uint64, name string) (*proto.XAttrInfo, error)

func (*MetaWrapper) XAttrSet_ll added in v1.5.0

func (mw *MetaWrapper) XAttrSet_ll(inode uint64, name, value []byte) error

func (*MetaWrapper) XAttrsList_ll

func (mw *MetaWrapper) XAttrsList_ll(inode uint64) ([]string, error)

type OSSSecure added in v1.5.0

type OSSSecure struct {
	AccessKey string
	SecretKey string
}

type Ticket added in v1.5.0

type Ticket struct {
	ID         string `json:"client_id"`
	SessionKey string `json:"session_key"`
	ServiceID  string `json:"service_id"`
	Ticket     string `json:"ticket"`
}

the ticket from authnode

type VolStatInfo

type VolStatInfo = proto.VolStatInfo

type VolumeView

type VolumeView struct {
	Name           string
	Owner          string
	MetaPartitions []*MetaPartition
	OSSSecure      *OSSSecure
	CreateTime     int64
}

Jump to

Keyboard shortcuts

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