Documentation ¶
Overview ¶
Package xio is a generated GoMock package.
Index ¶
- Variables
- func FilterEmptyBlockReadersSliceOfSlicesInPlace(brSliceOfSlices [][]BlockReader) ([][]BlockReader, error)
- func ToBytes(reader Reader64) ([]byte, error)
- type BlockReader
- type BytesReader64
- type MockSegmentReader
- func (m *MockSegmentReader) Clone(arg0 pool.CheckedBytesPool) (SegmentReader, error)
- func (m *MockSegmentReader) EXPECT() *MockSegmentReaderMockRecorder
- func (m *MockSegmentReader) Finalize()
- func (m *MockSegmentReader) Peek64() (uint64, byte, error)
- func (m *MockSegmentReader) Read64() (uint64, byte, error)
- func (m *MockSegmentReader) Reset(arg0 ts.Segment)
- func (m *MockSegmentReader) Segment() (ts.Segment, error)
- type MockSegmentReaderMockRecorder
- func (mr *MockSegmentReaderMockRecorder) Clone(arg0 interface{}) *gomock.Call
- func (mr *MockSegmentReaderMockRecorder) Finalize() *gomock.Call
- func (mr *MockSegmentReaderMockRecorder) Peek64() *gomock.Call
- func (mr *MockSegmentReaderMockRecorder) Read64() *gomock.Call
- func (mr *MockSegmentReaderMockRecorder) Reset(arg0 interface{}) *gomock.Call
- func (mr *MockSegmentReaderMockRecorder) Segment() *gomock.Call
- type MockSegmentReaderPool
- type MockSegmentReaderPoolMockRecorder
- type Reader64
- type ReaderSliceOfSlicesFromBlockReadersIterator
- type ReaderSliceOfSlicesIterator
- type SegmentReader
- type SegmentReaderPool
- type WideEntry
Constants ¶
This section is empty.
Variables ¶
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 xtime.UnixNano 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 xtime.UnixNano, blockSize time.Duration, )
ResetWindowed resets the underlying reader window, as well as start time and blockSize for the block
type BytesReader64 ¶ added in v1.2.0
type BytesReader64 struct {
// contains filtered or unexported fields
}
BytesReader64 implements a Reader64 over a slice of bytes.
func NewBytesReader64 ¶ added in v1.2.0
func NewBytesReader64(data []byte) *BytesReader64
NewBytesReader64 creates a new BytesReader64.
func (*BytesReader64) Peek64 ¶ added in v1.2.0
func (r *BytesReader64) Peek64() (word uint64, n byte, err error)
Peek64 peeks and returns the next 64 bit word plus a number of bytes (up to 8) available.
func (*BytesReader64) Read64 ¶ added in v1.2.0
func (r *BytesReader64) Read64() (word uint64, n byte, err error)
Read64 reads and returns a 64 bit word plus a number of bytes (up to 8) actually read.
func (*BytesReader64) Reset ¶ added in v1.2.0
func (r *BytesReader64) Reset(data []byte)
Reset resets the BytesReader64 for reuse.
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 ¶
func (m *MockSegmentReader) Clone(arg0 pool.CheckedBytesPool) (SegmentReader, error)
Clone mocks base method.
func (*MockSegmentReader) EXPECT ¶
func (m *MockSegmentReader) EXPECT() *MockSegmentReaderMockRecorder
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) Peek64 ¶ added in v1.2.0
func (m *MockSegmentReader) Peek64() (uint64, byte, error)
Peek64 mocks base method.
func (*MockSegmentReader) Read64 ¶ added in v1.2.0
func (m *MockSegmentReader) Read64() (uint64, byte, error)
Read64 mocks base method.
func (*MockSegmentReader) Reset ¶
func (m *MockSegmentReader) Reset(arg0 ts.Segment)
Reset 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) Peek64 ¶ added in v1.2.0
func (mr *MockSegmentReaderMockRecorder) Peek64() *gomock.Call
Peek64 indicates an expected call of Peek64.
func (*MockSegmentReaderMockRecorder) Read64 ¶ added in v1.2.0
func (mr *MockSegmentReaderMockRecorder) Read64() *gomock.Call
Read64 indicates an expected call of Read64.
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 ¶
func (m *MockSegmentReaderPool) EXPECT() *MockSegmentReaderPoolMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSegmentReaderPool) Get ¶
func (m *MockSegmentReaderPool) Get() SegmentReader
Get 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 ¶
func (mr *MockSegmentReaderPoolMockRecorder) Get() *gomock.Call
Get indicates an expected call of Get.
func (*MockSegmentReaderPoolMockRecorder) Init ¶
func (mr *MockSegmentReaderPoolMockRecorder) Init() *gomock.Call
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 Reader64 ¶ added in v1.2.0
type Reader64 interface { // Read64 reads and returns a 64 bit word plus a number of bytes (up to 8) actually read. Read64() (word uint64, n byte, err error) // Read64 peeks and returns the next 64 bit word plus a number of bytes (up to 8) available. Peek64() (word uint64, n byte, err error) }
Reader64 is a reader for reading 64 bit words.
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 xtime.UnixNano, 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) // RewindToIndex returns the iterator to a specific index. // This operation is invalid if any of the block readers have been read. RewindToIndex(idx int) // Index returns the iterator's current index. Index() int }
ReaderSliceOfSlicesIterator is an iterator that iterates through an array of reader arrays.
type SegmentReader ¶
type SegmentReader interface { Reader64 xresource.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
type WideEntry ¶ added in v1.0.1
type WideEntry struct { Shard uint32 ID ident.ID Size int64 Offset int64 DataChecksum int64 EncodedTags checked.Bytes MetadataChecksum int64 Data checked.Bytes // contains filtered or unexported fields }
WideEntry is an entry from the index file which can be passed to SeekUsingIndexEntry to seek to the data for that entry.