page_writer

package
v0.0.0-...-0b345dd Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActualChunkIndex

type ActualChunkIndex int

type ChunkWrittenInterval

type ChunkWrittenInterval struct {
	StartOffset int64
	// contains filtered or unexported fields
}

ChunkWrittenInterval mark one written interval within one page chunk

func (*ChunkWrittenInterval) Size

func (interval *ChunkWrittenInterval) Size() int64

type ChunkWrittenIntervalList

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

ChunkWrittenIntervalList mark written intervals within one page chunk

func (*ChunkWrittenIntervalList) IsComplete

func (list *ChunkWrittenIntervalList) IsComplete(chunkSize int64) bool

func (*ChunkWrittenIntervalList) MarkWritten

func (list *ChunkWrittenIntervalList) MarkWritten(startOffset, stopOffset int64)

func (*ChunkWrittenIntervalList) WrittenSize

func (list *ChunkWrittenIntervalList) WrittenSize() (writtenByteCount int64)

type DirtyPages

type DirtyPages interface {
	AddPage(offset int64, data []byte, isSequential bool)
	FlushData() error
	ReadDirtyDataAt(data []byte, startOffset int64) (maxStop int64)
	GetStorageOptions() (collection, replication string)
	Destroy()
	LockForRead(startOffset, stopOffset int64)
	UnlockForRead(startOffset, stopOffset int64)
}

type LogicChunkIndex

type LogicChunkIndex int

type MemChunk

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

func NewMemChunk

func NewMemChunk(logicChunkIndex LogicChunkIndex, chunkSize int64) *MemChunk

func (*MemChunk) FreeResource

func (mc *MemChunk) FreeResource()

func (*MemChunk) IsComplete

func (mc *MemChunk) IsComplete() bool

func (*MemChunk) ReadDataAt

func (mc *MemChunk) ReadDataAt(p []byte, off int64) (maxStop int64)

func (*MemChunk) SaveContent

func (mc *MemChunk) SaveContent(saveFn SaveToStorageFunc)

func (*MemChunk) WriteDataAt

func (mc *MemChunk) WriteDataAt(src []byte, offset int64) (n int)

func (*MemChunk) WrittenSize

func (mc *MemChunk) WrittenSize() int64

type PageChunk

type PageChunk interface {
	FreeResource()
	WriteDataAt(src []byte, offset int64) (n int)
	ReadDataAt(p []byte, off int64) (maxStop int64)
	IsComplete() bool
	WrittenSize() int64
	SaveContent(saveFn SaveToStorageFunc)
}

type SaveToStorageFunc

type SaveToStorageFunc func(reader io.Reader, offset int64, size int64, cleanupFn func())

type SealedChunk

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

func (*SealedChunk) FreeReference

func (sc *SealedChunk) FreeReference(messageOnFree string)

type SwapFile

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

func NewSwapFile

func NewSwapFile(dir string, chunkSize int64) *SwapFile

func (*SwapFile) FreeResource

func (sf *SwapFile) FreeResource()

func (*SwapFile) NewTempFileChunk

func (sf *SwapFile) NewTempFileChunk(logicChunkIndex LogicChunkIndex) (tc *SwapFileChunk)

type SwapFileChunk

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

func (*SwapFileChunk) FreeResource

func (sc *SwapFileChunk) FreeResource()

func (*SwapFileChunk) IsComplete

func (sc *SwapFileChunk) IsComplete() bool

func (*SwapFileChunk) ReadDataAt

func (sc *SwapFileChunk) ReadDataAt(p []byte, off int64) (maxStop int64)

func (*SwapFileChunk) SaveContent

func (sc *SwapFileChunk) SaveContent(saveFn SaveToStorageFunc)

func (*SwapFileChunk) WriteDataAt

func (sc *SwapFileChunk) WriteDataAt(src []byte, offset int64) (n int)

func (*SwapFileChunk) WrittenSize

func (sc *SwapFileChunk) WrittenSize() int64

type UploadPipeline

type UploadPipeline struct {
	ChunkSize int64
	// contains filtered or unexported fields
}

func NewUploadPipeline

func NewUploadPipeline(writers *util.LimitedConcurrentExecutor, chunkSize int64, saveToStorageFn SaveToStorageFunc, bufferChunkLimit int, swapFileDir string) *UploadPipeline

func (*UploadPipeline) FlushAll

func (up *UploadPipeline) FlushAll()

func (*UploadPipeline) IsLocked

func (up *UploadPipeline) IsLocked(logicChunkIndex LogicChunkIndex) bool

func (*UploadPipeline) LockForRead

func (up *UploadPipeline) LockForRead(startOffset, stopOffset int64)

func (*UploadPipeline) MaybeReadDataAt

func (up *UploadPipeline) MaybeReadDataAt(p []byte, off int64) (maxStop int64)

func (*UploadPipeline) SaveDataAt

func (up *UploadPipeline) SaveDataAt(p []byte, off int64, isSequential bool) (n int)

func (*UploadPipeline) Shutdown

func (up *UploadPipeline) Shutdown()

func (*UploadPipeline) UnlockForRead

func (up *UploadPipeline) UnlockForRead(startOffset, stopOffset int64)

Jump to

Keyboard shortcuts

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