page_writer

package
v0.0.0-...-45e1a9a Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 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 ActivityScore

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

func NewActivityScore

func NewActivityScore() *ActivityScore

func (ActivityScore) ActivityScore

func (as ActivityScore) ActivityScore() int64

func (ActivityScore) MarkRead

func (as ActivityScore) MarkRead()

func (ActivityScore) MarkWrite

func (as ActivityScore) MarkWrite()

type ActualChunkIndex

type ActualChunkIndex int

type ChunkWrittenInterval

type ChunkWrittenInterval struct {
	StartOffset int64

	TsNs 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, tsNs int64)

func (*ChunkWrittenIntervalList) WrittenSize

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

type DirtyPages

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

type LogicChunkIndex

type LogicChunkIndex int

type MemChunk

type MemChunk struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMemChunk

func NewMemChunk(logicChunkIndex LogicChunkIndex, chunkSize int64) *MemChunk

func (*MemChunk) ActivityScore

func (mc *MemChunk) ActivityScore() int64

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, tsNs int64) (maxStop int64)

func (*MemChunk) SaveContent

func (mc *MemChunk) SaveContent(saveFn SaveToStorageFunc)

func (*MemChunk) WriteDataAt

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

func (*MemChunk) WrittenSize

func (mc *MemChunk) WrittenSize() int64

type PageChunk

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

type SaveToStorageFunc

type SaveToStorageFunc func(reader io.Reader, offset int64, size int64, modifiedTsNs 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) NewSwapFileChunk

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

type SwapFileChunk

type SwapFileChunk struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*SwapFileChunk) ActivityScore

func (sc *SwapFileChunk) ActivityScore() int64

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, tsNs int64) (maxStop int64)

func (*SwapFileChunk) SaveContent

func (sc *SwapFileChunk) SaveContent(saveFn SaveToStorageFunc)

func (*SwapFileChunk) WriteDataAt

func (sc *SwapFileChunk) WriteDataAt(src []byte, offset int64, tsNs 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, tsNs int64) (maxStop int64)

func (*UploadPipeline) SaveDataAt

func (up *UploadPipeline) SaveDataAt(p []byte, off int64, isSequential bool, tsNs int64) (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