Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteBatchCount() uint64
- func DeleteWorkerSleepMs()
- type APIResponse
- type BTree
- func (b *BTree) Ascend(fn func(i BtreeItem) bool)
- func (b *BTree) AscendGreaterOrEqual(pivot BtreeItem, iterator func(i BtreeItem) bool)
- func (b *BTree) AscendRange(greaterOrEqual, lessThan BtreeItem, iterator func(i BtreeItem) bool)
- func (b *BTree) CopyFind(key BtreeItem, fn func(i BtreeItem))
- func (b *BTree) CopyGet(key BtreeItem) (item BtreeItem)
- func (b *BTree) Delete(key BtreeItem) (item BtreeItem)
- func (b *BTree) Execute(fn func(tree *btree.BTree) interface{}) interface{}
- func (b *BTree) Find(key BtreeItem, fn func(i BtreeItem))
- func (b *BTree) Get(key BtreeItem) (item BtreeItem)
- func (b *BTree) GetTree() *BTree
- func (b *BTree) Has(key BtreeItem) (ok bool)
- func (b *BTree) Len() (size int)
- func (b *BTree) MaxItem() BtreeItem
- func (b *BTree) ReplaceOrInsert(key BtreeItem, replace bool) (item BtreeItem, ok bool)
- func (b *BTree) Reset()
- type BatchDeleteDentryReq
- type BatchDeleteDentryResp
- type BatchEvictInodeReq
- type BatchUnlinkInoReq
- type BatchUnlinkInoResp
- type BtreeItem
- type CreateDentryReq
- type CreateInoReq
- type CreateInoResp
- type CreateMetaRangeReq
- type CreateMetaRangeResp
- type DataPartition
- type DataPartitionsView
- type DelExtFile
- type DeleteDentryReq
- type DeleteDentryResp
- type Dentry
- func (d *Dentry) Copy() BtreeItem
- func (d *Dentry) Less(than BtreeItem) (less bool)
- func (d *Dentry) Marshal() (result []byte, err error)
- func (d *Dentry) MarshalKey() (k []byte)
- func (d *Dentry) MarshalValue() (k []byte)
- func (d *Dentry) Unmarshal(raw []byte) (err error)
- func (d *Dentry) UnmarshalKey(k []byte) (err error)
- func (d *Dentry) UnmarshalValue(val []byte) (err error)
- type DentryBatch
- type DentryResponse
- type EvictInodeReq
- type Extend
- func (e *Extend) Bytes() ([]byte, error)
- func (e *Extend) Copy() btree.Item
- func (e *Extend) Get(key []byte) (value []byte, exist bool)
- func (e *Extend) Less(than btree.Item) bool
- func (e *Extend) Merge(o *Extend, override bool)
- func (e *Extend) Put(key, value []byte)
- func (e *Extend) Range(visitor func(key, value []byte) bool)
- func (e *Extend) Remove(key []byte)
- type ExtendOpResult
- type ExtentsTruncateReq
- type Inode
- func (i *Inode) AppendExtentWithCheck(ek proto.ExtentKey, ct int64, discardExtents []proto.ExtentKey, volType int) (delExtents []proto.ExtentKey, status uint8)
- func (i *Inode) AppendExtents(eks []proto.ExtentKey, ct int64, volType int) (delExtents []proto.ExtentKey)
- func (i *Inode) AppendObjExtents(eks []proto.ObjExtentKey, ct int64) (err error)
- func (i *Inode) Copy() BtreeItem
- func (i *Inode) CopyTinyExtents() (delExtents []proto.ExtentKey)
- func (i *Inode) DecNLink()
- func (i *Inode) DoReadFunc(fn func())
- func (i *Inode) DoWriteFunc(fn func())
- func (i *Inode) EmptyExtents(mtime int64) (delExtents []proto.ExtentKey)
- func (i *Inode) ExtentsTruncate(length uint64, ct int64) (delExtents []proto.ExtentKey)
- func (i *Inode) GetNLink() uint32
- func (i *Inode) IncNLink()
- func (i *Inode) IsEmptyDir() bool
- func (i *Inode) IsTempFile() bool
- func (i *Inode) Less(than BtreeItem) bool
- func (i *Inode) Marshal() (result []byte, err error)
- func (i *Inode) MarshalKey() (k []byte)
- func (i *Inode) MarshalToJSON() ([]byte, error)
- func (i *Inode) MarshalValue() (val []byte)
- func (i *Inode) SetAttr(req *SetattrRequest)
- func (i *Inode) SetDeleteMark()
- func (i *Inode) SetMtime()
- func (i *Inode) ShouldDelayDelete() (ok bool)
- func (i *Inode) ShouldDelete() (ok bool)
- func (i *Inode) String() string
- func (i *Inode) Unmarshal(raw []byte) (err error)
- func (i *Inode) UnmarshalKey(k []byte) (err error)
- func (i *Inode) UnmarshalValue(val []byte) (err error)
- type InodeBatch
- type InodeGetReq
- type InodeGetReqBatch
- type InodeResponse
- type LinkInodeReq
- type LinkInodeResp
- type LookupReq
- type LookupResp
- type MetaItem
- type MetaItemIterator
- type MetaNode
- type MetaNodeMetrics
- type MetaPartition
- type MetaPartitionConfig
- type MetadataManager
- type MetadataManagerConfig
- type Multipart
- func (m *Multipart) Bytes() ([]byte, error)
- func (m *Multipart) Copy() btree.Item
- func (m *Multipart) ID() string
- func (m *Multipart) InsertPart(part *Part, replace bool) (success bool)
- func (m *Multipart) Less(than btree.Item) bool
- func (m *Multipart) LoadOrStorePart(part *Part) (actual *Part, stored bool)
- func (m *Multipart) Parts() []*Part
- type MultipartExtend
- type NodeInfo
- type NowTime
- type OpDentry
- type OpExtend
- type OpExtent
- type OpInode
- type OpMeta
- type OpMultipart
- type OpPartition
- type Packet
- type Part
- type Parts
- func (m Parts) Bytes() ([]byte, error)
- func (m *Parts) Hash(part *Part) (has bool)
- func (m *Parts) Insert(part *Part, replace bool) (success bool)
- func (m Parts) Len() int
- func (m *Parts) LoadOrStore(part *Part) (actual *Part, stored bool)
- func (m *Parts) Remove(id uint16)
- func (m Parts) Search(id uint16) (part *Part, found bool)
- type ReadDirLimitReq
- type ReadDirLimitResp
- type ReadDirOnlyReq
- type ReadDirOnlyResp
- type ReadDirReq
- type ReadDirResp
- type SetattrRequest
- type SortedExtents
- func (se *SortedExtents) Append(ek proto.ExtentKey) (deleteExtents []proto.ExtentKey)
- func (se *SortedExtents) AppendWithCheck(ek proto.ExtentKey, discard []proto.ExtentKey) (deleteExtents []proto.ExtentKey, status uint8)
- func (se *SortedExtents) Clone() *SortedExtents
- func (se *SortedExtents) CopyExtents() []proto.ExtentKey
- func (se *SortedExtents) CopyTinyExtents() []proto.ExtentKey
- func (se *SortedExtents) Delete(delEks []proto.ExtentKey) (curEks []proto.ExtentKey)
- func (se *SortedExtents) Len() int
- func (se *SortedExtents) MarshalBinary() ([]byte, error)
- func (se *SortedExtents) Range(f func(ek proto.ExtentKey) bool)
- func (se *SortedExtents) Size() uint64
- func (se *SortedExtents) String() string
- func (se *SortedExtents) Truncate(offset uint64) (deleteExtents []proto.ExtentKey)
- func (se *SortedExtents) UnmarshalBinary(data []byte) error
- type SortedObjExtents
- func (se *SortedObjExtents) Append(ek proto.ObjExtentKey) (err error)
- func (se *SortedObjExtents) Clone() *SortedObjExtents
- func (se *SortedObjExtents) CopyExtents() []proto.ObjExtentKey
- func (se *SortedObjExtents) FindOffsetExist(fileOffset uint64) (bool, int)
- func (se *SortedObjExtents) MarshalBinary() ([]byte, error)
- func (se *SortedObjExtents) Range(f func(ek proto.ObjExtentKey) bool)
- func (se *SortedObjExtents) Size() uint64
- func (se *SortedObjExtents) String() string
- func (se *SortedObjExtents) UnmarshalBinary(data []byte) error
- type UnlinkInoReq
- type UnlinkInoResp
- type UpdateDentryReq
- type UpdateDentryResp
- type UpdatePartitionReq
- type UpdatePartitionResp
- type Vol
Constants ¶
const ( KB = 1 << (10 * iota) MB GB )
const ( ForceClosedConnect = true NoClosedConnect = false )
const ( UpdateNodeInfoTicket = 1 * time.Minute DefaultDeleteBatchCounts = 128 )
const ( AsyncDeleteInterval = 10 * time.Second UpdateVolTicket = 2 * time.Minute BatchCounts = 128 OpenRWAppendOpt = os.O_CREATE | os.O_RDWR | os.O_APPEND TempFileValidTime = 86400 //units: sec DeleteInodeFileExtension = "INODE_DEL" DeleteWorkerCnt = 10 InodeNLink0DelayDeleteSeconds = 24 * 3600 )
const ( MinDeleteBatchCounts = 100 MaxSleepCnt = 10 )
const (
DeleteMarkFlag = 1 << 0
)
const ExpiredPartitionPrefix = "expired_"
const (
MaxUsedMemFactor = 1.1
)
const (
SnapshotSign = ".sign"
)
const (
StatPeriod = time.Minute * time.Duration(1)
)
metrics
Variables ¶
var ( ErrNoLeader = errors.New("no leader") ErrNotALeader = errors.New("not a leader") )
var ( ErrIllegalHeartbeatAddress = errors.New("illegal heartbeat address") ErrIllegalReplicateAddress = errors.New("illegal replicate address") )
var (
ErrInodeIDOutOfRange = errors.New("inode ID out of range")
)
Errors
var ( // InodeV1Flag uint64 = 0x01 InodeV2Flag uint64 = 0x02 )
var Now = NewNowTime()
Now
Functions ¶
func DeleteBatchCount ¶
func DeleteBatchCount() uint64
func DeleteWorkerSleepMs ¶
func DeleteWorkerSleepMs()
Types ¶
type APIResponse ¶
type APIResponse struct { Code int `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data,omitempty"` }
APIResponse defines the structure of the response to an HTTP request
func NewAPIResponse ¶
func NewAPIResponse(code int, msg string) *APIResponse
NewAPIResponse returns a new API response.
func (*APIResponse) Marshal ¶
func (api *APIResponse) Marshal() ([]byte, error)
Marshal is a wrapper function of json.Marshal
type BTree ¶
BTree is the wrapper of Google's btree.
func (*BTree) Ascend ¶
Ascend is the wrapper of the google's btree Ascend. This function scans the entire btree. When the data is huge, it is not recommended to use this function online. Instead, it is recommended to call GetTree to obtain the snapshot of the current btree, and then do the scan on the snapshot.
func (*BTree) AscendGreaterOrEqual ¶
AscendGreaterOrEqual is the wrapper of the google's btree AscendGreaterOrEqual
func (*BTree) AscendRange ¶
AscendRange is the wrapper of the google's btree AscendRange.
func (*BTree) ReplaceOrInsert ¶
ReplaceOrInsert is the wrapper of google's btree ReplaceOrInsert.
type BatchDeleteDentryReq ¶
type BatchDeleteDentryReq = proto.BatchDeleteDentryRequest
Client -> MetaNode delete Dentry request
type BatchDeleteDentryResp ¶
type BatchDeleteDentryResp = proto.BatchDeleteDentryResponse
MetaNode -> Client batch delete Dentry response
type BatchUnlinkInoReq ¶
type BatchUnlinkInoReq = proto.BatchUnlinkInodeRequest
Client -> MetaNode delete Inode request struct
type BatchUnlinkInoResp ¶
type BatchUnlinkInoResp = proto.BatchUnlinkInodeResponse
MetaNode -> Client delete batch Inode response
type CreateDentryReq ¶
type CreateDentryReq = proto.CreateDentryRequest
Client -> MetaNode create Dentry request struct
type CreateInoReq ¶
type CreateInoReq = proto.CreateInodeRequest
Client -> MetaNode create Inode request
type CreateInoResp ¶
type CreateInoResp = proto.CreateInodeResponse
MetaNode -> Client create Inode response
type CreateMetaRangeReq ¶
type CreateMetaRangeReq = proto.CreateMetaPartitionRequest
Master -> MetaNode create metaPartition request
type CreateMetaRangeResp ¶
type CreateMetaRangeResp = proto.CreateMetaPartitionResponse
MetaNode -> Master create metaPartition response
type DataPartition ¶
type DataPartition struct { PartitionID uint64 Status int8 ReplicaNum uint8 PartitionType string Hosts []string }
DataPartition defines the struct of data partition that will be used on the meta node.
func (*DataPartition) GetAllAddrs ¶
func (dp *DataPartition) GetAllAddrs() (m string)
GetAllAddrs returns all addresses of the data partition.
type DataPartitionsView ¶
type DataPartitionsView struct {
DataPartitions []*DataPartition
}
DataPartitionsView defines the view of the data node.
func NewDataPartitionsView ¶
func NewDataPartitionsView() *DataPartitionsView
type DelExtFile ¶
func (DelExtFile) Len ¶
func (del DelExtFile) Len() int
func (DelExtFile) Less ¶
func (del DelExtFile) Less(i, j int) bool
func (DelExtFile) Swap ¶
func (del DelExtFile) Swap(i, j int)
type DeleteDentryReq ¶
type DeleteDentryReq = proto.DeleteDentryRequest
Client -> MetaNode delete Dentry request
type DeleteDentryResp ¶
type DeleteDentryResp = proto.DeleteDentryResponse
MetaNode -> Client delete Dentry response
type Dentry ¶
type Dentry struct { ParentId uint64 // FileID value of the parent inode. Name string // Name of the current dentry. Inode uint64 // FileID value of the current inode. Type uint32 }
Dentry wraps necessary properties of the `dentry` information in file system. Marshal exporterKey:
+-------+----------+------+ | item | ParentId | Name | +-------+----------+------+ | bytes | 8 | rest | +-------+----------+------+
Marshal value:
+-------+-------+------+ | item | Inode | Type | +-------+-------+------+ | bytes | 8 | 4 | +-------+-------+------+
Marshal entity:
+-------+-----------+--------------+-----------+--------------+ | item | KeyLength | MarshaledKey | ValLength | MarshaledVal | +-------+-----------+--------------+-----------+--------------+ | bytes | 4 | KeyLength | 4 | ValLength | +-------+-----------+--------------+-----------+--------------+
func (*Dentry) Less ¶
Less tests whether the current dentry is less than the given one. This method is necessary fot B-Tree item implementation.
func (*Dentry) MarshalKey ¶
MarshalKey is the bytes version of the MarshalKey method which returns the byte slice result.
func (*Dentry) MarshalValue ¶
MarshalValue marshals the exporterKey to bytes.
func (*Dentry) UnmarshalKey ¶
UnmarshalKey unmarshals the exporterKey from bytes.
func (*Dentry) UnmarshalValue ¶
UnmarshalValue unmarshals the value from bytes.
type DentryBatch ¶
type DentryBatch []*Dentry
func DentryBatchUnmarshal ¶
func DentryBatchUnmarshal(raw []byte) (DentryBatch, error)
Unmarshal unmarshals the dentryBatch.
func (DentryBatch) Marshal ¶
func (d DentryBatch) Marshal() ([]byte, error)
Marshal marshals the dentryBatch into a byte array.
type DentryResponse ¶
func NewDentryResponse ¶
func NewDentryResponse() *DentryResponse
type Extend ¶ added in v1.5.0
type Extend struct {
// contains filtered or unexported fields
}
func NewExtendFromBytes ¶ added in v1.5.0
type ExtendOpResult ¶ added in v1.5.0
type Inode ¶
type Inode struct { sync.RWMutex Inode uint64 // Inode ID Type uint32 Uid uint32 Gid uint32 Size uint64 Generation uint64 CreateTime int64 AccessTime int64 ModifyTime int64 LinkTarget []byte // SymLink target name NLink uint32 // NodeLink counts Flag int32 Reserved uint64 // reserved space //Extents *ExtentsTree Extents *SortedExtents ObjExtents *SortedObjExtents }
Inode wraps necessary properties of `Inode` information in the file system. Marshal exporterKey:
+-------+-------+ | item | Inode | +-------+-------+ | bytes | 8 | +-------+-------+
Marshal value:
+-------+------+------+-----+----+----+----+--------+------------------+ | item | Type | Size | Gen | CT | AT | MT | ExtLen | MarshaledExtents | +-------+------+------+-----+----+----+----+--------+------------------+ | bytes | 4 | 8 | 8 | 8 | 8 | 8 | 4 | ExtLen | +-------+------+------+-----+----+----+----+--------+------------------+
Marshal entity:
+-------+-----------+--------------+-----------+--------------+ | item | KeyLength | MarshaledKey | ValLength | MarshaledVal | +-------+-----------+--------------+-----------+--------------+ | bytes | 4 | KeyLength | 4 | ValLength | +-------+-----------+--------------+-----------+--------------+
func NewInode ¶
NewInode returns a new Inode instance with specified Inode ID, name and type. The AccessTime and ModifyTime will be set to the current time.
func (*Inode) AppendExtentWithCheck ¶
func (*Inode) AppendExtents ¶
func (i *Inode) AppendExtents(eks []proto.ExtentKey, ct int64, volType int) (delExtents []proto.ExtentKey)
AppendExtents append the extent to the btree.
func (*Inode) AppendObjExtents ¶
func (i *Inode) AppendObjExtents(eks []proto.ObjExtentKey, ct int64) (err error)
AppendObjExtents append the extent to the btree.
func (*Inode) CopyTinyExtents ¶
EmptyExtents clean the inode's extent list.
func (*Inode) DoReadFunc ¶
func (i *Inode) DoReadFunc(fn func())
DoFunc executes the given function.
func (*Inode) DoWriteFunc ¶
func (i *Inode) DoWriteFunc(fn func())
func (*Inode) EmptyExtents ¶
EmptyExtents clean the inode's extent list.
func (*Inode) ExtentsTruncate ¶
func (*Inode) IsEmptyDir ¶
func (*Inode) IsTempFile ¶
func (*Inode) Less ¶
Less tests whether the current Inode item is less than the given one. This method is necessary fot B-Tree item implementation.
func (*Inode) MarshalKey ¶
MarshalKey marshals the exporterKey to bytes.
func (*Inode) MarshalToJSON ¶
MarshalToJSON is the wrapper of json.Marshal.
func (*Inode) MarshalValue ¶
MarshalValue marshals the value to bytes.
func (*Inode) SetAttr ¶
func (i *Inode) SetAttr(req *SetattrRequest)
SetAttr sets the attributes of the inode.
func (*Inode) SetDeleteMark ¶
func (i *Inode) SetDeleteMark()
SetDeleteMark set the deleteMark flag. TODO markDelete or deleteMark? markDelete has been used in datanode.
func (*Inode) ShouldDelayDelete ¶
inode should delay remove if as 3 conditions: 1. DeleteMarkFlag is unset 2. NLink == 0 3. AccessTime is 7 days ago
func (*Inode) ShouldDelete ¶
ShouldDelete returns if the inode has been marked as deleted.
func (*Inode) UnmarshalKey ¶
UnmarshalKey unmarshals the exporterKey from bytes.
func (*Inode) UnmarshalValue ¶
UnmarshalValue unmarshals the value from bytes.
type InodeBatch ¶
type InodeBatch []*Inode
func InodeBatchUnmarshal ¶
func InodeBatchUnmarshal(raw []byte) (InodeBatch, error)
Unmarshal unmarshals the inodeBatch.
func (InodeBatch) Marshal ¶
func (i InodeBatch) Marshal() ([]byte, error)
Marshal marshals the inodeBatch into a byte array.
type InodeResponse ¶
func NewInodeResponse ¶
func NewInodeResponse() *InodeResponse
type LinkInodeReq ¶
type LinkInodeReq = proto.LinkInodeRequest
Client -> MetaNode create Link Request
type LinkInodeResp ¶
type LinkInodeResp = proto.LinkInodeResponse
MetaNode -> Client create Link Response
type MetaItem ¶
MetaItem defines the structure of the metadata operations.
func NewMetaItem ¶
NewMetaItem returns a new MetaItem.
func (*MetaItem) MarshalBinary ¶
MarshalBinary marshals MetaItem to binary data. Binary frame structure:
+------+----+------+------+------+------+ | Item | Op | LenK | K | LenV | V | +------+----+------+------+------+------+ | byte | 4 | 4 | LenK | 4 | LenV | +------+----+------+------+------+------+
func (*MetaItem) UnmarshalBinary ¶
MarshalBinary unmarshal this MetaItem entity from binary data. Binary frame structure:
+------+----+------+------+------+------+ | Item | Op | LenK | K | LenV | V | +------+----+------+------+------+------+ | byte | 4 | 4 | LenK | 4 | LenV | +------+----+------+------+------+------+
func (*MetaItem) UnmarshalJson ¶
UnmarshalJson unmarshals binary data to MetaItem.
type MetaItemIterator ¶
type MetaItemIterator struct {
// contains filtered or unexported fields
}
MetaItemIterator defines the iterator of the MetaItem.
func (*MetaItemIterator) ApplyIndex ¶
func (si *MetaItemIterator) ApplyIndex() uint64
ApplyIndex returns the applyID of the iterator.
func (*MetaItemIterator) Next ¶
func (si *MetaItemIterator) Next() (data []byte, err error)
Next returns the next item.
type MetaNode ¶
type MetaNode struct {
// contains filtered or unexported fields
}
The MetaNode manages the dentry and inode information of the meta partitions on a meta node. The data consistency is ensured by Raft.
type MetaNodeMetrics ¶
type MetaPartition ¶
type MetaPartition interface { Start() error Stop() DataSize() uint64 OpMeta LoadSnapshot(path string) error ForceSetMetaPartitionToLoadding() ForceSetMetaPartitionToFininshLoad() }
MetaPartition defines the interface for the meta partition operations.
func NewMetaPartition ¶
func NewMetaPartition(conf *MetaPartitionConfig, manager *metadataManager) MetaPartition
NewMetaPartition creates a new meta partition with the specified configuration.
type MetaPartitionConfig ¶
type MetaPartitionConfig struct { // Identity for raftStore group. RaftStore nodes in the same raftStore group must have the same groupID. PartitionId uint64 `json:"partition_id"` VolName string `json:"vol_name"` Start uint64 `json:"start"` // Minimal Inode ID of this range. (Required during initialization) End uint64 `json:"end"` // Maximal Inode ID of this range. (Required during initialization) PartitionType int `json:"partition_type"` Peers []proto.Peer `json:"peers"` // Peers information of the raftStore Cursor uint64 `json:"-"` // Cursor ID of the inode that have been assigned NodeId uint64 `json:"-"` RootDir string `json:"-"` BeforeStart func() `json:"-"` AfterStart func() `json:"-"` BeforeStop func() `json:"-"` AfterStop func() `json:"-"` RaftStore raftstore.RaftStore `json:"-"` ConnPool *util.ConnectPool `json:"-"` }
MetaPartitionConfig is used to create a meta partition.
type MetadataManager ¶
type MetadataManager interface { Start() error Stop() //CreatePartition(id string, start, end uint64, peers []proto.Peer) error HandleMetadataOperation(conn net.Conn, p *Packet, remoteAddr string) error GetPartition(id uint64) (MetaPartition, error) }
MetadataManager manages all the meta partitions.
func NewMetadataManager ¶
func NewMetadataManager(conf MetadataManagerConfig, metaNode *MetaNode) MetadataManager
NewMetadataManager returns a new metadata manager.
type MetadataManagerConfig ¶
type MetadataManagerConfig struct { NodeID uint64 RootDir string ZoneName string RaftStore raftstore.RaftStore }
MetadataManagerConfig defines the configures in the metadata manager.
type Multipart ¶ added in v1.5.0
type Multipart struct {
// contains filtered or unexported fields
}
Multipart defined necessary fields for multipart session management.
func MultipartFromBytes ¶ added in v1.5.0
func (*Multipart) InsertPart ¶ added in v1.5.0
Deprecated
func (*Multipart) LoadOrStorePart ¶
type MultipartExtend ¶
func MultipartExtendFromBytes ¶
func MultipartExtendFromBytes(raw []byte) MultipartExtend
func NewMultipartExtend ¶
func NewMultipartExtend() MultipartExtend
func (MultipartExtend) Bytes ¶
func (me MultipartExtend) Bytes() ([]byte, error)
type NowTime ¶
NowTime defines the current time.
func (*NowTime) GetCurrentTime ¶
GetCurrentTime returns the current time.
func (*NowTime) UpdateTime ¶
UpdateTime updates the stored time.
type OpDentry ¶
type OpDentry interface { CreateDentry(req *CreateDentryReq, p *Packet) (err error) DeleteDentry(req *DeleteDentryReq, p *Packet) (err error) DeleteDentryBatch(req *BatchDeleteDentryReq, p *Packet) (err error) UpdateDentry(req *UpdateDentryReq, p *Packet) (err error) ReadDir(req *ReadDirReq, p *Packet) (err error) ReadDirLimit(req *ReadDirLimitReq, p *Packet) (err error) ReadDirOnly(req *ReadDirOnlyReq, p *Packet) (err error) Lookup(req *LookupReq, p *Packet) (err error) GetDentryTree() *BTree }
OpDentry defines the interface for the dentry operations.
type OpExtend ¶ added in v1.5.0
type OpExtend interface { SetXAttr(req *proto.SetXAttrRequest, p *Packet) (err error) GetXAttr(req *proto.GetXAttrRequest, p *Packet) (err error) BatchGetXAttr(req *proto.BatchGetXAttrRequest, p *Packet) (err error) RemoveXAttr(req *proto.RemoveXAttrRequest, p *Packet) (err error) ListXAttr(req *proto.ListXAttrRequest, p *Packet) (err error) UpdateXAttr(req *proto.UpdateXAttrRequest, p *Packet) (err error) }
type OpExtent ¶
type OpExtent interface { ExtentAppend(req *proto.AppendExtentKeyRequest, p *Packet) (err error) ExtentAppendWithCheck(req *proto.AppendExtentKeyWithCheckRequest, p *Packet) (err error) BatchObjExtentAppend(req *proto.AppendObjExtentKeysRequest, p *Packet) (err error) ExtentsList(req *proto.GetExtentsRequest, p *Packet) (err error) ObjExtentsList(req *proto.GetExtentsRequest, p *Packet) (err error) ExtentsTruncate(req *ExtentsTruncateReq, p *Packet) (err error) BatchExtentAppend(req *proto.AppendExtentKeysRequest, p *Packet) (err error) }
OpExtent defines the interface for the extent operations.
type OpInode ¶
type OpInode interface { CreateInode(req *CreateInoReq, p *Packet) (err error) UnlinkInode(req *UnlinkInoReq, p *Packet) (err error) UnlinkInodeBatch(req *BatchUnlinkInoReq, p *Packet) (err error) InodeGet(req *InodeGetReq, p *Packet) (err error) InodeGetBatch(req *InodeGetReqBatch, p *Packet) (err error) CreateInodeLink(req *LinkInodeReq, p *Packet) (err error) EvictInode(req *EvictInodeReq, p *Packet) (err error) EvictInodeBatch(req *BatchEvictInodeReq, p *Packet) (err error) SetAttr(reqData []byte, p *Packet) (err error) GetInodeTree() *BTree DeleteInode(req *proto.DeleteInodeRequest, p *Packet) (err error) DeleteInodeBatch(req *proto.DeleteInodeBatchRequest, p *Packet) (err error) ClearInodeCache(req *proto.ClearInodeCacheRequest, p *Packet) (err error) }
OpInode defines the interface for the inode operations.
type OpMeta ¶
type OpMeta interface { OpInode OpDentry OpExtent OpPartition OpExtend OpMultipart }
OpMeta defines the interface for the metadata operations.
type OpMultipart ¶ added in v1.5.0
type OpMultipart interface { GetMultipart(req *proto.GetMultipartRequest, p *Packet) (err error) CreateMultipart(req *proto.CreateMultipartRequest, p *Packet) (err error) AppendMultipart(req *proto.AddMultipartPartRequest, p *Packet) (err error) RemoveMultipart(req *proto.RemoveMultipartRequest, p *Packet) (err error) ListMultipart(req *proto.ListMultipartRequest, p *Packet) (err error) }
type OpPartition ¶
type OpPartition interface { IsLeader() (leaderAddr string, isLeader bool) GetCursor() uint64 GetBaseConfig() MetaPartitionConfig ResponseLoadMetaPartition(p *Packet) (err error) PersistMetadata() (err error) ChangeMember(changeType raftproto.ConfChangeType, peer raftproto.Peer, context []byte) (resp interface{}, err error) Reset() (err error) UpdatePartition(req *UpdatePartitionReq, resp *UpdatePartitionResp) (err error) DeleteRaft() error IsExsitPeer(peer proto.Peer) bool TryToLeader(groupID uint64) error CanRemoveRaftMember(peer proto.Peer) error IsEquareCreateMetaPartitionRequst(request *proto.CreateMetaPartitionRequest) (err error) }
OpPartition defines the interface for the partition operations.
type Packet ¶
func NewPacketToBatchDeleteExtent ¶
func NewPacketToBatchDeleteExtent(dp *DataPartition, exts []*proto.ExtentKey) *Packet
NewPacketToBatchDeleteExtent returns a new packet to batch delete the extent.
func NewPacketToDeleteExtent ¶
func NewPacketToDeleteExtent(dp *DataPartition, ext *proto.ExtentKey) *Packet
NewPacketToDeleteExtent returns a new packet to delete the extent.
func NewPacketToFreeInodeOnRaftFollower ¶
NewPacketToDeleteExtent returns a new packet to delete the extent.
type Part ¶ added in v1.5.0
Part defined necessary fields for multipart part management.
func PartFromBytes ¶ added in v1.5.0
type Parts ¶ added in v1.5.0
type Parts []*Part
func PartsFromBytes ¶ added in v1.5.0
type ReadDirLimitReq ¶
type ReadDirLimitReq = proto.ReadDirLimitRequest
Client -> MetaNode read dir request
type ReadDirLimitResp ¶
type ReadDirLimitResp = proto.ReadDirLimitResponse
MetaNode -> Client read dir response
type SortedExtents ¶
func NewSortedExtents ¶
func NewSortedExtents() *SortedExtents
func NewSortedExtentsFromEks ¶
func NewSortedExtentsFromEks(eks []proto.ExtentKey) *SortedExtents
attention: only used for deleted eks
func (*SortedExtents) Append ¶
func (se *SortedExtents) Append(ek proto.ExtentKey) (deleteExtents []proto.ExtentKey)
func (*SortedExtents) AppendWithCheck ¶
func (*SortedExtents) Clone ¶
func (se *SortedExtents) Clone() *SortedExtents
func (*SortedExtents) CopyExtents ¶
func (se *SortedExtents) CopyExtents() []proto.ExtentKey
func (*SortedExtents) CopyTinyExtents ¶
func (se *SortedExtents) CopyTinyExtents() []proto.ExtentKey
func (*SortedExtents) Delete ¶
func (se *SortedExtents) Delete(delEks []proto.ExtentKey) (curEks []proto.ExtentKey)
discard code
func (*SortedExtents) Len ¶
func (se *SortedExtents) Len() int
func (*SortedExtents) MarshalBinary ¶
func (se *SortedExtents) MarshalBinary() ([]byte, error)
func (*SortedExtents) String ¶
func (se *SortedExtents) String() string
func (*SortedExtents) Truncate ¶
func (se *SortedExtents) Truncate(offset uint64) (deleteExtents []proto.ExtentKey)
func (*SortedExtents) UnmarshalBinary ¶
func (se *SortedExtents) UnmarshalBinary(data []byte) error
type SortedObjExtents ¶
func NewSortedObjExtents ¶
func NewSortedObjExtents() *SortedObjExtents
func (*SortedObjExtents) Append ¶
func (se *SortedObjExtents) Append(ek proto.ObjExtentKey) (err error)
Append will return error if the objextentkey exist overlap.
func (*SortedObjExtents) Clone ¶
func (se *SortedObjExtents) Clone() *SortedObjExtents
func (*SortedObjExtents) CopyExtents ¶
func (se *SortedObjExtents) CopyExtents() []proto.ObjExtentKey
func (*SortedObjExtents) FindOffsetExist ¶
func (se *SortedObjExtents) FindOffsetExist(fileOffset uint64) (bool, int)
func (*SortedObjExtents) MarshalBinary ¶
func (se *SortedObjExtents) MarshalBinary() ([]byte, error)
func (*SortedObjExtents) Range ¶
func (se *SortedObjExtents) Range(f func(ek proto.ObjExtentKey) bool)
func (*SortedObjExtents) String ¶
func (se *SortedObjExtents) String() string
func (*SortedObjExtents) UnmarshalBinary ¶
func (se *SortedObjExtents) UnmarshalBinary(data []byte) error
type UnlinkInoReq ¶
type UnlinkInoReq = proto.UnlinkInodeRequest
Client -> MetaNode delete Inode request struct
type UnlinkInoResp ¶
type UnlinkInoResp = proto.UnlinkInodeResponse
MetaNode -> Client delete Inode response
type UpdateDentryReq ¶
type UpdateDentryReq = proto.UpdateDentryRequest
Client -> MetaNode updateDentry request
type UpdateDentryResp ¶
type UpdateDentryResp = proto.UpdateDentryResponse
MetaNode -> Client updateDentry response
type UpdatePartitionReq ¶
type UpdatePartitionReq = proto.UpdateMetaPartitionRequest
Master -> MetaNode
type UpdatePartitionResp ¶
type UpdatePartitionResp = proto.UpdateMetaPartitionResponse
MetaNode -> Master
type Vol ¶
Vol defines the view of the data partition with the read/write lock.
func (*Vol) GetPartition ¶
func (v *Vol) GetPartition(partitionID uint64) *DataPartition
GetPartition returns the data partition based on the given partition ID.
func (*Vol) UpdatePartitions ¶
func (v *Vol) UpdatePartitions(partitions *DataPartitionsView)
UpdatePartitions updates the data partition.
Source Files ¶
- api_handler.go
- btree.go
- const.go
- datapartition.go
- dentry.go
- extend.go
- free_list.go
- inode.go
- manager.go
- manager_op.go
- manager_proxy.go
- manager_resp.go
- metanode.go
- metrics.go
- multipart.go
- nodeinfo.go
- packet.go
- partition.go
- partition_delete_extents.go
- partition_free_list.go
- partition_fsm.go
- partition_fsmop.go
- partition_fsmop_dentry.go
- partition_fsmop_extend.go
- partition_fsmop_inode.go
- partition_fsmop_multipart.go
- partition_item.go
- partition_op_dentry.go
- partition_op_extend.go
- partition_op_extent.go
- partition_op_inode.go
- partition_op_multipart.go
- partition_store.go
- partition_store_ticket.go
- raft_server.go
- server.go
- sorted_extents.go
- sorted_obj_extents.go
- time.go
- util.go