internal

package
v0.0.0-...-353e2e1 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StagingChunkData   = byte(1)
	StagingChunkDelete = byte(2)
	StagingChunkBlank  = byte(3)
)
View Source
const (
	DiskWriteBegin   int32 = -1
	DiskWritePrepare int32 = 0
)
View Source
const (
	MaxNrCacheForUpdateChunk  int = 32
	MaxNrWriterForUpdateChunk int = 16
)
View Source
const (
	RaftInit      = 0
	RaftFollower  = 1
	RaftCandidate = 2
	RaftLeader    = 3

	RaftReplyOk          = int32(api.Reply_Ok)
	RaftReplyFail        = int32(api.Reply_Fail)
	RaftReplyNotLeader   = int32(api.Reply_NotLeader)
	RaftReplyTimeout     = int32(api.Reply_Timeout)
	RaftReplyContinue    = int32(api.Reply_Continue)
	RaftReplyMismatchVer = int32(api.Reply_MismatchVer)
	RaftReplyRetry       = int32(api.Reply_Retry)
	RaftReplyVoting      = int32(api.Reply_Voting)
	RaftReplyNoGroup     = int32(api.Reply_NoGroup)
	RaftReplyExt         = int32(api.Reply_Ext)
)
View Source
const (
	AppendEntryCommandLogBaseSize = int32(crc32.Size + 7)
	AppendEntryCommandLogSize     = AppendEntryCommandLogBaseSize + int32(AppendEntryExtLogCmdLength)
	AppendEntryExtLogCmdLength    = uint8(28)

	DataCmdIdBit = uint16(1 << 15)

	AppendEntryNoOpCmdId                      = uint16(0)
	AppendEntryAddServerCmdId                 = uint16(1)
	AppendEntryRemoveServerCmdId              = uint16(2)
	AppendEntryCommitTxCmdId                  = uint16(3)
	AppendEntryResetExtLogCmdId               = uint16(4)
	AppendEntryFillChunkCmdId                 = DataCmdIdBit | uint16(1)
	AppendEntryUpdateChunkCmdId               = DataCmdIdBit | uint16(2)
	AppendEntryUpdateMetaCmdId                = DataCmdIdBit | uint16(3)
	AppendEntryCommitChunkCmdId               = DataCmdIdBit | uint16(4)
	AppendEntryAbortTxCmdId                   = DataCmdIdBit | uint16(5)
	AppendEntryPersistChunkCmdId              = DataCmdIdBit | uint16(6)
	AppendEntryBeginPersistCmdId              = DataCmdIdBit | uint16(7)
	AppendEntryInitNodeListCmdId              = DataCmdIdBit | uint16(8)
	AppendEntryUpdateNodeListCmdId            = DataCmdIdBit | uint16(9)
	AppendEntryUpdateMetaKeyCmdId             = DataCmdIdBit | uint16(10)
	AppendEntryCreateMetaCmdId                = DataCmdIdBit | uint16(11)
	AppendEntryDeleteMetaCmdId                = DataCmdIdBit | uint16(12)
	AppendEntryUpdateParentMetaCmdId          = DataCmdIdBit | uint16(13)
	AppendEntryAddInodeFileMapCmdId           = DataCmdIdBit | uint16(14)
	AppendEntryDropLRUChunksCmdId             = DataCmdIdBit | uint16(15)
	AppendEntryCreateChunkCmdId               = DataCmdIdBit | uint16(16)
	AppendEntryUpdateMetaAttrCmdId            = DataCmdIdBit | uint16(17)
	AppendEntryDeleteInodeFileMapCmdId        = DataCmdIdBit | uint16(18)
	AppendEntryRemoveNonDirtyChunksCmdId      = DataCmdIdBit | uint16(19)
	AppendEntryForgetAllDirtyLogCmdId         = DataCmdIdBit | uint16(20)
	AppendEntryRecordMigratedAddMetaCmdId     = DataCmdIdBit | uint16(21)
	AppendEntryRecordMigratedRemoveMetaCmdId  = DataCmdIdBit | uint16(22)
	AppendEntryRecordMigratedAddChunkCmdId    = DataCmdIdBit | uint16(23)
	AppendEntryRecordMigratedRemoveChunkCmdId = DataCmdIdBit | uint16(24)
	AppendEntryTruncateCoordinatorCmdId       = DataCmdIdBit | uint16(25)
	AppendEntryFlushCoordinatorCmdId          = DataCmdIdBit | uint16(26)
	AppendEntryHardLinkCoordinatorCmdId       = DataCmdIdBit | uint16(27)
	AppendEntryPersistCoordinatorCmdId        = DataCmdIdBit | uint16(28)
	AppendEntryDeletePersistCoordinatorCmdId  = DataCmdIdBit | uint16(29)
	AppendEntryUpdateNodeListCoordinatorCmdId = DataCmdIdBit | uint16(30)
	AppendEntryCreateCoordinatorCmdId         = DataCmdIdBit | uint16(31)
	AppendEntryRenameCoordinatorCmdId         = DataCmdIdBit | uint16(32)
	AppendEntryDeleteCoordinatorCmdId         = DataCmdIdBit | uint16(33)
	AppendEntryCompactLogCoordinatorCmdId     = DataCmdIdBit | uint16(34)
)
View Source
const (
	SizeOfUint32 = unsafe.Sizeof(uint32(0))
	SizeOfUint64 = unsafe.Sizeof(uint64(0))
)
View Source
const (
	AppendEntriesCmdId         = uint8(1)
	AppendEntriesResponseCmdId = uint8(2)
	RequestVoteCmdId           = uint8(3)
	RequestVoteResponseCmdId   = uint8(4)
	ExecProtoBufCmdId          = uint8(5)
	ExecProtoBufResponseCmdId  = uint8(6)
)

CmdIds for RpcMsg NoOpCmdId = uint16(0)

View Source
const (
	RpcMsgMaxLength           = int32(32)
	RpcControlHeaderLength    = int32(3)
	RpcOptControlHeaderLength = int32(8)

	RequestVotePayloadSize           = uint8(20)
	RequestVoteResponsePayloadSize   = uint8(9)
	ExecProtoBufPayloadSize          = uint8(10)
	AppendEntriesResponsePayloadSize = uint8(17)
	AppendEntryPayloadSize           = uint8(28)
)
View Source
const (
	RpcGetMetaCmdId           = uint16(1)
	RpcReadChunkCmdId         = uint16(2)
	RpcPrefetchChunkCmdId     = uint16(3)
	RpcRestoreDirtyMetasCmdId = uint16(4)
	RpcGetApiIpAndPortCmdId   = uint16(5)
	RpcUpdateMetaAttrCmdId    = uint16(6)

	RpcUpdateChunkCmdId        = DataCmdIdBit | uint16(10)
	RpcRestoreDirtyChunksCmdId = DataCmdIdBit | uint16(11)

	RpcCommitParticipantCmdId  = uint16(20)
	RpcAbortParticipantCmdId   = uint16(21)
	RpcCreateMetaCmdId         = uint16(30)
	RpcTruncateMetaCmdId       = uint16(31)
	RpcUpdateMetaSizeCmdId     = uint16(32)
	RpcDeleteMetaCmdId         = uint16(33)
	RpcUnlinkMetaCmdId         = uint16(34)
	RpcRenameMetaCmdId         = uint16(35)
	RpcCommitUpdateChunkCmdId  = uint16(36)
	RpcCommitDeleteChunkCmdId  = uint16(37)
	RpcCommitExpandChunkCmdId  = uint16(38)
	RpcCommitPersistChunkCmdId = uint16(39)
	RpcUpdateNodeListCmdId     = uint16(40)
	RpcFillNodeListCmdId       = uint16(41)
	RpcMpuAddCmdId             = uint16(42)
	RpcJoinMigrationCmdId      = uint16(43)
	RpcLeaveMigrationCmdId     = uint16(44)
	RpcCreateChildMetaCmdId    = uint16(45)
	RpcUpdateMetaKeyCmdId      = uint16(46)

	RpcCoordinatorUpdateNodeListCmdId = uint16(50)
	RpcCoordinatorFlushObjectCmdId    = uint16(51)
	RpcCoordinatorTruncateObjectCmdId = uint16(52)
	RpcCoordinatorDeleteObjectCmdId   = uint16(53)
	RpcCoordinatorHardLinkObjectCmdId = uint16(54)
	RpcCoordinatorRenameObjectCmdId   = uint16(55)
	RpcCoordinatorCreateObjectCmdId   = uint16(56)
	RpcCoordinatorPersistCmdId        = uint16(57)
	RpcCoordinatorDeletePersistCmdId  = uint16(58)
)

AppendEntryHeartBeatCmdId = uint16(0)

View Source
const (
	TxUpdateMeta       = 0
	TxUpdateChunk      = 1
	TxDeleteChunk      = 2
	TxUpdateNodeList   = 3
	TxUpdateMetaKey    = 4
	TxDeleteMeta       = 5
	TxCreateMeta       = 6
	TxUpdateParentMeta = 7

	TxUpdateCoordinator         = 30
	TxDeleteCoordinator         = 31
	TxBeginPersistCoordinator   = 32
	TxPersistCoordinator        = 33
	TxDeletePersistCoordinator  = 34
	TxUpdateNodeListCoordinator = 35
	TxCreateCoordinator         = 36
	TxRenameCoordinator         = 37
	TxTruncateCoordinator       = 38
)
View Source
const (
	ObjCacheReplyErrBase    = RaftReplyExt + 0
	ObjCacheReplySuspending = ObjCacheReplyErrBase + 1
	ObjCacheIsNotDirty      = ObjCacheReplyErrBase + 2
	FuseReplyErrBase        = RaftReplyExt + 10
)
View Source
const INIT_ERR_BLOB = "mount.err"
View Source
const ObjcacheDirName = ".objcache"
View Source
const (
	OnDiskStateReset = uint32(math.MaxUint32)
)
View Source
const TrackerNodeKey = InodeKeyType(math.MaxUint64)

Variables

View Source
var AccessLinkHead = Chunk{}
View Source
var AccessLinkLock sync.Mutex
View Source
var CoordinatorOpMap = map[uint16]func(RpcMsg) (CoordinatorOpBase, uint64, int32){
	RpcCoordinatorUpdateNodeListCmdId: NewCoordinatorUpdateNodeListOpFromMsg,
	RpcCoordinatorFlushObjectCmdId:    NewCoordinatorFlushObjectOpFromMsg,
	RpcCoordinatorTruncateObjectCmdId: NewCoordinatorTruncateObjectOpFromMsg,
	RpcCoordinatorDeleteObjectCmdId:   NewCoordinatorDeleteObjectOpFromMsg,
	RpcCoordinatorHardLinkObjectCmdId: NewCoordinatorHardLinkOpFromMsg,
	RpcCoordinatorRenameObjectCmdId:   NewCoordinatorRenameObjectOpFromMsg,
	RpcCoordinatorCreateObjectCmdId:   NewCoordinatorCreateObjectOpFromMsg,
	RpcCoordinatorPersistCmdId:        NewCoordinatorPersistOpFromMsg,
	RpcCoordinatorDeletePersistCmdId:  NewCoordinatorDeletePersistOpFromMsg,
}
View Source
var MaxTime = time.Unix(1<<63-62135596801, 999999999)
View Source
var PageSize = int64(os.Getpagesize())
View Source
var ParticipantOpMap = map[uint16]func(RpcMsg) (ParticipantOp, uint64, int32){
	RpcCommitParticipantCmdId:  NewCommitParticipantOpFromMsg,
	RpcAbortParticipantCmdId:   NewAbortParticipantOpFromMsg,
	RpcCreateMetaCmdId:         NewCreateMetaOpFromMsg,
	RpcTruncateMetaCmdId:       NewTruncateMetaOpFromMsg,
	RpcUpdateMetaSizeCmdId:     NewUpdateMetaSizeOpFromMsg,
	RpcDeleteMetaCmdId:         NewDeleteMetaOpFromMsg,
	RpcUnlinkMetaCmdId:         NewUnlinkMetaOpFromMsg,
	RpcRenameMetaCmdId:         NewRenameMetaOpFromMsg,
	RpcCommitUpdateChunkCmdId:  NewCommitUpdateChunkOpFromMsg,
	RpcCommitDeleteChunkCmdId:  NewCommitDeleteChunkOpFromMsg,
	RpcCommitExpandChunkCmdId:  NewCommitExpandChunkOpFromMsg,
	RpcCommitPersistChunkCmdId: NewCommitPersistChunkOpFromMsg,
	RpcUpdateNodeListCmdId:     NewUpdateNodeListOpFromMsg,
	RpcFillNodeListCmdId:       NewFillNodeListOpFromMsg,
	RpcMpuAddCmdId:             NewMpuAddOpFromMsg,
	RpcJoinMigrationCmdId:      NewJoinMigrationOpFromMsg,
	RpcLeaveMigrationCmdId:     NewLeaveMigrationOpFromMsg,
	RpcCreateChildMetaCmdId:    NewCreateChildMetaOpFromMsg,
	RpcUpdateMetaKeyCmdId:      NewUpdateMetaKeyOpFromMsg,
}
View Source
var RandString = MyRandString{/* contains filtered or unexported fields */}
View Source
var SectorSize = 512
View Source
var SingleShotOpMap = map[uint16]func(RpcMsg) (SingleShotOp, uint64, int32){
	RpcGetMetaCmdId:           NewGetMetaOpFromMsg,
	RpcReadChunkCmdId:         NewReadChunkOpFromMsg,
	RpcPrefetchChunkCmdId:     NewPrefetchChunkOpFromMsg,
	RpcRestoreDirtyMetasCmdId: NewRestoreDirtyMetaOpFromMsg,
	RpcGetApiIpAndPortCmdId:   NewGetApiIpAndPortOpFromMsg,
	RpcUpdateMetaAttrCmdId:    NewUpdateMetaAttrOpFromMsg,
}
View Source
var TotalDown int32
View Source
var TotalUp int32

Functions

func AwsErrToReply

func AwsErrToReply(err error) int32

func CalcRequiredPageBufferSize

func CalcRequiredPageBufferSize(offset int64, dataLen int64) int64

func CalculateBufferLengthForDownload

func CalculateBufferLengthForDownload(h MetaRWHandler, offset int64) int

func CollectLRUChunks

func CollectLRUChunks(dirtyMgr *DirtyMgr, raft *RaftInstance, reclaimDiskBytes int64) (keys []uint64, offsets []int64)

func CollectLRUDirtyKeys

func CollectLRUDirtyKeys(dirtyMgr *DirtyMgr, raft *RaftInstance, reclaimDiskBytes int64) (keys map[InodeKeyType]bool)

func ErrnoToReply

func ErrnoToReply(err error) int32

func GetAddrInet4FromString

func GetAddrInet4FromString(headWorkerAddr string, headWorkerPort int) (common.NodeAddrInet4, error)

func GetBufCheckSum

func GetBufCheckSum(buf []byte) []byte

func GetGroupForChunk

func GetGroupForChunk(ring *hashring.HashRing, inodeKey InodeKeyType, offset int64, chunkSize int64) (groupId string, ok bool)

func GetGroupForMeta

func GetGroupForMeta(ring *hashring.HashRing, inodeKey InodeKeyType) (groupId string, ok bool)

func GetRandF

func GetRandF(r rand.Source) float64

func GetServerConfig

func GetServerConfig(args *common.ObjcacheCmdlineArgs, timeout time.Duration) (common.ObjcacheConfig, error)

func HttpErrToReply

func HttpErrToReply(status int) int32

func InitAccessLinkHead

func InitAccessLinkHead()

func InitLog

func InitMemoryPool

func InitMemoryPool()

func MyHashFunc

func MyHashFunc(in []byte) hashring.HashKey

func MyHashFunc64

func MyHashFunc64(in []byte) hashring.HashKey

func MyHashFunc64V2

func MyHashFunc64V2(in []byte) hashring.HashKey

func MyHashFuncV2

func MyHashFuncV2(in []byte) hashring.HashKey

func NewAppendCommitUpdateChunkMsg

func NewAppendCommitUpdateChunkMsg(meta *WorkingMeta, chunks map[int64]*WorkingChunk, isDelete bool) *common.AppendCommitUpdateChunksMsg

func NewNodeMsgFromAddr

func NewNodeMsgFromAddr(addr common.NodeAddrInet4) *common.NodeMsg

func NewSaFromApiNodeMsg

func NewSaFromApiNodeMsg(msg *api.ApiNodeMsg) (ret common.NodeAddrInet4)

func NewSaFromNodeMsg

func NewSaFromNodeMsg(msg *common.NodeMsg) (ret common.NodeAddrInet4)

func PString

func PString(v string) *string

func PTime

func PTime(v time.Time) *time.Time

func PrepareCommitUpdateChunkBody

func PrepareCommitUpdateChunkBody(inodeMgr *InodeMgr, offStags map[int64][]*common.StagingChunkMsg, newMeta *WorkingMeta) (chunks map[int64]*WorkingChunk, unlocks []func())

func ProfilerThread

func ProfilerThread(blockProfileRate int, mutexProfileRate int, listenIp string, profilePort int)

func ReadDataToBuffer

func ReadDataToBuffer(fd int, msg *RpcMsg, r *ReadRpcMsgState, data []byte)

func ReadDataToFd

func ReadDataToFd(fd int, msg *RpcMsg, r *ReadRpcMsgState, toFd int, pipeFds [2]int)

func ReadDataToRaftLog

func ReadDataToRaftLog(fd int, msg *RpcMsg, r *ReadRpcMsgState, extLogger *OnDiskLogger, pipeFds [2]int)

ReadDataToRaftLog Note: msg must be already filled by ReadRpcMsg

func ReadRpcMsg

func ReadRpcMsg(fd int, msg *RpcMsg, r *ReadRpcMsgState)

func ReplyToFuseErr

func ReplyToFuseErr(reply int32) error

func ReturnPageBuffer

func ReturnPageBuffer(buf *PageBuffer)

func SignV2

func SignV2(req *request.Request)

Sign requests with signature chunkVersion 2.

Will sign the requests with the service config's Credentials object Signing is skipped if the credentials is the credentials.AnonymousCredentials object.

Types

type AbortParticipantOp

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

func NewAbortParticipantOp

func NewAbortParticipantOp(rpcSeqNum TxId, abortTxIds []*common.TxIdMsg, groupId string, nodeLock bool) AbortParticipantOp

func (AbortParticipantOp) GetCaller

func (o AbortParticipantOp) GetCaller(n *NodeServer) RpcCaller

func (AbortParticipantOp) GetLeader

func (o AbortParticipantOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (AbortParticipantOp) GetTxId

func (o AbortParticipantOp) GetTxId() TxId

func (AbortParticipantOp) RetToMsg

func (o AbortParticipantOp) RetToMsg(_ interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type AbortTxCommand

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

func NewAbortTxCommand

func NewAbortTxCommand(txIds []TxId) AbortTxCommand

func (AbortTxCommand) Commit

func (c AbortTxCommand) Commit(n *NodeServer)

func (AbortTxCommand) GetExtCmdId

func (c AbortTxCommand) GetExtCmdId() uint16

func (AbortTxCommand) GetTxId

func (c AbortTxCommand) GetTxId() TxId

func (AbortTxCommand) IsSingleShot

func (c AbortTxCommand) IsSingleShot() bool

func (AbortTxCommand) NeedTwoPhaseCommit

func (c AbortTxCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type AddInodeFileMapCommand

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

func NewAddInodeFileMapCommand

func NewAddInodeFileMapCommand(working *WorkingMeta, children map[string]InodeKeyType, key string) AddInodeFileMapCommand

func (AddInodeFileMapCommand) Commit

func (c AddInodeFileMapCommand) Commit(n *NodeServer)

func (AddInodeFileMapCommand) GetExtCmdId

func (c AddInodeFileMapCommand) GetExtCmdId() uint16

func (AddInodeFileMapCommand) GetTxId

func (c AddInodeFileMapCommand) GetTxId() TxId

func (AddInodeFileMapCommand) IsSingleShot

func (c AddInodeFileMapCommand) IsSingleShot() bool

func (AddInodeFileMapCommand) NeedTwoPhaseCommit

func (c AddInodeFileMapCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type AddServerCommand

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

func NewAddServerCommand

func NewAddServerCommand(serverId uint32, ip [4]byte, port uint16) AddServerCommand

func (AddServerCommand) Apply

func (AddServerCommand) GetCmdId

func (c AddServerCommand) GetCmdId() uint16

func (AddServerCommand) GetExtPayloadSize

func (c AddServerCommand) GetExtPayloadSize() uint8

func (AddServerCommand) SetExtPayload

func (c AddServerCommand) SetExtPayload(extPayload []byte)

type AppendEntryCommand

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

func GetAppendEntryCommand

func GetAppendEntryCommand(term uint32, rc RaftCommand) (cmd AppendEntryCommand)

func (*AppendEntryCommand) AppendToRpcMsg

func (l *AppendEntryCommand) AppendToRpcMsg(d *RpcMsg) (newOptHeaderLength uint16, newTotalExtLogSize uint32)

func (*AppendEntryCommand) AsRaftCommand

func (l *AppendEntryCommand) AsRaftCommand() (RaftCommand, bool)

func (*AppendEntryCommand) GetChecksum

func (l *AppendEntryCommand) GetChecksum() []byte

func (*AppendEntryCommand) GetEntryLength

func (l *AppendEntryCommand) GetEntryLength() uint8

func (*AppendEntryCommand) GetExtCmdId

func (l *AppendEntryCommand) GetExtCmdId() uint16

func (*AppendEntryCommand) GetExtPayload

func (l *AppendEntryCommand) GetExtPayload() []byte

func (*AppendEntryCommand) GetTerm

func (l *AppendEntryCommand) GetTerm() uint32

type BeginPersistCommand

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

func NewBeginPersistCommand

func NewBeginPersistCommand(txId TxId, keys []string, uploadIds []string) BeginPersistCommand

func (BeginPersistCommand) Commit

func (c BeginPersistCommand) Commit(n *NodeServer)

func (BeginPersistCommand) GetExtCmdId

func (c BeginPersistCommand) GetExtCmdId() uint16

func (BeginPersistCommand) GetTxId

func (c BeginPersistCommand) GetTxId() TxId

func (BeginPersistCommand) IsSingleShot

func (c BeginPersistCommand) IsSingleShot() bool

func (BeginPersistCommand) NeedTwoPhaseCommit

func (c BeginPersistCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

func (BeginPersistCommand) RemoteCommit

func (c BeginPersistCommand) RemoteCommit(*RaftGroupMgr) []ParticipantOp

type BlobItemOutput

type BlobItemOutput struct {
	Key          *string
	ETag         *string
	LastModified *time.Time
	Size         uint64
	StorageClass *string
}

type BlobPrefixOutput

type BlobPrefixOutput struct {
	Prefix *string
}

type BucketCredential

type BucketCredential struct {
	DirName     string `yaml:"dirName"`
	BucketName  string `yaml:"bucketName"`
	BackendName string `yaml:"backendName"`
	Endpoint    string `yaml:"endpoint"`
	AccessKey   string `yaml:"accessKey"`
	SecretKey   string `yaml:"secretKey"`
	TestFile    string `yaml:"testFile"`
	Anonymous   bool   `yaml:"anonymous"`
}

type BucketCredentials

type BucketCredentials struct {
	Buckets []BucketCredential `yaml:"buckets"`
}

type BucketSpec

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

type BufferedDiskPageReader

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

*

  • Buffer layout:
  • bf o <------ dataLen ------>
  • ----|------|------------------------|
  • <- al ->
  • <------------ len(buf.Buf) ----->
  • original request is (offset o, dataLen) but we need to align SectorSize for offset and size.
  • BufferedDiskPageReader must still return the range [o, o + dataLen] regardless of reading more than it.
  • bf: bufLogOffset is calculated by offset o and dataLen at prepareBuffer, aligned to be a multiple of SectorSize
  • al: alignLeft to align offset to be a multiple of SectorSize

func NewBufferedDiskPageReaderFromStag

func NewBufferedDiskPageReaderFromStag(page *PageBuffer, logId LogIdType, logOffset int64, dataLen int64) *BufferedDiskPageReader

func (*BufferedDiskPageReader) GetSlicedPageBufferAt

func (r *BufferedDiskPageReader) GetSlicedPageBufferAt(stagPart *StagingChunkPart, offset int64, dec func(interface{})) (SlicedPageBuffer, error)

GetSlicedPageBufferAt returns slice of Buf with ref count incremented. user must call .Release() later.

type Capabilities

type Capabilities struct {
	NoParallelMultipart bool
	MaxMultipartSize    uint64
	// indicates that the blob store has native support for directories
	DirBlob bool
	Name    string
}

type Chunk

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

func CreateNewChunk

func CreateNewChunk(inodeKey InodeKeyType, offset int64, chunkIdx uint32) *Chunk

func (*Chunk) AddWorkingChunk

func (c *Chunk) AddWorkingChunk(inodeMgr *InodeMgr, working *WorkingChunk, prev *WorkingChunk)

func (*Chunk) DeleteFromLRUListNoLock

func (c *Chunk) DeleteFromLRUListNoLock()

func (*Chunk) Drop

func (c *Chunk) Drop(inodeMgr *InodeMgr, raft *RaftInstance)

func (*Chunk) GetLogId

func (c *Chunk) GetLogId() LogIdType

func (*Chunk) GetWorkingChunk

func (c *Chunk) GetWorkingChunk(ver uint32, updateLRU bool) (*WorkingChunk, error)

func (*Chunk) NewWorkingChunk

func (c *Chunk) NewWorkingChunk(chunkVer uint32) *WorkingChunk

func (*Chunk) UpdateLRUList

func (c *Chunk) UpdateLRUList()

type ChunkReader

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

ChunkReader must hold lock for stags

func (*ChunkReader) Close

func (r *ChunkReader) Close() (err error)

func (*ChunkReader) GetBufferZeroCopy

func (r *ChunkReader) GetBufferZeroCopy(size int) (bufs []SlicedPageBuffer, count int, err error)

func (*ChunkReader) GetLen

func (r *ChunkReader) GetLen() (int64, error)

func (*ChunkReader) HasLen

func (r *ChunkReader) HasLen() (int, bool)

func (*ChunkReader) IsSeeker

func (r *ChunkReader) IsSeeker() bool

func (*ChunkReader) Read

func (r *ChunkReader) Read(p []byte) (int, error)

used when reading chunks

func (*ChunkReader) Seek

func (r *ChunkReader) Seek(offset int64, whence int) (int64, error)

func (*ChunkReader) WriteTo

func (r *ChunkReader) WriteTo(w io.Writer) (n int64, err error)

WriteTo used when persisting chunks

type CommitAbortRpcCaller

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

func NewCommitAbortRpcCaller

func NewCommitAbortRpcCaller(fn ParticipantOp, remoteTimeout time.Duration, nodeLock bool) CommitAbortRpcCaller

func (CommitAbortRpcCaller) ExecLocal

func (c CommitAbortRpcCaller) ExecLocal(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CommitAbortRpcCaller) ExecLocalInRpc

func (c CommitAbortRpcCaller) ExecLocalInRpc(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CommitAbortRpcCaller) ExecRemote

func (c CommitAbortRpcCaller) ExecRemote(n *NodeServer, addr common.NodeAddrInet4, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CommitAbortRpcCaller) GetLeader

func (c CommitAbortRpcCaller) GetLeader(n *NodeServer, nodeList *RaftNodeList) (RaftNode, bool)

func (CommitAbortRpcCaller) TryNext

func (c CommitAbortRpcCaller) TryNext(n *NodeServer, i int) bool

type CommitChunkCommand

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

func NewCommitChunkCommand

func NewCommitChunkCommand(meta *WorkingMeta, chunks map[int64]*WorkingChunk, isDelete bool) CommitChunkCommand

func (CommitChunkCommand) Commit

func (c CommitChunkCommand) Commit(n *NodeServer)

func (CommitChunkCommand) GetExtCmdId

func (c CommitChunkCommand) GetExtCmdId() uint16

func (CommitChunkCommand) GetTxId

func (c CommitChunkCommand) GetTxId() TxId

func (CommitChunkCommand) IsSingleShot

func (c CommitChunkCommand) IsSingleShot() bool

func (CommitChunkCommand) NeedTwoPhaseCommit

func (c CommitChunkCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type CommitChunkRpcCaller

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

func NewCommitChunkRpcCaller

func NewCommitChunkRpcCaller(fn ParticipantOp, remoteTimeout time.Duration) CommitChunkRpcCaller

func (CommitChunkRpcCaller) ExecLocal

func (c CommitChunkRpcCaller) ExecLocal(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CommitChunkRpcCaller) ExecLocalInRpc

func (c CommitChunkRpcCaller) ExecLocalInRpc(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CommitChunkRpcCaller) ExecRemote

func (c CommitChunkRpcCaller) ExecRemote(n *NodeServer, addr common.NodeAddrInet4, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CommitChunkRpcCaller) GetLeader

func (c CommitChunkRpcCaller) GetLeader(n *NodeServer, nodeList *RaftNodeList) (RaftNode, bool)

func (CommitChunkRpcCaller) TryNext

func (c CommitChunkRpcCaller) TryNext(n *NodeServer, i int) bool

type CommitCommand

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

func NewCommitCommand

func NewCommitCommand(txId TxId) CommitCommand

func (CommitCommand) Apply

func (CommitCommand) GetCmdId

func (c CommitCommand) GetCmdId() uint16

func (CommitCommand) GetExtPayloadSize

func (c CommitCommand) GetExtPayloadSize() uint8

func (CommitCommand) SetExtPayload

func (c CommitCommand) SetExtPayload(extPayload []byte)

type CommitDeleteChunkOp

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

func NewCommitDeleteChunkOp

func NewCommitDeleteChunkOp(txId TxId, newMeta *WorkingMeta, offset int64, deleteLen int64) CommitDeleteChunkOp

func (CommitDeleteChunkOp) GetCaller

func (o CommitDeleteChunkOp) GetCaller(n *NodeServer) RpcCaller

func (CommitDeleteChunkOp) GetLeader

func (o CommitDeleteChunkOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (CommitDeleteChunkOp) GetTxId

func (o CommitDeleteChunkOp) GetTxId() TxId

func (CommitDeleteChunkOp) RetToMsg

func (o CommitDeleteChunkOp) RetToMsg(_ interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type CommitExpandChunkOp

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

func NewCommitExpandChunkOp

func NewCommitExpandChunkOp(txId TxId, newMeta *WorkingMeta, offset int64, expandLen int64) CommitExpandChunkOp

func (CommitExpandChunkOp) GetCaller

func (o CommitExpandChunkOp) GetCaller(n *NodeServer) RpcCaller

func (CommitExpandChunkOp) GetLeader

func (o CommitExpandChunkOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (CommitExpandChunkOp) GetTxId

func (o CommitExpandChunkOp) GetTxId() TxId

func (CommitExpandChunkOp) RetToMsg

func (o CommitExpandChunkOp) RetToMsg(_ interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type CommitParticipantOp

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

func NewCommitParticipantOp

func NewCommitParticipantOp(rpcSeqNum TxId, commitTxId TxId, groupId string) CommitParticipantOp

func NewCommitParticipantOpForUpdateNode

func NewCommitParticipantOpForUpdateNode(rpcSeqNum TxId, commitTxId TxId, node RaftNode) CommitParticipantOp

func (CommitParticipantOp) GetCaller

func (o CommitParticipantOp) GetCaller(n *NodeServer) RpcCaller

func (CommitParticipantOp) GetLeader

func (o CommitParticipantOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (CommitParticipantOp) GetTxId

func (o CommitParticipantOp) GetTxId() TxId

func (CommitParticipantOp) RetToMsg

func (o CommitParticipantOp) RetToMsg(_ interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type CommitPersistChunkOp

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

func NewCommitPersistChunkOp

func NewCommitPersistChunkOp(txId TxId, commitTxId TxId, groupId string, offsets []int64, cVers []uint32, inodeKey InodeKeyType) CommitPersistChunkOp

func (CommitPersistChunkOp) GetCaller

func (o CommitPersistChunkOp) GetCaller(n *NodeServer) RpcCaller

func (CommitPersistChunkOp) GetLeader

func (o CommitPersistChunkOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (CommitPersistChunkOp) GetTxId

func (o CommitPersistChunkOp) GetTxId() TxId

func (CommitPersistChunkOp) RetToMsg

func (o CommitPersistChunkOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type CommitUpdateChunkOp

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

func NewCommitUpdateChunkOp

func NewCommitUpdateChunkOp(txId TxId, record *common.UpdateChunkRecordMsg, newMeta *WorkingMeta) CommitUpdateChunkOp

func (CommitUpdateChunkOp) GetCaller

func (o CommitUpdateChunkOp) GetCaller(n *NodeServer) RpcCaller

func (CommitUpdateChunkOp) GetLeader

func (o CommitUpdateChunkOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (CommitUpdateChunkOp) GetTxId

func (o CommitUpdateChunkOp) GetTxId() TxId

func (CommitUpdateChunkOp) RetToMsg

func (o CommitUpdateChunkOp) RetToMsg(_ interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type CompactLogCoordinatorCommand

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

func NewCompactLogCoordinatorCommand

func NewCompactLogCoordinatorCommand(s *Snapshot) CompactLogCoordinatorCommand

func (CompactLogCoordinatorCommand) Commit

func (CompactLogCoordinatorCommand) GetExtCmdId

func (c CompactLogCoordinatorCommand) GetExtCmdId() uint16

func (CompactLogCoordinatorCommand) GetTxId

func (c CompactLogCoordinatorCommand) GetTxId() TxId

func (CompactLogCoordinatorCommand) IsSingleShot

func (c CompactLogCoordinatorCommand) IsSingleShot() bool

func (CompactLogCoordinatorCommand) NeedTwoPhaseCommit

func (c CompactLogCoordinatorCommand) NeedTwoPhaseCommit(raftGroup *RaftGroupMgr) bool

func (CompactLogCoordinatorCommand) RemoteCommit

type CoordinatorCommand

type CoordinatorCommand interface {
	RemoteCommit(raftGroup *RaftGroupMgr) []ParticipantOp
	ExtLogCommandImpl
}

type CoordinatorCompactLogOp

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

func NewCoordinatorCompactLogOp

func NewCoordinatorCompactLogOp(id CoordinatorId) CoordinatorCompactLogOp

func (CoordinatorCompactLogOp) GetCaller

func (CoordinatorCompactLogOp) GetLeader

func (CoordinatorCompactLogOp) GetTxId

func (o CoordinatorCompactLogOp) GetTxId() TxId

func (CoordinatorCompactLogOp) RetToMsg

func (o CoordinatorCompactLogOp) RetToMsg(_ interface{}, r RaftBasicReply) proto.Message

type CoordinatorCreateObjectOp

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

func NewCoordinatorCreateObjectOp

func NewCoordinatorCreateObjectOp(id CoordinatorId, parentFullPath string, parentInodeKey InodeKeyType, childName string, childInodeKey InodeKeyType, mode uint32, chunkSize int64, expireMs int32) CoordinatorCreateObjectOp

func (CoordinatorCreateObjectOp) GetCaller

func (CoordinatorCreateObjectOp) GetLeader

func (CoordinatorCreateObjectOp) GetTxId

func (o CoordinatorCreateObjectOp) GetTxId() TxId

func (CoordinatorCreateObjectOp) RetToMsg

func (o CoordinatorCreateObjectOp) RetToMsg(ret interface{}, r RaftBasicReply) proto.Message

type CoordinatorDeleteObjectOp

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

func NewCoordinatorDeleteObjectOp

func NewCoordinatorDeleteObjectOp(id CoordinatorId, parentFullPath string, parentInodeKey InodeKeyType, childName string, childInodeKey InodeKeyType) CoordinatorDeleteObjectOp

func (CoordinatorDeleteObjectOp) GetCaller

func (CoordinatorDeleteObjectOp) GetLeader

func (CoordinatorDeleteObjectOp) GetTxId

func (o CoordinatorDeleteObjectOp) GetTxId() TxId

func (CoordinatorDeleteObjectOp) RetToMsg

func (o CoordinatorDeleteObjectOp) RetToMsg(ret interface{}, r RaftBasicReply) proto.Message

type CoordinatorDeletePersistOp

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

func NewCoordinatorDeletePersistOp

func NewCoordinatorDeletePersistOp(id CoordinatorId, key string, inodeKey InodeKeyType, priority int) CoordinatorDeletePersistOp

func (CoordinatorDeletePersistOp) GetCaller

func (CoordinatorDeletePersistOp) GetLeader

func (CoordinatorDeletePersistOp) GetTxId

func (o CoordinatorDeletePersistOp) GetTxId() TxId

func (CoordinatorDeletePersistOp) RetToMsg

func (o CoordinatorDeletePersistOp) RetToMsg(ret interface{}, r RaftBasicReply) proto.Message

type CoordinatorFlushObjectOp

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

func NewCoordinatorFlushObjectOp

func NewCoordinatorFlushObjectOp(id CoordinatorId, inodeKey InodeKeyType, records []*common.UpdateChunkRecordMsg, mTime int64, mode uint32) CoordinatorFlushObjectOp

func (CoordinatorFlushObjectOp) GetCaller

func (CoordinatorFlushObjectOp) GetLeader

func (CoordinatorFlushObjectOp) GetTxId

func (o CoordinatorFlushObjectOp) GetTxId() TxId

func (CoordinatorFlushObjectOp) RetToMsg

func (o CoordinatorFlushObjectOp) RetToMsg(ret interface{}, r RaftBasicReply) proto.Message

type CoordinatorHardLinkOp

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

func NewCoordinatorHardLinkOp

func NewCoordinatorHardLinkOp(id CoordinatorId, srcInodeKey InodeKeyType, srcParentInodeKey InodeKeyType, dstParentKey string, dstParentInodeKey InodeKeyType, dstName string, childInodeKey InodeKeyType) CoordinatorHardLinkOp

func (CoordinatorHardLinkOp) GetCaller

func (o CoordinatorHardLinkOp) GetCaller(n *NodeServer) RpcCaller

func (CoordinatorHardLinkOp) GetLeader

func (CoordinatorHardLinkOp) GetTxId

func (o CoordinatorHardLinkOp) GetTxId() TxId

func (CoordinatorHardLinkOp) RetToMsg

func (o CoordinatorHardLinkOp) RetToMsg(ret interface{}, r RaftBasicReply) proto.Message

type CoordinatorId

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

func NewCoordinatorIdFromMsg

func NewCoordinatorIdFromMsg(msg *common.CoordinatorIdMsg) CoordinatorId

type CoordinatorOpBase

type CoordinatorOpBase interface {
	GetTxId() TxId
	GetLeader(*NodeServer, *RaftNodeList) (RaftNode, bool)

	RetToMsg(ret interface{}, r RaftBasicReply) proto.Message
	GetCaller(*NodeServer) RpcCaller
	// contains filtered or unexported methods
}

func NewCoordinatorCreateObjectOpFromMsg

func NewCoordinatorCreateObjectOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

func NewCoordinatorDeleteObjectOpFromMsg

func NewCoordinatorDeleteObjectOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

func NewCoordinatorDeletePersistOpFromMsg

func NewCoordinatorDeletePersistOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

func NewCoordinatorFlushObjectOpFromMsg

func NewCoordinatorFlushObjectOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

func NewCoordinatorHardLinkOpFromMsg

func NewCoordinatorHardLinkOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

func NewCoordinatorPersistOpFromMsg

func NewCoordinatorPersistOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

func NewCoordinatorRenameObjectOpFromMsg

func NewCoordinatorRenameObjectOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

func NewCoordinatorTruncateObjectOpFromMsg

func NewCoordinatorTruncateObjectOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

func NewCoordinatorUpdateNodeListOpFromMsg

func NewCoordinatorUpdateNodeListOpFromMsg(msg RpcMsg) (CoordinatorOpBase, uint64, int32)

type CoordinatorPersistOp

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

func NewCoordinatorPersistOp

func NewCoordinatorPersistOp(id CoordinatorId, inodeKey InodeKeyType, priority int) CoordinatorPersistOp

func (CoordinatorPersistOp) GetCaller

func (o CoordinatorPersistOp) GetCaller(n *NodeServer) RpcCaller

func (CoordinatorPersistOp) GetLeader

func (o CoordinatorPersistOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (CoordinatorPersistOp) GetTxId

func (o CoordinatorPersistOp) GetTxId() TxId

func (CoordinatorPersistOp) RetToMsg

func (o CoordinatorPersistOp) RetToMsg(ret interface{}, r RaftBasicReply) proto.Message

type CoordinatorRenameObjectOp

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

func NewCoordinatorRenameObjectOp

func NewCoordinatorRenameObjectOp(id CoordinatorId, srcParentKey string, srcParentInodeKey InodeKeyType, srcName string, dstParentKey string, dstParentInodeKey InodeKeyType, dstName string, childInodeKey InodeKeyType) CoordinatorRenameObjectOp

func (CoordinatorRenameObjectOp) CheckError

func (CoordinatorRenameObjectOp) GetCaller

func (CoordinatorRenameObjectOp) GetLeader

func (CoordinatorRenameObjectOp) GetTxId

func (o CoordinatorRenameObjectOp) GetTxId() TxId

func (CoordinatorRenameObjectOp) RetToMsg

func (o CoordinatorRenameObjectOp) RetToMsg(ret interface{}, r RaftBasicReply) proto.Message

type CoordinatorRet

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

func NewCoordinatorRetFromMsg

func NewCoordinatorRetFromMsg(msg *common.CoordinatorRetMsg) *CoordinatorRet

type CoordinatorRpcCaller

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

func NewCoordinatorRpcCaller

func NewCoordinatorRpcCaller(fn CoordinatorOpBase, nodeLock bool) CoordinatorRpcCaller

func (CoordinatorRpcCaller) ExecLocal

func (c CoordinatorRpcCaller) ExecLocal(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CoordinatorRpcCaller) ExecLocalInRpc

func (c CoordinatorRpcCaller) ExecLocalInRpc(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CoordinatorRpcCaller) ExecRemote

func (c CoordinatorRpcCaller) ExecRemote(n *NodeServer, addr common.NodeAddrInet4, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (CoordinatorRpcCaller) GetLeader

func (c CoordinatorRpcCaller) GetLeader(n *NodeServer, nodeList *RaftNodeList) (RaftNode, bool)

func (CoordinatorRpcCaller) TryNext

func (c CoordinatorRpcCaller) TryNext(n *NodeServer, i int) bool

type CoordinatorTruncateObjectOp

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

func NewCoordinatorTruncateObjectOp

func NewCoordinatorTruncateObjectOp(id CoordinatorId, inodeKey InodeKeyType, newSize int64) CoordinatorTruncateObjectOp

func (CoordinatorTruncateObjectOp) GetCaller

func (CoordinatorTruncateObjectOp) GetLeader

func (CoordinatorTruncateObjectOp) GetTxId

func (o CoordinatorTruncateObjectOp) GetTxId() TxId

func (CoordinatorTruncateObjectOp) RetToMsg

func (o CoordinatorTruncateObjectOp) RetToMsg(ret interface{}, r RaftBasicReply) proto.Message

type CoordinatorUpdateNodeListOp

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

func NewCoordinatorUpdateNodeListOp

func NewCoordinatorUpdateNodeListOp(id CoordinatorId, trackerNode RaftNode, isAdd bool, target RaftNode, groupAddr map[string]bool, nodeListVer uint64) CoordinatorUpdateNodeListOp

func (CoordinatorUpdateNodeListOp) GetCaller

func (CoordinatorUpdateNodeListOp) GetLeader

func (CoordinatorUpdateNodeListOp) GetTxId

func (o CoordinatorUpdateNodeListOp) GetTxId() TxId

func (CoordinatorUpdateNodeListOp) RetToMsg

func (o CoordinatorUpdateNodeListOp) RetToMsg(_ interface{}, r RaftBasicReply) proto.Message

type CopyBlobInput

type CopyBlobInput struct {
	Source      string
	Destination string

	Size         *uint64
	ETag         *string            // if non-nil, do conditional copy
	Metadata     map[string]*string // if nil, copy from Source
	StorageClass *string            // if nil, copy from Source
}

type CopyBlobOutput

type CopyBlobOutput struct {
	RequestId string
}

type CreateChildMetaOp

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

func NewCreateChildMetaOp

func NewCreateChildMetaOp(txId TxId, inodeKey InodeKeyType, key string, childName string, childInodeKey InodeKeyType, childIsDir bool) CreateChildMetaOp

func (CreateChildMetaOp) GetCaller

func (o CreateChildMetaOp) GetCaller(n *NodeServer) RpcCaller

func (CreateChildMetaOp) GetLeader

func (o CreateChildMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (CreateChildMetaOp) GetTxId

func (o CreateChildMetaOp) GetTxId() TxId

func (CreateChildMetaOp) RetToMsg

func (o CreateChildMetaOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type CreateChunkCommand

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

func NewCreateChunkCommand

func NewCreateChunkCommand(inodeKey InodeKeyType, offset int64, version uint32, logOffset int64, length int64, key string, chunkIdx uint32) CreateChunkCommand

func (CreateChunkCommand) Commit

func (c CreateChunkCommand) Commit(n *NodeServer)

func (CreateChunkCommand) GetExtCmdId

func (c CreateChunkCommand) GetExtCmdId() uint16

func (CreateChunkCommand) GetTxId

func (c CreateChunkCommand) GetTxId() TxId

func (CreateChunkCommand) IsSingleShot

func (c CreateChunkCommand) IsSingleShot() bool

func (CreateChunkCommand) NeedTwoPhaseCommit

func (c CreateChunkCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type CreateCoordinatorCommand

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

func NewCreateCoordinatorCommand

func NewCreateCoordinatorCommand(txId TxId, newKey string, metaTx TxRet, parentTx TxRet, raftGroup *RaftGroupMgr, commitTxId TxId) CreateCoordinatorCommand

func (CreateCoordinatorCommand) Commit

func (c CreateCoordinatorCommand) Commit(n *NodeServer)

func (CreateCoordinatorCommand) GetExtCmdId

func (c CreateCoordinatorCommand) GetExtCmdId() uint16

func (CreateCoordinatorCommand) GetTxId

func (c CreateCoordinatorCommand) GetTxId() TxId

func (CreateCoordinatorCommand) IsSingleShot

func (c CreateCoordinatorCommand) IsSingleShot() bool

func (CreateCoordinatorCommand) NeedTwoPhaseCommit

func (c CreateCoordinatorCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

func (CreateCoordinatorCommand) RemoteCommit

type CreateMetaCommand

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

func NewCreateMetaCommand

func NewCreateMetaCommand(txId TxId, meta *WorkingMeta, newKey string, parent InodeKeyType) CreateMetaCommand

func (CreateMetaCommand) Commit

func (c CreateMetaCommand) Commit(n *NodeServer)

func (CreateMetaCommand) GetExtCmdId

func (c CreateMetaCommand) GetExtCmdId() uint16

func (CreateMetaCommand) GetTxId

func (c CreateMetaCommand) GetTxId() TxId

func (CreateMetaCommand) IsSingleShot

func (c CreateMetaCommand) IsSingleShot() bool

func (CreateMetaCommand) NeedTwoPhaseCommit

func (c CreateMetaCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type CreateMetaOp

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

func NewCreateMetaOp

func NewCreateMetaOp(txId TxId, inodeKey InodeKeyType, parentInodeKey InodeKeyType, newKey string, mode uint32, chunkSize int64, expireMs int32) CreateMetaOp

func (CreateMetaOp) GetCaller

func (o CreateMetaOp) GetCaller(n *NodeServer) RpcCaller

func (CreateMetaOp) GetLeader

func (o CreateMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (CreateMetaOp) GetTxId

func (o CreateMetaOp) GetTxId() TxId

func (CreateMetaOp) RetToMsg

func (o CreateMetaOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type Delegator

type Delegator interface {
	Delegate() interface{}
}

type DeleteBlobInput

type DeleteBlobInput struct {
	Key string
}

type DeleteBlobOutput

type DeleteBlobOutput struct {
	RequestId string
}

type DeleteBlobsInput

type DeleteBlobsInput struct {
	Items []string
}

type DeleteBlobsOutput

type DeleteBlobsOutput struct {
	RequestId string
}

type DeleteCoordinatorCommand

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

func NewDeleteCoordinatorCommand

func NewDeleteCoordinatorCommand(txId TxId, key string, prevSize int64, metaTx TxRet, parentTx TxRet, raftGroup *RaftGroupMgr, commitTxId TxId) DeleteCoordinatorCommand

func (DeleteCoordinatorCommand) Commit

func (c DeleteCoordinatorCommand) Commit(n *NodeServer)

func (DeleteCoordinatorCommand) GetExtCmdId

func (c DeleteCoordinatorCommand) GetExtCmdId() uint16

func (DeleteCoordinatorCommand) GetTxId

func (c DeleteCoordinatorCommand) GetTxId() TxId

func (DeleteCoordinatorCommand) IsSingleShot

func (c DeleteCoordinatorCommand) IsSingleShot() bool

func (DeleteCoordinatorCommand) NeedTwoPhaseCommit

func (c DeleteCoordinatorCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

func (DeleteCoordinatorCommand) RemoteCommit

type DeleteInodeFileMapCommand

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

func NewDeleteInodeFileMapCommand

func NewDeleteInodeFileMapCommand(inodeKeys []uint64, keys []string) DeleteInodeFileMapCommand

func (DeleteInodeFileMapCommand) Commit

func (DeleteInodeFileMapCommand) GetExtCmdId

func (c DeleteInodeFileMapCommand) GetExtCmdId() uint16

func (DeleteInodeFileMapCommand) GetTxId

func (c DeleteInodeFileMapCommand) GetTxId() TxId

func (DeleteInodeFileMapCommand) IsSingleShot

func (c DeleteInodeFileMapCommand) IsSingleShot() bool

func (DeleteInodeFileMapCommand) NeedTwoPhaseCommit

func (c DeleteInodeFileMapCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type DeleteMetaCommand

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

func NewDeleteMetaCommand

func NewDeleteMetaCommand(txId TxId, parentWorking *WorkingMeta, key string) DeleteMetaCommand

func (DeleteMetaCommand) Commit

func (c DeleteMetaCommand) Commit(n *NodeServer)

func (DeleteMetaCommand) GetExtCmdId

func (c DeleteMetaCommand) GetExtCmdId() uint16

func (DeleteMetaCommand) GetTxId

func (c DeleteMetaCommand) GetTxId() TxId

func (DeleteMetaCommand) IsSingleShot

func (c DeleteMetaCommand) IsSingleShot() bool

func (DeleteMetaCommand) NeedTwoPhaseCommit

func (c DeleteMetaCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type DeleteMetaOp

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

func NewDeleteMetaOp

func NewDeleteMetaOp(txId TxId, inodeKey InodeKeyType, removedKey string) DeleteMetaOp

func (DeleteMetaOp) GetCaller

func (o DeleteMetaOp) GetCaller(n *NodeServer) RpcCaller

func (DeleteMetaOp) GetLeader

func (o DeleteMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (DeleteMetaOp) GetTxId

func (o DeleteMetaOp) GetTxId() TxId

func (DeleteMetaOp) RetToMsg

func (o DeleteMetaOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type DeletePersistCoordinatorCommand

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

func NewDeletePersistCoordinatorCommand

func NewDeletePersistCoordinatorCommand(key string) DeletePersistCoordinatorCommand

func (DeletePersistCoordinatorCommand) Commit

func (DeletePersistCoordinatorCommand) GetExtCmdId

func (c DeletePersistCoordinatorCommand) GetExtCmdId() uint16

func (DeletePersistCoordinatorCommand) GetTxId

func (DeletePersistCoordinatorCommand) IsSingleShot

func (c DeletePersistCoordinatorCommand) IsSingleShot() bool

func (DeletePersistCoordinatorCommand) NeedTwoPhaseCommit

func (c DeletePersistCoordinatorCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

func (DeletePersistCoordinatorCommand) RemoteCommit

type DeletedFileInfo

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

func NewDeleteFileInfoFromMeta

func NewDeleteFileInfoFromMeta(meta *WorkingMeta) DeletedFileInfo

func NewDeleteFileInfoFromMsg

func NewDeleteFileInfoFromMsg(msg *common.DeletedFileInfoMsg) DeletedFileInfo

type DirtyChunkInfo

type DirtyChunkInfo struct {
	OffsetVersions map[int64]uint32
	// contains filtered or unexported fields
}

func NewDirtyChunkInfoFromMsg

func NewDirtyChunkInfoFromMsg(msg *common.DirtyChunkInfoMsg) DirtyChunkInfo

type DirtyMetaInfo

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

func NewDirtyMetaInfoFromMeta

func NewDirtyMetaInfoFromMeta(meta *WorkingMeta) DirtyMetaInfo

func NewDirtyMetaInfoFromMsg

func NewDirtyMetaInfoFromMsg(msg *common.DirtyMetaInfoMsg) DirtyMetaInfo

type DirtyMgr

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

func NewDirtyMgr

func NewDirtyMgr() *DirtyMgr

func NewDirtyMgrFromMsg

func NewDirtyMgrFromMsg(msg *common.DirtyMgrSnapshotMsg) *DirtyMgr

func (*DirtyMgr) AddChildMetaNoLock

func (d *DirtyMgr) AddChildMetaNoLock(meta *WorkingMeta, name string)

func (*DirtyMgr) AddChunkNoLock

func (d *DirtyMgr) AddChunkNoLock(inodeKey InodeKeyType, chunkSize int64, chunkVer uint32, offset int64, objectSize int64)

func (*DirtyMgr) AddDeleteKeyNoLock

func (d *DirtyMgr) AddDeleteKeyNoLock(key string, meta *WorkingMeta)

func (*DirtyMgr) AddMetaNoLock

func (d *DirtyMgr) AddMetaNoLock(meta *WorkingMeta)

func (*DirtyMgr) AddMigratedAddChunk

func (d *DirtyMgr) AddMigratedAddChunk(migrationId MigrationId, chunk *common.AppendCommitUpdateChunksMsg)

func (*DirtyMgr) AddMigratedAddMetas

func (d *DirtyMgr) AddMigratedAddMetas(s *Snapshot)

func (*DirtyMgr) AddMigratedRemoveChunk

func (d *DirtyMgr) AddMigratedRemoveChunk(migrationId MigrationId, chunks []*common.ChunkRemoveDirtyMsg)

func (*DirtyMgr) AddMigratedRemoveMetas

func (d *DirtyMgr) AddMigratedRemoveMetas(migrationId MigrationId, inodeKeys []uint64, dirKeys []uint64)

func (*DirtyMgr) AppendForgetAllDirtyLog

func (d *DirtyMgr) AppendForgetAllDirtyLog(raft *RaftInstance) int32

func (*DirtyMgr) AppendRemoveNonDirtyChunksLog

func (d *DirtyMgr) AppendRemoveNonDirtyChunksLog(raft *RaftInstance, fps []uint64) int32

func (*DirtyMgr) ApplyAsRemoveNonDirtyChunks

func (d *DirtyMgr) ApplyAsRemoveNonDirtyChunks(pm proto.Message) int32

func (*DirtyMgr) CheckReset

func (d *DirtyMgr) CheckReset() (ok bool)

func (*DirtyMgr) CommitMigratedDataLocal

func (d *DirtyMgr) CommitMigratedDataLocal(inodeMgr *InodeMgr, migrationId MigrationId)

func (*DirtyMgr) CopyAllExpiredPrimaryDeletedDirtyMeta

func (d *DirtyMgr) CopyAllExpiredPrimaryDeletedDirtyMeta() map[string]InodeKeyType

func (*DirtyMgr) CopyAllExpiredPrimaryDirtyMeta

func (d *DirtyMgr) CopyAllExpiredPrimaryDirtyMeta() []InodeKeyType

func (*DirtyMgr) CopyAllPrimaryDeletedKeys

func (d *DirtyMgr) CopyAllPrimaryDeletedKeys() map[string]InodeKeyType

func (*DirtyMgr) CopyAllPrimaryDirtyMeta

func (d *DirtyMgr) CopyAllPrimaryDirtyMeta() []InodeKeyType

func (*DirtyMgr) DropMigratingData

func (d *DirtyMgr) DropMigratingData(migrationId MigrationId)

func (*DirtyMgr) ForgetAllDirty

func (d *DirtyMgr) ForgetAllDirty()

func (*DirtyMgr) GetAllDirtyMeta

func (d *DirtyMgr) GetAllDirtyMeta() []*common.DirtyMetaInfoMsg

func (*DirtyMgr) GetDeleteKey

func (d *DirtyMgr) GetDeleteKey(key string) (inodeKey InodeKeyType, ok bool)

func (*DirtyMgr) GetDirInodesForNodeJoin

func (d *DirtyMgr) GetDirInodesForNodeJoin(dirInodes []*common.InodeTreeMsg, migrationId MigrationId, nodeList *RaftNodeList, newRing *hashring.HashRing, selfGroup string, joinGroup string) []*common.InodeTreeMsg

func (*DirtyMgr) GetDirMetaForNodeLeave

func (d *DirtyMgr) GetDirMetaForNodeLeave(keys []*common.InodeTreeMsg, nodeList *RaftNodeList) map[string][]*common.InodeTreeMsg

func (*DirtyMgr) GetDirtyChunkAll

func (d *DirtyMgr) GetDirtyChunkAll() map[InodeKeyType]DirtyChunkInfo

func (*DirtyMgr) GetDirtyChunkForNodeJoin

func (d *DirtyMgr) GetDirtyChunkForNodeJoin(migrationId MigrationId, nodeList *RaftNodeList, newRing *hashring.HashRing, selfGroupId string, joinGroupId string) map[InodeKeyType]DirtyChunkInfo

func (*DirtyMgr) GetDirtyMetaForNodeLeave

func (d *DirtyMgr) GetDirtyMetaForNodeLeave(nodeList *RaftNodeList) (map[InodeKeyType]bool, map[string]map[InodeKeyType]bool)

GetDirtyMetaForNodeLeave returns a blank string if the number of participant Node is < nrReplicas

func (*DirtyMgr) GetDirtyMetasForNodeJoin

func (d *DirtyMgr) GetDirtyMetasForNodeJoin(migrationId MigrationId, nodeList *RaftNodeList, newRing *hashring.HashRing, selfGroup string, joinGroup string) map[InodeKeyType]bool

func (*DirtyMgr) GetLikelyDirtyChunkInodeIds

func (d *DirtyMgr) GetLikelyDirtyChunkInodeIds() []InodeKeyType

func (*DirtyMgr) IsDirtyChunk

func (d *DirtyMgr) IsDirtyChunk(chunk *Chunk) bool

func (*DirtyMgr) IsDirtyMeta

func (d *DirtyMgr) IsDirtyMeta(inodeKey InodeKeyType) (ok bool)

func (*DirtyMgr) RemoveChildMetaNoLock

func (d *DirtyMgr) RemoveChildMetaNoLock(meta *WorkingMeta, name string)

func (*DirtyMgr) RemoveChunkNoLock

func (d *DirtyMgr) RemoveChunkNoLock(inodeKey InodeKeyType, offset int64, chunkVer uint32)

func (*DirtyMgr) RemoveChunkNoLockAllOffsets

func (d *DirtyMgr) RemoveChunkNoLockAllOffsets(inodeId InodeKeyType)

func (*DirtyMgr) RemoveDeleteKeyNoLock

func (d *DirtyMgr) RemoveDeleteKeyNoLock(key string) (InodeKeyType, bool)

func (*DirtyMgr) RemoveMetaNoLock

func (d *DirtyMgr) RemoveMetaNoLock(inodeId InodeKeyType)

func (*DirtyMgr) RemoveMetaNoLockIfLatest

func (d *DirtyMgr) RemoveMetaNoLockIfLatest(inodeId InodeKeyType, version uint32) bool

func (*DirtyMgr) RemoveNonDirtyChunks

func (d *DirtyMgr) RemoveNonDirtyChunks(fps []uint64)

type DiskWriteVector

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

func (*DiskWriteVector) Less

func (b *DiskWriteVector) Less(i btree.Item) bool

type DropLRUChunksCommand

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

func NewDropLRUChunksCommand

func NewDropLRUChunksCommand(inodeKeys []uint64, offsets []int64) DropLRUChunksCommand

func (DropLRUChunksCommand) Commit

func (c DropLRUChunksCommand) Commit(n *NodeServer)

func (DropLRUChunksCommand) GetExtCmdId

func (c DropLRUChunksCommand) GetExtCmdId() uint16

func (DropLRUChunksCommand) GetTxId

func (c DropLRUChunksCommand) GetTxId() TxId

func (DropLRUChunksCommand) IsSingleShot

func (c DropLRUChunksCommand) IsSingleShot() bool

func (DropLRUChunksCommand) NeedTwoPhaseCommit

func (c DropLRUChunksCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type EpollHandler

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

func NewEpollHandler

func NewEpollHandler() (*EpollHandler, error)

func (*EpollHandler) AddFd

func (r *EpollHandler) AddFd(fd int, events uint32) (err error)

func (*EpollHandler) Close

func (r *EpollHandler) Close() (err error)

func (*EpollHandler) RemoveFd

func (r *EpollHandler) RemoveFd(fd int) (err error)

type EpollReader

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

func NewEpollReader

func NewEpollReader() (*EpollReader, error)

func (*EpollReader) AddFd

func (r *EpollReader) AddFd(fd int, sa common.NodeAddrInet4) (err error)

func (*EpollReader) CheckReset

func (r *EpollReader) CheckReset() (ok bool)

func (*EpollReader) Close

func (r *EpollReader) Close() error

func (*EpollReader) RaftRpcThread

func (r *EpollReader) RaftRpcThread(maxEvents int, n *NodeServer, pipeFds [2]int, raft *RaftInstance)

func (*EpollReader) RemoveFd

func (r *EpollReader) RemoveFd(fd int) (err error)

type ExpireDeleteInfo

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

func NewExpireDeleteInfoFromMeta

func NewExpireDeleteInfoFromMeta(key string, meta *WorkingMeta, timestamp int64) ExpireDeleteInfo

func NewExpireDeleteInfoFromMsg

func NewExpireDeleteInfoFromMsg(msg *common.DeletedFileInfoMsg) ExpireDeleteInfo

func (ExpireDeleteInfo) Less

func (i ExpireDeleteInfo) Less(l btree.Item) bool

type ExpireInfo

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

func NewExpireInfoFromMeta

func NewExpireInfoFromMeta(meta *WorkingMeta, timestamp int64) ExpireInfo

func NewExpireInfoFromMsg

func NewExpireInfoFromMsg(msg *common.DirtyMetaInfoMsg) ExpireInfo

func (ExpireInfo) Less

func (i ExpireInfo) Less(l btree.Item) bool

type ExtLogCommand

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

func NewExtLogCommand

func NewExtLogCommand(extCmdId uint16, logId LogIdType, logOffset int64, dataLen uint32, extBufChksum [4]byte) ExtLogCommand

func NewExtLogCommandFromExtBuf

func NewExtLogCommandFromExtBuf(extCmdId uint16, logId LogIdType, logOffset int64, extBuf []byte) ExtLogCommand

func (ExtLogCommand) Apply

func (c ExtLogCommand) Apply(n *NodeServer, extLog ExtLogCommandImpl)

func (ExtLogCommand) GetCmdId

func (c ExtLogCommand) GetCmdId() uint16

func (ExtLogCommand) GetExtPayloadSize

func (c ExtLogCommand) GetExtPayloadSize() uint8

func (ExtLogCommand) SetExtPayload

func (c ExtLogCommand) SetExtPayload(extPayload []byte)

type ExtLogCommandImpl

type ExtLogCommandImpl interface {
	GetExtCmdId() uint16
	GetTxId() TxId
	IsSingleShot() bool
	NeedTwoPhaseCommit(*RaftGroupMgr) bool
	Commit(*NodeServer)
	// contains filtered or unexported methods
}

func LoadExtBuf

func LoadExtBuf(extLogger *OnDiskLogger, l *AppendEntryCommand) (extCmd ExtLogCommandImpl, err error)

func NewAbortTxCommandFromExtbuf

func NewAbortTxCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewAddInodeFileMapCommandFromExtbuf

func NewAddInodeFileMapCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewBeginPersistCommandFromExtBuf

func NewBeginPersistCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewCommitChunkCommandFromExtbuf

func NewCommitChunkCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewCompactLogCoordinatorCommandFromExtBuf

func NewCompactLogCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewCreateChunkCommandFromExtbuf

func NewCreateChunkCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewCreateCoordinatorCommandFromExtBuf

func NewCreateCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewCreateMetaCommandFromExtbuf

func NewCreateMetaCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewDeleteCoordinatorCommandFromExtBuf

func NewDeleteCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewDeleteInodeFileMapCommandFromExtbuf

func NewDeleteInodeFileMapCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewDeleteMetaCommandFromExtbuf

func NewDeleteMetaCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewDeletePersistCoordinatorCommandFromExtBuf

func NewDeletePersistCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewDropLRUChunksCommandFromExtbuf

func NewDropLRUChunksCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewFlushCoordinatorCommandFromExtBuf

func NewFlushCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewForgetAllDirtyLogCommandFromExtbuf

func NewForgetAllDirtyLogCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewHardLinkCoordinatorCommandFromExtBuf

func NewHardLinkCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewInitNodeListCommandFromExtBuf

func NewInitNodeListCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewPersistChunkCommandFromExtbuf

func NewPersistChunkCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewPersistCoordinatorCommandFromExtBuf

func NewPersistCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewRecordMigratedAddChunkCommandFromExtbuf

func NewRecordMigratedAddChunkCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewRecordMigratedAddMetaCommandFromExtbuf

func NewRecordMigratedAddMetaCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewRecordMigratedRemoveChunkCommandFromExtbuf

func NewRecordMigratedRemoveChunkCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewRecordMigratedRemoveMetaCommandFromExtbuf

func NewRecordMigratedRemoveMetaCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewRemoveNonDirtyChunksCommandFromExtbuf

func NewRemoveNonDirtyChunksCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewRenameCoordinatorCommandFromExtBuf

func NewRenameCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewTruncateCoordinatorCommandFromExtBuf

func NewTruncateCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewUpdateChunkCommandFromExtbuf

func NewUpdateChunkCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewUpdateMetaAttrCommandFromExtbuf

func NewUpdateMetaAttrCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewUpdateMetaCommandFromExtbuf

func NewUpdateMetaCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewUpdateMetaKeyCommandFromExtbuf

func NewUpdateMetaKeyCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewUpdateNodeListCommandFromExtbuf

func NewUpdateNodeListCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewUpdateNodeListCoordinatorCommandFromExtBuf

func NewUpdateNodeListCoordinatorCommandFromExtBuf(extBuf []byte) (ExtLogCommandImpl, error)

func NewUpdateParentMetaCommandFromExtbuf

func NewUpdateParentMetaCommandFromExtbuf(extBuf []byte) (ExtLogCommandImpl, error)

type FileHandle

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

func NewFileHandle

func NewFileHandle(h MetaRWHandler, isReadOnly bool, disableLocalWriteBackCaching bool) *FileHandle

func (*FileHandle) Flush

func (i *FileHandle) Flush(n *NodeServer) (meta *WorkingMeta, errno error)

func (*FileHandle) GetLength

func (i *FileHandle) GetLength() int64

func (*FileHandle) Read

func (i *FileHandle) Read(offset int64, size int64, n *NodeServer, op interface{}) (data [][]byte, count int, errno error)

func (*FileHandle) ReadNoCache

func (i *FileHandle) ReadNoCache(offset int64, size int64, n *NodeServer, op interface{}) (data [][]byte, count int, errno error)

func (*FileHandle) ReleaseFlyingBuffer

func (i *FileHandle) ReleaseFlyingBuffer(op interface{})

func (*FileHandle) SetMeta

func (i *FileHandle) SetMeta(meta *WorkingMeta)

func (*FileHandle) SetModeMTime

func (i *FileHandle) SetModeMTime(mode *os.FileMode, mTime *time.Time)

func (*FileHandle) Write

func (i *FileHandle) Write(offset int64, data []byte, n *NodeServer) (meta *WorkingMeta, errno error)

type FillNodeListOp

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

func NewFillNodeListOp

func NewFillNodeListOp(txId TxId, nodeList *RaftNodeList, target RaftNode, migrationId MigrationId) FillNodeListOp

func (FillNodeListOp) GetCaller

func (o FillNodeListOp) GetCaller(n *NodeServer) RpcCaller

func (FillNodeListOp) GetLeader

func (o FillNodeListOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (FillNodeListOp) GetTxId

func (o FillNodeListOp) GetTxId() TxId

func (FillNodeListOp) RetToMsg

func (o FillNodeListOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type FillingInfo

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

type FillingKey

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

type FillingKey2

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

type FlushCoordinatorCommand

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

func NewFlushCoordinatorCommand

func NewFlushCoordinatorCommand(txId TxId, chunks []*common.UpdateChunkRecordMsg, metaTx TxRet, commitTxId TxId) FlushCoordinatorCommand

func (FlushCoordinatorCommand) Commit

func (c FlushCoordinatorCommand) Commit(n *NodeServer)

func (FlushCoordinatorCommand) GetExtCmdId

func (c FlushCoordinatorCommand) GetExtCmdId() uint16

func (FlushCoordinatorCommand) GetTxId

func (c FlushCoordinatorCommand) GetTxId() TxId

func (FlushCoordinatorCommand) IsSingleShot

func (c FlushCoordinatorCommand) IsSingleShot() bool

func (FlushCoordinatorCommand) NeedTwoPhaseCommit

func (c FlushCoordinatorCommand) NeedTwoPhaseCommit(raftGroup *RaftGroupMgr) bool

func (FlushCoordinatorCommand) RemoteCommit

func (c FlushCoordinatorCommand) RemoteCommit(raftGroup *RaftGroupMgr) []ParticipantOp

type ForgetAllDirtyLogCommand

type ForgetAllDirtyLogCommand struct {
}

func NewForgetAllDirtyLogCommand

func NewForgetAllDirtyLogCommand() ForgetAllDirtyLogCommand

func (ForgetAllDirtyLogCommand) Commit

func (c ForgetAllDirtyLogCommand) Commit(n *NodeServer)

func (ForgetAllDirtyLogCommand) GetExtCmdId

func (c ForgetAllDirtyLogCommand) GetExtCmdId() uint16

func (ForgetAllDirtyLogCommand) GetTxId

func (c ForgetAllDirtyLogCommand) GetTxId() TxId

func (ForgetAllDirtyLogCommand) IsSingleShot

func (c ForgetAllDirtyLogCommand) IsSingleShot() bool

func (ForgetAllDirtyLogCommand) NeedTwoPhaseCommit

func (c ForgetAllDirtyLogCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type GCS3

type GCS3 struct {
	*S3Backend
}

GCS variant of S3

func (*GCS3) Delegate

func (s *GCS3) Delegate() interface{}

func (*GCS3) DeleteBlobs

func (s *GCS3) DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)

func (*GCS3) MultipartBlobAdd

func (s *GCS3) MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)

func (*GCS3) MultipartBlobBegin

func (s *GCS3) MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)

func (*GCS3) MultipartBlobCommit

func (s *GCS3) MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)

type GCSMultipartBlobCommitInput

type GCSMultipartBlobCommitInput struct {
	Size uint64
	ETag *string
	Prev *MultipartBlobAddInput
}

type GetApiIpAndPortOp

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

func NewGetApiIpAndPortOp

func NewGetApiIpAndPortOp(leader RaftNode) GetApiIpAndPortOp

func (GetApiIpAndPortOp) GetCaller

func (o GetApiIpAndPortOp) GetCaller(*NodeServer) RpcCaller

func (GetApiIpAndPortOp) GetLeader

func (o GetApiIpAndPortOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (GetApiIpAndPortOp) RetToMsg

func (o GetApiIpAndPortOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type GetBlobInput

type GetBlobInput struct {
	Key     string
	Start   uint64
	Count   uint64
	IfMatch *string
}

type GetBlobOutput

type GetBlobOutput struct {
	HeadBlobOutput

	Body io.ReadCloser

	RequestId string
}

type GetMetaOp

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

func NewGetMetaOp

func NewGetMetaOp(inodeKey InodeKeyType, key string, chunkSize int64, expireMs int32, parent InodeKeyType) GetMetaOp

func (GetMetaOp) GetCaller

func (o GetMetaOp) GetCaller(*NodeServer) RpcCaller

func (GetMetaOp) GetLeader

func (o GetMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (GetMetaOp) RetToMsg

func (o GetMetaOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type GetWorkingMetaRet

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

func NewGetWrokingMetaRetFromMsg

func NewGetWrokingMetaRetFromMsg(msg *common.GetWorkingMetaRetMsg) *GetWorkingMetaRet

func (*GetWorkingMetaRet) GetChildrenMsg

func (u *GetWorkingMetaRet) GetChildrenMsg() []*common.CopiedMetaChildMsg

type HardLinkCoordinatorCommand

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

func NewHardLinkCoordinatorCommand

func NewHardLinkCoordinatorCommand(txId TxId, groupId string, newKey string, metaTx TxRet, parentTx TxRet, commitTxId TxId) HardLinkCoordinatorCommand

func (HardLinkCoordinatorCommand) Commit

func (HardLinkCoordinatorCommand) GetExtCmdId

func (c HardLinkCoordinatorCommand) GetExtCmdId() uint16

func (HardLinkCoordinatorCommand) GetTxId

func (c HardLinkCoordinatorCommand) GetTxId() TxId

func (HardLinkCoordinatorCommand) IsSingleShot

func (c HardLinkCoordinatorCommand) IsSingleShot() bool

func (HardLinkCoordinatorCommand) NeedTwoPhaseCommit

func (c HardLinkCoordinatorCommand) NeedTwoPhaseCommit(raftGroup *RaftGroupMgr) bool

func (HardLinkCoordinatorCommand) RemoteCommit

type HeadBlobInput

type HeadBlobInput struct {
	Key string
}

type HeadBlobOutput

type HeadBlobOutput struct {
	BlobItemOutput

	ContentType *string
	Metadata    map[string]*string
	IsDirBlob   bool

	RequestId string
}

type InitNodeListCommand

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

func NewInitNodeListCommand

func NewInitNodeListCommand(node RaftNode) InitNodeListCommand

func (InitNodeListCommand) Commit

func (c InitNodeListCommand) Commit(n *NodeServer)

func (InitNodeListCommand) GetExtCmdId

func (c InitNodeListCommand) GetExtCmdId() uint16

func (InitNodeListCommand) GetTxId

func (c InitNodeListCommand) GetTxId() TxId

func (InitNodeListCommand) IsSingleShot

func (c InitNodeListCommand) IsSingleShot() bool

func (InitNodeListCommand) NeedTwoPhaseCommit

func (c InitNodeListCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type Inode

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

func NewInode

func NewInode() *Inode

func (*Inode) CopyChildren

func (i *Inode) CopyChildren() map[string]InodeKeyType

func (*Inode) CopyFiles

func (i *Inode) CopyFiles() []string

func (*Inode) CopyMeta

func (i *Inode) CopyMeta() *WorkingMeta

func (*Inode) UpdateMeta

func (i *Inode) UpdateMeta(meta *WorkingMeta, children map[string]InodeKeyType)

type InodeKeyType

type InodeKeyType uint64

type InodeMgr

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

func NewInodeMgr

func NewInodeMgr(back *ObjCacheBackend, raft *RaftInstance, flags *common.ObjcacheConfig) *InodeMgr

func (*InodeMgr) AppendStagingChunkBuffer

func (n *InodeMgr) AppendStagingChunkBuffer(inodeKey InodeKeyType, offset int64, chunkSize int64, buf []byte) (logOffset int64, reply int32)

func (*InodeMgr) AppendStagingChunkLog

func (n *InodeMgr) AppendStagingChunkLog(inodeKey InodeKeyType, offset int64, logId LogIdType, logOffset int64, dataLength uint32, extBufChksum [4]byte) (reply int32)

func (*InodeMgr) CheckReset

func (n *InodeMgr) CheckReset() (ok bool)

func (*InodeMgr) Clean

func (n *InodeMgr) Clean(dirtyMgr *DirtyMgr) int32

func (*InodeMgr) CommitCreateChunk

func (n *InodeMgr) CommitCreateChunk(inodeKey InodeKeyType, offset int64, version uint32, logOffset int64, length int64, key string, chunkIdx uint32)

func (*InodeMgr) CommitCreateMeta

func (n *InodeMgr) CommitCreateMeta(working *WorkingMeta, parent InodeKeyType, newKey string, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitDeleteChunk

func (n *InodeMgr) CommitDeleteChunk(inodeKey InodeKeyType, offset int64, chunkSize int64, chunkVer uint32, stags []*common.StagingChunkAddMsg, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitDeleteInodeMap

func (n *InodeMgr) CommitDeleteInodeMap(inodeKeys []uint64, keys []string)

func (*InodeMgr) CommitDeletePersistMeta

func (n *InodeMgr) CommitDeletePersistMeta(key string, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitPersistChunk

func (n *InodeMgr) CommitPersistChunk(inodeKey InodeKeyType, offsets []int64, cVers []uint32, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitPersistMeta

func (n *InodeMgr) CommitPersistMeta(inodeKey InodeKeyType, newFetchKey string, version uint32, ts int64, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitSetMetaAndInodeFile

func (n *InodeMgr) CommitSetMetaAndInodeFile(working *WorkingMeta, children map[string]InodeKeyType, key string)

func (*InodeMgr) CommitUpdateChunk

func (n *InodeMgr) CommitUpdateChunk(inodeKey InodeKeyType, offset int64, chunkSize int64, chunkVer uint32, stags []*common.StagingChunkAddMsg, objectSize int64, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitUpdateInodeToFile

func (n *InodeMgr) CommitUpdateInodeToFile(working *WorkingMeta, children map[string]InodeKeyType, removedKey string, newKey string, dirtyMgr *DirtyMgr) *WorkingMeta

func (*InodeMgr) CommitUpdateMeta

func (n *InodeMgr) CommitUpdateMeta(working *WorkingMeta, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitUpdateMetaAttr

func (n *InodeMgr) CommitUpdateMetaAttr(inodeKey InodeKeyType, mode uint32, ts int64)

func (*InodeMgr) CommitUpdateParentMeta

func (n *InodeMgr) CommitUpdateParentMeta(info *UpdateParentInfo, dirtyMgr *DirtyMgr)

func (*InodeMgr) CreateInodeId

func (n *InodeMgr) CreateInodeId() (InodeKeyType, error)

func (*InodeMgr) DeleteInode

func (n *InodeMgr) DeleteInode(inodeKeys []uint64)

func (*InodeMgr) DropLRUChunk

func (n *InodeMgr) DropLRUChunk(keys []uint64, offsets []int64)

func (*InodeMgr) GetAllChunks

func (n *InodeMgr) GetAllChunks(chunks map[InodeKeyType]DirtyChunkInfo) ([]*common.AppendCommitUpdateChunksMsg, error)

func (*InodeMgr) GetAllDirInodes

func (n *InodeMgr) GetAllDirInodes() []*common.InodeTreeMsg

func (*InodeMgr) GetAllDirectoryMetaAsUint64

func (n *InodeMgr) GetAllDirectoryMetaAsUint64() []uint64

func (*InodeMgr) GetAllMeta

func (n *InodeMgr) GetAllMeta() ([]*common.CopiedMetaMsg, []*common.InodeToFileMsg)

func (*InodeMgr) GetAllMetaIn

func (n *InodeMgr) GetAllMetaIn(inodeKeys []uint64) ([]*common.CopiedMetaMsg, []*common.InodeToFileMsg)

func (*InodeMgr) GetChunk

func (n *InodeMgr) GetChunk(inodeKey InodeKeyType, offset int64, chunkSize int64) *Chunk

func (*InodeMgr) GetInode

func (n *InodeMgr) GetInode(inodeKey InodeKeyType) *Inode

func (*InodeMgr) GetMetaForNodeJoin

func (n *InodeMgr) GetMetaForNodeJoin(migrationId MigrationId, selfGroup string, joinGroup string, nodeList *RaftNodeList, newRing *hashring.HashRing, dirtyMetas map[InodeKeyType]bool) *Snapshot

func (*InodeMgr) GetMetaForNodeLeave

func (n *InodeMgr) GetMetaForNodeLeave(migrationId MigrationId, nodeList *RaftNodeList, dirtyMetas map[string]map[InodeKeyType]bool) map[string]*Snapshot

func (*InodeMgr) GetOrFetchWorkingMeta

func (n *InodeMgr) GetOrFetchWorkingMeta(inodeKey InodeKeyType, key string, chunkSize int64, expireMs int32, parent InodeKeyType) (*WorkingMeta, map[string]InodeKeyType, int32)

func (*InodeMgr) MpuAbort

func (n *InodeMgr) MpuAbort(key string, uploadId string) (reply int32)

func (*InodeMgr) MpuAdd

func (n *InodeMgr) MpuAdd(metaKey string, meta *WorkingMeta, offset int64, uploadId string, priority int, dirtyExpireInterval time.Duration) (out MpuAddOut, unlock func(*NodeServer), reply int32)

func (*InodeMgr) MpuBegin

func (n *InodeMgr) MpuBegin(key string) (uploadId string, reply int32)

func (*InodeMgr) MpuCommit

func (n *InodeMgr) MpuCommit(key string, uploadId string, eTags []string) (ts int64, reply int32)

func (*InodeMgr) NewWorkingMetaForRoot

func (n *InodeMgr) NewWorkingMetaForRoot() (*WorkingMeta, map[string]InodeKeyType)

func (*InodeMgr) PersistDeleteObject

func (n *InodeMgr) PersistDeleteObject(key string, _ int) (reply int32)

func (*InodeMgr) PrefetchChunkThread

func (n *InodeMgr) PrefetchChunkThread(h MetaRWHandler, offset int64)

func (*InodeMgr) PrepareCreateMeta

func (n *InodeMgr) PrepareCreateMeta(inodeKey InodeKeyType, chunkSize int64, expireMs int32, mode uint32) (*WorkingMeta, func(*NodeServer), int32)

func (*InodeMgr) PreparePersistChunk

func (n *InodeMgr) PreparePersistChunk(meta *WorkingMeta, offset int64) (chunk *Chunk, working *WorkingChunk, reply int32)

func (*InodeMgr) PreparePersistDeleteMeta

func (n *InodeMgr) PreparePersistDeleteMeta(key string, dirtyMgr *DirtyMgr) int32

func (*InodeMgr) PreparePersistMeta

func (n *InodeMgr) PreparePersistMeta(inodeKey InodeKeyType, dirtyMgr *DirtyMgr) (*Inode, []string, *WorkingMeta, int32)

func (*InodeMgr) PrepareUpdateChunk

func (n *InodeMgr) PrepareUpdateChunk(newMeta *WorkingMeta, alignedOffset int64) (chunk *Chunk, working *WorkingChunk)

func (*InodeMgr) PrepareUpdateMeta

func (n *InodeMgr) PrepareUpdateMeta(inodeKey InodeKeyType, delete bool) (*WorkingMeta, func(*NodeServer), int32)

func (*InodeMgr) PrepareUpdateMetaKey

func (n *InodeMgr) PrepareUpdateMetaKey(inodeKey InodeKeyType, oldKey string, parent InodeKeyType, chunkSize int64, expireMs int32) (*WorkingMeta, map[string]InodeKeyType, func(*NodeServer), int32)

func (*InodeMgr) PrepareUpdateParent

func (n *InodeMgr) PrepareUpdateParent(inodeKey InodeKeyType, delete bool) (*WorkingMeta, map[string]InodeKeyType, func(*NodeServer), int32)

func (*InodeMgr) PutDirObject

func (n *InodeMgr) PutDirObject(inode *Inode, meta *WorkingMeta, _ int) (ts int64, reply int32)

func (*InodeMgr) PutEmptyObject

func (n *InodeMgr) PutEmptyObject(metaKeys []string, meta *WorkingMeta, _ int) (ts int64, reply int32)

func (*InodeMgr) PutObject

func (n *InodeMgr) PutObject(tm *TxIdMgr, metaKeys []string, meta *WorkingMeta, priority int, selfGroup string, dirtyExpireInterval time.Duration) (ts int64, chunks []*common.PersistedChunkInfoMsg, reply int32)

func (*InodeMgr) QuickCommitDeleteChunk

func (n *InodeMgr) QuickCommitDeleteChunk(localOffsets map[int64]int64, meta *WorkingMeta, dirtyMgr *DirtyMgr)

func (*InodeMgr) QuickCommitExpandChunk

func (n *InodeMgr) QuickCommitExpandChunk(localOffsets map[int64]int64, meta *WorkingMeta, dirtyMgr *DirtyMgr)

func (*InodeMgr) QuickCommitUpdateChunk

func (n *InodeMgr) QuickCommitUpdateChunk(meta *WorkingMeta, selfGroup string, ucs []*common.UpdateChunkRecordMsg, dirtyMgr *DirtyMgr)

func (*InodeMgr) QuickPrepareChunk

func (n *InodeMgr) QuickPrepareChunk(newMeta *WorkingMeta, alignedOffset int64) (chunk *Chunk, working *WorkingChunk)

func (*InodeMgr) RestoreInodeTree

func (n *InodeMgr) RestoreInodeTree(inodes []*common.InodeTreeMsg)

func (*InodeMgr) RestoreMetas

func (n *InodeMgr) RestoreMetas(metas []*common.CopiedMetaMsg, files []*common.InodeToFileMsg)

func (*InodeMgr) SetChunkNoLock

func (n *InodeMgr) SetChunkNoLock(chunk *Chunk, h MetaRWHandler) (*WorkingChunk, int32)

SetChunkNoLock: caller must hold chunk.lock.Lock()

func (*InodeMgr) UnlockPersistInode

func (n *InodeMgr) UnlockPersistInode(inode *Inode, inodeKey InodeKeyType)

func (*InodeMgr) UpdateMetaAttr

func (n *InodeMgr) UpdateMetaAttr(inodeKey InodeKeyType, mode uint32, ts int64) (*WorkingMeta, int32)

func (*InodeMgr) UpdateMetaXattr

func (n *InodeMgr) UpdateMetaXattr(inodeKey InodeKeyType, expireMs int32, dirtyMgr *DirtyMgr) int32

func (*InodeMgr) VectorReadChunk

func (n *InodeMgr) VectorReadChunk(h MetaRWHandler, offset int64, size int, blocking bool) (bufs []SlicedPageBuffer, count int, reply int32)

type JoinMigrationOp

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

func NewJoinMigrationOp

func NewJoinMigrationOp(txId TxId, target RaftNode, leaderGroupId string, migrationId MigrationId) JoinMigrationOp

func (JoinMigrationOp) GetCaller

func (o JoinMigrationOp) GetCaller(n *NodeServer) RpcCaller

func (JoinMigrationOp) GetLeader

func (o JoinMigrationOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (JoinMigrationOp) GetTxId

func (o JoinMigrationOp) GetTxId() TxId

func (JoinMigrationOp) RetToMsg

func (o JoinMigrationOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type LeaveMigrationOp

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

func NewLeaveMigrationOp

func NewLeaveMigrationOp(txId TxId, target RaftNode, leaderGroupId string, migrationId MigrationId) LeaveMigrationOp

func (LeaveMigrationOp) GetCaller

func (o LeaveMigrationOp) GetCaller(n *NodeServer) RpcCaller

func (LeaveMigrationOp) GetLeader

func (o LeaveMigrationOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (LeaveMigrationOp) GetTxId

func (o LeaveMigrationOp) GetTxId() TxId

func (LeaveMigrationOp) RetToMsg

func (o LeaveMigrationOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type ListBlobsInput

type ListBlobsInput struct {
	Prefix            *string
	Delimiter         *string
	MaxKeys           *uint32
	StartAfter        *string // XXX: not supported by Azure
	ContinuationToken *string
}

type ListBlobsOutput

type ListBlobsOutput struct {
	Prefixes              []BlobPrefixOutput
	Items                 []BlobItemOutput
	NextContinuationToken *string
	IsTruncated           bool

	RequestId string
}

type LocalInode

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

type LocalReadHistory

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

func NewLocalBufferCacheHistory

func NewLocalBufferCacheHistory() *LocalReadHistory

func (*LocalReadHistory) Add

func (c *LocalReadHistory) Add(inodeKey InodeKeyType, offset int64, length int)

func (*LocalReadHistory) CheckReset

func (c *LocalReadHistory) CheckReset() (ok bool)

func (*LocalReadHistory) Delete

func (c *LocalReadHistory) Delete(inodeKey InodeKeyType)

func (*LocalReadHistory) DropAll

func (c *LocalReadHistory) DropAll()

func (*LocalReadHistory) Has

func (c *LocalReadHistory) Has(inodeKey InodeKeyType, offset int64) (int, bool)

type LogIdType

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

func GetAppendEntryExtLogArgs

func GetAppendEntryExtLogArgs(extEntryPayload []byte) (logId LogIdType, logLength int32, logOffset int64)

func NewLogIdTypeFromBuf

func NewLogIdTypeFromBuf(buf []byte) LogIdType

func NewLogIdTypeFromInodeKey

func NewLogIdTypeFromInodeKey(inodeKey InodeKeyType, offset int64, chunkSize int64) LogIdType

func (LogIdType) IsValid

func (f LogIdType) IsValid() bool

func (LogIdType) Put

func (f LogIdType) Put(buf []byte)

type LogOffsetPair

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

type MakeBucketInput

type MakeBucketInput struct {
}

type MakeBucketOutput

type MakeBucketOutput struct {
	RequestId string
}

type MemoryPool

type MemoryPool struct {
	// contains filtered or unexported fields
}
var MemPool *MemoryPool

func (*MemoryPool) CheckReset

func (m *MemoryPool) CheckReset() (ok bool)

func (*MemoryPool) GetPages

func (m *MemoryPool) GetPages(nrPages int64) (buf *PageBuffer, err error)

func (*MemoryPool) PutPages

func (m *MemoryPool) PutPages(buf *PageBuffer)

func (*MemoryPool) Reset

func (m *MemoryPool) Reset()

type MetaRWHandler

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

func NewMetaRWHandlerFromMeta

func NewMetaRWHandlerFromMeta(meta *WorkingMeta) MetaRWHandler

func NewMetaRWHandlerFromMsg

func NewMetaRWHandlerFromMsg(msg *common.MetaRWHandlerMsg) MetaRWHandler

type MigrationId

type MigrationId struct {
	ClientId uint32
	SeqNum   uint32
}

func NewMigrationIdFromMsg

func NewMigrationIdFromMsg(migrationId *common.MigrationIdMsg) MigrationId

type MpuAbortOp

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

func NewMpuAbortOp

func NewMpuAbortOp(txId TxId, keys []string, uploadIds []string) MpuAbortOp

func (MpuAbortOp) GetCaller

func (o MpuAbortOp) GetCaller(n *NodeServer) RpcCaller

func (MpuAbortOp) GetLeader

func (o MpuAbortOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (MpuAbortOp) GetTxId

func (o MpuAbortOp) GetTxId() TxId

func (MpuAbortOp) RetToMsg

func (o MpuAbortOp) RetToMsg(interface{}, RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type MpuAddOp

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

func NewMpuAddOp

func NewMpuAddOp(leader RaftNode, nodeListVer uint64, txId TxId, metaKey string, meta *WorkingMeta, offsets []int64, uploadId string, priority int) MpuAddOp

func (MpuAddOp) GetCaller

func (o MpuAddOp) GetCaller(n *NodeServer) RpcCaller

func (MpuAddOp) GetLeader

func (o MpuAddOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (MpuAddOp) GetTxId

func (o MpuAddOp) GetTxId() TxId

func (MpuAddOp) RetToMsg

func (o MpuAddOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type MpuAddOut

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

type MpuContext

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

func (*MpuContext) WaitRet

func (c *MpuContext) WaitRet(n *NodeServer) (ret []MpuAddOut, r RaftBasicReply)

type MultipartBlobAbortOutput

type MultipartBlobAbortOutput struct {
	RequestId string
}

type MultipartBlobAddInput

type MultipartBlobAddInput struct {
	Commit     *MultipartBlobCommitInput
	PartNumber uint32

	Body io.ReadSeeker

	Size   uint64 // GCS wants to know part putSize
	Last   bool   // GCS needs to know if this part is the last one
	Offset uint64 // ADLv2 needs to know offset
}

type MultipartBlobAddOutput

type MultipartBlobAddOutput struct {
	RequestId string
}

type MultipartBlobBeginInput

type MultipartBlobBeginInput struct {
	Key         string
	Metadata    map[string]*string
	ContentType *string
}

type MultipartBlobCommitInput

type MultipartBlobCommitInput struct {
	Key *string

	Metadata map[string]*string
	UploadId *string
	Parts    []*string
	NumParts uint32
	// contains filtered or unexported fields
}

type MultipartBlobCommitOutput

type MultipartBlobCommitOutput struct {
	ETag         *string
	LastModified *time.Time
	StorageClass *string

	RequestId string
}

type MultipartExpireInput

type MultipartExpireInput struct {
}

type MultipartExpireOutput

type MultipartExpireOutput struct {
	RequestId string
}

type MyHashKey

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

func (MyHashKey) Less

func (m MyHashKey) Less(l hashring.HashKey) bool

type MyRandString

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

func (*MyRandString) Get

func (r *MyRandString) Get(digit int64) string

type NoOpCommand

type NoOpCommand struct {
}

func NewNoOpCommand

func NewNoOpCommand() NoOpCommand

func (NoOpCommand) Apply

func (NoOpCommand) GetCmdId

func (c NoOpCommand) GetCmdId() uint16

func (NoOpCommand) GetExtPayloadSize

func (c NoOpCommand) GetExtPayloadSize() uint8

func (NoOpCommand) SetExtPayload

func (c NoOpCommand) SetExtPayload([]byte)

type NodeServer

type NodeServer struct {
	api.UnimplementedObjcacheApiServer
	// contains filtered or unexported fields
}

func (*NodeServer) AbortWriteObject

func (n *NodeServer) AbortWriteObject(recordMap map[string][]*common.StagingChunkMsg)

func (*NodeServer) CheckReset

func (n *NodeServer) CheckReset() (ok bool)

func (*NodeServer) CoreDump

func (n *NodeServer) CoreDump(_ context.Context, _ *api.Void) (*api.Void, error)

func (*NodeServer) CreateObject

func (n *NodeServer) CreateObject(parentKey string, parentInodeKey InodeKeyType, name string, childInodeKey InodeKeyType, mode uint32) (meta *WorkingMeta, err error)

func (*NodeServer) DropCache

func (n *NodeServer) DropCache(_ context.Context, _ *api.Void) (*api.ApiRet, error)

func (*NodeServer) EndOp

func (n *NodeServer) EndOp()

func (*NodeServer) EvictionThread

func (n *NodeServer) EvictionThread(cacheCapacityBytes int64)

func (*NodeServer) ExecDataRpc

func (n *NodeServer) ExecDataRpc(msg RpcMsg, sa common.NodeAddrInet4, fd int, pipeFds [2]int, state *ReadRpcMsgState) (noData bool)

func (*NodeServer) ExecRpcThread

func (n *NodeServer) ExecRpcThread(msg RpcMsg, sa common.NodeAddrInet4, fd int)

func (*NodeServer) FlushObject

func (n *NodeServer) FlushObject(inodeKey InodeKeyType, records []*common.UpdateChunkRecordMsg, mTime int64, mode uint32) (meta *WorkingMeta, err error)

func (*NodeServer) FlusherThread

func (n *NodeServer) FlusherThread()

func (*NodeServer) ForceStop

func (n *NodeServer) ForceStop()

func (*NodeServer) GetApiIpAndPort

func (n *NodeServer) GetApiIpAndPort(RpcMsg) *common.GetApiIpAndPortRet

func (*NodeServer) GetApiIpAndPortRemote

func (n *NodeServer) GetApiIpAndPortRemote(node RaftNode) (apiAddr string, apiPort int, reply int32)

func (*NodeServer) GetApiPort

func (n *NodeServer) GetApiPort(leader RaftNode) (apiPort int, reply int32)

func (*NodeServer) GetConfig

func (n *NodeServer) GetConfig(context.Context, *api.Void) (*api.GetConfigRet, error)

func (*NodeServer) GetMeta

func (n *NodeServer) GetMeta(inodeKey InodeKeyType, key string, parent InodeKeyType) (*WorkingMeta, map[string]InodeKeyType, error)

func (*NodeServer) GetTrackerNode

func (n *NodeServer) GetTrackerNode(context.Context, *api.Void) (*api.GetTrackerNodeRet, error)

func (*NodeServer) HardLinkObject

func (n *NodeServer) HardLinkObject(srcInodeId fuseops.InodeID, srcParent InodeKeyType, dstParentKey string, dstParentInodeId fuseops.InodeID, dstName string, childInodeKey InodeKeyType) (meta *WorkingMeta, err error)

func (*NodeServer) Init

func (n *NodeServer) Init(back *ObjCacheBackend) error

func (*NodeServer) IsReady

func (n *NodeServer) IsReady(_ context.Context, _ *api.Void) (*api.ApiRet, error)

func (*NodeServer) LockNode

func (n *NodeServer) LockNode()

func (*NodeServer) Panic

func (n *NodeServer) Panic(_ context.Context, _ *api.Void) (*api.Void, error)

func (*NodeServer) PersistAllDirty

func (n *NodeServer) PersistAllDirty()

func (*NodeServer) PersistObject

func (n *NodeServer) PersistObject(inodeId fuseops.InodeID) (meta *WorkingMeta, err error)

func (*NodeServer) PrefetchChunk

func (n *NodeServer) PrefetchChunk(h MetaRWHandler, offset int64, length int64)

func (*NodeServer) ReadAheadChunk

func (n *NodeServer) ReadAheadChunk(h MetaRWHandler, offset int64, size int64)

func (*NodeServer) ReadChunk

func (n *NodeServer) ReadChunk(h MetaRWHandler, offset int64, size int, blocking bool) (bufs []SlicedPageBuffer, count int, err error)

func (*NodeServer) Rejuvenate

func (n *NodeServer) Rejuvenate(_ context.Context, _ *api.Void) (*api.ApiRet, error)

func (*NodeServer) RemoveInodeMetadataKey

func (n *NodeServer) RemoveInodeMetadataKey(_ fuseops.InodeID, _ string) error

func (*NodeServer) RenameObject

func (n *NodeServer) RenameObject(srcParentKey string, srcParent InodeKeyType, dstParentKey string, dstParentId fuseops.InodeID, srcName string, dstName string, childInodeKey InodeKeyType) (err error)

func (*NodeServer) RequestJoin

func (n *NodeServer) RequestJoin(_ context.Context, args *api.RequestJoinArgs) (*api.ApiRet, error)

func (*NodeServer) RequestJoinLocal

func (n *NodeServer) RequestJoinLocal(headWorkerAddr string, headWorkerPort int) error

func (*NodeServer) RequestLeave

func (n *NodeServer) RequestLeave() int32

func (*NodeServer) RequestRemoveNode

func (n *NodeServer) RequestRemoveNode(_ context.Context, args *api.RequestLeaveArgs) (*api.ApiRet, error)

func (*NodeServer) SetFs

func (n *NodeServer) SetFs(fs *ObjcacheFileSystem)

func (*NodeServer) SetInodeMetadataKey

func (n *NodeServer) SetInodeMetadataKey(_ fuseops.InodeID, name string, value []byte, flags uint32) error

func (*NodeServer) Shutdown

func (n *NodeServer) Shutdown(deleteStateFile bool) bool

Shutdown NOTE: Shutdown grace period is often very short (e.g., 30 sec in k8s). So, heavy tasks must be avoided so as not to be inconsistent.

func (*NodeServer) StartGrpcServer

func (n *NodeServer) StartGrpcServer() error

func (*NodeServer) Terminate

func (n *NodeServer) Terminate(_ context.Context, _ *api.Void) (*api.Void, error)

func (*NodeServer) TerminateThread

func (n *NodeServer) TerminateThread()

func (*NodeServer) TruncateObject

func (n *NodeServer) TruncateObject(inodeId fuseops.InodeID, size int64) (meta *WorkingMeta, err error)

func (*NodeServer) TryBeginOp

func (n *NodeServer) TryBeginOp() bool

func (*NodeServer) TryLockNode

func (n *NodeServer) TryLockNode() bool

func (*NodeServer) UnlinkObject

func (n *NodeServer) UnlinkObject(parentFullPath string, parentId fuseops.InodeID, name string, childKey InodeKeyType) (err error)

func (*NodeServer) UnlockNode

func (n *NodeServer) UnlockNode()

func (*NodeServer) UpdateNodeListAsClient

func (n *NodeServer) UpdateNodeListAsClient() error

func (*NodeServer) UpdateObjectAttr

func (n *NodeServer) UpdateObjectAttr(inodeKeyType InodeKeyType, mode uint32, ts int64) (meta *WorkingMeta, err error)

func (*NodeServer) VectorReadFastPath

func (n *NodeServer) VectorReadFastPath(h MetaRWHandler, offset int64, size int, blocking bool) (bufs []SlicedPageBuffer, count int, err error)

func (*NodeServer) WaitNodeUnlocked

func (n *NodeServer) WaitNodeUnlocked()

func (*NodeServer) WaitShutdown

func (n *NodeServer) WaitShutdown()

func (*NodeServer) WriteChunk

func (n *NodeServer) WriteChunk(inodeKey InodeKeyType, chunkSize int64, offset int64, size int64, buf []byte) ([]*common.UpdateChunkRecordMsg, int32)

type ObjCacheBackend

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

func NewObjCache

func NewObjCache(secretFile string, debugS3 bool, bufferSize int) (*ObjCacheBackend, error)

func NewObjCacheFromSecrets

func NewObjCacheFromSecrets(buckets []BucketCredential, debugS3 bool, bufferSize int) (*ObjCacheBackend, error)

func (*ObjCacheBackend) GetBucketKey

func (s *ObjCacheBackend) GetBucketKey(path string) (string, string)

func (*ObjCacheBackend) Init

func (s *ObjCacheBackend) Init(key string) error

type ObjcacheFileSystem

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

func GetFSWithoutMount

func GetFSWithoutMount(args *common.ObjcacheCmdlineArgs, flags *common.ObjcacheConfig) (fs *ObjcacheFileSystem, err error)

func (*ObjcacheFileSystem) BatchForget

func (fs *ObjcacheFileSystem) BatchForget(_ context.Context, op *fuseops.BatchForgetOp) error

func (*ObjcacheFileSystem) CheckReset

func (fs *ObjcacheFileSystem) CheckReset() (ok bool)

func (*ObjcacheFileSystem) CreateFile

func (fs *ObjcacheFileSystem) CreateFile(_ context.Context, op *fuseops.CreateFileOp) (err error)
func (fs *ObjcacheFileSystem) CreateLink(_ context.Context, op *fuseops.CreateLinkOp) (err error)
func (fs *ObjcacheFileSystem) CreateSymlink(_ context.Context, op *fuseops.CreateSymlinkOp) (err error)

func (*ObjcacheFileSystem) Destroy

func (fs *ObjcacheFileSystem) Destroy()

func (*ObjcacheFileSystem) EndReset

func (fs *ObjcacheFileSystem) EndReset()

func (*ObjcacheFileSystem) Fallocate

func (fs *ObjcacheFileSystem) Fallocate(_ context.Context, op *fuseops.FallocateOp) (err error)

func (*ObjcacheFileSystem) FlushFile

func (fs *ObjcacheFileSystem) FlushFile(_ context.Context, op *fuseops.FlushFileOp) (err error)

func (*ObjcacheFileSystem) ForgetInode

func (fs *ObjcacheFileSystem) ForgetInode(_ context.Context, op *fuseops.ForgetInodeOp) error

func (*ObjcacheFileSystem) FuseMount

func (fs *ObjcacheFileSystem) FuseMount(args *common.ObjcacheCmdlineArgs, flags *common.ObjcacheConfig) (err error)

func (*ObjcacheFileSystem) GetInodeAttributes

func (fs *ObjcacheFileSystem) GetInodeAttributes(_ context.Context, op *fuseops.GetInodeAttributesOp) (err error)

func (*ObjcacheFileSystem) GetOpenInodes

func (fs *ObjcacheFileSystem) GetOpenInodes() map[InodeKeyType]bool

func (*ObjcacheFileSystem) GetXattr

func (fs *ObjcacheFileSystem) GetXattr(_ context.Context, op *fuseops.GetXattrOp) (err error)

func (*ObjcacheFileSystem) InitNodeListAsClient

func (fs *ObjcacheFileSystem) InitNodeListAsClient() (err error)

func (*ObjcacheFileSystem) ListXattr

func (fs *ObjcacheFileSystem) ListXattr(_ context.Context, op *fuseops.ListXattrOp) (err error)

func (*ObjcacheFileSystem) LookUpInode

func (fs *ObjcacheFileSystem) LookUpInode(_ context.Context, op *fuseops.LookUpInodeOp) (err error)

func (*ObjcacheFileSystem) MkDir

func (fs *ObjcacheFileSystem) MkDir(_ context.Context, op *fuseops.MkDirOp) (err error)

func (*ObjcacheFileSystem) MkNode

func (fs *ObjcacheFileSystem) MkNode(_ context.Context, op *fuseops.MkNodeOp) (err error)

func (*ObjcacheFileSystem) OpenDir

func (fs *ObjcacheFileSystem) OpenDir(_ context.Context, op *fuseops.OpenDirOp) (err error)

func (*ObjcacheFileSystem) OpenFile

func (fs *ObjcacheFileSystem) OpenFile(_ context.Context, op *fuseops.OpenFileOp) (err error)

func (*ObjcacheFileSystem) PostOp

func (fs *ObjcacheFileSystem) PostOp(_ context.Context, op interface{})

func (*ObjcacheFileSystem) ReadDir

func (fs *ObjcacheFileSystem) ReadDir(_ context.Context, op *fuseops.ReadDirOp) (err error)

func (*ObjcacheFileSystem) ReadFile

func (fs *ObjcacheFileSystem) ReadFile(_ context.Context, op *fuseops.ReadFileOp) (err error)
func (fs *ObjcacheFileSystem) ReadSymlink(_ context.Context, op *fuseops.ReadSymlinkOp) (err error)

func (*ObjcacheFileSystem) ReleaseDirHandle

func (fs *ObjcacheFileSystem) ReleaseDirHandle(_ context.Context, op *fuseops.ReleaseDirHandleOp) (err error)

func (*ObjcacheFileSystem) ReleaseFileHandle

func (fs *ObjcacheFileSystem) ReleaseFileHandle(_ context.Context, op *fuseops.ReleaseFileHandleOp) (err error)

func (*ObjcacheFileSystem) RemoveXattr

func (fs *ObjcacheFileSystem) RemoveXattr(_ context.Context, op *fuseops.RemoveXattrOp) (err error)

func (*ObjcacheFileSystem) Rename

func (fs *ObjcacheFileSystem) Rename(_ context.Context, op *fuseops.RenameOp) (err error)

func (*ObjcacheFileSystem) RequestJoinLocal

func (fs *ObjcacheFileSystem) RequestJoinLocal(headWorkerAddr string, headWorkerPort int) (err error)

func (*ObjcacheFileSystem) Reset

func (fs *ObjcacheFileSystem) Reset(shutdown bool) error

func (*ObjcacheFileSystem) RmDir

func (fs *ObjcacheFileSystem) RmDir(_ context.Context, op *fuseops.RmDirOp) (err error)

func (*ObjcacheFileSystem) SetInodeAttributes

func (fs *ObjcacheFileSystem) SetInodeAttributes(_ context.Context, op *fuseops.SetInodeAttributesOp) (err error)

func (*ObjcacheFileSystem) SetRoot

func (fs *ObjcacheFileSystem) SetRoot() error

func (*ObjcacheFileSystem) SetXattr

func (fs *ObjcacheFileSystem) SetXattr(_ context.Context, op *fuseops.SetXattrOp) (err error)

func (*ObjcacheFileSystem) StatFS

func (fs *ObjcacheFileSystem) StatFS(_ context.Context, op *fuseops.StatFSOp) (err error)

func (*ObjcacheFileSystem) SyncFile

func (fs *ObjcacheFileSystem) SyncFile(_ context.Context, op *fuseops.SyncFileOp) (err error)
func (fs *ObjcacheFileSystem) Unlink(_ context.Context, op *fuseops.UnlinkOp) (err error)

func (*ObjcacheFileSystem) WaitReset

func (fs *ObjcacheFileSystem) WaitReset()

func (*ObjcacheFileSystem) WriteFile

func (fs *ObjcacheFileSystem) WriteFile(_ context.Context, op *fuseops.WriteFileOp) (err error)

type ObjcacheProc

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

func (*ObjcacheProc) CheckReset

func (p *ObjcacheProc) CheckReset() (ok bool)

type OnDiskLog

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

func NewOnDiskLog

func NewOnDiskLog(filePath string, maxNrCache int, maxWriters int) *OnDiskLog

func (*OnDiskLog) AppendSingleBuffer

func (d *OnDiskLog) AppendSingleBuffer(buf []byte) (vec *DiskWriteVector, sizeIncrease int64, err error)

func (*OnDiskLog) BeginAppendSplice

func (d *OnDiskLog) BeginAppendSplice(srcFd int, size int64) (*DiskWriteVector, error)

func (*OnDiskLog) BeginAppendWrite

func (d *OnDiskLog) BeginAppendWrite(buf []byte) (*DiskWriteVector, error)

func (*OnDiskLog) BeginRandomSplice

func (d *OnDiskLog) BeginRandomSplice(srcFd int, size int64, logOffset int64) (*DiskWriteVector, error)

func (*OnDiskLog) BeginRandomWrite

func (d *OnDiskLog) BeginRandomWrite(buf []byte, logOffset int64) (*DiskWriteVector, error)

func (*OnDiskLog) CheckReset

func (d *OnDiskLog) CheckReset() (ok bool)

func (*OnDiskLog) Clear

func (d *OnDiskLog) Clear() (size int64)

func (*OnDiskLog) EndWrite

func (d *OnDiskLog) EndWrite(vec *DiskWriteVector) (sizeIncrease int64, err error)

func (*OnDiskLog) GetSize

func (d *OnDiskLog) GetSize() int64

func (*OnDiskLog) InitSize

func (d *OnDiskLog) InitSize(fileSize int64)

func (*OnDiskLog) Read

func (d *OnDiskLog) Read(logOffset int64, size int64) (bufs [][]byte, count int64, err error)

func (*OnDiskLog) ReadNoCache

func (d *OnDiskLog) ReadNoCache(buf []byte, logOffset int64, dataLen int64, directIo bool) (count int64, err error)

func (*OnDiskLog) ReserveAppendWrite

func (d *OnDiskLog) ReserveAppendWrite(size int64) (logOffset int64)

func (*OnDiskLog) SendZeroCopy

func (d *OnDiskLog) SendZeroCopy(toFd int, logOffset int64, size int32, bufOff *int32) (err error)

func (*OnDiskLog) Shrink

func (d *OnDiskLog) Shrink(newSize int64) (oldSize int64, err error)

func (*OnDiskLog) Splice

func (d *OnDiskLog) Splice(vec *DiskWriteVector, pipeFds [2]int, bufOff *int32) (err error)

func (*OnDiskLog) WaitWrites

func (d *OnDiskLog) WaitWrites() (size int64)

func (*OnDiskLog) Write

func (d *OnDiskLog) Write(vec *DiskWriteVector) error

func (*OnDiskLog) WriteSingleBuffer

func (d *OnDiskLog) WriteSingleBuffer(buf []byte, logOffset int64) (vec *DiskWriteVector, sizeIncrease int64, err error)

type OnDiskLogger

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

func NewOnDiskLogger

func NewOnDiskLogger(filePrefix string) *OnDiskLogger

func (*OnDiskLogger) AddDiskUsage

func (c *OnDiskLogger) AddDiskUsage(size int64) int64

func (*OnDiskLogger) AppendSingleBuffer

func (c *OnDiskLogger) AppendSingleBuffer(logId LogIdType, buf []byte) (logOffset int64, err error)

func (*OnDiskLogger) CheckReset

func (c *OnDiskLogger) CheckReset() (ok bool)

func (*OnDiskLogger) Clear

func (c *OnDiskLogger) Clear()

func (*OnDiskLogger) Freeze

func (c *OnDiskLogger) Freeze(logId LogIdType)

func (*OnDiskLogger) GetDiskLog

func (c *OnDiskLogger) GetDiskLog(logId LogIdType, maxNrCache int, maxWriters int) (disk *OnDiskLog)

func (*OnDiskLogger) GetDiskUsage

func (c *OnDiskLogger) GetDiskUsage() int64

func (*OnDiskLogger) GetSize

func (c *OnDiskLogger) GetSize(logId LogIdType) (size int64)

func (*OnDiskLogger) IsFreezed

func (c *OnDiskLogger) IsFreezed(logId LogIdType) bool

func (*OnDiskLogger) PutDiskLog

func (c *OnDiskLogger) PutDiskLog(logId LogIdType, vec *DiskWriteVector, sizeIncrease int64)

func (*OnDiskLogger) Read

func (c *OnDiskLogger) Read(logId LogIdType, logOffset int64, logBytes int64) (extBuf []byte, err error)

func (*OnDiskLogger) ReadNoCache

func (c *OnDiskLogger) ReadNoCache(logId LogIdType, buf []byte, logOffset int64, logBytes int64, directIo bool) (count int64, err error)

func (*OnDiskLogger) Remove

func (c *OnDiskLogger) Remove(logId LogIdType) (size int64, err error)

func (*OnDiskLogger) ReserveRange

func (c *OnDiskLogger) ReserveRange(logId LogIdType, logBytes int64) (offset int64)

func (*OnDiskLogger) Reset

func (c *OnDiskLogger) Reset()

func (*OnDiskLogger) SendZeroCopy

func (c *OnDiskLogger) SendZeroCopy(logId LogIdType, toFd int, logOffset int64, logBytes int32, bufOff *int32) (err error)

func (*OnDiskLogger) WriteSingleBuffer

func (c *OnDiskLogger) WriteSingleBuffer(logId LogIdType, buf []byte, logOffset int64) error

func (*OnDiskLogger) ZeroCopyRead

func (c *OnDiskLogger) ZeroCopyRead(logId LogIdType, logOffset int64, logBytes int64) (bufs [][]byte, count int64, err error)

type OnDiskState

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

func NewOnDiskState

func NewOnDiskState(rootDir string, selfId uint32, stateName string) (*OnDiskState, int32)

func (*OnDiskState) CheckReset

func (s *OnDiskState) CheckReset() (ok bool)

func (*OnDiskState) Clean

func (s *OnDiskState) Clean()

func (*OnDiskState) Get

func (s *OnDiskState) Get() uint32

func (*OnDiskState) Increment

func (s *OnDiskState) Increment() int32

func (*OnDiskState) Reset

func (s *OnDiskState) Reset() int32

func (*OnDiskState) Set

func (s *OnDiskState) Set(value uint32) int32

type PageBuffer

type PageBuffer struct {
	Buf []byte
	// contains filtered or unexported fields
}

func GetPageBuffer

func GetPageBuffer(size int64) (*PageBuffer, error)

func (*PageBuffer) AsSlice

func (p *PageBuffer) AsSlice() SlicedPageBuffer

func (*PageBuffer) Down

func (p *PageBuffer) Down() (count int32)

func (*PageBuffer) IsEvictable

func (p *PageBuffer) IsEvictable() bool

func (*PageBuffer) Up

func (p *PageBuffer) Up()

Up increments refCount to prevent Buf from begin released unexpectedly.

type PagePool

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

func NewPagePool

func NewPagePool(size int, maxNrElements int) *PagePool

func (*PagePool) CheckReset

func (p *PagePool) CheckReset() (ok bool)

func (*PagePool) Get

func (p *PagePool) Get() (*PageBuffer, error)

func (*PagePool) Put

func (p *PagePool) Put(buf *PageBuffer)

func (*PagePool) Reset

func (p *PagePool) Reset()

type ParticipantOp

type ParticipantOp interface {
	GetTxId() TxId
	GetLeader(*NodeServer, *RaftNodeList) (RaftNode, bool)

	RetToMsg(interface{}, RaftBasicReply) (proto.Message, []SlicedPageBuffer)
	GetCaller(*NodeServer) RpcCaller
	// contains filtered or unexported methods
}

func NewAbortParticipantOpFromMsg

func NewAbortParticipantOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewCommitDeleteChunkOpFromMsg

func NewCommitDeleteChunkOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewCommitExpandChunkOpFromMsg

func NewCommitExpandChunkOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewCommitParticipantOpFromMsg

func NewCommitParticipantOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewCommitPersistChunkOpFromMsg

func NewCommitPersistChunkOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewCommitUpdateChunkOpFromMsg

func NewCommitUpdateChunkOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewCreateChildMetaOpFromMsg

func NewCreateChildMetaOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewCreateMetaOpFromMsg

func NewCreateMetaOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewDeleteMetaOpFromMsg

func NewDeleteMetaOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewFillNodeListOpFromMsg

func NewFillNodeListOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewJoinMigrationOpFromMsg

func NewJoinMigrationOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewLeaveMigrationOpFromMsg

func NewLeaveMigrationOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewMpuAddOpFromMsg

func NewMpuAddOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewRenameMetaOpFromMsg

func NewRenameMetaOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewTruncateMetaOpFromMsg

func NewTruncateMetaOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewUnlinkMetaOpFromMsg

func NewUnlinkMetaOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewUpdateChunkOpFromProtoMsg

func NewUpdateChunkOpFromProtoMsg(m proto.Message, logId LogIdType, logOffset int64, dataLength uint32) (ParticipantOp, uint64)

func NewUpdateMetaKeyOpFromMsg

func NewUpdateMetaKeyOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewUpdateMetaSizeOpFromMsg

func NewUpdateMetaSizeOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

func NewUpdateNodeListOpFromMsg

func NewUpdateNodeListOpFromMsg(msg RpcMsg) (ParticipantOp, uint64, int32)

type ParticipantTx

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

func NewParticipantTx

func NewParticipantTx(txRet TxRet) ParticipantTx

func NewParticipantTxFromMsg

func NewParticipantTxFromMsg(msg *common.ParticipantTxMsg) ParticipantTx

type PersistChunkCommand

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

func NewPersistChunkCommand

func NewPersistChunkCommand(inodeKey InodeKeyType, offsets []int64, chunkVers []uint32) PersistChunkCommand

func (PersistChunkCommand) Commit

func (c PersistChunkCommand) Commit(n *NodeServer)

func (PersistChunkCommand) GetExtCmdId

func (c PersistChunkCommand) GetExtCmdId() uint16

func (PersistChunkCommand) GetTxId

func (c PersistChunkCommand) GetTxId() TxId

func (PersistChunkCommand) IsSingleShot

func (c PersistChunkCommand) IsSingleShot() bool

func (PersistChunkCommand) NeedTwoPhaseCommit

func (c PersistChunkCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type PersistCoordinatorCommand

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

func NewPersistCoordinatorCommand

func NewPersistCoordinatorCommand(txId TxId, inodeKey InodeKeyType, metaVer uint32, ts int64, keys []string, chunks []*common.PersistedChunkInfoMsg, commitTxId TxId) PersistCoordinatorCommand

func (PersistCoordinatorCommand) Commit

func (PersistCoordinatorCommand) GetExtCmdId

func (c PersistCoordinatorCommand) GetExtCmdId() uint16

func (PersistCoordinatorCommand) GetTxId

func (c PersistCoordinatorCommand) GetTxId() TxId

func (PersistCoordinatorCommand) IsSingleShot

func (c PersistCoordinatorCommand) IsSingleShot() bool

func (PersistCoordinatorCommand) NeedTwoPhaseCommit

func (c PersistCoordinatorCommand) NeedTwoPhaseCommit(raftGroup *RaftGroupMgr) bool

func (PersistCoordinatorCommand) RemoteCommit

func (c PersistCoordinatorCommand) RemoteCommit(raftGroup *RaftGroupMgr) []ParticipantOp

type PrefetchChunkOp

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

func NewPrefetchChunkOp

func NewPrefetchChunkOp(leader RaftNode, offset int64, length int64, h MetaRWHandler, nodeListVer uint64) PrefetchChunkOp

func (PrefetchChunkOp) GetCaller

func (o PrefetchChunkOp) GetCaller(*NodeServer) RpcCaller

func (PrefetchChunkOp) GetLeader

func (PrefetchChunkOp) RetToMsg

func (o PrefetchChunkOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type PrepareRpcCaller

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

func NewPrepareRpcCaller

func NewPrepareRpcCaller(fn ParticipantOp, remoteTimeout time.Duration, nodeLock bool) PrepareRpcCaller

func (PrepareRpcCaller) ExecLocal

func (c PrepareRpcCaller) ExecLocal(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (PrepareRpcCaller) ExecLocalInRpc

func (c PrepareRpcCaller) ExecLocalInRpc(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (PrepareRpcCaller) ExecRemote

func (c PrepareRpcCaller) ExecRemote(n *NodeServer, addr common.NodeAddrInet4, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (PrepareRpcCaller) GetLeader

func (c PrepareRpcCaller) GetLeader(n *NodeServer, nodeList *RaftNodeList) (RaftNode, bool)

func (PrepareRpcCaller) TryNext

func (c PrepareRpcCaller) TryNext(n *NodeServer, i int) bool

type PutBlobInput

type PutBlobInput struct {
	Key         string
	Metadata    map[string]*string
	ContentType *string
	DirBlob     bool

	Body io.ReadSeeker
	Size *uint64
}

type PutBlobOutput

type PutBlobOutput struct {
	ETag         *string
	LastModified *time.Time
	StorageClass *string

	RequestId string
}

type RaftBasicReply

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

func NewRaftBasicReply

func NewRaftBasicReply(Status int32, leader *common.LeaderNodeMsg) RaftBasicReply

func (*RaftBasicReply) GetApiNodeMsg

func (r *RaftBasicReply) GetApiNodeMsg(groupId string) *api.ApiNodeMsg

func (*RaftBasicReply) GetLeaderNodeMsg

func (r *RaftBasicReply) GetLeaderNodeMsg() *common.LeaderNodeMsg

func (*RaftBasicReply) GetNodeMsg

func (r *RaftBasicReply) GetNodeMsg(groupId string) *common.NodeMsg

type RaftCommand

type RaftCommand interface {
	GetCmdId() uint16
	GetExtPayloadSize() uint8
	SetExtPayload([]byte)
	Apply(*NodeServer, ExtLogCommandImpl)
}

func NewAddServerCommandFromBytes

func NewAddServerCommandFromBytes(l *AppendEntryCommand) RaftCommand

func NewCommitCommandFromBytes

func NewCommitCommandFromBytes(l *AppendEntryCommand) RaftCommand

func NewExtLogCommandFromBytes

func NewExtLogCommandFromBytes(l *AppendEntryCommand) RaftCommand

func NewNoOpCommandFromBytes

func NewNoOpCommandFromBytes(_ *AppendEntryCommand) RaftCommand

func NewRemoveServerCommandFromBytes

func NewRemoveServerCommandFromBytes(l *AppendEntryCommand) RaftCommand

func NewResetExtCommandFromBytes

func NewResetExtCommandFromBytes(l *AppendEntryCommand) RaftCommand

type RaftGroupMgr

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

func NewRaftGroupMgr

func NewRaftGroupMgr(groupId string, nrVirt int) *RaftGroupMgr

func (*RaftGroupMgr) Add

func (m *RaftGroupMgr) Add(node RaftNode)

func (*RaftGroupMgr) BeginRaftRead

func (m *RaftGroupMgr) BeginRaftRead(raft *RaftInstance, nodeListVer uint64) (r RaftBasicReply)

func (*RaftGroupMgr) CheckReset

func (m *RaftGroupMgr) CheckReset() (ok bool)

func (*RaftGroupMgr) Clean

func (m *RaftGroupMgr) Clean()

func (*RaftGroupMgr) CommitUpdate

func (m *RaftGroupMgr) CommitUpdate(nodes []RaftNode, isAdd bool, nodeListVer uint64)

func (*RaftGroupMgr) GetChunkOwnerGroupId

func (m *RaftGroupMgr) GetChunkOwnerGroupId(inodeKey InodeKeyType, offset int64, chunkSize int64) (string, bool)

func (*RaftGroupMgr) GetGroupLeader

func (m *RaftGroupMgr) GetGroupLeader(groupId string, l *RaftNodeList) (RaftNode, bool)

func (*RaftGroupMgr) GetGroupLeaderNoLock

func (m *RaftGroupMgr) GetGroupLeaderNoLock(groupId string, l *RaftNodeList) (RaftNode, bool)

func (*RaftGroupMgr) GetNodeListLocal

func (m *RaftGroupMgr) GetNodeListLocal() *RaftNodeList

GetNodeListLocal must be called after raft.SyncBeforeClientQuery()

func (*RaftGroupMgr) GetNumberOfGroups

func (m *RaftGroupMgr) GetNumberOfGroups() int

func (*RaftGroupMgr) GetRemovedNodeListLocal

func (m *RaftGroupMgr) GetRemovedNodeListLocal(removed RaftNode) *RaftNodeList

func (*RaftGroupMgr) GetReplica

func (m *RaftGroupMgr) GetReplica(leader RaftNode) (replica RaftNode, found bool)

func (*RaftGroupMgr) Remove

func (m *RaftGroupMgr) Remove(nodeId uint32, groupId string)

func (*RaftGroupMgr) ResetWithRaftNodeListMsg

func (m *RaftGroupMgr) ResetWithRaftNodeListMsg(msg *common.RaftNodeListMsg)

func (*RaftGroupMgr) SetNodeListDirect

func (m *RaftGroupMgr) SetNodeListDirect(nodes []*api.ApiNodeMsg, nodeListVer uint64)

func (*RaftGroupMgr) UpdateLeader

func (m *RaftGroupMgr) UpdateLeader(newLeader RaftNode) bool

func (*RaftGroupMgr) UpdateNodeListLocal

func (m *RaftGroupMgr) UpdateNodeListLocal(isAdd bool, nodes []RaftNode, nodeListVer uint64)

UpdateNodeListLocal appends a new server with a group (the group can be duplicated in the existing entry)

type RaftInstance

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

func NewRaftInstance

func NewRaftInstance(server *NodeServer) (*RaftInstance, uint64)

NewRaftInstance Raft Command Format: | command Id (byte) | Term (uint64) | log Index (uint64) | cmd (size returned by GetSize())

func (*RaftInstance) AddServerLocal

func (n *RaftInstance) AddServerLocal(sa common.NodeAddrInet4, serverId uint32) int32

func (*RaftInstance) AppendBootstrapLogs

func (n *RaftInstance) AppendBootstrapLogs(groupId string) int32

func (*RaftInstance) AppendEntriesLocal

func (n *RaftInstance) AppendEntriesLocal(rc RaftCommand, extLogCmd ExtLogCommandImpl) (ret interface{}, lastLogIndex uint64, reply int32)

func (*RaftInstance) AppendEntriesRpcBottomHalf

func (n *RaftInstance) AppendEntriesRpcBottomHalf(msg RpcMsg, sa common.NodeAddrInet4, fd int) (hadEntry bool)

func (*RaftInstance) AppendEntriesRpcTopHalf

func (n *RaftInstance) AppendEntriesRpcTopHalf(msg RpcMsg, sa common.NodeAddrInet4, fd int) (success bool, abort bool)

func (*RaftInstance) AppendExtendedLogEntry

func (n *RaftInstance) AppendExtendedLogEntry(extLogCmd ExtLogCommandImpl) int32

func (*RaftInstance) AppendInitEntry

func (n *RaftInstance) AppendInitEntry(rc RaftCommand) int32

func (*RaftInstance) ApplyAll

func (n *RaftInstance) ApplyAll(cmd *AppendEntryCommand, logIndex uint64, extLogCmd ExtLogCommandImpl)

func (*RaftInstance) CatchUpLog

func (n *RaftInstance) CatchUpLog(sa common.NodeAddrInet4, serverId uint32, timeout time.Duration) int32

func (*RaftInstance) CheckReset

func (n *RaftInstance) CheckReset() (ok bool)

func (*RaftInstance) CleanExtLogger

func (n *RaftInstance) CleanExtLogger()

func (*RaftInstance) GenerateCoordinatorId

func (n *RaftInstance) GenerateCoordinatorId() CoordinatorId

func (*RaftInstance) GetExtLogId

func (n *RaftInstance) GetExtLogId() LogIdType

func (*RaftInstance) GetExtLogIdForLogCompaction

func (n *RaftInstance) GetExtLogIdForLogCompaction() LogIdType

func (*RaftInstance) HandleAppendEntriesResponse

func (n *RaftInstance) HandleAppendEntriesResponse(msg RpcMsg, sa common.NodeAddrInet4) int32

func (*RaftInstance) HandleRequestVoteResponse

func (n *RaftInstance) HandleRequestVoteResponse(msg RpcMsg, sa common.NodeAddrInet4) int32

func (*RaftInstance) HeartBeatRecvThread

func (n *RaftInstance) HeartBeatRecvThread(interval time.Duration)

func (*RaftInstance) HeartBeaterThread

func (n *RaftInstance) HeartBeaterThread()

func (*RaftInstance) Init

func (n *RaftInstance) Init(passive bool)

func (*RaftInstance) IsLeader

func (n *RaftInstance) IsLeader() (r RaftBasicReply)

func (*RaftInstance) RemoveAllServerIds

func (n *RaftInstance) RemoveAllServerIds() int32

func (*RaftInstance) RemoveServerLocal

func (n *RaftInstance) RemoveServerLocal(serverId uint32) int32

func (*RaftInstance) ReplayAll

func (n *RaftInstance) ReplayAll() int32

func (*RaftInstance) ReplicateLog

func (n *RaftInstance) ReplicateLog(lastLogIndex uint64, added *uint32, addedSa *common.NodeAddrInet4, removedNodeId *uint32, cmd *AppendEntryCommand, extLogCmd ExtLogCommandImpl) (reply int32)

func (*RaftInstance) RequestVoteRpc

func (n *RaftInstance) RequestVoteRpc(msg RpcMsg, sa common.NodeAddrInet4, fd int) bool

func (*RaftInstance) SetExt

func (n *RaftInstance) SetExt(logId uint32, seqNum uint32)

func (*RaftInstance) Shutdown

func (n *RaftInstance) Shutdown()

func (*RaftInstance) StartVoting

func (n *RaftInstance) StartVoting()

func (*RaftInstance) StepDown

func (n *RaftInstance) StepDown(lastLogIndex uint64)

func (*RaftInstance) SwitchExtLog

func (n *RaftInstance) SwitchExtLog(logId uint32)

func (*RaftInstance) SwitchFileAndAppendEntriesLocal

func (n *RaftInstance) SwitchFileAndAppendEntriesLocal(rc RaftCommand, extLogCmd ExtLogCommandImpl) (ret interface{}, lastLogIndex uint64, reply int32)

func (*RaftInstance) SyncBeforeClientQuery

func (n *RaftInstance) SyncBeforeClientQuery() (r RaftBasicReply)

SyncBeforeClientQuery Original method is ClientQuery, which is invoked by clients to query the replicated state (read-only commands). 6.4 Note: no GRPC is provided and only sync code for linearizability is implemented. must be accessed by leader's context.

func (*RaftInstance) WaitPreviousCommits

func (n *RaftInstance) WaitPreviousCommits()

type RaftLogger

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

func NewRaftLogger

func NewRaftLogger(rootDir string, filePrefix string, maxNrCache int) (ret *RaftLogger, reply int32)

func (*RaftLogger) AppendCommand

func (f *RaftLogger) AppendCommand(cmd AppendEntryCommand) (logIndex uint64, reply int32)

func (*RaftLogger) CheckReset

func (f *RaftLogger) CheckReset() (ok bool)

func (*RaftLogger) Clear

func (f *RaftLogger) Clear()

func (*RaftLogger) CompactLog

func (f *RaftLogger) CompactLog() (reply int32)

func (*RaftLogger) GetCurrentLogLength

func (f *RaftLogger) GetCurrentLogLength() uint64

func (*RaftLogger) LoadCommandAt

func (f *RaftLogger) LoadCommandAt(logIndex uint64) (cmd AppendEntryCommand, reply int32)

func (*RaftLogger) Shrink

func (f *RaftLogger) Shrink(logIndex uint64) (reply int32)

func (*RaftLogger) SwitchFileAndAppendCommand

func (f *RaftLogger) SwitchFileAndAppendCommand(cmd AppendEntryCommand) (logIndex uint64, reply int32)

type RaftNode

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

func NewRaftNodeFromApiMsg

func NewRaftNodeFromApiMsg(msg *api.ApiNodeMsg) RaftNode

func NewRaftNodeFromMsg

func NewRaftNodeFromMsg(msg *common.NodeMsg) RaftNode

type RaftNodeList

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

func NewRaftNodeList

func NewRaftNodeList(ring *hashring.HashRing, version uint64) *RaftNodeList

func NewRaftNodeListFromMsg

func NewRaftNodeListFromMsg(nrVirt int, msg *common.RaftNodeListMsg) *RaftNodeList

func (*RaftNodeList) CheckReset

func (r *RaftNodeList) CheckReset() (ok bool)

type ReadChunkOp

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

func NewReadChunkOp

func NewReadChunkOp(h MetaRWHandler, offset int64, size int, blocking bool, readAhead bool) ReadChunkOp

func (ReadChunkOp) GetCaller

func (o ReadChunkOp) GetCaller(*NodeServer) RpcCaller

func (ReadChunkOp) GetLeader

func (o ReadChunkOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (ReadChunkOp) RetToMsg

func (o ReadChunkOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type ReadChunkOpRet

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

type ReadRpcMsgState

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

type ReadSeekerCloser

type ReadSeekerCloser struct {
	io.ReadSeeker
}

func (*ReadSeekerCloser) Close

func (r *ReadSeekerCloser) Close() error

type ReaderBufferCache

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

func NewReaderBufferCache

func NewReaderBufferCache(flags *common.ObjcacheConfig) *ReaderBufferCache

func (*ReaderBufferCache) CheckReset

func (c *ReaderBufferCache) CheckReset() (ok bool)

func (*ReaderBufferCache) Delete

func (c *ReaderBufferCache) Delete(logId LogIdType) (size int64)

func (*ReaderBufferCache) DropAll

func (c *ReaderBufferCache) DropAll()

func (*ReaderBufferCache) EndFill

func (c *ReaderBufferCache) EndFill(logId LogIdType, offset int64)

func (*ReaderBufferCache) EndFillWithPut

func (c *ReaderBufferCache) EndFillWithPut(reader *BufferedDiskPageReader)

func (*ReaderBufferCache) GetCacheOrBeginFill

func (c *ReaderBufferCache) GetCacheOrBeginFill(logId LogIdType, offset int64) (reader *BufferedDiskPageReader, beginFill bool)

func (*ReaderBufferCache) GetCacheWithFillWait

func (c *ReaderBufferCache) GetCacheWithFillWait(logId LogIdType, stagPart *StagingChunkPart, offset int64) *BufferedDiskPageReader

func (*ReaderBufferCache) GetNewBufferedDiskPageReader

func (c *ReaderBufferCache) GetNewBufferedDiskPageReader(logId LogIdType, stag *StagingChunk, blocking bool) (*BufferedDiskPageReader, error)

func (*ReaderBufferCache) ReleaseInFlightBuffer

func (c *ReaderBufferCache) ReleaseInFlightBuffer(reader *BufferedDiskPageReader)

func (*ReaderBufferCache) SetEvictable

func (c *ReaderBufferCache) SetEvictable(reader *BufferedDiskPageReader)

func (*ReaderBufferCache) TryBeginFill

func (c *ReaderBufferCache) TryBeginFill(logId LogIdType, offset int64) (beginFill bool)

type RecordMigratedAddChunkCommand

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

func (RecordMigratedAddChunkCommand) Commit

func (RecordMigratedAddChunkCommand) GetExtCmdId

func (c RecordMigratedAddChunkCommand) GetExtCmdId() uint16

func (RecordMigratedAddChunkCommand) GetTxId

func (c RecordMigratedAddChunkCommand) GetTxId() TxId

func (RecordMigratedAddChunkCommand) IsSingleShot

func (c RecordMigratedAddChunkCommand) IsSingleShot() bool

func (RecordMigratedAddChunkCommand) NeedTwoPhaseCommit

func (c RecordMigratedAddChunkCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type RecordMigratedAddMetaCommand

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

func NewRecordMigratedAddMetaCommand

func NewRecordMigratedAddMetaCommand(s *Snapshot) RecordMigratedAddMetaCommand

func (RecordMigratedAddMetaCommand) Commit

func (RecordMigratedAddMetaCommand) GetExtCmdId

func (c RecordMigratedAddMetaCommand) GetExtCmdId() uint16

func (RecordMigratedAddMetaCommand) GetTxId

func (c RecordMigratedAddMetaCommand) GetTxId() TxId

func (RecordMigratedAddMetaCommand) IsSingleShot

func (c RecordMigratedAddMetaCommand) IsSingleShot() bool

func (RecordMigratedAddMetaCommand) NeedTwoPhaseCommit

func (c RecordMigratedAddMetaCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type RecordMigratedRemoveChunkCommand

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

func NewRecordMigratedRemoveChunkCommand

func NewRecordMigratedRemoveChunkCommand(migrationId MigrationId, chunks []*common.ChunkRemoveDirtyMsg) RecordMigratedRemoveChunkCommand

func (RecordMigratedRemoveChunkCommand) Commit

func (RecordMigratedRemoveChunkCommand) GetExtCmdId

func (c RecordMigratedRemoveChunkCommand) GetExtCmdId() uint16

func (RecordMigratedRemoveChunkCommand) GetTxId

func (RecordMigratedRemoveChunkCommand) IsSingleShot

func (c RecordMigratedRemoveChunkCommand) IsSingleShot() bool

func (RecordMigratedRemoveChunkCommand) NeedTwoPhaseCommit

func (c RecordMigratedRemoveChunkCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type RecordMigratedRemoveMetaCommand

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

func NewRecordMigratedRemoveMetaCommand

func NewRecordMigratedRemoveMetaCommand(migrationId MigrationId, inodeKeys map[InodeKeyType]bool, dirInodes []*common.InodeTreeMsg) RecordMigratedRemoveMetaCommand

func (RecordMigratedRemoveMetaCommand) Commit

func (RecordMigratedRemoveMetaCommand) GetExtCmdId

func (c RecordMigratedRemoveMetaCommand) GetExtCmdId() uint16

func (RecordMigratedRemoveMetaCommand) GetTxId

func (RecordMigratedRemoveMetaCommand) IsSingleShot

func (c RecordMigratedRemoveMetaCommand) IsSingleShot() bool

func (RecordMigratedRemoveMetaCommand) NeedTwoPhaseCommit

func (c RecordMigratedRemoveMetaCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type RemoteBufferCache

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

func NewRemotePageBufferCache

func NewRemotePageBufferCache(maxSize int64) *RemoteBufferCache

func (*RemoteBufferCache) CheckReset

func (c *RemoteBufferCache) CheckReset() (ok bool)

func (*RemoteBufferCache) Delete

func (c *RemoteBufferCache) Delete(inode InodeKeyType)

func (*RemoteBufferCache) DropAll

func (c *RemoteBufferCache) DropAll()

func (*RemoteBufferCache) EndFill

func (c *RemoteBufferCache) EndFill(inodeKey InodeKeyType, offset int64)

func (*RemoteBufferCache) EndFillWithPut

func (c *RemoteBufferCache) EndFillWithPut(page *RemotePageBuffer)

func (*RemoteBufferCache) GetCache

func (c *RemoteBufferCache) GetCache(inodeKey InodeKeyType, offset int64) (SlicedPageBuffer, bool)

func (*RemoteBufferCache) GetCacheOrBeginFill

func (c *RemoteBufferCache) GetCacheOrBeginFill(inodeKey InodeKeyType, offset int64) (p *RemotePageBuffer, beginFill bool)

func (*RemoteBufferCache) GetCacheWithFillWait

func (c *RemoteBufferCache) GetCacheWithFillWait(inodeKey InodeKeyType, offset int64, length int) (SlicedPageBuffer, bool)

func (*RemoteBufferCache) GetRemotePageBuffer

func (c *RemoteBufferCache) GetRemotePageBuffer(inodeKey InodeKeyType, offset int64, length int64, blocking bool) (*RemotePageBuffer, error)

func (*RemoteBufferCache) Has

func (c *RemoteBufferCache) Has(inodekey InodeKeyType, offset int64) bool

func (*RemoteBufferCache) ReleaseInFlightBuffer

func (c *RemoteBufferCache) ReleaseInFlightBuffer(p *RemotePageBuffer)

func (*RemoteBufferCache) SetEvictable

func (c *RemoteBufferCache) SetEvictable(page *RemotePageBuffer) (size int64)

type RemotePageBuffer

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

func (*RemotePageBuffer) AsSlice

func (r *RemotePageBuffer) AsSlice(dec func(interface{})) SlicedPageBuffer

type RemoveBucketInput

type RemoveBucketInput struct {
}

type RemoveBucketOutput

type RemoveBucketOutput struct {
	RequestId string
}

type RemoveNonDirtyChunksCommand

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

func NewRemoveNonDirtyChunksCommand

func NewRemoveNonDirtyChunksCommand(inodeKeys []uint64) RemoveNonDirtyChunksCommand

func (RemoveNonDirtyChunksCommand) Commit

func (RemoveNonDirtyChunksCommand) GetExtCmdId

func (c RemoveNonDirtyChunksCommand) GetExtCmdId() uint16

func (RemoveNonDirtyChunksCommand) GetTxId

func (c RemoveNonDirtyChunksCommand) GetTxId() TxId

func (RemoveNonDirtyChunksCommand) IsSingleShot

func (c RemoveNonDirtyChunksCommand) IsSingleShot() bool

func (RemoveNonDirtyChunksCommand) NeedTwoPhaseCommit

func (c RemoveNonDirtyChunksCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type RemoveServerCommand

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

func NewRemoveServerCommand

func NewRemoveServerCommand(serverId uint32) RemoveServerCommand

func (RemoveServerCommand) Apply

func (RemoveServerCommand) GetCmdId

func (c RemoveServerCommand) GetCmdId() uint16

func (RemoveServerCommand) GetExtPayloadSize

func (c RemoveServerCommand) GetExtPayloadSize() uint8

func (RemoveServerCommand) SetExtPayload

func (c RemoveServerCommand) SetExtPayload(extPayload []byte)

type RenameBlobInput

type RenameBlobInput struct {
	Source      string
	Destination string
}

type RenameBlobOutput

type RenameBlobOutput struct {
	RequestId string
}

type RenameCoordinatorCommand

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

func NewRenameCoordinatorCommand

func NewRenameCoordinatorCommand(txId TxId) RenameCoordinatorCommand

func (*RenameCoordinatorCommand) AddMeta

func (r *RenameCoordinatorCommand) AddMeta(txRet TxRet, oldKey string, newKey string, selfGroup string)

func (*RenameCoordinatorCommand) AddParent

func (r *RenameCoordinatorCommand) AddParent(txRet TxRet, selfGroup string)

func (RenameCoordinatorCommand) Commit

func (c RenameCoordinatorCommand) Commit(n *NodeServer)

func (RenameCoordinatorCommand) GetExtCmdId

func (c RenameCoordinatorCommand) GetExtCmdId() uint16

func (RenameCoordinatorCommand) GetTxId

func (c RenameCoordinatorCommand) GetTxId() TxId

func (RenameCoordinatorCommand) IsSingleShot

func (c RenameCoordinatorCommand) IsSingleShot() bool

func (RenameCoordinatorCommand) NeedTwoPhaseCommit

func (c RenameCoordinatorCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

func (RenameCoordinatorCommand) RemoteCommit

type RenameMetaInfo

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

func NewRenameMetaInfo

func NewRenameMetaInfo(meta *WorkingMeta, oldKey string, newKey string) RenameMetaInfo

func NewRenameMetaInfoFromMsg

func NewRenameMetaInfoFromMsg(msg *common.RenameMetaInfoMsg) RenameMetaInfo

type RenameMetaOp

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

func NewRenameMetaOp

func NewRenameMetaOp(txId TxId, inodeKey InodeKeyType, key string, srcName string, dstName string, childInodekey InodeKeyType) RenameMetaOp

func (RenameMetaOp) GetCaller

func (o RenameMetaOp) GetCaller(n *NodeServer) RpcCaller

func (RenameMetaOp) GetLeader

func (o RenameMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (RenameMetaOp) GetTxId

func (o RenameMetaOp) GetTxId() TxId

func (RenameMetaOp) RetToMsg

func (o RenameMetaOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type ResetExtCommand

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

func NewResetExtCommand

func NewResetExtCommand(logId uint32, nextSeqNum uint32) ResetExtCommand

func (ResetExtCommand) Apply

func (ResetExtCommand) GetCmdId

func (c ResetExtCommand) GetCmdId() uint16

func (ResetExtCommand) GetExtPayloadSize

func (c ResetExtCommand) GetExtPayloadSize() uint8

func (ResetExtCommand) SetExtPayload

func (c ResetExtCommand) SetExtPayload(extPayload []byte)

type RestoreDirtyChunkOp

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

func NewRestoreDirtyChunkOp

func NewRestoreDirtyChunkOp(migrationId MigrationId, target RaftNode, inodeKey InodeKeyType, chunkSize int64, offset int64, objectSize int64, chunkVer uint32, bufs [][]byte) RestoreDirtyChunkOp

func (RestoreDirtyChunkOp) GetCaller

func (RestoreDirtyChunkOp) GetLeader

func (o RestoreDirtyChunkOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (RestoreDirtyChunkOp) RetToMsg

func (o RestoreDirtyChunkOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type RestoreDirtyMetaOp

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

func NewRestoreDirtyMetaOp

func NewRestoreDirtyMetaOp(s *Snapshot, target RaftNode) RestoreDirtyMetaOp

func (RestoreDirtyMetaOp) GetCaller

func (o RestoreDirtyMetaOp) GetCaller(*NodeServer) RpcCaller

func (RestoreDirtyMetaOp) GetLeader

func (o RestoreDirtyMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (RestoreDirtyMetaOp) RetToMsg

func (o RestoreDirtyMetaOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type RpcCaller

type RpcCaller interface {
	GetLeader(n *NodeServer, nodeList *RaftNodeList) (RaftNode, bool)
	ExecLocal(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)
	ExecLocalInRpc(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)
	ExecRemote(n *NodeServer, addr common.NodeAddrInet4, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)
	TryNext(n *NodeServer, i int) bool
	// contains filtered or unexported methods
}

type RpcClient

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

func NewRpcClient

func NewRpcClient(boundDev string) (*RpcClient, error)

func (*RpcClient) AddFd

func (w *RpcClient) AddFd(na common.NodeAddrInet4, fd int) error

func (*RpcClient) BroadcastAndWaitRpcMsg

func (w *RpcClient) BroadcastAndWaitRpcMsg(messages map[int]RpcMsg, raft *RaftInstance, timeout time.Duration, debug bool) (nrSuccess int)

func (*RpcClient) CheckReset

func (w *RpcClient) CheckReset() (ok bool)

func (*RpcClient) Close

func (w *RpcClient) Close() (err error)

func (*RpcClient) Connect

func (w *RpcClient) Connect(na common.NodeAddrInet4) (fd int, err error)

func (*RpcClient) RemoveFd

func (w *RpcClient) RemoveFd(fd int)

func (*RpcClient) SendAndWait

func (w *RpcClient) SendAndWait(msg RpcMsg, sa common.NodeAddrInet4, extLogger *OnDiskLogger, timeout time.Duration) (replyMsg RpcMsg, err error)

func (*RpcClient) UnicastRpcMsg

func (w *RpcClient) UnicastRpcMsg(msg RpcMsg, sa common.NodeAddrInet4, extLogger *OnDiskLogger, timeout time.Duration, dataBuf [][]byte, debug bool) (err error)

func (*RpcClient) WaitAndCheckRaftReply

func (w *RpcClient) WaitAndCheckRaftReply(raft *RaftInstance, servers map[int]*WriteRpcState, timeout time.Duration, debug bool) (nrSuccess int)

func (*RpcClient) WaitAndGetRpcReply

func (w *RpcClient) WaitAndGetRpcReply(fd int, timeout time.Duration) (msg RpcMsg, reply int32)

type RpcClientConnectionV2

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

func NewRpcClientConnectionV2

func NewRpcClientConnectionV2(na common.NodeAddrInet4, connectErrLog bool, boundDev string) (ret *RpcClientConnectionV2, err error)

func NewRpcClientConnectionV2FromFd

func NewRpcClientConnectionV2FromFd(fd int, na common.NodeAddrInet4) (ret *RpcClientConnectionV2, err error)

func (*RpcClientConnectionV2) AsyncObjcacheRpc

func (w *RpcClientConnectionV2) AsyncObjcacheRpc(extCmdId uint16, seqNum uint64, args proto.Message, sa common.NodeAddrInet4, extLogger *OnDiskLogger, dataBuf [][]byte, rpcArgs *RpcSeqNumArgs) (reply int32)

func (*RpcClientConnectionV2) CallObjcacheRpc

func (w *RpcClientConnectionV2) CallObjcacheRpc(extCmdId uint16, seqNum uint64, args proto.Message, timeout time.Duration, extLogger *OnDiskLogger, dataBuf [][]byte, rpcArgs *RpcSeqNumArgs, ret proto.Message) (reply int32)

func (*RpcClientConnectionV2) CallObjcacheRpcNoTimeout

func (w *RpcClientConnectionV2) CallObjcacheRpcNoTimeout(extCmdId uint16, seqNum uint64, args proto.Message, extLogger *OnDiskLogger, dataBuf [][]byte, rpcArgs *RpcSeqNumArgs, ret proto.Message) (reply int32)

func (*RpcClientConnectionV2) Close

func (w *RpcClientConnectionV2) Close() bool

func (*RpcClientConnectionV2) Down

func (w *RpcClientConnectionV2) Down() int32

func (*RpcClientConnectionV2) IsFree

func (w *RpcClientConnectionV2) IsFree() bool

func (*RpcClientConnectionV2) RemoveRpcArgs

func (w *RpcClientConnectionV2) RemoveRpcArgs(seqNum uint64)

func (*RpcClientConnectionV2) SendRpcMsg

func (w *RpcClientConnectionV2) SendRpcMsg(msg RpcMsg, extLogger *OnDiskLogger, wakeUpInterval time.Duration, dataBuf [][]byte, doTimeout bool) (err error)

func (*RpcClientConnectionV2) StoreRpcArgs

func (w *RpcClientConnectionV2) StoreRpcArgs(seqNum uint64, args *RpcSeqNumArgs)

func (*RpcClientConnectionV2) Up

func (w *RpcClientConnectionV2) Up()

func (*RpcClientConnectionV2) WaitAndGetRpcReply

func (w *RpcClientConnectionV2) WaitAndGetRpcReply(seqNum uint64, timeout time.Duration, enableLog bool) (msg RpcMsg, err error)

type RpcClientV2

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

func NewRpcClientV2

func NewRpcClientV2(boundDev string) (*RpcClientV2, error)

func (*RpcClientV2) AsyncObjcacheRpc

func (w *RpcClientV2) AsyncObjcacheRpc(extCmdId uint16, args proto.Message, sa common.NodeAddrInet4, extLogger *OnDiskLogger, dataBuf [][]byte, rpcArgs *RpcSeqNumArgs) (con *RpcClientConnectionV2, seqNum uint64, reply int32)

func (*RpcClientV2) CallObjcacheRpc

func (w *RpcClientV2) CallObjcacheRpc(extCmdId uint16, args proto.Message, sa common.NodeAddrInet4, timeout time.Duration, extLogger *OnDiskLogger, dataBuf [][]byte, rpcArgs *RpcSeqNumArgs, ret proto.Message) (reply int32)

func (*RpcClientV2) CheckReset

func (w *RpcClientV2) CheckReset() (ok bool)

func (*RpcClientV2) Close

func (w *RpcClientV2) Close()

func (*RpcClientV2) WaitAsyncObjcacheRpc

func (w *RpcClientV2) WaitAsyncObjcacheRpc(con *RpcClientConnectionV2, seqNum uint64, ret proto.Message) (reply int32)

type RpcMgr

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

func NewRpcManager

func NewRpcManager(n *NodeServer) *RpcMgr

func (*RpcMgr) AbortAll

func (o *RpcMgr) AbortAll(tm *TxIdMgr, retryInterval time.Duration, nodeLock bool)

func (*RpcMgr) CallRpc

func (o *RpcMgr) CallRpc(c RpcCaller) (ret RpcRet, r RaftBasicReply)

func (*RpcMgr) CallRpcOneShot

func (o *RpcMgr) CallRpcOneShot(c RpcCaller, nodeList *RaftNodeList) (ret RpcRet, r RaftBasicReply)

func (*RpcMgr) CheckReset

func (o *RpcMgr) CheckReset() (ok bool)

func (*RpcMgr) Commit

func (o *RpcMgr) Commit(extLog CoordinatorCommand, retryInterval time.Duration) (reply int32)

func (*RpcMgr) CommitCoordinator

func (o *RpcMgr) CommitCoordinator(extLog CoordinatorCommand, retryInterval time.Duration) (reply int32)

func (*RpcMgr) DeleteAndGet

func (o *RpcMgr) DeleteAndGet(seq TxId) (call RpcState, ok bool)

func (*RpcMgr) DeleteAndUnlockLocalAll

func (o *RpcMgr) DeleteAndUnlockLocalAll(tm *TxIdMgr)

func (*RpcMgr) Enter

func (o *RpcMgr) Enter(seq TxId) (call RpcState, duplicated bool, passed bool)

func (*RpcMgr) Get

func (o *RpcMgr) Get(seq TxId) (call RpcState, ok bool)

func (*RpcMgr) Record

func (o *RpcMgr) Record(seq TxId, ret RpcRet)

func (*RpcMgr) RestoreDirtyChunksBottomHalf

func (o *RpcMgr) RestoreDirtyChunksBottomHalf(m proto.Message, logId LogIdType, logOffset int64, dataLength uint32, reply int32) (proto.Message, []SlicedPageBuffer)

func (*RpcMgr) UpdateChunkBottomHalf

func (o *RpcMgr) UpdateChunkBottomHalf(m proto.Message, logId LogIdType, logOffset int64, dataLength uint32, reply int32) proto.Message

type RpcMsg

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

func (*RpcMsg) CreateOptControlHeader

func (d *RpcMsg) CreateOptControlHeader(totalExtLogLength uint32, nrEntries uint32, entryPayloadLength uint16)

func (*RpcMsg) FillAppendEntriesResponseArgs

func (d *RpcMsg) FillAppendEntriesResponseArgs(term uint32, success bool, logLength uint64, reply int32)

func (*RpcMsg) FillAppendEntryArgs

func (d *RpcMsg) FillAppendEntryArgs(term uint32, prevTerm uint32, prevIndex uint64, leaderCommit uint64, leaderId uint32)

func (*RpcMsg) FillExecProtoBufArgs

func (d *RpcMsg) FillExecProtoBufArgs(execId uint16, seqNum uint64, m proto.Message, dataBufLen int, isResponse bool) int32

func (*RpcMsg) FillRequestVoteArgs

func (d *RpcMsg) FillRequestVoteArgs(term uint32, candidateId uint32, lastLogTerm uint32, lastLogIndex uint64)

func (*RpcMsg) FillRequestVoteResponseArgs

func (d *RpcMsg) FillRequestVoteResponseArgs(term uint32, voteGranted bool, reply int32)

func (*RpcMsg) GetAppendEntriesResponseArgs

func (d *RpcMsg) GetAppendEntriesResponseArgs() (term uint32, success bool, logLength uint64, reply int32)

func (*RpcMsg) GetAppendEntryArgs

func (d *RpcMsg) GetAppendEntryArgs() (term uint32, prevTerm uint32, prevIndex uint64, leaderCommit uint64, leaderId uint32)

func (*RpcMsg) GetAppendEntryCommandDiskFormat

func (d *RpcMsg) GetAppendEntryCommandDiskFormat(off uint16) (cmd AppendEntryCommand, nextOff uint16)

func (*RpcMsg) GetAppendEntryExtHeader

func (d *RpcMsg) GetAppendEntryExtHeader(off uint16) (extCmdId uint16, extEntryPayload []byte, nextOff uint16)

func (*RpcMsg) GetAppendEntryNrEntries

func (d *RpcMsg) GetAppendEntryNrEntries() (nrEntries uint32)

func (*RpcMsg) GetArrivingMsgLengths

func (d *RpcMsg) GetArrivingMsgLengths(off uint16, optHeaderLength *uint16) (complete bool)

func (*RpcMsg) GetCmdId

func (d *RpcMsg) GetCmdId() uint8

func (*RpcMsg) GetCmdPayload

func (d *RpcMsg) GetCmdPayload() []byte

func (*RpcMsg) GetExecProtoBufRpcId

func (d *RpcMsg) GetExecProtoBufRpcId(payload []byte) (rpcId uint16)

func (*RpcMsg) GetExecProtoBufRpcSeqNum

func (d *RpcMsg) GetExecProtoBufRpcSeqNum(payload []byte) (seqNum uint64)

func (*RpcMsg) GetOptControlHeader

func (d *RpcMsg) GetOptControlHeader() (totalExtLogLength uint32, nrEntries uint32)

func (*RpcMsg) GetOptHeaderLength

func (d *RpcMsg) GetOptHeaderLength() uint16

func (*RpcMsg) GetOptHeaderPayload

func (d *RpcMsg) GetOptHeaderPayload() []byte

func (*RpcMsg) GetRequestVoteArgs

func (d *RpcMsg) GetRequestVoteArgs() (term uint32, candidateId uint32, lastLogTerm uint32, lastLogIndex uint64)

func (*RpcMsg) GetRequestVoteResponseArgs

func (d *RpcMsg) GetRequestVoteResponseArgs() (term uint32, voteGranted bool, reply int32)

func (*RpcMsg) ParseExecProtoBufMessage

func (d *RpcMsg) ParseExecProtoBufMessage(m proto.Message) (reply int32)

func (*RpcMsg) SetCmdControlHeader

func (d *RpcMsg) SetCmdControlHeader(cmdId uint8, optHeaderLength uint16)

func (*RpcMsg) SetNrEntries

func (d *RpcMsg) SetNrEntries(nrEntries uint32)

func (*RpcMsg) SetOptHeaderLength

func (d *RpcMsg) SetOptHeaderLength(optHeaderLength uint16)

func (*RpcMsg) SetTotalExtLogLength

func (d *RpcMsg) SetTotalExtLogLength(totalExtLogLength uint32)

type RpcReplyClient

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

func NewRpcReplyClient

func NewRpcReplyClient() (*RpcReplyClient, error)

func (*RpcReplyClient) CheckReset

func (w *RpcReplyClient) CheckReset() (ok bool)

func (*RpcReplyClient) Close

func (w *RpcReplyClient) Close()

func (*RpcReplyClient) Register

func (w *RpcReplyClient) Register(fd int, sa common.NodeAddrInet4) (err error)

func (*RpcReplyClient) ReplyRpcMsg

func (w *RpcReplyClient) ReplyRpcMsg(msg RpcMsg, fd int, sa common.NodeAddrInet4, extLogger *OnDiskLogger, timeout time.Duration, dataBuf [][]byte) (reply int32)

type RpcRet

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

type RpcSeqNumArgs

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

type RpcState

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

type RpcStatePointer

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

func (RpcStatePointer) Less

func (o RpcStatePointer) Less(a btree.Item) bool

type RpcThreads

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

func NewRpcThreads

func NewRpcThreads(sa common.NodeAddrInet4, boundDev string) (ret RpcThreads, err error)

func (*RpcThreads) AcceptThread

func (f *RpcThreads) AcceptThread(epollFd int, acceptTimeout time.Duration, stopFlag *int32)

func (*RpcThreads) CheckReset

func (f *RpcThreads) CheckReset() (ok bool)

func (*RpcThreads) Close

func (f *RpcThreads) Close()

func (*RpcThreads) Start

func (f *RpcThreads) Start(maxEvents int, n *NodeServer, raft *RaftInstance) error

type S3Backend

type S3Backend struct {
	*s3.S3
	// contains filtered or unexported fields
}

func NewGCS3

func NewGCS3(bucket string, debugS3 bool, config *S3Config, bufferSize int) (*S3Backend, error)

func NewS3

func NewS3(bucket string, debugS3 bool, config *S3Config, bufferSize int) (*S3Backend, error)

func (*S3Backend) Bucket

func (s *S3Backend) Bucket() string

func (*S3Backend) Capabilities

func (s *S3Backend) Capabilities() *Capabilities

func (*S3Backend) CopyBlob

func (s *S3Backend) CopyBlob(param *CopyBlobInput) (*CopyBlobOutput, error)

func (*S3Backend) Delegate

func (s *S3Backend) Delegate() interface{}

func (*S3Backend) DeleteBlob

func (s *S3Backend) DeleteBlob(param *DeleteBlobInput) (*DeleteBlobOutput, error)

func (*S3Backend) DeleteBlobs

func (s *S3Backend) DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)

func (*S3Backend) GetBlob

func (s *S3Backend) GetBlob(param *GetBlobInput) (*GetBlobOutput, error)

func (*S3Backend) HeadBlob

func (s *S3Backend) HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error)

func (*S3Backend) Init

func (s *S3Backend) Init(key string) error

func (*S3Backend) ListBlobs

func (s *S3Backend) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error)

func (*S3Backend) ListObjectsV2

func (s *S3Backend) ListObjectsV2(params *s3.ListObjectsV2Input) (*s3.ListObjectsV2Output, string, error)

func (*S3Backend) MakeBucket

func (s *S3Backend) MakeBucket(param *MakeBucketInput) (*MakeBucketOutput, error)

func (*S3Backend) MultipartBlobAbort

func (s *S3Backend) MultipartBlobAbort(param *MultipartBlobCommitInput) (*MultipartBlobAbortOutput, error)

func (*S3Backend) MultipartBlobAdd

func (s *S3Backend) MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)

func (*S3Backend) MultipartBlobBegin

func (s *S3Backend) MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)

func (*S3Backend) MultipartBlobCommit

func (s *S3Backend) MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)

func (*S3Backend) MultipartExpire

func (s *S3Backend) MultipartExpire(param *MultipartExpireInput) (*MultipartExpireOutput, error)

func (*S3Backend) PutBlob

func (s *S3Backend) PutBlob(param *PutBlobInput) (*PutBlobOutput, error)

func (*S3Backend) RemoveBucket

func (s *S3Backend) RemoveBucket(param *RemoveBucketInput) (*RemoveBucketOutput, error)

func (*S3Backend) RenameBlob

func (s *S3Backend) RenameBlob(param *RenameBlobInput) (*RenameBlobOutput, error)

type S3Config

type S3Config struct {
	Profile         string
	AccessKey       string
	SecretKey       string
	RoleArn         string
	RoleExternalId  string
	RoleSessionName string
	StsEndpoint     string

	RequesterPays bool
	Region        string
	RegionSet     bool

	StorageClass string

	UseSSE     bool
	UseKMS     bool
	KMSKeyID   string
	SseC       string
	SseCDigest string
	ACL        string

	Subdomain bool

	Credentials *credentials.Credentials
	Session     *session.Session

	BucketOwner string
}

func (*S3Config) Init

func (c *S3Config) Init() *S3Config

func (*S3Config) ToAwsConfig

func (c *S3Config) ToAwsConfig(debugS3 bool, bufferSize int) (*aws.Config, error)

type SingleShotOp

type SingleShotOp interface {
	GetLeader(*NodeServer, *RaftNodeList) (RaftNode, bool)

	RetToMsg(interface{}, RaftBasicReply) (proto.Message, []SlicedPageBuffer)
	GetCaller(*NodeServer) RpcCaller
	// contains filtered or unexported methods
}

func NewGetApiIpAndPortOpFromMsg

func NewGetApiIpAndPortOpFromMsg(msg RpcMsg) (fn SingleShotOp, nodeListVer uint64, reply int32)

func NewGetMetaOpFromMsg

func NewGetMetaOpFromMsg(msg RpcMsg) (fn SingleShotOp, nodeListVer uint64, reply int32)

func NewPrefetchChunkOpFromMsg

func NewPrefetchChunkOpFromMsg(msg RpcMsg) (fn SingleShotOp, nodeListVer uint64, reply int32)

func NewReadChunkOpFromMsg

func NewReadChunkOpFromMsg(msg RpcMsg) (fn SingleShotOp, nodeListVer uint64, reply int32)

func NewRestoreDirtyChunkOpFromProtoMsg

func NewRestoreDirtyChunkOpFromProtoMsg(m proto.Message, logId LogIdType, logOffset int64, dataLength uint32) (fn SingleShotOp, nodeListVer uint64)

func NewRestoreDirtyMetaOpFromMsg

func NewRestoreDirtyMetaOpFromMsg(msg RpcMsg) (fn SingleShotOp, nodeListVer uint64, reply int32)

func NewUpdateMetaAttrOpFromMsg

func NewUpdateMetaAttrOpFromMsg(msg RpcMsg) (SingleShotOp, uint64, int32)

type SingleShotRpcCaller

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

func NewSingleShotRpcCaller

func NewSingleShotRpcCaller(fn SingleShotOp, remoteTimeout time.Duration, noTryBeginOp bool) SingleShotRpcCaller

func (SingleShotRpcCaller) ExecLocal

func (c SingleShotRpcCaller) ExecLocal(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (SingleShotRpcCaller) ExecLocalInRpc

func (c SingleShotRpcCaller) ExecLocalInRpc(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (SingleShotRpcCaller) ExecRemote

func (c SingleShotRpcCaller) ExecRemote(n *NodeServer, addr common.NodeAddrInet4, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (SingleShotRpcCaller) GetLeader

func (c SingleShotRpcCaller) GetLeader(n *NodeServer, nodeList *RaftNodeList) (RaftNode, bool)

func (SingleShotRpcCaller) TryNext

func (c SingleShotRpcCaller) TryNext(n *NodeServer, i int) bool

type SlicedPageBuffer

type SlicedPageBuffer struct {
	Buf []byte
	// contains filtered or unexported fields
}

func NewBlankSlicedPageBuffer

func NewBlankSlicedPageBuffer(size int64) SlicedPageBuffer

func (*SlicedPageBuffer) SetEvictable

func (p *SlicedPageBuffer) SetEvictable()

func (*SlicedPageBuffer) Slice

func (p *SlicedPageBuffer) Slice(begin int64, last int64)

type Snapshot

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

func NewSnapshot

func NewSnapshot(maxBytes int, migrationId MigrationId, newExtLogId uint32,
	metas []*common.CopiedMetaMsg,
	files []*common.InodeToFileMsg,
	dirents []*common.InodeTreeMsg,
	dirtyMetas []*common.DirtyMetaInfoMsg,
	dirtyChunks []*common.AppendCommitUpdateChunksMsg,
	nodeList *common.RaftNodeListMsg) *Snapshot

func NewSnapshotFromMsg

func NewSnapshotFromMsg(msg *common.SnapshotMsg) *Snapshot

func (*Snapshot) GetNext

func (s *Snapshot) GetNext() *Snapshot

type StagingChunk

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

func NewStagingChunk

func NewStagingChunk(slop int64, length int64, updateType byte, logOffset int64, key string, filled int32) *StagingChunk

func NewStagingChunkFromAddMsg

func NewStagingChunkFromAddMsg(msg *common.StagingChunkAddMsg) *StagingChunk

func (*StagingChunk) AppendToLog

func (s *StagingChunk) AppendToLog(inodeMgr *InodeMgr, reader *BufferedDiskPageReader, fetchKey string) (err error)

func (*StagingChunk) GetObject

func (s *StagingChunk) GetObject(inodeMgr *InodeMgr, reader *BufferedDiskPageReader, fetchOffset int64) error

func (*StagingChunk) ReadObject

func (s *StagingChunk) ReadObject(inodeMgr *InodeMgr, reader *BufferedDiskPageReader) (err error)

type StagingChunkPart

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

func (*StagingChunkPart) LastOffset

func (p *StagingChunkPart) LastOffset() int64

func (*StagingChunkPart) Less

func (p *StagingChunkPart) Less(b btree.Item) bool

type StaleInode

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

type StorageBackend

type StorageBackend interface {
	Init(key string) error
	Capabilities() *Capabilities
	// typically this would return bucket/prefix
	Bucket() string
	HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error)
	ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error)
	DeleteBlob(param *DeleteBlobInput) (*DeleteBlobOutput, error)
	DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)
	RenameBlob(param *RenameBlobInput) (*RenameBlobOutput, error)
	CopyBlob(param *CopyBlobInput) (*CopyBlobOutput, error)
	GetBlob(param *GetBlobInput) (*GetBlobOutput, error)
	PutBlob(param *PutBlobInput) (*PutBlobOutput, error)
	MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)
	MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)
	MultipartBlobAbort(param *MultipartBlobCommitInput) (*MultipartBlobAbortOutput, error)
	MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)
	MultipartExpire(param *MultipartExpireInput) (*MultipartExpireOutput, error)
	RemoveBucket(param *RemoveBucketInput) (*RemoveBucketOutput, error)
	MakeBucket(param *MakeBucketInput) (*MakeBucketOutput, error)
	Delegate() interface{}
}

/ Implementations of all the functions here are expected to be / concurrency-safe, except for / / Init() is called exactly once before any other functions are / called. / / Capabilities()/Bucket() are expected to be const

type StorageBackendInitError

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

func (StorageBackendInitError) Bucket

func (s StorageBackendInitError) Bucket() string

func (StorageBackendInitError) Capabilities

func (e StorageBackendInitError) Capabilities() *Capabilities

func (StorageBackendInitError) CopyBlob

func (StorageBackendInitError) Delegate

func (e StorageBackendInitError) Delegate() interface{}

func (StorageBackendInitError) DeleteBlob

func (StorageBackendInitError) DeleteBlobs

func (StorageBackendInitError) GetBlob

func (StorageBackendInitError) HeadBlob

func (StorageBackendInitError) Init

func (e StorageBackendInitError) Init(key string) error

func (StorageBackendInitError) ListBlobs

func (StorageBackendInitError) MakeBucket

func (StorageBackendInitError) MultipartBlobAbort

func (StorageBackendInitError) MultipartBlobAdd

func (StorageBackendInitError) MultipartBlobBegin

func (StorageBackendInitError) MultipartBlobCommit

func (StorageBackendInitError) MultipartExpire

func (StorageBackendInitError) PutBlob

func (StorageBackendInitError) RemoveBucket

func (StorageBackendInitError) RenameBlob

type StorageBackendInitWrapper

type StorageBackendInitWrapper struct {
	StorageBackend
	// contains filtered or unexported fields
}

func (*StorageBackendInitWrapper) Bucket

func (s *StorageBackendInitWrapper) Bucket() string

func (*StorageBackendInitWrapper) Capabilities

func (s *StorageBackendInitWrapper) Capabilities() *Capabilities

func (*StorageBackendInitWrapper) CopyBlob

func (*StorageBackendInitWrapper) DeleteBlob

func (*StorageBackendInitWrapper) DeleteBlobs

func (*StorageBackendInitWrapper) GetBlob

func (*StorageBackendInitWrapper) HeadBlob

func (*StorageBackendInitWrapper) Init

func (s *StorageBackendInitWrapper) Init(key string) error

func (*StorageBackendInitWrapper) ListBlobs

func (*StorageBackendInitWrapper) MakeBucket

func (*StorageBackendInitWrapper) MultipartBlobAbort

func (*StorageBackendInitWrapper) MultipartBlobAdd

func (*StorageBackendInitWrapper) MultipartBlobBegin

func (*StorageBackendInitWrapper) MultipartBlobCommit

func (*StorageBackendInitWrapper) MultipartExpire

func (*StorageBackendInitWrapper) PutBlob

func (*StorageBackendInitWrapper) RemoveBucket

func (*StorageBackendInitWrapper) RenameBlob

type TruncateCoordinatorCommand

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

func NewTruncateCoordinatorCommand

func NewTruncateCoordinatorCommand(txId TxId, metaTx TxRet, raftGroup *RaftGroupMgr, commitTxId TxId) TruncateCoordinatorCommand

func (TruncateCoordinatorCommand) Commit

func (TruncateCoordinatorCommand) GetExtCmdId

func (c TruncateCoordinatorCommand) GetExtCmdId() uint16

func (TruncateCoordinatorCommand) GetTxId

func (c TruncateCoordinatorCommand) GetTxId() TxId

func (TruncateCoordinatorCommand) IsSingleShot

func (c TruncateCoordinatorCommand) IsSingleShot() bool

func (TruncateCoordinatorCommand) NeedTwoPhaseCommit

func (c TruncateCoordinatorCommand) NeedTwoPhaseCommit(raftGroup *RaftGroupMgr) bool

func (TruncateCoordinatorCommand) RemoteCommit

func (c TruncateCoordinatorCommand) RemoteCommit(raftGroup *RaftGroupMgr) []ParticipantOp

type TruncateMetaOp

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

func NewTruncateMetaOp

func NewTruncateMetaOp(txId TxId, inodeKey InodeKeyType, newSize int64) TruncateMetaOp

func (TruncateMetaOp) GetCaller

func (o TruncateMetaOp) GetCaller(n *NodeServer) RpcCaller

func (TruncateMetaOp) GetLeader

func (o TruncateMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (TruncateMetaOp) GetTxId

func (o TruncateMetaOp) GetTxId() TxId

func (TruncateMetaOp) RetToMsg

func (o TruncateMetaOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type Tx

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

func (Tx) Less

func (p Tx) Less(b btree.Item) bool

type TxId

type TxId struct {
	ClientId uint32
	SeqNum   uint32
	TxSeqNum uint64
}

func NewTxIdFromMsg

func NewTxIdFromMsg(msg *common.TxIdMsg) TxId

func (*TxId) GetNext

func (t *TxId) GetNext() TxId

func (*TxId) GetVariant

func (t *TxId) GetVariant(TxSeqNum uint64) TxId

type TxIdMgr

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

func NewTxIdMgr

func NewTxIdMgr(txId TxId) *TxIdMgr

func (*TxIdMgr) AddTx

func (t *TxIdMgr) AddTx(txId TxId, ret RpcRet) TxRet

func (*TxIdMgr) GetCoordinatorTxId

func (t *TxIdMgr) GetCoordinatorTxId() TxId

func (*TxIdMgr) GetLocalTxIds

func (t *TxIdMgr) GetLocalTxIds(selfGroup string) []TxId

func (*TxIdMgr) GetMigrationId

func (t *TxIdMgr) GetMigrationId() MigrationId

func (*TxIdMgr) GetNextId

func (t *TxIdMgr) GetNextId() TxId

func (*TxIdMgr) GetTxGroupIds

func (t *TxIdMgr) GetTxGroupIds() map[TxId]string

type TxMgr

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

func NewTxMgr

func NewTxMgr() *TxMgr

func (*TxMgr) ResumeTx

func (m *TxMgr) ResumeTx(n *NodeServer) int32

type TxRet

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

type UnlinkMetaOp

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

func NewUnlinkMetaOp

func NewUnlinkMetaOp(txId TxId, inodeKey InodeKeyType, parentKey string, childName string, childIsDir bool) UnlinkMetaOp

func (UnlinkMetaOp) GetCaller

func (o UnlinkMetaOp) GetCaller(n *NodeServer) RpcCaller

func (UnlinkMetaOp) GetLeader

func (o UnlinkMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (UnlinkMetaOp) GetTxId

func (o UnlinkMetaOp) GetTxId() TxId

func (UnlinkMetaOp) RetToMsg

func (o UnlinkMetaOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type UpadteChunkRpcCaller

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

func NewUpadteChunkRpcCaller

func NewUpadteChunkRpcCaller(fn ParticipantOp, remoteTimeout time.Duration) UpadteChunkRpcCaller

func (UpadteChunkRpcCaller) ExecLocal

func (c UpadteChunkRpcCaller) ExecLocal(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (UpadteChunkRpcCaller) ExecLocalInRpc

func (c UpadteChunkRpcCaller) ExecLocalInRpc(n *NodeServer, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (UpadteChunkRpcCaller) ExecRemote

func (c UpadteChunkRpcCaller) ExecRemote(n *NodeServer, addr common.NodeAddrInet4, nodeListVer uint64) (ret RpcRet, r RaftBasicReply)

func (UpadteChunkRpcCaller) GetLeader

func (c UpadteChunkRpcCaller) GetLeader(n *NodeServer, nodeList *RaftNodeList) (RaftNode, bool)

func (UpadteChunkRpcCaller) TryNext

func (c UpadteChunkRpcCaller) TryNext(n *NodeServer, i int) bool

type UpdateChunkCommand

type UpdateChunkCommand struct {
}

func NewUpdateChunkCommand

func NewUpdateChunkCommand() UpdateChunkCommand

func (UpdateChunkCommand) Commit

func (c UpdateChunkCommand) Commit(n *NodeServer)

func (UpdateChunkCommand) GetExtCmdId

func (c UpdateChunkCommand) GetExtCmdId() uint16

func (UpdateChunkCommand) GetTxId

func (c UpdateChunkCommand) GetTxId() TxId

func (UpdateChunkCommand) IsSingleShot

func (c UpdateChunkCommand) IsSingleShot() bool

func (UpdateChunkCommand) NeedTwoPhaseCommit

func (c UpdateChunkCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type UpdateChunkOp

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

func NewUpdateChunkOp

func NewUpdateChunkOp(txId TxId, inodeKey InodeKeyType, chunkSize int64, offset int64, buf []byte) UpdateChunkOp

func (UpdateChunkOp) GetCaller

func (o UpdateChunkOp) GetCaller(n *NodeServer) RpcCaller

func (UpdateChunkOp) GetLeader

func (o UpdateChunkOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (UpdateChunkOp) GetTxId

func (o UpdateChunkOp) GetTxId() TxId

func (UpdateChunkOp) RetToMsg

func (o UpdateChunkOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type UpdateMetaAttrCommand

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

func NewUpdateMetaAttrCommand

func NewUpdateMetaAttrCommand(inodeKey InodeKeyType, mode uint32, ts int64) UpdateMetaAttrCommand

func (UpdateMetaAttrCommand) Commit

func (c UpdateMetaAttrCommand) Commit(n *NodeServer)

func (UpdateMetaAttrCommand) GetExtCmdId

func (c UpdateMetaAttrCommand) GetExtCmdId() uint16

func (UpdateMetaAttrCommand) GetTxId

func (c UpdateMetaAttrCommand) GetTxId() TxId

func (UpdateMetaAttrCommand) IsSingleShot

func (c UpdateMetaAttrCommand) IsSingleShot() bool

func (UpdateMetaAttrCommand) NeedTwoPhaseCommit

func (c UpdateMetaAttrCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type UpdateMetaAttrOp

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

func NewUpdateMetaAttrOp

func NewUpdateMetaAttrOp(txId TxId, inodeKey InodeKeyType, mode uint32, ts int64) UpdateMetaAttrOp

func (UpdateMetaAttrOp) GetCaller

func (o UpdateMetaAttrOp) GetCaller(n *NodeServer) RpcCaller

func (UpdateMetaAttrOp) GetLeader

func (o UpdateMetaAttrOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (UpdateMetaAttrOp) GetTxId

func (o UpdateMetaAttrOp) GetTxId() TxId

func (UpdateMetaAttrOp) RetToMsg

func (o UpdateMetaAttrOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type UpdateMetaCommand

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

func NewUpdateMetaCommand

func NewUpdateMetaCommand(txId TxId, working *WorkingMeta) UpdateMetaCommand

func (UpdateMetaCommand) Commit

func (c UpdateMetaCommand) Commit(n *NodeServer)

func (UpdateMetaCommand) GetExtCmdId

func (c UpdateMetaCommand) GetExtCmdId() uint16

func (UpdateMetaCommand) GetTxId

func (c UpdateMetaCommand) GetTxId() TxId

func (UpdateMetaCommand) IsSingleShot

func (c UpdateMetaCommand) IsSingleShot() bool

func (UpdateMetaCommand) NeedTwoPhaseCommit

func (c UpdateMetaCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type UpdateMetaKeyCommand

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

func NewUpdateMetaKeyCommand

func NewUpdateMetaKeyCommand(txId TxId, parentWorking *WorkingMeta, children map[string]InodeKeyType, oldKey string, newKey string) UpdateMetaKeyCommand

func (UpdateMetaKeyCommand) Commit

func (c UpdateMetaKeyCommand) Commit(n *NodeServer)

func (UpdateMetaKeyCommand) GetExtCmdId

func (c UpdateMetaKeyCommand) GetExtCmdId() uint16

func (UpdateMetaKeyCommand) GetTxId

func (c UpdateMetaKeyCommand) GetTxId() TxId

func (UpdateMetaKeyCommand) IsSingleShot

func (c UpdateMetaKeyCommand) IsSingleShot() bool

func (UpdateMetaKeyCommand) NeedTwoPhaseCommit

func (c UpdateMetaKeyCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type UpdateMetaKeyOp

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

func NewUpdateMetaKeyOp

func NewUpdateMetaKeyOp(txId TxId, inodeKey InodeKeyType, oldKey string, newKey string, parent InodeKeyType) UpdateMetaKeyOp

func (UpdateMetaKeyOp) GetCaller

func (o UpdateMetaKeyOp) GetCaller(n *NodeServer) RpcCaller

func (UpdateMetaKeyOp) GetLeader

func (o UpdateMetaKeyOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (UpdateMetaKeyOp) GetTxId

func (o UpdateMetaKeyOp) GetTxId() TxId

func (UpdateMetaKeyOp) RetToMsg

func (o UpdateMetaKeyOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type UpdateMetaSizeOp

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

func NewUpdateMetaSizeOp

func NewUpdateMetaSizeOp(txId TxId, inodeKey InodeKeyType, newSize int64, mTime int64, mode uint32) UpdateMetaSizeOp

func (UpdateMetaSizeOp) GetCaller

func (o UpdateMetaSizeOp) GetCaller(n *NodeServer) RpcCaller

func (UpdateMetaSizeOp) GetLeader

func (o UpdateMetaSizeOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (UpdateMetaSizeOp) GetTxId

func (o UpdateMetaSizeOp) GetTxId() TxId

func (UpdateMetaSizeOp) RetToMsg

func (o UpdateMetaSizeOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type UpdateNodeListCommand

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

func NewUpdateNodeListCommand

func NewUpdateNodeListCommand(txId TxId, migrationId MigrationId, isAdd bool, needRestore bool, nodes []RaftNode, nodeListVer uint64) UpdateNodeListCommand

func (UpdateNodeListCommand) Commit

func (c UpdateNodeListCommand) Commit(n *NodeServer)

func (UpdateNodeListCommand) GetExtCmdId

func (c UpdateNodeListCommand) GetExtCmdId() uint16

func (UpdateNodeListCommand) GetTxId

func (c UpdateNodeListCommand) GetTxId() TxId

func (UpdateNodeListCommand) IsSingleShot

func (c UpdateNodeListCommand) IsSingleShot() bool

func (UpdateNodeListCommand) NeedTwoPhaseCommit

func (c UpdateNodeListCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type UpdateNodeListCoordinatorCommand

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

func NewUpdateNodeListCoordinatorCommand

func NewUpdateNodeListCoordinatorCommand(txId TxId, migrationId MigrationId, target RaftNode, isAdd bool, selfNode RaftNode) UpdateNodeListCoordinatorCommand

func (*UpdateNodeListCoordinatorCommand) AddNode

func (c *UpdateNodeListCoordinatorCommand) AddNode(txRet TxRet)

func (UpdateNodeListCoordinatorCommand) Commit

func (UpdateNodeListCoordinatorCommand) GetExtCmdId

func (c UpdateNodeListCoordinatorCommand) GetExtCmdId() uint16

func (UpdateNodeListCoordinatorCommand) GetTxId

func (UpdateNodeListCoordinatorCommand) IsSingleShot

func (c UpdateNodeListCoordinatorCommand) IsSingleShot() bool

func (UpdateNodeListCoordinatorCommand) NeedTwoPhaseCommit

func (c UpdateNodeListCoordinatorCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

func (UpdateNodeListCoordinatorCommand) RemoteCommit

type UpdateNodeListOp

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

func NewUpdateNodeListOp

func NewUpdateNodeListOp(txId TxId, added RaftNode, leaderGroupId string, isAdd bool, target *common.NodeAddrInet4, migrationId MigrationId) UpdateNodeListOp

func (UpdateNodeListOp) GetCaller

func (o UpdateNodeListOp) GetCaller(n *NodeServer) RpcCaller

func (UpdateNodeListOp) GetLeader

func (o UpdateNodeListOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, bool)

func (UpdateNodeListOp) GetTxId

func (o UpdateNodeListOp) GetTxId() TxId

func (UpdateNodeListOp) RetToMsg

func (o UpdateNodeListOp) RetToMsg(ret interface{}, r RaftBasicReply) (proto.Message, []SlicedPageBuffer)

type UpdateParentInfo

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

func NewUpdateParentInfo

func NewUpdateParentInfo(inodeKey InodeKeyType, key string, addInodeKey InodeKeyType, addChild string, removedChild string, childIsDir bool) *UpdateParentInfo

func NewUpdateParentInfoFromMsg

func NewUpdateParentInfoFromMsg(msg *common.UpdateParentMetaInfoMsg) *UpdateParentInfo

type UpdateParentMetaCommand

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

func NewUpdateParentMetaCommand

func NewUpdateParentMetaCommand(txId TxId, info *UpdateParentInfo) UpdateParentMetaCommand

func (UpdateParentMetaCommand) Commit

func (c UpdateParentMetaCommand) Commit(n *NodeServer)

func (UpdateParentMetaCommand) GetExtCmdId

func (c UpdateParentMetaCommand) GetExtCmdId() uint16

func (UpdateParentMetaCommand) GetTxId

func (c UpdateParentMetaCommand) GetTxId() TxId

func (UpdateParentMetaCommand) IsSingleShot

func (c UpdateParentMetaCommand) IsSingleShot() bool

func (UpdateParentMetaCommand) NeedTwoPhaseCommit

func (c UpdateParentMetaCommand) NeedTwoPhaseCommit(*RaftGroupMgr) bool

type UpdateParentRet

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

type WorkingChunk

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

func (*WorkingChunk) AddNewStag

func (c *WorkingChunk) AddNewStag(raft *RaftInstance, backingKey string, offset int64, updateType byte, objectSize int64, chunkSize int64) int32

func (*WorkingChunk) AddNewStagFromMsg

func (c *WorkingChunk) AddNewStagFromMsg(l *common.StagingChunkAddMsg)

func (*WorkingChunk) AddStag

func (c *WorkingChunk) AddStag(stag *StagingChunk)

AddStag must be in a critical section

func (*WorkingChunk) AddStagingChunkFromAddMsg

func (c *WorkingChunk) AddStagingChunkFromAddMsg(cLog *common.WorkingChunkAddMsg)

func (*WorkingChunk) Copy

func (c *WorkingChunk) Copy(chunkVer uint32) *WorkingChunk

func (*WorkingChunk) DeleteFromVersionListNoLock

func (c *WorkingChunk) DeleteFromVersionListNoLock()

func (*WorkingChunk) GetNext

func (c *WorkingChunk) GetNext(inodeMgr *InodeMgr, offset int64, blocking bool) (buf SlicedPageBuffer, err error)

func (*WorkingChunk) GetReader

func (c *WorkingChunk) GetReader(chunkSize int64, objectSize int64, offset int64, inodeMgr *InodeMgr, blocking bool) *ChunkReader

func (*WorkingChunk) Head

func (c *WorkingChunk) Head() *StagingChunkPart

func (*WorkingChunk) LastNonDeletedPtr

func (c *WorkingChunk) LastNonDeletedPtr() *StagingChunkPart

func (*WorkingChunk) NewStagingChunkPart

func (c *WorkingChunk) NewStagingChunkPart(length int64, stag *StagingChunk, slop int64) *StagingChunkPart

func (*WorkingChunk) Prefetch

func (c *WorkingChunk) Prefetch(inodeMgr *InodeMgr)

func (*WorkingChunk) ReadNext

func (c *WorkingChunk) ReadNext(inodeMgr *InodeMgr, p []byte, offset int64, blocking bool) (int64, error)

func (*WorkingChunk) Size

func (c *WorkingChunk) Size() int64

Size must hold lock

func (*WorkingChunk) Tail

func (c *WorkingChunk) Tail() *StagingChunkPart

func (*WorkingChunk) WriteToNext

func (c *WorkingChunk) WriteToNext(inodeMgr *InodeMgr, w io.Writer, offset int64, blocking bool) (int64, error)

type WorkingMeta

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

func NewWorkingMeta

func NewWorkingMeta(inodeKey InodeKeyType, chunkSize int64, expireMs int32, mode uint32, nlink uint32, fetchKey string) *WorkingMeta

func NewWorkingMetaFromMsg

func NewWorkingMetaFromMsg(res *common.CopiedMetaMsg) *WorkingMeta

func (*WorkingMeta) DropPrev

func (m *WorkingMeta) DropPrev()

DropPrev: Meta.lock must be held

func (*WorkingMeta) GetAttr

func (m *WorkingMeta) GetAttr(uid uint32, gid uint32) fuseops.InodeAttributes

func (*WorkingMeta) GetMetadata

func (m *WorkingMeta) GetMetadata() map[string][]byte

func (*WorkingMeta) IsDeleted

func (m *WorkingMeta) IsDeleted() bool

func (*WorkingMeta) IsDir

func (m *WorkingMeta) IsDir() bool

type WriteRpcState

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

Jump to

Keyboard shortcuts

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