piecestore

package
v0.2.4-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package piecestore is a generated GoMock package.

Index

Constants

View Source
const (
	PrimarySPRedundancyIndex = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MockPieceOp added in v0.2.4

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

MockPieceOp is a mock of PieceOp interface.

func NewMockPieceOp added in v0.2.4

func NewMockPieceOp(ctrl *gomock.Controller) *MockPieceOp

NewMockPieceOp creates a new mock instance.

func (*MockPieceOp) ChallengePieceKey added in v0.2.4

func (m *MockPieceOp) ChallengePieceKey(objectID uint64, segmentIdx uint32, redundancyIdx int32) string

ChallengePieceKey mocks base method.

func (*MockPieceOp) ECPieceKey added in v0.2.4

func (m *MockPieceOp) ECPieceKey(objectID uint64, segmentIdx, redundancyIdx uint32) string

ECPieceKey mocks base method.

func (*MockPieceOp) ECPieceSize added in v0.2.4

func (m *MockPieceOp) ECPieceSize(payloadSize uint64, segmentIdx uint32, maxSegmentSize uint64, chunkNum uint32) int64

ECPieceSize mocks base method.

func (*MockPieceOp) EXPECT added in v0.2.4

func (m *MockPieceOp) EXPECT() *MockPieceOpMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPieceOp) MaxSegmentPieceSize added in v0.2.4

func (m *MockPieceOp) MaxSegmentPieceSize(payloadSize, maxSegmentSize uint64) int64

MaxSegmentPieceSize mocks base method.

func (*MockPieceOp) ParseChallengeIdx added in v0.2.4

func (m *MockPieceOp) ParseChallengeIdx(challengeKey string) (uint32, int32, error)

ParseChallengeIdx mocks base method.

func (*MockPieceOp) ParseSegmentIdx added in v0.2.4

func (m *MockPieceOp) ParseSegmentIdx(segmentKey string) (uint32, error)

ParseSegmentIdx mocks base method.

func (*MockPieceOp) SegmentPieceCount added in v0.2.4

func (m *MockPieceOp) SegmentPieceCount(payloadSize, maxSegmentSize uint64) uint32

SegmentPieceCount mocks base method.

func (*MockPieceOp) SegmentPieceKey added in v0.2.4

func (m *MockPieceOp) SegmentPieceKey(objectID uint64, segmentIdx uint32) string

SegmentPieceKey mocks base method.

func (*MockPieceOp) SegmentPieceSize added in v0.2.4

func (m *MockPieceOp) SegmentPieceSize(payloadSize uint64, segmentIdx uint32, maxSegmentSize uint64) int64

SegmentPieceSize mocks base method.

type MockPieceOpMockRecorder added in v0.2.4

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

MockPieceOpMockRecorder is the mock recorder for MockPieceOp.

func (*MockPieceOpMockRecorder) ChallengePieceKey added in v0.2.4

func (mr *MockPieceOpMockRecorder) ChallengePieceKey(objectID, segmentIdx, redundancyIdx interface{}) *gomock.Call

ChallengePieceKey indicates an expected call of ChallengePieceKey.

func (*MockPieceOpMockRecorder) ECPieceKey added in v0.2.4

func (mr *MockPieceOpMockRecorder) ECPieceKey(objectID, segmentIdx, redundancyIdx interface{}) *gomock.Call

ECPieceKey indicates an expected call of ECPieceKey.

func (*MockPieceOpMockRecorder) ECPieceSize added in v0.2.4

func (mr *MockPieceOpMockRecorder) ECPieceSize(payloadSize, segmentIdx, maxSegmentSize, chunkNum interface{}) *gomock.Call

ECPieceSize indicates an expected call of ECPieceSize.

func (*MockPieceOpMockRecorder) MaxSegmentPieceSize added in v0.2.4

func (mr *MockPieceOpMockRecorder) MaxSegmentPieceSize(payloadSize, maxSegmentSize interface{}) *gomock.Call

MaxSegmentPieceSize indicates an expected call of MaxSegmentPieceSize.

func (*MockPieceOpMockRecorder) ParseChallengeIdx added in v0.2.4

func (mr *MockPieceOpMockRecorder) ParseChallengeIdx(challengeKey interface{}) *gomock.Call

ParseChallengeIdx indicates an expected call of ParseChallengeIdx.

func (*MockPieceOpMockRecorder) ParseSegmentIdx added in v0.2.4

func (mr *MockPieceOpMockRecorder) ParseSegmentIdx(segmentKey interface{}) *gomock.Call

ParseSegmentIdx indicates an expected call of ParseSegmentIdx.

func (*MockPieceOpMockRecorder) SegmentPieceCount added in v0.2.4

func (mr *MockPieceOpMockRecorder) SegmentPieceCount(payloadSize, maxSegmentSize interface{}) *gomock.Call

SegmentPieceCount indicates an expected call of SegmentPieceCount.

func (*MockPieceOpMockRecorder) SegmentPieceKey added in v0.2.4

func (mr *MockPieceOpMockRecorder) SegmentPieceKey(objectID, segmentIdx interface{}) *gomock.Call

SegmentPieceKey indicates an expected call of SegmentPieceKey.

func (*MockPieceOpMockRecorder) SegmentPieceSize added in v0.2.4

func (mr *MockPieceOpMockRecorder) SegmentPieceSize(payloadSize, segmentIdx, maxSegmentSize interface{}) *gomock.Call

SegmentPieceSize indicates an expected call of SegmentPieceSize.

type MockPieceStore added in v0.2.4

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

MockPieceStore is a mock of PieceStore interface.

func NewMockPieceStore added in v0.2.4

func NewMockPieceStore(ctrl *gomock.Controller) *MockPieceStore

NewMockPieceStore creates a new mock instance.

func (*MockPieceStore) DeletePiece added in v0.2.4

func (m *MockPieceStore) DeletePiece(ctx context.Context, key string) error

DeletePiece mocks base method.

func (*MockPieceStore) EXPECT added in v0.2.4

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPieceStore) GetPiece added in v0.2.4

func (m *MockPieceStore) GetPiece(ctx context.Context, key string, offset, limit int64) ([]byte, error)

GetPiece mocks base method.

func (*MockPieceStore) PutPiece added in v0.2.4

func (m *MockPieceStore) PutPiece(ctx context.Context, key string, value []byte) error

PutPiece mocks base method.

type MockPieceStoreMockRecorder added in v0.2.4

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

MockPieceStoreMockRecorder is the mock recorder for MockPieceStore.

func (*MockPieceStoreMockRecorder) DeletePiece added in v0.2.4

func (mr *MockPieceStoreMockRecorder) DeletePiece(ctx, key interface{}) *gomock.Call

DeletePiece indicates an expected call of DeletePiece.

func (*MockPieceStoreMockRecorder) GetPiece added in v0.2.4

func (mr *MockPieceStoreMockRecorder) GetPiece(ctx, key, offset, limit interface{}) *gomock.Call

GetPiece indicates an expected call of GetPiece.

func (*MockPieceStoreMockRecorder) PutPiece added in v0.2.4

func (mr *MockPieceStoreMockRecorder) PutPiece(ctx, key, value interface{}) *gomock.Call

PutPiece indicates an expected call of PutPiece.

type PieceOp

type PieceOp interface {
	// SegmentPieceKey returns the segment piece key used as the key of store piece store.
	SegmentPieceKey(objectID uint64, segmentIdx uint32) string
	// ECPieceKey returns the ec piece key used as the key of store piece store.
	ECPieceKey(objectID uint64, segmentIdx, redundancyIdx uint32) string
	// ChallengePieceKey returns the  piece key used as the key of challenge piece key.
	// if replicateIdx < 0 , returns the SegmentPieceKey, otherwise returns the ECPieceKey.
	ChallengePieceKey(objectID uint64, segmentIdx uint32, redundancyIdx int32) string
	// MaxSegmentPieceSize returns the object max segment piece size by object payload size and
	// max segment size that comes from storage params.
	MaxSegmentPieceSize(payloadSize uint64, maxSegmentSize uint64) int64
	// SegmentPieceCount returns the segment piece count of object payload by object payload size
	// and max segment size that comes from storage params.
	SegmentPieceCount(payloadSize uint64, maxSegmentSize uint64) uint32
	// SegmentPieceSize returns the segment piece size of segment index by object payload size and
	// max segment size that comes from storage params.
	SegmentPieceSize(payloadSize uint64, segmentIdx uint32, maxSegmentSize uint64) int64
	// ECPieceSize returns the ec piece size of ec index, by object payload size, max segment
	// size and chunk number that ths last two params comes from storage params.
	ECPieceSize(payloadSize uint64, segmentIdx uint32, maxSegmentSize uint64, chunkNum uint32) int64
	// ParseSegmentIdx returns the segment index according to the segment piece key
	ParseSegmentIdx(segmentKey string) (uint32, error)
	// ParseChallengeIdx returns the segment index and EC piece index  according to the challenge piece key
	ParseChallengeIdx(challengeKey string) (uint32, int32, error)
}

PieceOp is a helper interface for piece key operator and piece size calculate.

type PieceStore

type PieceStore interface {
	// GetPiece returns the piece data from piece store by piece key.
	// the piece can segment or ec piece key.
	GetPiece(ctx context.Context, key string, offset, limit int64) ([]byte, error)
	// PutPiece puts the piece data to piece store, it can put segment
	// or ec piece data.
	PutPiece(ctx context.Context, key string, value []byte) error
	// DeletePiece deletes the piece data from piece store, it can delete
	// segment or ec piece data.
	DeletePiece(ctx context.Context, key string) error
}

PieceStore is an abstract interface to piece store that store the object payload data.

Jump to

Keyboard shortcuts

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