Documentation ¶
Index ¶
- Constants
- Variables
- func NewDataReader(r backend.ContextReader, encoding backend.Encoding) (common.DataReader, error)
- func NewDataWriter(writer io.Writer, encoding backend.Encoding) (common.DataWriter, error)
- func NewIndexReader(r backend.ContextReader, pageSizeBytes int, totalRecords int) (common.IndexReader, error)
- func NewIndexWriter(pageSizeBytes int) common.IndexWriter
- func NewObjectReaderWriter() common.ObjectReaderWriter
- func NewRecordReaderWriter() common.RecordReaderWriter
- type GzipPool
- func (pool *GzipPool) Encoding() backend.Encoding
- func (pool *GzipPool) GetReader(src io.Reader) (io.Reader, error)
- func (pool *GzipPool) GetWriter(dst io.Writer) (io.WriteCloser, error)
- func (pool *GzipPool) PutReader(reader io.Reader)
- func (pool *GzipPool) PutWriter(writer io.WriteCloser)
- func (pool *GzipPool) ResetReader(src io.Reader, resetReader io.Reader) (io.Reader, error)
- func (pool *GzipPool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
- type LZ4Pool
- func (pool *LZ4Pool) Encoding() backend.Encoding
- func (pool *LZ4Pool) GetReader(src io.Reader) (io.Reader, error)
- func (pool *LZ4Pool) GetWriter(dst io.Writer) (io.WriteCloser, error)
- func (pool *LZ4Pool) PutReader(reader io.Reader)
- func (pool *LZ4Pool) PutWriter(writer io.WriteCloser)
- func (pool *LZ4Pool) ResetReader(src io.Reader, resetReader io.Reader) (io.Reader, error)
- func (pool *LZ4Pool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
- type NoopPool
- func (pool *NoopPool) Encoding() backend.Encoding
- func (pool *NoopPool) GetReader(src io.Reader) (io.Reader, error)
- func (pool *NoopPool) GetWriter(dst io.Writer) (io.WriteCloser, error)
- func (pool *NoopPool) PutReader(reader io.Reader)
- func (pool *NoopPool) PutWriter(writer io.WriteCloser)
- func (pool *NoopPool) ResetReader(src io.Reader, resetReader io.Reader) (io.Reader, error)
- func (pool *NoopPool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
- type ReaderPool
- type S2Pool
- func (pool *S2Pool) Encoding() backend.Encoding
- func (pool *S2Pool) GetReader(src io.Reader) (io.Reader, error)
- func (pool *S2Pool) GetWriter(dst io.Writer) (io.WriteCloser, error)
- func (pool *S2Pool) PutReader(reader io.Reader)
- func (pool *S2Pool) PutWriter(writer io.WriteCloser)
- func (pool *S2Pool) ResetReader(src io.Reader, resetReader io.Reader) (io.Reader, error)
- func (pool *S2Pool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
- type SnappyPool
- func (pool *SnappyPool) Encoding() backend.Encoding
- func (pool *SnappyPool) GetReader(src io.Reader) (io.Reader, error)
- func (pool *SnappyPool) GetWriter(dst io.Writer) (io.WriteCloser, error)
- func (pool *SnappyPool) PutReader(reader io.Reader)
- func (pool *SnappyPool) PutWriter(writer io.WriteCloser)
- func (pool *SnappyPool) ResetReader(src io.Reader, resetReader io.Reader) (io.Reader, error)
- func (pool *SnappyPool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
- type WriterPool
- type ZstdPool
- func (pool *ZstdPool) Encoding() backend.Encoding
- func (pool *ZstdPool) GetReader(src io.Reader) (io.Reader, error)
- func (pool *ZstdPool) GetWriter(dst io.Writer) (io.WriteCloser, error)
- func (pool *ZstdPool) PutReader(reader io.Reader)
- func (pool *ZstdPool) PutWriter(writer io.WriteCloser)
- func (pool *ZstdPool) ResetReader(src io.Reader, resetReader io.Reader) (io.Reader, error)
- func (pool *ZstdPool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
Constants ¶
const DataHeaderLength = 0
DataHeaderLength is the length in bytes for the data header
const IndexHeaderLength = int(uint64Size) // 64bit checksum (xxhash)
IndexHeaderLength is the length in bytes for the record header
Variables ¶
var ( // Gzip is the gnu zip compression pool Gzip = GzipPool{/* contains filtered or unexported fields */} // Lz4_64k is the l4z compression pool, with 64k buffer size Lz4_64k = LZ4Pool{/* contains filtered or unexported fields */} // Lz4_256k uses 256k buffer Lz4_256k = LZ4Pool{/* contains filtered or unexported fields */} // Lz4_1M uses 1M buffer Lz4_1M = LZ4Pool{/* contains filtered or unexported fields */} // Lz4_4M uses 4M buffer Lz4_4M = LZ4Pool{/* contains filtered or unexported fields */} // Snappy is the snappy compression pool Snappy SnappyPool // Noop is the no compression pool Noop NoopPool // Zstd Pool Zstd = ZstdPool{} // S2 Pool S2 = S2Pool{} // BytesBufferPool is a bytes buffer used for lines decompressed. // Buckets [0.5KB,1KB,2KB,4KB,8KB] BytesBufferPool = pool.New(1<<9, 1<<13, 2, func(size int) interface{} { return make([]byte, 0, size) }) )
Functions ¶
func NewDataReader ¶
func NewDataReader(r backend.ContextReader, encoding backend.Encoding) (common.DataReader, error)
NewDataReader constructs a v2 DataReader that handles paged...reading
func NewDataWriter ¶
NewDataWriter creates a paged page writer
func NewIndexReader ¶
func NewIndexReader(r backend.ContextReader, pageSizeBytes int, totalRecords int) (common.IndexReader, error)
NewIndexReader returns an index reader for a byte slice of marshalled ordered records. The index has not changed between v0 and v1.
func NewIndexWriter ¶
func NewIndexWriter(pageSizeBytes int) common.IndexWriter
NewIndexWriter returns an index writer that writes to the provided io.Writer. The index has not changed between v0 and v1.
func NewObjectReaderWriter ¶
func NewObjectReaderWriter() common.ObjectReaderWriter
func NewRecordReaderWriter ¶
func NewRecordReaderWriter() common.RecordReaderWriter
Types ¶
type GzipPool ¶ added in v1.2.0
type GzipPool struct {
// contains filtered or unexported fields
}
GzipPool is a gun zip compression pool
func (*GzipPool) GetReader ¶ added in v1.2.0
GetReader gets or creates a new CompressionReader and reset it to read from src
func (*GzipPool) GetWriter ¶ added in v1.2.0
GetWriter gets or creates a new CompressionWriter and reset it to write to dst
func (*GzipPool) PutWriter ¶ added in v1.2.0
func (pool *GzipPool) PutWriter(writer io.WriteCloser)
PutWriter places back in the pool a CompressionWriter
func (*GzipPool) ResetReader ¶ added in v1.2.0
ResetReader implements ReaderPool
func (*GzipPool) ResetWriter ¶ added in v1.2.0
func (pool *GzipPool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
ResetWriter implements WriterPool
type LZ4Pool ¶ added in v1.2.0
type LZ4Pool struct {
// contains filtered or unexported fields
}
LZ4Pool is an pool...of lz4s...
func (*LZ4Pool) GetReader ¶ added in v1.2.0
GetReader gets or creates a new CompressionReader and reset it to read from src
func (*LZ4Pool) GetWriter ¶ added in v1.2.0
GetWriter gets or creates a new CompressionWriter and reset it to write to dst
func (*LZ4Pool) PutWriter ¶ added in v1.2.0
func (pool *LZ4Pool) PutWriter(writer io.WriteCloser)
PutWriter places back in the pool a CompressionWriter
func (*LZ4Pool) ResetReader ¶ added in v1.2.0
ResetReader implements ReaderPool
func (*LZ4Pool) ResetWriter ¶ added in v1.2.0
func (pool *LZ4Pool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
ResetWriter implements WriterPool
type NoopPool ¶ added in v1.2.0
type NoopPool struct{}
NoopPool is for people who think compression is for the weak
func (*NoopPool) GetReader ¶ added in v1.2.0
GetReader gets or creates a new CompressionReader and reset it to read from src
func (*NoopPool) GetWriter ¶ added in v1.2.0
GetWriter gets or creates a new CompressionWriter and reset it to write to dst
func (*NoopPool) PutWriter ¶ added in v1.2.0
func (pool *NoopPool) PutWriter(writer io.WriteCloser)
PutWriter places back in the pool a CompressionWriter
func (*NoopPool) ResetReader ¶ added in v1.2.0
ResetReader implements ReaderPool
func (*NoopPool) ResetWriter ¶ added in v1.2.0
func (pool *NoopPool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
ResetWriter implements WriterPool
type ReaderPool ¶ added in v1.2.0
type ReaderPool interface { GetReader(io.Reader) (io.Reader, error) PutReader(io.Reader) ResetReader(src io.Reader, resetReader io.Reader) (io.Reader, error) Encoding() backend.Encoding }
ReaderPool similar to WriterPool but for reading chunks.
type S2Pool ¶ added in v1.2.0
type S2Pool struct {
// contains filtered or unexported fields
}
S2Pool is one s short of s3
func (*S2Pool) GetReader ¶ added in v1.2.0
GetReader gets or creates a new CompressionReader and reset it to read from src
func (*S2Pool) GetWriter ¶ added in v1.2.0
GetWriter gets or creates a new CompressionWriter and reset it to write to dst
func (*S2Pool) PutWriter ¶ added in v1.2.0
func (pool *S2Pool) PutWriter(writer io.WriteCloser)
PutWriter places back in the pool a CompressionWriter
func (*S2Pool) ResetReader ¶ added in v1.2.0
ResetReader implements ReaderPool
func (*S2Pool) ResetWriter ¶ added in v1.2.0
func (pool *S2Pool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
ResetWriter implements WriterPool
type SnappyPool ¶ added in v1.2.0
type SnappyPool struct {
// contains filtered or unexported fields
}
SnappyPool is a really cool looking pool. Dang that pool is _snappy_.
func (*SnappyPool) Encoding ¶ added in v1.2.0
func (pool *SnappyPool) Encoding() backend.Encoding
Encoding implements WriterPool and ReaderPool
func (*SnappyPool) GetReader ¶ added in v1.2.0
GetReader gets or creates a new CompressionReader and reset it to read from src
func (*SnappyPool) GetWriter ¶ added in v1.2.0
func (pool *SnappyPool) GetWriter(dst io.Writer) (io.WriteCloser, error)
GetWriter gets or creates a new CompressionWriter and reset it to write to dst
func (*SnappyPool) PutReader ¶ added in v1.2.0
func (pool *SnappyPool) PutReader(reader io.Reader)
PutReader places back in the pool a CompressionReader
func (*SnappyPool) PutWriter ¶ added in v1.2.0
func (pool *SnappyPool) PutWriter(writer io.WriteCloser)
PutWriter places back in the pool a CompressionWriter
func (*SnappyPool) ResetReader ¶ added in v1.2.0
ResetReader implements ReaderPool
func (*SnappyPool) ResetWriter ¶ added in v1.2.0
func (pool *SnappyPool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
ResetWriter implements WriterPool
type WriterPool ¶ added in v1.2.0
type WriterPool interface { GetWriter(io.Writer) (io.WriteCloser, error) PutWriter(io.WriteCloser) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error) Encoding() backend.Encoding }
WriterPool is a pool of io.Writer This is used by every chunk to avoid unnecessary allocations.
func GetWriterPool ¶ added in v1.2.0
func GetWriterPool(enc backend.Encoding) (WriterPool, error)
type ZstdPool ¶ added in v1.2.0
type ZstdPool struct { }
ZstdPool is a zstd compression pool
func (*ZstdPool) GetReader ¶ added in v1.2.0
GetReader gets or creates a new CompressionReader and reset it to read from src
func (*ZstdPool) GetWriter ¶ added in v1.2.0
GetWriter gets or creates a new CompressionWriter and reset it to write to dst
func (*ZstdPool) PutWriter ¶ added in v1.2.0
func (pool *ZstdPool) PutWriter(writer io.WriteCloser)
PutWriter places back in the pool a CompressionWriter
func (*ZstdPool) ResetReader ¶ added in v1.2.0
ResetReader implements ReaderPool
func (*ZstdPool) ResetWriter ¶ added in v1.2.0
func (pool *ZstdPool) ResetWriter(dst io.Writer, resetWriter io.WriteCloser) (io.WriteCloser, error)
ResetWriter implements WriterPool