Versions in this module Expand all Collapse all v1 v1.5.1 Jan 20, 2020 v1.5.0 Jan 8, 2020 Changes in this version + type Extend struct + func NewExtend(inode uint64) *Extend + func NewExtendFromBytes(raw []byte) (*Extend, error) + 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 struct + Extend *Extend + Status uint8 + type Multipart struct + func MultipartFromBytes(raw []byte) *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) Parts() []*Part + type OpExtend interface + BatchGetXAttr func(req *proto.BatchGetXAttrRequest, p *Packet) (err error) + GetXAttr func(req *proto.GetXAttrRequest, p *Packet) (err error) + ListXAttr func(req *proto.ListXAttrRequest, p *Packet) (err error) + RemoveXAttr func(req *proto.RemoveXAttrRequest, p *Packet) (err error) + SetXAttr func(req *proto.SetXAttrRequest, p *Packet) (err error) type OpExtent + BatchExtentAppend func(req *proto.AppendExtentKeysRequest, p *Packet) (err error) type OpInode + DeleteInode func(req *proto.DeleteInodeRequest, p *Packet) (err error) + type OpMultipart interface + AppendMultipart func(req *proto.AddMultipartPartRequest, p *Packet) (err error) + CreateMultipart func(req *proto.CreateMultipartRequest, p *Packet) (err error) + GetMultipart func(req *proto.GetMultipartRequest, p *Packet) (err error) + ListMultipart func(req *proto.ListMultipartRequest, p *Packet) (err error) + RemoveMultipart func(req *proto.RemoveMultipartRequest, p *Packet) (err error) type OpPartition + Reset func() (err error) + ResponseLoadMetaPartition func(p *Packet) (err error) + type Part struct + ID uint16 + Inode uint64 + MD5 string + Size uint64 + UploadTime time.Time + func PartFromBytes(raw []byte) *Part + func (m Part) Bytes() ([]byte, error) + type Parts []*Part + func PartsFromBytes(raw []byte) Parts + func (m *Parts) Hash(part *Part) (has bool) + func (m *Parts) Insert(part *Part, replace bool) (success bool) + func (m *Parts) Remove(id uint16) + func (m Parts) Bytes() ([]byte, error) + func (m Parts) Len() int + func (m Parts) Less(i, j int) bool + func (m Parts) Search(id uint16) (part *Part, found bool) + func (m Parts) Sort() + func (m Parts) Swap(i, j int) v1.4.0 Nov 13, 2019 Changes in this version + const MaxUsedMemFactor + type MetaNodeInfo struct + Addr string + PersistenceMetaPartitions []uint64 type OpPartition + CanRemoveRaftMember func(peer proto.Peer) error + IsExsitPeer func(peer proto.Peer) bool + TryToLeader func(groupID uint64) error v1.1.1 Jun 11, 2019 v1.1.0 May 9, 2019 v1.0.0 Apr 2, 2019 Changes in this version + const AsyncDeleteInterval + const BatchCounts + const DeleteInodeFileExtension + const DeleteMarkFlag + const ForceClosedConnect + const GB + const KB + const MB + const NoClosedConnect + const OpenRWAppendOpt + const SnapshotSign + const StateRunning + const StateShutdown + const StateStandby + const StateStart + const StateStopped + const TempFileValidTime + const UpdateVolTicket + var ErrIllegalHeartbeatAddress = errors.New("illegal heartbeat address") + var ErrIllegalReplicateAddress = errors.New("illegal replicate address") + var ErrInodeIDOutOfRange = errors.New("inode ID out of range") + var ErrNoLeader = errors.New("no leader") + var ErrNotALeader = errors.New("not a leader") + var Now = NewNowTime() + func PutExtentSlice(eks []BtreeItem) + type APIResponse struct + Code int + Data interface{} + Msg string + func NewAPIResponse(code int, msg string) *APIResponse + func (api *APIResponse) Marshal() ([]byte, error) + type BTree struct + func NewBtree() *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) 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 BtreeItem = btree.Item + func GetExtentSlice() []BtreeItem + type CreateDentryReq = proto.CreateDentryRequest + type CreateInoReq = proto.CreateInodeRequest + type CreateInoResp = proto.CreateInodeResponse + type CreateMetaRangeReq = proto.CreateMetaPartitionRequest + type CreateMetaRangeResp = proto.CreateMetaPartitionResponse + type DataPartition struct + Hosts []string + PartitionID uint64 + PartitionType string + ReplicaNum uint8 + Status int8 + func (dp *DataPartition) GetAllAddrs() (m string) + type DataPartitionsView struct + DataPartitions []*DataPartition + func NewDataPartitionsView() *DataPartitionsView + type DeleteDentryReq = proto.DeleteDentryRequest + type DeleteDentryResp = proto.DeleteDentryResponse + type Dentry struct + Inode uint64 + Name string + ParentId uint64 + Type uint32 + 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 DentryResponse struct + Msg *Dentry + Status uint8 + func NewDentryResponse() *DentryResponse + type EvictInodeReq = proto.EvictInodeRequest + type ExtentsTree struct + func NewExtentsTree() *ExtentsTree + func (e *ExtentsTree) Append(key BtreeItem) (items []BtreeItem) + func (e *ExtentsTree) Clone() *ExtentsTree + func (e *ExtentsTree) Marshal() ([]byte, error) + func (e *ExtentsTree) MarshalBinary() (data []byte, err error) + func (e *ExtentsTree) MarshalJSON() ([]byte, error) + func (e *ExtentsTree) Range(f func(item BtreeItem) bool) + func (e *ExtentsTree) Size() (size uint64) + func (e *ExtentsTree) String() string + func (e *ExtentsTree) UnmarshalBinary(data []byte) (err error) + type ExtentsTruncateReq = proto.TruncateRequest + type Inode struct + AccessTime int64 + CreateTime int64 + Extents *ExtentsTree + Flag int32 + Generation uint64 + Gid uint32 + Inode uint64 + LinkTarget []byte + ModifyTime int64 + NLink uint32 + Reserved uint64 + Size uint64 + Type uint32 + Uid uint32 + func NewInode(ino uint64, t uint32) *Inode + func (i *Inode) AppendExtents(exts []BtreeItem, ct int64) (items []BtreeItem) + func (i *Inode) Copy() BtreeItem + func (i *Inode) DecNLink() + func (i *Inode) DoReadFunc(fn func()) + func (i *Inode) DoWriteFunc(fn func()) + func (i *Inode) ExtentsTruncate(exts []BtreeItem, length uint64, ct int64) + 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(valid, mode, uid, gid uint32) + func (i *Inode) SetDeleteMark() + func (i *Inode) ShouldDelete() 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 InodeGetReq = proto.InodeGetRequest + type InodeGetReqBatch = proto.BatchInodeGetRequest + type InodeResponse struct + Msg *Inode + Status uint8 + func NewInodeResponse() *InodeResponse + type LinkInodeReq = proto.LinkInodeRequest + type LinkInodeResp = proto.LinkInodeResponse + type LookupReq = proto.LookupRequest + type LookupResp = proto.LookupResponse + type MetaItem struct + K []byte + Op uint32 + V []byte + func NewMetaItem(op uint32, key, value []byte) *MetaItem + func (s *MetaItem) MarshalBinary() (result []byte, err error) + func (s *MetaItem) MarshalJson() ([]byte, error) + func (s *MetaItem) UnmarshalBinary(raw []byte) (err error) + func (s *MetaItem) UnmarshalJson(data []byte) error + type MetaItemIterator struct + func NewMetaItemIterator(applyID uint64, ino, den *BTree, rootDir string, filelist []string) *MetaItemIterator + func (si *MetaItemIterator) ApplyIndex() uint64 + func (si *MetaItemIterator) Close() + func (si *MetaItemIterator) Next() (data []byte, err error) + type MetaNode struct + func NewServer() *MetaNode + func (m *MetaNode) Shutdown() + func (m *MetaNode) Start(cfg *config.Config) (err error) + func (m *MetaNode) Sync() + type MetaPartition interface + Start func() error + Stop func() + func NewMetaPartition(conf *MetaPartitionConfig) MetaPartition + type MetaPartitionConfig struct + AfterStart func() + AfterStop func() + BeforeStart func() + BeforeStop func() + ConnPool *util.ConnectPool + Cursor uint64 + End uint64 + NodeId uint64 + PartitionId uint64 + Peers []proto.Peer + RaftStore raftstore.RaftStore + RootDir string + Start uint64 + VolName string + type MetadataManager interface + GetPartition func(id uint64) (MetaPartition, error) + HandleMetadataOperation func(conn net.Conn, p *Packet, remoteAddr string) error + Start func() error + Stop func() + func NewMetadataManager(conf MetadataManagerConfig) MetadataManager + type MetadataManagerConfig struct + NodeID uint64 + RaftStore raftstore.RaftStore + RootDir string + type NowTime struct + func NewNowTime() *NowTime + func (t *NowTime) GetCurrentTime() (now time.Time) + func (t *NowTime) UpdateTime(now time.Time) + type OpDentry interface + CreateDentry func(req *CreateDentryReq, p *Packet) (err error) + DeleteDentry func(req *DeleteDentryReq, p *Packet) (err error) + GetDentryTree func() *BTree + Lookup func(req *LookupReq, p *Packet) (err error) + ReadDir func(req *ReadDirReq, p *Packet) (err error) + UpdateDentry func(req *UpdateDentryReq, p *Packet) (err error) + type OpExtent interface + ExtentAppend func(req *proto.AppendExtentKeyRequest, p *Packet) (err error) + ExtentsList func(req *proto.GetExtentsRequest, p *Packet) (err error) + ExtentsTruncate func(req *ExtentsTruncateReq, p *Packet) (err error) + type OpInode interface + CreateInode func(req *CreateInoReq, p *Packet) (err error) + CreateInodeLink func(req *LinkInodeReq, p *Packet) (err error) + EvictInode func(req *EvictInodeReq, p *Packet) (err error) + GetInodeTree func() *BTree + InodeGet func(req *InodeGetReq, p *Packet) (err error) + InodeGetBatch func(req *InodeGetReqBatch, p *Packet) (err error) + SetAttr func(reqData []byte, p *Packet) (err error) + UnlinkInode func(req *UnlinkInoReq, p *Packet) (err error) + type OpMeta interface + type OpPartition interface + ChangeMember func(changeType raftproto.ConfChangeType, peer raftproto.Peer, context []byte) (resp interface{}, err error) + DeletePartition func() (err error) + DeleteRaft func() error + GetBaseConfig func() MetaPartitionConfig + GetCursor func() uint64 + IsLeader func() (leaderAddr string, isLeader bool) + LoadSnapshotSign func(p *Packet) (err error) + PersistMetadata func() (err error) + UpdatePartition func(req *UpdatePartitionReq, resp *UpdatePartitionResp) (err error) + type Packet struct + func NewPacketToDeleteExtent(dp *DataPartition, ext *proto.ExtentKey) *Packet + func NewPacketToFreeInodeOnRaftFollower(partitionID uint64, freeInodes []byte) *Packet + type ReadDirReq = proto.ReadDirRequest + type ReadDirResp = proto.ReadDirResponse + type SetattrRequest = proto.SetAttrRequest + type UnlinkInoReq = proto.UnlinkInodeRequest + type UnlinkInoResp = proto.UnlinkInodeResponse + type UpdateDentryReq = proto.UpdateDentryRequest + type UpdateDentryResp = proto.UpdateDentryResponse + type UpdatePartitionReq = proto.UpdateMetaPartitionRequest + type UpdatePartitionResp = proto.UpdateMetaPartitionResponse + type Vol struct + func NewVol() *Vol + func (v *Vol) GetPartition(partitionID uint64) *DataPartition + func (v *Vol) UpdatePartitions(partitions *DataPartitionsView) Incompatible versions in this module v2.0.0+incompatible Apr 10, 2020 v2.0.0-rc.1+incompatible Apr 9, 2020