xio

package
v0.15.13 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 7 Imported by: 33

Documentation

Overview

Package xio is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var EmptyBlockReader = BlockReader{}

EmptyBlockReader represents the default block reader.

Functions

func FilterEmptyBlockReadersSliceOfSlicesInPlace added in v0.11.0

func FilterEmptyBlockReadersSliceOfSlicesInPlace(brSliceOfSlices [][]BlockReader) ([][]BlockReader, error)

FilterEmptyBlockReadersSliceOfSlicesInPlace filters a [][]BlockReader in place (I.E by modifying the existing data structures instead of allocating new ones) such that the returned [][]BlockReader will only contain BlockReaders that contain non-empty segments.

Note that if any of the Block/Segment readers are backed by async implementations then this function will not return until all of the async execution has completed.

Types

type BlockReader

type BlockReader struct {
	SegmentReader
	Start     time.Time
	BlockSize time.Duration
}

BlockReader represents a block reader backed by a SegmentReader with start time and block size.

func FilterEmptyBlockReadersInPlace added in v0.11.0

func FilterEmptyBlockReadersInPlace(brs []BlockReader) ([]BlockReader, error)

FilterEmptyBlockReadersInPlace is the same as FilterEmptyBlockReadersSliceOfSlicesInPlace except for one dimensional slices instead of two.

func (BlockReader) CloneBlock

func (b BlockReader) CloneBlock(pool pool.CheckedBytesPool) (BlockReader, error)

CloneBlock returns a clone of the block with the underlying data reset

func (BlockReader) IsEmpty

func (b BlockReader) IsEmpty() bool

IsEmpty returns true for the empty block

func (BlockReader) IsNotEmpty

func (b BlockReader) IsNotEmpty() bool

IsNotEmpty returns false for the empty block

func (*BlockReader) ResetWindowed

func (b *BlockReader) ResetWindowed(segment ts.Segment, start time.Time, blockSize time.Duration)

ResetWindowed resets the underlying reader window, as well as start time and blockSize for the block

type MockSegmentReader

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

MockSegmentReader is a mock of SegmentReader interface

func NewMockSegmentReader

func NewMockSegmentReader(ctrl *gomock.Controller) *MockSegmentReader

NewMockSegmentReader creates a new mock instance

func (*MockSegmentReader) Clone

Clone mocks base method

func (*MockSegmentReader) EXPECT

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

func (*MockSegmentReader) Finalize

func (m *MockSegmentReader) Finalize()

Finalize mocks base method

func (*MockSegmentReader) Read

func (m *MockSegmentReader) Read(arg0 []byte) (int, error)

Read mocks base method

func (*MockSegmentReader) Reset

func (m *MockSegmentReader) Reset(arg0 ts.Segment)

Reset mocks base method

func (*MockSegmentReader) Segment

func (m *MockSegmentReader) Segment() (ts.Segment, error)

Segment mocks base method

type MockSegmentReaderMockRecorder

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

MockSegmentReaderMockRecorder is the mock recorder for MockSegmentReader

func (*MockSegmentReaderMockRecorder) Clone

func (mr *MockSegmentReaderMockRecorder) Clone(arg0 interface{}) *gomock.Call

Clone indicates an expected call of Clone

func (*MockSegmentReaderMockRecorder) Finalize

func (mr *MockSegmentReaderMockRecorder) Finalize() *gomock.Call

Finalize indicates an expected call of Finalize

func (*MockSegmentReaderMockRecorder) Read

func (mr *MockSegmentReaderMockRecorder) Read(arg0 interface{}) *gomock.Call

Read indicates an expected call of Read

func (*MockSegmentReaderMockRecorder) Reset

func (mr *MockSegmentReaderMockRecorder) Reset(arg0 interface{}) *gomock.Call

Reset indicates an expected call of Reset

func (*MockSegmentReaderMockRecorder) Segment

func (mr *MockSegmentReaderMockRecorder) Segment() *gomock.Call

Segment indicates an expected call of Segment

type MockSegmentReaderPool

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

MockSegmentReaderPool is a mock of SegmentReaderPool interface

func NewMockSegmentReaderPool

func NewMockSegmentReaderPool(ctrl *gomock.Controller) *MockSegmentReaderPool

NewMockSegmentReaderPool creates a new mock instance

func (*MockSegmentReaderPool) EXPECT

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

func (*MockSegmentReaderPool) Get

Get mocks base method

func (*MockSegmentReaderPool) Init

func (m *MockSegmentReaderPool) Init()

Init mocks base method

func (*MockSegmentReaderPool) Put

func (m *MockSegmentReaderPool) Put(arg0 SegmentReader)

Put mocks base method

type MockSegmentReaderPoolMockRecorder

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

MockSegmentReaderPoolMockRecorder is the mock recorder for MockSegmentReaderPool

func (*MockSegmentReaderPoolMockRecorder) Get

Get indicates an expected call of Get

func (*MockSegmentReaderPoolMockRecorder) Init

Init indicates an expected call of Init

func (*MockSegmentReaderPoolMockRecorder) Put

func (mr *MockSegmentReaderPoolMockRecorder) Put(arg0 interface{}) *gomock.Call

Put indicates an expected call of Put

type ReaderSliceOfSlicesFromBlockReadersIterator

type ReaderSliceOfSlicesFromBlockReadersIterator interface {
	ReaderSliceOfSlicesIterator

	// Reset resets the iterator with a new array of block readers arrays.
	Reset(blocks [][]BlockReader)
}

ReaderSliceOfSlicesFromBlockReadersIterator is an iterator that iterates through an array of reader arrays.

func NewReaderSliceOfSlicesFromBlockReadersIterator

func NewReaderSliceOfSlicesFromBlockReadersIterator(
	blocks [][]BlockReader,
) ReaderSliceOfSlicesFromBlockReadersIterator

NewReaderSliceOfSlicesFromBlockReadersIterator creates a new reader slice of slices iterator

type ReaderSliceOfSlicesIterator

type ReaderSliceOfSlicesIterator interface {
	// Next moves to the next item.
	Next() bool

	// CurrentReaders returns the current length, start time, and block size.
	CurrentReaders() (length int, start time.Time, blockSize time.Duration)

	// CurrentReaderAt returns the current reader in the slice
	// of readers at an index.
	CurrentReaderAt(idx int) BlockReader

	// Close closes the iterator.
	Close()

	// Size gives the size of bytes in this iterator.
	Size() (int, error)
}

ReaderSliceOfSlicesIterator is an iterator that iterates through an array of reader arrays.

type SegmentReader

type SegmentReader interface {
	io.Reader
	resource.Finalizer

	// Segment gets the segment read by this reader.
	Segment() (ts.Segment, error)

	// Reset resets the reader to read a new segment.
	Reset(segment ts.Segment)

	// Clone returns a clone of a copy of the underlying data reset,
	// with an optional byte pool to reduce allocations.
	Clone(pool pool.CheckedBytesPool) (SegmentReader, error)
}

SegmentReader implements the io reader interface backed by a segment.

func NewSegmentReader

func NewSegmentReader(segment ts.Segment) SegmentReader

NewSegmentReader creates a new segment reader along with a specified segment.

type SegmentReaderPool

type SegmentReaderPool interface {
	// Init will initialize the pool.
	Init()

	// Get provides a segment reader from the pool.
	Get() SegmentReader

	// Put returns a segment reader to the pool.
	Put(sr SegmentReader)
}

SegmentReaderPool provides a pool for segment readers.

func NewSegmentReaderPool

func NewSegmentReaderPool(opts pool.ObjectPoolOptions) SegmentReaderPool

NewSegmentReaderPool creates a new pool

Jump to

Keyboard shortcuts

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