internal

package
v0.0.0-...-4e9bc17 Latest Latest
Warning

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

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

Documentation

Overview

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	StagingChunkData   = byte(1)
	StagingChunkDelete = byte(2)
	StagingChunkBlank  = byte(3)
)
View Source
const (
	AppendEntryCommandLogBaseSize = int32(crc32.Size + 7)
	AppendEntryCommandLogSize     = AppendEntryCommandLogBaseSize + int32(AppendEntryFileCmdLength)

	AppendEntryFileCmdLength         = uint8(28)
	AppendEntryNoOpCmdLength         = uint8(0)
	AppendEntryAddServerCmdLength    = uint8(10)
	AppendEntryRemoveServerCmdLength = uint8(4)
	AppendEntryCommitTxCmdLength     = uint8(16)
	AppendEntryResetExtLogCmdLength  = uint8(12)
)
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 (
	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 (
	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)
	AppendEntryUpdateMetaCoordinatorCmdId     = DataCmdIdBit | uint16(4)
	AppendEntryCommitChunkCmdId               = DataCmdIdBit | uint16(5)
	AppendEntryAbortTxCmdId                   = DataCmdIdBit | uint16(6)
	AppendEntryPersistChunkCmdId              = DataCmdIdBit | uint16(7)
	AppendEntryBeginPersistCmdId              = DataCmdIdBit | uint16(8)
	AppendEntryPersistCmdId                   = DataCmdIdBit | uint16(9)
	AppendEntryUpdateNodeListCoordinatorCmdId = DataCmdIdBit | uint16(10)
	AppendEntryUpdateNodeListCmdId            = DataCmdIdBit | uint16(11)
	AppendEntryUpdateNodeListLocalCmdId       = DataCmdIdBit | uint16(12)
	AppendEntryCommitMigrationCmdId           = DataCmdIdBit | uint16(13)
	AppendEntryCreateMetaCoordinatorCmdId     = DataCmdIdBit | uint16(14)
	AppendEntryUpdateMetaKeyCmdId             = DataCmdIdBit | uint16(15)
	AppendEntryRenameCoordinatorCmdId         = DataCmdIdBit | uint16(16)
	AppendEntryCreateMetaCmdId                = DataCmdIdBit | uint16(17)
	AppendEntryDeleteMetaCmdId                = DataCmdIdBit | uint16(18)
	AppendEntryDeleteMetaCoordinatorCmdId     = DataCmdIdBit | uint16(19)
	AppendEntryDeletePersistCmdId             = DataCmdIdBit | uint16(20)
	AppendEntryUpdateParentMetaCmdId          = DataCmdIdBit | uint16(21)
	AppendEntryAddInodeFileMapCmdId           = DataCmdIdBit | uint16(22)
	AppendEntryDropLRUChunksCmdId             = DataCmdIdBit | uint16(23)
	AppendEntryCreateChunkCmdId               = DataCmdIdBit | uint16(24)
	AppendEntryUpdateMetaAttrCmdId            = DataCmdIdBit | uint16(25)
	AppendEntryDeleteInodeFileMapCmdId        = DataCmdIdBit | uint16(26)
	AppendEntryRemoveNonDirtyChunksCmdId      = DataCmdIdBit | uint16(27)
	AppendEntryForgetAllDirtyLogCmdId         = DataCmdIdBit | uint16(28)

	RpcGetMetaInClusterCmdId       = uint16(1)
	RpcGetMetaCmdId                = uint16(2)
	RpcDownloadChunkViaRemoteCmdId = uint16(3)
	RpcPrefetchChunkCmdId          = uint16(4)
	RpcRestoreDirtyMetasCmdId      = uint16(5)
	RpcGetApiIpAndPortCmdId        = uint16(6)

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

	RpcCommitParticipantCmdId          = uint16(20)
	RpcCommitMigrationParticipantCmdId = uint16(21)
	RpcAbortParticipantCmdId           = uint16(22)

	RpcCreateMetaCmdId         = uint16(30)
	RpcLinkMetaCmdId           = uint16(31)
	RpcTruncateMetaCmdId       = uint16(32)
	RpcUpdateMetaSizeCmdId     = uint16(33)
	RpcDeleteMetaCmdId         = uint16(34)
	RpcUnlinkMetaCmdId         = uint16(35)
	RpcRenameMetaCmdId         = uint16(36)
	RpcCommitUpdateChunkCmdId  = uint16(37)
	RpcCommitDeleteChunkCmdId  = uint16(38)
	RpcCommitExpandChunkCmdId  = uint16(39)
	RpcCommitPersistChunkCmdId = uint16(40)
	RpcUpdateNodeListCmdId     = uint16(41)
	RpcInitNodeListCmdId       = uint16(42)
	RpcMpuAddCmdId             = uint16(43)
	RpcJoinMigrationCmdId      = uint16(44)
	RpcLeaveMigrationCmdId     = uint16(45)
	RpcCreateChildMetaCmdId    = uint16(46)
	RpcUpdateMetaKeyCmdId      = uint16(47)
	RpcUpdateMetaAttrCmdId     = uint16(48)
	RpcGetApiPortCmdId         = uint16(49)

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

AppendEntryHeartBeatCmdId = uint16(0)

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

	TxUpdateCoordinator         = 30
	TxDeleteCoordinator         = 31
	TxBeginPersistCoordinator   = 32
	TxPersistCoordinator        = 33
	TxUpdateNodeListCoordinator = 34
	TxCreateCoordinator         = 35
	TxRenameCoordinator         = 36
	TxTruncateCoordinator       = 37
)
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 (
	RaftFileCacheLimit = 100
)
View Source
const RaftPersistStateReset = 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 MaxTime = time.Unix(1<<63-62135596801, 999999999)
View Source
var PageSize = int64(os.Getpagesize())
View Source
var RandString = MyRandString{/* contains filtered or unexported fields */}
View Source
var SectorSize = 512
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 CallGetApiPort

func CallGetApiPort(n *NodeServer, sa common.NodeAddrInet4) (apiPort int, reply int32)

func CollectLRUChunks

func CollectLRUChunks(dirtyMgr *DirtyMgr, raft *RaftInstance, reclaimDiskBytes int64) *common.DropLRUChunksArgs

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 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 IsReset

func IsReset(value uint32) bool

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 NewRenameRetFromMsg

func NewRenameRetFromMsg(msg *common.RenameRetMsg) (*RenameRet, RaftBasicReply)

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, files *RaftFiles, 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) AbortParticipantOp

func (AbortParticipantOp) GetLeader

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

type AppendEntryCommand

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

func NewAppendEntryAddServerCommand

func NewAppendEntryAddServerCommand(term uint32, serverId uint32, ip [4]byte, port uint16) (cmd AppendEntryCommand)

func NewAppendEntryCommitTxCommand

func NewAppendEntryCommitTxCommand(term uint32, txId *common.TxIdMsg) (cmd AppendEntryCommand)

func NewAppendEntryDeleteExtLogCommand

func NewAppendEntryDeleteExtLogCommand(term uint32, fileId uint64) (cmd AppendEntryCommand)

func NewAppendEntryFileCommand

func NewAppendEntryFileCommand(term uint32, extCmdId uint16, fileId FileIdType, fileOffset int64, fileContent []byte) (cmd AppendEntryCommand)

func NewAppendEntryFileCommandFromFile

func NewAppendEntryFileCommandFromFile(term uint32, extCmdId uint16, fileId FileIdType, fileOffset int64, dataLen uint32, fileName string) (cmd AppendEntryCommand, err error)

func NewAppendEntryNoOpCommandDiskFormat

func NewAppendEntryNoOpCommandDiskFormat(term uint32) (cmd AppendEntryCommand)

func NewAppendEntryRemoveServerCommand

func NewAppendEntryRemoveServerCommand(term uint32, serverId uint32) (cmd AppendEntryCommand)

func NewAppendEntryResetExtLogCommand

func NewAppendEntryResetExtLogCommand(term uint32, fileId uint64, nextSeqNum uint32) (cmd AppendEntryCommand)

func (*AppendEntryCommand) AppendToRpcMsg

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

func (*AppendEntryCommand) GetAsAddServer

func (l *AppendEntryCommand) GetAsAddServer() (serverId uint32, ip [4]byte, port uint16)

func (*AppendEntryCommand) GetAsAppendEntryFile

func (l *AppendEntryCommand) GetAsAppendEntryFile() (fileId FileIdType, fileLength int32, fileOffset int64)

func (*AppendEntryCommand) GetAsCommitTx

func (l *AppendEntryCommand) GetAsCommitTx() (clientId uint32, seqNum uint32, txSeqNum uint64)

func (*AppendEntryCommand) GetAsRemoveServer

func (l *AppendEntryCommand) GetAsRemoveServer() (serverId uint32)

func (*AppendEntryCommand) GetAsResetExtLog

func (l *AppendEntryCommand) GetAsResetExtLog() (fileId uint64, nextSeqNum uint32)

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 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 BufferedFilePageReader

type BufferedFilePageReader 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.
  • BufferedFilePageReader must still return the range [o, o + dataLen] regardless of reading more than it.
  • bf: bufFileOffset 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 NewBufferedFilePageReaderFromStag

func NewBufferedFilePageReaderFromStag(page *PageBuffer, fileId FileIdType, fileOffset int64, dataLen int64) *BufferedFilePageReader

func (*BufferedFilePageReader) GetSlicedPageBufferAt

func (r *BufferedFilePageReader) 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 CachedCommand

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

func (CachedCommand) Less

func (c CachedCommand) Less(i btree.Item) bool

type CachedFd

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

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, files *RaftFiles) *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) GetFileId

func (c *Chunk) GetFileId() FileIdType

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) DontNeed

func (r *ChunkReader) DontNeed(raft *RaftInstance)

func (*ChunkReader) GetBufferDirect

func (r *ChunkReader) GetBufferDirect(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 CommandCache

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

func NewCommandCache

func NewCommandCache(maxLength int) CommandCache

func (CommandCache) CheckReset

func (c CommandCache) CheckReset() (ok bool)

func (*CommandCache) Clean

func (c *CommandCache) Clean()

func (CommandCache) Get

func (c CommandCache) Get(index uint64) (cmd AppendEntryCommand, ok bool)

func (CommandCache) Put

func (c CommandCache) Put(index uint64, cmd AppendEntryCommand)

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) GetLeader

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

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) GetLeader

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

type CommitMigrationParticipantOp

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

func NewCommitMigrationParticipantOp

func NewCommitMigrationParticipantOp(rpcSeqNum TxId, commitTxId TxId, groupId string, nodeListVer uint64, addr *common.NodeAddrInet4, migrationId MigrationId) CommitMigrationParticipantOp

func (CommitMigrationParticipantOp) GetLeader

type CommitParticipantOp

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

func NewCommitParticipantOp

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

func (CommitParticipantOp) GetLeader

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

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, newFetchKey string) CommitPersistChunkOp

func (CommitPersistChunkOp) GetLeader

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

type CommitUpdateChunkOp

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

func NewCommitUpdateChunkOp

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

func (CommitUpdateChunkOp) GetLeader

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

type CoordinatorCreateObjectOp

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

func NewCoordinatorCreateObjectOp

func NewCoordinatorCreateObjectOp(parentFullPath string, parentAttr MetaAttributes, childName string, childAttr MetaAttributes, chunkSize int64, expireMs int32) CoordinatorCreateObjectOp

func (CoordinatorCreateObjectOp) GetLeader

type CoordinatorDeleteObjectOp

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

func NewCoordinatorDeleteObjectOp

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

func (CoordinatorDeleteObjectOp) GetLeader

type CoordinatorDeletePersistOp

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

func NewCoordinatorDeletePersistOp

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

func (CoordinatorDeletePersistOp) GetLeader

type CoordinatorFlushObjectOp

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

func NewCoordinatorFlushObjectOp

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

func (CoordinatorFlushObjectOp) GetLeader

type CoordinatorHardLinkOp

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

func NewCoordinatorHardLinkOp

func NewCoordinatorHardLinkOp(srcInodeKey InodeKeyType, srcParent MetaAttributes, dstParentKey string, dstParentInodeKey InodeKeyType, dstName string, childAttr MetaAttributes) CoordinatorHardLinkOp

func (CoordinatorHardLinkOp) GetLeader

type CoordinatorId

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

func NewCoordinatorIdFromMsg

func NewCoordinatorIdFromMsg(msg *common.CoordinatorIdMsg) CoordinatorId

type CoordinatorOpBase

type CoordinatorOpBase interface {
	GetLeader(*NodeServer, *RaftNodeList) (RaftNode, bool)
	// contains filtered or unexported methods
}

type CoordinatorPersistOp

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

func NewCoordinatorPersistOp

func NewCoordinatorPersistOp(inodeKey InodeKeyType, priority int) CoordinatorPersistOp

func (CoordinatorPersistOp) GetLeader

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

type CoordinatorRenameObjectOp

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

func NewCoordinatorRenameObjectOp

func NewCoordinatorRenameObjectOp(srcParentKey string, srcParent MetaAttributes, srcName string, dstParentKey string, dstParentInodeKey InodeKeyType, dstName string, childAttr MetaAttributes) CoordinatorRenameObjectOp

func (CoordinatorRenameObjectOp) CheckError

func (o CoordinatorRenameObjectOp) CheckError(unlink RenameRet, link RenameRet) int32

func (CoordinatorRenameObjectOp) GetLeader

type CoordinatorRet

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

func NewCoordinatorRetFromMsg

func NewCoordinatorRetFromMsg(msg *common.CoordinatorRetMsg) CoordinatorRet

type CoordinatorTruncateObjectOp

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

func NewCoordinatorTruncateObjectOp

func NewCoordinatorTruncateObjectOp(inodeKey InodeKeyType, newSize int64) CoordinatorTruncateObjectOp

func (CoordinatorTruncateObjectOp) GetLeader

type CoordinatorUpdateNodeListOp

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

func NewCoordinatorUpdateNodeListOp

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

func (CoordinatorUpdateNodeListOp) GetLeader

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, childName string, childAttr MetaAttributes) CreateChildMetaOp

func (CreateChildMetaOp) GetLeader

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

type CreateMetaOp

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

func NewCreateMetaOp

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

func (CreateMetaOp) GetLeader

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

type DataCache

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

func NewDataCache

func NewDataCache(maxKeys int, maxValueLength int) *DataCache

func (*DataCache) CheckReset

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

func (*DataCache) Close

func (c *DataCache) Close()

func (*DataCache) Get

func (c *DataCache) Get(id FileIdType, offset int64, length int32) ([]byte, bool)

func (*DataCache) Put

func (c *DataCache) Put(id FileIdType, offset int64, buf []byte)

type DataCacheKey

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

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 DeleteMetaOp

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

func NewDeleteMetaOp

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

func (DeleteMetaOp) GetLeader

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

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) 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) AppendCommitMigrationLog

func (d *DirtyMgr) AppendCommitMigrationLog(raft *RaftInstance, txId TxId, migrationId MigrationId) int32

func (*DirtyMgr) AppendForgetAllDirtyLog

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

func (*DirtyMgr) AppendRemoveNonDirtyChunksLog

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

func (*DirtyMgr) ApplyAsForgetAllDirty

func (d *DirtyMgr) ApplyAsForgetAllDirty(extBuf []byte) int32

func (*DirtyMgr) ApplyAsRemoveNonDirtyChunks

func (d *DirtyMgr) ApplyAsRemoveNonDirtyChunks(extBuf []byte) int32

func (*DirtyMgr) CheckReset

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

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) GetDeleteKey

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

func (*DirtyMgr) GetDirMetaForNodeLeave

func (d *DirtyMgr) GetDirMetaForNodeLeave(keys []InodeKeyType, nodeList *RaftNodeList) map[string][]InodeKeyType

func (*DirtyMgr) GetDirMetasForNodeJoin

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

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[string][]InodeKeyType

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) []InodeKeyType

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) IsRemoveChunkRecorded

func (d *DirtyMgr) IsRemoveChunkRecorded(migrationId MigrationId, inodeKey InodeKeyType, offset int64) bool

func (*DirtyMgr) IsRemoveDirMetaRecorded

func (d *DirtyMgr) IsRemoveDirMetaRecorded(migrationId MigrationId, inodeKey InodeKeyType) bool

func (*DirtyMgr) IsRemoveMetaRecorded

func (d *DirtyMgr) IsRemoveMetaRecorded(migrationId MigrationId, inodeKey InodeKeyType) bool

func (*DirtyMgr) RecordMigratedAddChunks

func (d *DirtyMgr) RecordMigratedAddChunks(migrationId MigrationId, inodeKey InodeKeyType, chunkSize int64, chunk *WorkingChunk, offset int64, objectSize int64)

func (*DirtyMgr) RecordMigratedAddMetas

func (d *DirtyMgr) RecordMigratedAddMetas(migrationId MigrationId, metas []*common.CopiedMetaMsg, files []*common.InodeToFileMsg)

func (*DirtyMgr) RecordMigratedDirMetas

func (d *DirtyMgr) RecordMigratedDirMetas(migrationId MigrationId, metas []*common.CopiedMetaMsg, files []*common.InodeToFileMsg)

func (*DirtyMgr) RecordMigratedRemoveChunks

func (d *DirtyMgr) RecordMigratedRemoveChunks(migrationId MigrationId, inodeKey InodeKeyType, offset int64, version uint32)

func (*DirtyMgr) RecordMigratedRemoveDirMetas

func (d *DirtyMgr) RecordMigratedRemoveDirMetas(migrationId MigrationId, keys ...InodeKeyType)

func (*DirtyMgr) RecordMigratedRemoveMetas

func (d *DirtyMgr) RecordMigratedRemoveMetas(migrationId MigrationId, keys ...InodeKeyType)

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 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 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(key string, offset int64, size int64, n *NodeServer, op interface{}) (data [][]byte, count int, errno error)

func (*FileHandle) ReadNoCache

func (i *FileHandle) ReadNoCache(key string, 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 FileIdType

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

func GetAppendEntryFileArgs

func GetAppendEntryFileArgs(extEntryPayload []byte) (fileId FileIdType, fileLength int32, fileOffset int64)

func NewFileIdTypeFromBuf

func NewFileIdTypeFromBuf(buf []byte) FileIdType

func NewFileIdTypeFromInodeKey

func NewFileIdTypeFromInodeKey(inodeKey InodeKeyType, offset int64, chunkSize int64) FileIdType

func (FileIdType) IsValid

func (f FileIdType) IsValid() bool

func (FileIdType) Put

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

type FileOffsetPair

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

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 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 GetBlobInput

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

type GetBlobOutput

type GetBlobOutput struct {
	HeadBlobOutput

	Body io.ReadCloser

	RequestId string
}

type HeadBlobInput

type HeadBlobInput struct {
	Key string
}

type HeadBlobOutput

type HeadBlobOutput struct {
	BlobItemOutput

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

	RequestId string
}

type HeadIndexFilePair

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

func (HeadIndexFilePair) Less

func (h HeadIndexFilePair) Less(item btree.Item) bool

type InitNodeListOp

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

func NewInitNodeListOp

func NewInitNodeListOp(txId TxId, nodeList *RaftNodeList, target RaftNode, migrationId MigrationId) InitNodeListOp

func (InitNodeListOp) GetLeader

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

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) (fileOffset int64, reply int32)

func (*InodeMgr) AppendStagingChunkFile

func (n *InodeMgr) AppendStagingChunkFile(inodeKey InodeKeyType, offset int64, fileId FileIdType, fileOffset int64, dataLength uint32) (reply int32)

func (*InodeMgr) ApplyAsAddInodeFileMap

func (n *InodeMgr) ApplyAsAddInodeFileMap(extBuf []byte) (reply int32)

func (*InodeMgr) ApplyAsCommitUpdateChunk

func (n *InodeMgr) ApplyAsCommitUpdateChunk(extBuf []byte, dirtyMgr *DirtyMgr) int32

func (*InodeMgr) ApplyAsCreateChunk

func (n *InodeMgr) ApplyAsCreateChunk(extBuf []byte) (reply int32)

func (*InodeMgr) ApplyAsDeleteInodeMap

func (n *InodeMgr) ApplyAsDeleteInodeMap(extBuf []byte) (reply int32)

func (*InodeMgr) ApplyAsDeletePersist

func (n *InodeMgr) ApplyAsDeletePersist(extBuf []byte, dirtyMgr *DirtyMgr) int32

func (*InodeMgr) ApplyAsDropLRUChunks

func (n *InodeMgr) ApplyAsDropLRUChunks(extBuf []byte) (reply int32)

func (*InodeMgr) ApplyAsPersistChunk

func (n *InodeMgr) ApplyAsPersistChunk(extBuf []byte, dirtyMgr *DirtyMgr) int32

func (*InodeMgr) ApplyAsUpdateMetaAttr

func (n *InodeMgr) ApplyAsUpdateMetaAttr(extBuf []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, fileOffset int64, length int64, key string)

func (*InodeMgr) CommitCreateMeta

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

func (*InodeMgr) CommitDeleteChunk

func (n *InodeMgr) CommitDeleteChunk(working *WorkingChunk, offset int64, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitDeleteInodeMap

func (n *InodeMgr) CommitDeleteInodeMap(deleted *common.DeleteInodeMapArgs)

func (*InodeMgr) CommitDeleteMeta

func (n *InodeMgr) CommitDeleteMeta(working *WorkingMeta, key string, dirtyMgr *DirtyMgr)

func (*InodeMgr) CommitDeletePersistMeta

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

func (*InodeMgr) CommitPersistChunk

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

func (*InodeMgr) CommitPersistMeta

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

func (*InodeMgr) CommitSetMetaAndInodeFile

func (n *InodeMgr) CommitSetMetaAndInodeFile(working *WorkingMeta, key string)

func (*InodeMgr) CommitUpdateChunk

func (n *InodeMgr) CommitUpdateChunk(working *WorkingChunk, offset int64, chunkSize int64, dirtyMgr *DirtyMgr, objectSize int64)

func (*InodeMgr) CommitUpdateMeta

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

func (*InodeMgr) CommitUpdateMetaKey

func (n *InodeMgr) CommitUpdateMetaKey(working *WorkingMeta, removedKey string, newKey string, dirtyMgr *DirtyMgr) *WorkingMeta

func (*InodeMgr) CommitUpdateParentMeta

func (n *InodeMgr) CommitUpdateParentMeta(working *WorkingMeta, key string, dirtyMgr *DirtyMgr)

func (*InodeMgr) CreateInodeId

func (n *InodeMgr) CreateInodeId() InodeKeyType

func (*InodeMgr) DeleteInodeToFiles

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

func (*InodeMgr) DropLRUChunk

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

func (*InodeMgr) GetAllDirectoryMeta

func (n *InodeMgr) GetAllDirectoryMeta() []InodeKeyType

func (*InodeMgr) GetAllMeta

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

func (*InodeMgr) GetChunk

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

func (*InodeMgr) GetFilePathAndWorkingMeta

func (n *InodeMgr) GetFilePathAndWorkingMeta(inodeId InodeKeyType) (string, *WorkingMeta, int32)

func (*InodeMgr) GetMetaHandler

func (n *InodeMgr) GetMetaHandler(inodeKey InodeKeyType) *Meta

func (*InodeMgr) GetOrFetchWorkingMeta

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

func (*InodeMgr) IsNodeSuspending

func (n *InodeMgr) IsNodeSuspending() bool

must hold n.nodeLock.RLock

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

func (*InodeMgr) PersistDeleteObject

func (n *InodeMgr) PersistDeleteObject(ret *common.TwoPCPersistRecordMsg, metaKey string, meta *WorkingMeta, _ int) (reply int32)

func (*InodeMgr) PrefetchChunkThread

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

func (*InodeMgr) PrepareCreateMeta

func (n *InodeMgr) PrepareCreateMeta(inodeKey InodeKeyType, parent MetaAttributes, 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(inodeKey InodeKeyType, key string, dirtyMgr *DirtyMgr) (*Meta, *WorkingMeta, int32)

func (*InodeMgr) PreparePersistMeta

func (n *InodeMgr) PreparePersistMeta(inodeKey InodeKeyType, dirtyMgr *DirtyMgr) (*Meta, []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) (*Meta, *WorkingMeta, func(*NodeServer), int32)

func (*InodeMgr) PrepareUpdateMetaKey

func (n *InodeMgr) PrepareUpdateMetaKey(inodeKey InodeKeyType, oldKey string, parent MetaAttributes, chunkSize int64, expireMs int32) (*Meta, *WorkingMeta, func(*NodeServer), int32)

func (*InodeMgr) PutDirObject

func (n *InodeMgr) PutDirObject(ret *common.TwoPCPersistRecordMsg, metaKeys []string, meta *WorkingMeta, _ int) (reply int32)

func (*InodeMgr) PutEmptyObject

func (n *InodeMgr) PutEmptyObject(ret *common.TwoPCPersistRecordMsg, metaKeys []string, meta *WorkingMeta, _ int) (reply int32)

func (*InodeMgr) PutObject

func (n *InodeMgr) PutObject(ret *common.TwoPCPersistRecordMsg, metaKeys []string, meta *WorkingMeta, priority int, selfGroup string, dirtyExpireInterval time.Duration) (reply int32)

func (*InodeMgr) QuickCommitDeleteChunk

func (n *InodeMgr) QuickCommitDeleteChunk(ring *hashring.HashRing, selfGroup string, meta *WorkingMeta, dirtyMgr *DirtyMgr)

func (*InodeMgr) QuickCommitExpandChunk

func (n *InodeMgr) QuickCommitExpandChunk(ring *hashring.HashRing, selfGroup string, 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) RestoreMetas

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

func (*InodeMgr) ResumeNode

func (n *InodeMgr) ResumeNode()

func (*InodeMgr) SetChunkNoLock

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

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

func (*InodeMgr) SuspendNode

func (n *InodeMgr) SuspendNode()

func (*InodeMgr) UnlockPersistMeta

func (n *InodeMgr) UnlockPersistMeta(meta *Meta, inodeKey InodeKeyType)

func (*InodeMgr) UpdateMetaAttr

func (n *InodeMgr) UpdateMetaAttr(attr MetaAttributes, 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, key string, 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) GetLeader

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

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) GetLeader

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

type LinkMetaOp

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

func NewLinkMetaOp

func NewLinkMetaOp(txId TxId, inodeKey InodeKeyType, childName string, childAttr MetaAttributes) LinkMetaOp

func (LinkMetaOp) GetLeader

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

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 LogFile

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

func NewLogFile

func NewLogFile(rootDir string, filePrefix string) (ret *LogFile, reply int32)

func (*LogFile) AppendCommand

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

func (*LogFile) AppendCommandAt

func (f *LogFile) AppendCommandAt(logIndex uint64, cmd AppendEntryCommand) (reply int32)

func (*LogFile) CheckReset

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

func (*LogFile) Clean

func (f *LogFile) Clean()

func (*LogFile) CreateNewFile

func (f *LogFile) CreateNewFile(newHeadIndex uint64) (reply int32)

func (*LogFile) GetCurrentLogLength

func (f *LogFile) GetCurrentLogLength() uint64

func (*LogFile) LoadCommandAt

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

func (*LogFile) SeekLog

func (f *LogFile) SeekLog(logIndex uint64) (reply int32)

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 Meta

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

func (*Meta) AddWorkingMeta

func (b *Meta) AddWorkingMeta(working *WorkingMeta)

func (*Meta) DropAll

func (b *Meta) DropAll()

func (*Meta) GetLatestWorkingMeta

func (b *Meta) GetLatestWorkingMeta() *WorkingMeta

func (*Meta) GetWorkingMetaEqual

func (b *Meta) GetWorkingMetaEqual(version uint32) *WorkingMeta

type MetaAttributes

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

func NewMetaAttributes

func NewMetaAttributes(inodeKey InodeKeyType, mode uint32) MetaAttributes

func NewMetaAttributesFromMsg

func NewMetaAttributesFromMsg(msg *common.CopiedMetaChildMsg) MetaAttributes

func (MetaAttributes) IsDir

func (m MetaAttributes) IsDir() bool

type MetaRWHandler

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

func NewMetaRWHandler

func NewMetaRWHandler(inodeKey InodeKeyType, version uint32, size int64, chunkSize int64, mTime int64, mode uint32) MetaRWHandler

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 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) GetLeader

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

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 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) Apply

func (n *NodeServer) Apply(l *AppendEntryCommand) (reply int32)

func (*NodeServer) CallCoordinator

func (n *NodeServer) CallCoordinator(fn CoordinatorOpBase) (ret CoordinatorRet, reply int32)

func (*NodeServer) CheckReset

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

func (*NodeServer) CommitRecord

func (n *NodeServer) CommitRecord(txIdMsg *common.TxIdMsg, nextSeqNum uint64, txType uint16, record proto.Message, retryInterval time.Duration, remotes []*common.MetaCommitRecordMsg) int32

func (*NodeServer) CoreDump

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

func (*NodeServer) CreateCoordinatorId

func (n *NodeServer) CreateCoordinatorId() CoordinatorId

func (*NodeServer) CreateObject

func (n *NodeServer) CreateObject(parentKey string, parentAttr MetaAttributes, name string, childAttr MetaAttributes) (meta *WorkingMeta, err error)

func (*NodeServer) DownloadChunkViaRemote

func (n *NodeServer) DownloadChunkViaRemote(msg RpcMsg) (*common.DownloadChunkRet, []SlicedPageBuffer)

func (*NodeServer) DropCache

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

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) GetConfig

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

func (*NodeServer) GetMetaFromClusterOrCOS

func (n *NodeServer) GetMetaFromClusterOrCOS(inodeKey InodeKeyType, key string, parent MetaAttributes) (*WorkingMeta, error)

func (*NodeServer) GetMetaRpc

func (n *NodeServer) GetMetaRpc(msg RpcMsg) *common.GetWorkingMetaRet

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 MetaAttributes, dstParentKey string, dstParentInodeId fuseops.InodeID, dstName string, childAttr MetaAttributes) (meta *WorkingMeta, err error)

func (*NodeServer) Init

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

func (*NodeServer) IsReady

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

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(msg RpcMsg) *common.Ack

func (*NodeServer) ReadAheadChunk

func (n *NodeServer) ReadAheadChunk(h MetaRWHandler, key string, offset int64, size int64)
func (n *NodeServer) ReadChunk(h MetaRWHandler, key string, offset int64, data []byte) (buf *PageBuffer, count int, err error) {
	if h.size == 0 {
		return nil, 0, nil
	}
	begin := time.Now()
	var nodeList *RaftNodeList
	var leader RaftNode
	for i := 0; i < n.flags.MaxRetry; i++ {
		l := n.raftGroup.GetNodeListLocal()
		if nodeList == nil || nodeList.version != l.version {
			var reply int32
			leader, nodeList, reply = n.raftGroup.getChunkOwnerNodeLocal(h.inodeKey, offset, h.chunkSize)
			if reply != RaftReplyOk {
				log.Errorf("Failed: ReadChunk, getKeyOwnerNodeAny, inodeKey=%v, offset=%v, reply=%v", h.inodeKey, offset, reply)
				return nil, 0, ReplyToFuseErr(reply)
			}
		}
		var r RaftBasicReply
		if leader.nodeId == n.raft.selfId {
			if r = n.raftGroup.BeginRaftRead(n.raft, nodeList.version); r.reply == RaftReplyOk {
				buf, count, r.reply = n.inodeMgr.ReadChunk(h, key, offset, data)
			}
		} else {
			buf, count, r = n.readChunkRemote(leader, h, key, offset, data, len(data))
		}
		if r.reply != RaftReplyOk {
			log.Infof("Failed: ReadChunk, attempt=%v, leader=%v, meta=%v, offset=%v, r=%v", i, leader, h, offset, r)
			if r.reply != RaftReplyOk {
				if newLeader, found := fixupRpcErr(n, leader, r); found {
					leader = newLeader
				}
			}
			if needRetry(r.reply) {
				continue
			}
			err = ReplyToFuseErr(r.reply)
		} else if i > 0 {
			n.raftGroup.UpdateLeader(leader)
		}
		break
	}
	endAll := time.Now()
	log.Debugf("Success: ReadChunk, local=%v, inode=%v, key=%v, offset=%v, count=%v, elapsed=%v",
		leader.nodeId == n.raft.selfId, h.inodeKey, key, offset, count, endAll.Sub(begin))
	return
}

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 MetaAttributes, dstParentKey string, dstParentId fuseops.InodeID, srcName string, dstName string, childAttr MetaAttributes) (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) RestoreDirtyChunksTopHalf

func (n *NodeServer) RestoreDirtyChunksTopHalf(msg RpcMsg, dataLength uint32, fd int, pipeFds [2]int, state *ReadRpcMsgState) (m proto.Message, fileId FileIdType, fileOffset int64, r RaftBasicReply)

func (*NodeServer) ResumeCoordinatorCommit

func (n *NodeServer) ResumeCoordinatorCommit()

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) SpliceChunk

func (n *NodeServer) SpliceChunk(fd int, pipeFds [2]int, state *ReadRpcMsgState, inodeKey InodeKeyType, dataLength uint32, offset int64, chunkSize int64) (fileId FileIdType, fileOffset int64, reply int32)

func (*NodeServer) StartGrpcServer

func (n *NodeServer) StartGrpcServer()

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) UnlinkObject

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

func (*NodeServer) UpdateChunkTopHalf

func (n *NodeServer) UpdateChunkTopHalf(msg RpcMsg, dataLength uint32, fd int, pipeFds [2]int, state *ReadRpcMsgState) (m proto.Message, fileId FileIdType, fileOffset int64, r RaftBasicReply)

func (*NodeServer) UpdateNodeListAsClient

func (n *NodeServer) UpdateNodeListAsClient() error

func (*NodeServer) UpdateObjectAttr

func (n *NodeServer) UpdateObjectAttr(attr MetaAttributes, ts int64) (meta *WorkingMeta, err error)

func (*NodeServer) VectorReadChunk

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

func (*NodeServer) VectorReadFastPath

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

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 (*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() 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()

func (*ObjcacheFileSystem) SetXattr

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

func (*ObjcacheFileSystem) Shutdown

func (fs *ObjcacheFileSystem) Shutdown()

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 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 {
	GetLeader(*NodeServer, *RaftNodeList) (RaftNode, bool)
	// contains filtered or unexported methods
}

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 RaftFiles

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

func NewRaftFileCache

func NewRaftFileCache(filePrefix string, cacheLimit int) *RaftFiles

func (*RaftFiles) AddDiskUsage

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

func (*RaftFiles) CheckReset

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

func (*RaftFiles) Clear

func (c *RaftFiles) Clear()

func (*RaftFiles) DontNeed

func (c *RaftFiles) DontNeed(fileId FileIdType)

func (*RaftFiles) GetDiskUsage

func (c *RaftFiles) GetDiskUsage() int64

func (*RaftFiles) GetFileLength

func (c *RaftFiles) GetFileLength(fileId FileIdType) int64

func (*RaftFiles) GetFileName

func (c *RaftFiles) GetFileName(fileId FileIdType) string

func (*RaftFiles) Open

func (c *RaftFiles) Open(fileId FileIdType, mode int) (int, error)

func (*RaftFiles) OpenAndReadCache

func (c *RaftFiles) OpenAndReadCache(fileId FileIdType, offset int64, length int32) ([]byte, int32)

func (*RaftFiles) OpenAndWriteCache

func (c *RaftFiles) OpenAndWriteCache(fileId FileIdType, buf []byte) (offset int64, length int32, reply int32)

func (*RaftFiles) Remove

func (c *RaftFiles) Remove(fileId FileIdType) (int64, error)

func (*RaftFiles) ReserveRange

func (c *RaftFiles) ReserveRange(fileId FileIdType, dataLen int64) (offset int64)

func (*RaftFiles) Reset

func (c *RaftFiles) Reset()

func (*RaftFiles) SeekRange

func (c *RaftFiles) SeekRange(fileId FileIdType, newNextOffset int64)

func (*RaftFiles) Splice

func (c *RaftFiles) Splice(pipeFds [2]int, fileId FileIdType, fd int, offset int64, dataLength int32, bufOff *int32) (err error)

func (*RaftFiles) SyncWrite

func (c *RaftFiles) SyncWrite(fileId FileIdType, buf []byte) (offset int64, length int32, reply int32)

type RaftGroupMgr

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

func NewRaftGroupMgr

func NewRaftGroupMgr(groupId string, nrVirt int) *RaftGroupMgr

func NewRaftGroupMgrFromMsg

func NewRaftGroupMgrFromMsg(groupId string, nrVirt int, msg *common.RaftGroupMgrSnapshotMsg) *RaftGroupMgr

func (*RaftGroupMgr) Add

func (m *RaftGroupMgr) Add(msg *common.NodeMsg)

func (*RaftGroupMgr) ApplyAsUpdateNodeListLocal

func (m *RaftGroupMgr) ApplyAsUpdateNodeListLocal(extBuf []byte) int32

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

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) 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) SetNodeListDirect

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

func (*RaftGroupMgr) UpdateLeader

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

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(cmd AppendEntryCommand) (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(extCmdId uint16, m proto.Message) int32

func (*RaftInstance) AppendInitEntry

func (n *RaftInstance) AppendInitEntry(cmd AppendEntryCommand) int32

func (*RaftInstance) ApplyAll

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

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) CleanExtFile

func (n *RaftInstance) CleanExtFile()

func (*RaftInstance) GenerateCoordinatorId

func (n *RaftInstance) GenerateCoordinatorId() CoordinatorId

func (*RaftInstance) GetExtFileId

func (n *RaftInstance) GetExtFileId() FileIdType

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) (reply int32)

func (*RaftInstance) RequestVoteRpc

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

func (*RaftInstance) SetExt

func (n *RaftInstance) SetExt(fileId uint64, 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) 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 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 RaftPersistState

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

func NewRaftPersistState

func NewRaftPersistState(rootDir string, selfId uint32, stateName string) (*RaftPersistState, int32)

func (*RaftPersistState) CheckReset

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

func (*RaftPersistState) Clean

func (s *RaftPersistState) Clean()

func (*RaftPersistState) Get

func (s *RaftPersistState) Get() uint32

func (*RaftPersistState) Increment

func (s *RaftPersistState) Increment() int32

func (*RaftPersistState) Reset

func (s *RaftPersistState) Reset() int32

func (*RaftPersistState) Set

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

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(fileId FileIdType) (size int64)

func (*ReaderBufferCache) DropAll

func (c *ReaderBufferCache) DropAll()

func (*ReaderBufferCache) EndFill

func (c *ReaderBufferCache) EndFill(fileId FileIdType, offset int64)

func (*ReaderBufferCache) EndFillWithPut

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

func (*ReaderBufferCache) GetCacheOrBeginFill

func (c *ReaderBufferCache) GetCacheOrBeginFill(fileId FileIdType, offset int64) (reader *BufferedFilePageReader, beginFill bool)

func (*ReaderBufferCache) GetCacheWithFillWait

func (c *ReaderBufferCache) GetCacheWithFillWait(fileId FileIdType, stagPart *StagingChunkPart, offset int64) *BufferedFilePageReader

func (*ReaderBufferCache) GetNewBufferedFilePageReader

func (c *ReaderBufferCache) GetNewBufferedFilePageReader(fileId FileIdType, stag *StagingChunk, blocking bool) (*BufferedFilePageReader, error)

func (*ReaderBufferCache) ReleaseInFlightBuffer

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

func (*ReaderBufferCache) SetEvictable

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

func (*ReaderBufferCache) TryBeginFill

func (c *ReaderBufferCache) TryBeginFill(fileId FileIdType, offset int64) (beginFill 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 RenameBlobInput

type RenameBlobInput struct {
	Source      string
	Destination string
}

type RenameBlobOutput

type RenameBlobOutput struct {
	RequestId string
}

type RenameMetaOp

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

func NewRenameMetaOp

func NewRenameMetaOp(txId TxId, inodeKey InodeKeyType, srcName string, dstName string, childAttr MetaAttributes) RenameMetaOp

func (RenameMetaOp) GetLeader

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

type RenameRet

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

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) GetLeader

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

type RestoreDirtyMetaOp

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

func NewRestoreDirtyMetaOp

func NewRestoreDirtyMetaOp(migrationId MigrationId, metas []*common.CopiedMetaMsg, files []*common.InodeToFileMsg, dirMetas []*common.CopiedMetaMsg, dirFiles []*common.InodeToFileMsg, target RaftNode) RestoreDirtyMetaOp

func (RestoreDirtyMetaOp) GetLeader

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

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, files *RaftFiles, timeout time.Duration) (replyMsg RpcMsg, err error)

func (*RpcClient) UnicastRpcMsg

func (w *RpcClient) UnicastRpcMsg(msg RpcMsg, sa common.NodeAddrInet4, files *RaftFiles, 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, files *RaftFiles, dataBuf [][]byte, rpcArgs *RpcSeqNumArgs) (reply int32)

func (*RpcClientConnectionV2) CallObjcacheRpc

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

func (*RpcClientConnectionV2) CallObjcacheRpcNoTimeout

func (w *RpcClientConnectionV2) CallObjcacheRpcNoTimeout(extCmdId uint16, seqNum uint64, args proto.Message, files *RaftFiles, 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, files *RaftFiles, 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) (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, files *RaftFiles, 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, files *RaftFiles, 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(nextTxId TxId, groups []string, txIds []TxId, retryInterval time.Duration)

func (*RpcMgr) AbortParticipant

func (o *RpcMgr) AbortParticipant(msg RpcMsg) *common.Ack

func (*RpcMgr) CallAny

func (o *RpcMgr) CallAny(fn ParticipantOp, txId TxId, remoteTimeout time.Duration) (ret RpcRet, r RaftBasicReply)

func (*RpcMgr) CallCoordinatorMetaInRPC

func (o *RpcMgr) CallCoordinatorMetaInRPC(fn CoordinatorOpBase, id CoordinatorId, nodeListVer uint64) (CoordinatorRet, RaftBasicReply)

func (*RpcMgr) CallCoordinatorUpdateNodeListInRPC

func (o *RpcMgr) CallCoordinatorUpdateNodeListInRPC(fn CoordinatorUpdateNodeListOp, id CoordinatorId, nodeListVer uint64) (*common.MembershipListMsg, RaftBasicReply)

func (*RpcMgr) CallPrepareAny

func (o *RpcMgr) CallPrepareAny(fn ParticipantOp, txId TxId, remoteTimeout time.Duration) (ret RpcRet, reply int32)

func (*RpcMgr) CallRemote

func (o *RpcMgr) CallRemote(fn ParticipantOp, retryInterval time.Duration) bool

func (*RpcMgr) CallRpcAnyNoFail

func (o *RpcMgr) CallRpcAnyNoFail(fn ParticipantOp, txId TxId, remoteTimeout time.Duration) (ret RpcRet)

func (*RpcMgr) CheckReset

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

func (*RpcMgr) CommitDeleteChunk

func (o *RpcMgr) CommitDeleteChunk(msg RpcMsg) *common.Ack

func (*RpcMgr) CommitExpandChunk

func (o *RpcMgr) CommitExpandChunk(msg RpcMsg) *common.Ack

func (*RpcMgr) CommitMigrationParticipant

func (o *RpcMgr) CommitMigrationParticipant(msg RpcMsg) *common.Ack

func (*RpcMgr) CommitParticipant

func (o *RpcMgr) CommitParticipant(msg RpcMsg) *common.Ack

func (*RpcMgr) CommitPersistChunk

func (o *RpcMgr) CommitPersistChunk(msg RpcMsg) *common.Ack

func (*RpcMgr) CommitUpdateChunk

func (o *RpcMgr) CommitUpdateChunk(msg RpcMsg) *common.Ack

func (*RpcMgr) CoordinatorCreateObject

func (o *RpcMgr) CoordinatorCreateObject(msg RpcMsg) *common.CoordinatorRetMsg

func (*RpcMgr) CoordinatorDeleteObject

func (o *RpcMgr) CoordinatorDeleteObject(msg RpcMsg) *common.CoordinatorRetMsg

func (*RpcMgr) CoordinatorDeletePersist

func (o *RpcMgr) CoordinatorDeletePersist(msg RpcMsg) *common.CoordinatorRetMsg

func (*RpcMgr) CoordinatorFlushObject

func (o *RpcMgr) CoordinatorFlushObject(msg RpcMsg) *common.CoordinatorRetMsg

func (*RpcMgr) CoordinatorHardLinkObject

func (o *RpcMgr) CoordinatorHardLinkObject(msg RpcMsg) *common.CoordinatorRetMsg

func (*RpcMgr) CoordinatorPersist

func (o *RpcMgr) CoordinatorPersist(msg RpcMsg) *common.CoordinatorRetMsg

func (*RpcMgr) CoordinatorRenameObject

func (o *RpcMgr) CoordinatorRenameObject(msg RpcMsg) *common.CoordinatorRetMsg

func (*RpcMgr) CoordinatorTruncateObject

func (o *RpcMgr) CoordinatorTruncateObject(msg RpcMsg) *common.CoordinatorRetMsg

func (*RpcMgr) CoordinatorUpdateNodeList

func (o *RpcMgr) CoordinatorUpdateNodeList(msg RpcMsg) *common.Ack

func (*RpcMgr) CreateChildMeta

func (o *RpcMgr) CreateChildMeta(msg RpcMsg) *common.MetaTxMsg

func (*RpcMgr) CreateMeta

func (o *RpcMgr) CreateMeta(msg RpcMsg) *common.MetaTxMsg

func (*RpcMgr) DeleteAndGet

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

func (*RpcMgr) DeleteAndUnlockLocalAll

func (o *RpcMgr) DeleteAndUnlockLocalAll(seqs ...TxId)

func (*RpcMgr) DeleteMeta

func (o *RpcMgr) DeleteMeta(msg RpcMsg) *common.MetaTxWithPrevMsg

func (*RpcMgr) Enter

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

func (*RpcMgr) ExecCommitAbort

func (o *RpcMgr) ExecCommitAbort(fn ParticipantOp, seq TxId, nodeListVer uint64) (RpcRet, RaftBasicReply)

func (*RpcMgr) ExecPrepare

func (o *RpcMgr) ExecPrepare(fn ParticipantOp, seq TxId, nodeListVer uint64) (RpcRet, RaftBasicReply)

func (*RpcMgr) Get

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

func (*RpcMgr) GetApiPort

func (o *RpcMgr) GetApiPort(msg RpcMsg) *common.GetApiPortRet

func (*RpcMgr) InitNodeList

func (o *RpcMgr) InitNodeList(msg RpcMsg) *common.UpdateNodeListRet

func (*RpcMgr) JoinMigration

func (o *RpcMgr) JoinMigration(msg RpcMsg) *common.Ack

func (*RpcMgr) LeaveMigration

func (o *RpcMgr) LeaveMigration(msg RpcMsg) *common.Ack

func (*RpcMgr) LinkMeta

func (o *RpcMgr) LinkMeta(msg RpcMsg) *common.RenameRetMsg

func (*RpcMgr) MpuAdd

func (o *RpcMgr) MpuAdd(msg RpcMsg) *common.MpuAddRet

func (*RpcMgr) Record

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

func (*RpcMgr) RenameMeta

func (o *RpcMgr) RenameMeta(msg RpcMsg) *common.MetaTxMsg

func (*RpcMgr) RestoreDirtyChunksBottomHalf

func (o *RpcMgr) RestoreDirtyChunksBottomHalf(m proto.Message, fileId FileIdType, fileOffset int64, dataLength uint32, r RaftBasicReply) *common.Ack

func (*RpcMgr) RestoreDirtyMeta

func (o *RpcMgr) RestoreDirtyMeta(msg RpcMsg) *common.Ack

func (*RpcMgr) TruncateMeta

func (o *RpcMgr) TruncateMeta(msg RpcMsg) *common.MetaTxWithPrevMsg

func (*RpcMgr) UnlinkMeta

func (o *RpcMgr) UnlinkMeta(msg RpcMsg) *common.RenameRetMsg

func (*RpcMgr) UpdateChunkBottomHalf

func (o *RpcMgr) UpdateChunkBottomHalf(m proto.Message, fileId FileIdType, fileOffset int64, dataLength uint32, r RaftBasicReply) *common.UpdateChunkRet

func (*RpcMgr) UpdateMetaAttr

func (o *RpcMgr) UpdateMetaAttr(msg RpcMsg) *common.MetaTxMsg

func (*RpcMgr) UpdateMetaKey

func (o *RpcMgr) UpdateMetaKey(msg RpcMsg) *common.MetaTxMsg

func (*RpcMgr) UpdateMetaSize

func (o *RpcMgr) UpdateMetaSize(msg RpcMsg) *common.MetaTxWithPrevMsg

func (*RpcMgr) UpdateNodeList

func (o *RpcMgr) UpdateNodeList(msg RpcMsg) *common.UpdateNodeListRet

type RpcMsg

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

func (*RpcMsg) CreateOptControlHeader

func (d *RpcMsg) CreateOptControlHeader(totalFileLength 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() (totalFileLength 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) SetTotalFileLength

func (d *RpcMsg) SetTotalFileLength(totalFileLength 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, files *RaftFiles, 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 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 StagingChunk

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

func NewStagingChunk

func NewStagingChunk(slop int64, length int64, updateType byte, fileOffset int64, key string, filled int32) *StagingChunk

func (*StagingChunk) AppendToLog

func (s *StagingChunk) AppendToLog(inodeMgr *InodeMgr, reader *BufferedFilePageReader, fetchKey string) (err error)

func (*StagingChunk) GetObject

func (s *StagingChunk) GetObject(inodeMgr *InodeMgr, reader *BufferedFilePageReader, fetchOffset int64) error

func (*StagingChunk) ReadObject

func (s *StagingChunk) ReadObject(inodeMgr *InodeMgr, reader *BufferedFilePageReader) (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 TruncateMetaOp

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

func NewTruncateMetaOp

func NewTruncateMetaOp(txId TxId, inodeKey InodeKeyType, newSize int64) TruncateMetaOp

func (TruncateMetaOp) GetLeader

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

type TwoPCCommitRecord

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

func NewTwoPCCommitRecordFromMsg

func NewTwoPCCommitRecordFromMsg(l *common.TwoPCCommitRecordMsg) *TwoPCCommitRecord

func NewTwoPCUpdateCommitLog

func NewTwoPCUpdateCommitLog(n *NodeServer, txId TxId, pOp RpcRet, chunks []*common.UpdateChunkRecordMsg, txType int) *TwoPCCommitRecord

func (*TwoPCCommitRecord) CommitCoordinator

func (o *TwoPCCommitRecord) CommitCoordinator(n *NodeServer, retryInterval time.Duration) (reply int32)

func (*TwoPCCommitRecord) CommitRemote

func (o *TwoPCCommitRecord) CommitRemote(n *NodeServer, retryInterval time.Duration)

func (*TwoPCCommitRecord) CountRemote

func (o *TwoPCCommitRecord) CountRemote(raftGroup *RaftGroupMgr) (r int)

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 TxMgr

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

func NewTxMgr

func NewTxMgr() *TxMgr

func (*TxMgr) ApplyAsAbortTx

func (m *TxMgr) ApplyAsAbortTx(extBuf []byte) (reply int32)

func (*TxMgr) ApplyAsBeginPersist

func (m *TxMgr) ApplyAsBeginPersist(extBuf []byte) int32

func (*TxMgr) ApplyAsCommitMigration

func (m *TxMgr) ApplyAsCommitMigration(extBuf []byte, inodeMgr *InodeMgr, dirtyMgr *DirtyMgr, groupMgr *RaftGroupMgr) int32

func (*TxMgr) ApplyAsCommitTx

func (m *TxMgr) ApplyAsCommitTx(inodeMgr *InodeMgr, dirtyMgr *DirtyMgr, raftGroup *RaftGroupMgr, clientId uint32, seqNum uint32, txSeqNum uint64) int32

func (*TxMgr) ApplyAsCreateMeta

func (m *TxMgr) ApplyAsCreateMeta(extBuf []byte) (reply int32)

func (*TxMgr) ApplyAsCreateMetaCoordinator

func (m *TxMgr) ApplyAsCreateMetaCoordinator(extBuf []byte, inodeMgr *InodeMgr, dirtyMgr *DirtyMgr, raftGroup *RaftGroupMgr) (reply int32)

func (*TxMgr) ApplyAsDeleteMeta

func (m *TxMgr) ApplyAsDeleteMeta(extBuf []byte) (reply int32)

func (*TxMgr) ApplyAsDeleteMetaCoordinator

func (m *TxMgr) ApplyAsDeleteMetaCoordinator(extBuf []byte, inodeMgr *InodeMgr, dirtyMgr *DirtyMgr, raftGroup *RaftGroupMgr) (reply int32)

func (*TxMgr) ApplyAsPersist

func (m *TxMgr) ApplyAsPersist(extBuf []byte, inodeMgr *InodeMgr, dirtyMgr *DirtyMgr, raftGroup *RaftGroupMgr) int32

func (*TxMgr) ApplyAsRenameCoordinator

func (m *TxMgr) ApplyAsRenameCoordinator(extBuf []byte, inodeMgr *InodeMgr, dirtyMgr *DirtyMgr, raftGroup *RaftGroupMgr) (reply int32)

func (*TxMgr) ApplyAsUpdateMeta

func (m *TxMgr) ApplyAsUpdateMeta(extBuf []byte) (reply int32)

func (*TxMgr) ApplyAsUpdateMetaCoordinator

func (m *TxMgr) ApplyAsUpdateMetaCoordinator(extBuf []byte, inodeMgr *InodeMgr, dirtyMgr *DirtyMgr, raftGroup *RaftGroupMgr) (reply int32)

func (*TxMgr) ApplyAsUpdateMetaKey

func (m *TxMgr) ApplyAsUpdateMetaKey(extBuf []byte) (reply int32)

func (*TxMgr) ApplyAsUpdateNodeList

func (m *TxMgr) ApplyAsUpdateNodeList(extBuf []byte) int32

func (*TxMgr) ApplyAsUpdateNodeListCoordinator

func (m *TxMgr) ApplyAsUpdateNodeListCoordinator(extBuf []byte) int32

func (*TxMgr) ApplyAsUpdateParentMeta

func (m *TxMgr) ApplyAsUpdateParentMeta(extBuf []byte) (reply int32)

type UnlinkMetaOp

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

func NewUnlinkMetaOp

func NewUnlinkMetaOp(txId TxId, inodeKey InodeKeyType, childName string) UnlinkMetaOp

func (UnlinkMetaOp) GetLeader

func (o UnlinkMetaOp) GetLeader(n *NodeServer, l *RaftNodeList) (RaftNode, 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) GetLeader

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

type UpdateMetaAttrOp

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

func NewUpdateMetaAttrOp

func NewUpdateMetaAttrOp(txId TxId, attr MetaAttributes, ts int64) UpdateMetaAttrOp

func (UpdateMetaAttrOp) GetLeader

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

type UpdateMetaKeyOp

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

func NewUpdateMetaKeyOp

func NewUpdateMetaKeyOp(txId TxId, inodeKey InodeKeyType, oldKey string, newKey string, parent MetaAttributes) UpdateMetaKeyOp

func (UpdateMetaKeyOp) GetLeader

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

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) GetLeader

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

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) GetLeader

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

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, parent MetaAttributes, chunkSize int64, expireMs int32, mode 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) 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