log_buffer

package
v0.0.0-...-5c6c1e7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize = 4 * 1024 * 1024
View Source
const PreviousBufferCount = 3

Variables

View Source
var (
	ResumeError         = fmt.Errorf("resume")
	ResumeFromDiskError = fmt.Errorf("resumeFromDisk")
)

Functions

This section is empty.

Types

type LogBuffer

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

func NewLogBuffer

func NewLogBuffer(name string, flushInterval time.Duration, flushFn func(startTime, stopTime time.Time, buf []byte), notifyFn func()) *LogBuffer

func (*LogBuffer) AddToBuffer

func (m *LogBuffer) AddToBuffer(partitionKey, data []byte, processingTsNs int64)

func (*LogBuffer) LoopProcessLogData

func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startReadTime time.Time, stopTsNs int64,
	waitForDataFn func() bool, eachLogDataFn func(logEntry *filer_pb.LogEntry) error) (lastReadTime time.Time, isDone bool, err error)

func (*LogBuffer) ReadFromBuffer

func (m *LogBuffer) ReadFromBuffer(lastReadTime time.Time) (bufferCopy *bytes.Buffer, err error)

func (*LogBuffer) ReleaseMemory

func (m *LogBuffer) ReleaseMemory(b *bytes.Buffer)

func (*LogBuffer) Shutdown

func (m *LogBuffer) Shutdown()

type MemBuffer

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

func (*MemBuffer) String

func (mb *MemBuffer) String() string

type SealedBuffers

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

func (*SealedBuffers) SealBuffer

func (sbs *SealedBuffers) SealBuffer(startTime, stopTime time.Time, buf []byte, pos int) (newBuf []byte)

Jump to

Keyboard shortcuts

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