Documentation
¶
Index ¶
- func Next() uint64
- type Buffer
- func (b *Buffer) Clone() *Buffer
- func (b *Buffer) IsEmpty() bool
- func (b *Buffer) PutAny(op OpType, idx uint32, value any) error
- func (b *Buffer) PutBitmap(op OpType, chunk Chunk, value bitmap.Bitmap)
- func (b *Buffer) PutBool(idx uint32, value bool)
- func (b *Buffer) PutBytes(op OpType, idx uint32, value []byte)
- func (b *Buffer) PutFloat32(op OpType, idx uint32, value float32)
- func (b *Buffer) PutFloat64(op OpType, idx uint32, value float64)
- func (b *Buffer) PutInt(op OpType, idx uint32, value int)
- func (b *Buffer) PutInt16(op OpType, idx uint32, value int16)
- func (b *Buffer) PutInt32(op OpType, idx uint32, value int32)
- func (b *Buffer) PutInt64(op OpType, idx uint32, value int64)
- func (b *Buffer) PutNumber(op OpType, idx uint32, value float64)
- func (b *Buffer) PutOperation(op OpType, idx uint32)
- func (b *Buffer) PutString(op OpType, idx uint32, value string)
- func (b *Buffer) PutUint(op OpType, idx uint32, value uint)
- func (b *Buffer) PutUint16(op OpType, idx uint32, value uint16)
- func (b *Buffer) PutUint32(op OpType, idx uint32, value uint32)
- func (b *Buffer) PutUint64(op OpType, idx uint32, value uint64)
- func (b *Buffer) RangeChunks(fn func(chunk Chunk))
- func (b *Buffer) ReadFrom(src io.Reader) (int64, error)
- func (b *Buffer) Reset(column string)
- func (b *Buffer) WriteTo(dst io.Writer) (int64, error)
- type Channel
- type Chunk
- type Commit
- type Log
- type Logger
- type OpType
- type Reader
- func (r *Reader) Bool() bool
- func (r *Reader) Bytes() []byte
- func (r *Reader) Float() float64
- func (r *Reader) Float32() float32
- func (r *Reader) Float64() float64
- func (r *Reader) Index() uint32
- func (r *Reader) IndexAtChunk() uint32
- func (r *Reader) Int() int
- func (r *Reader) Int16() int16
- func (r *Reader) Int32() int32
- func (r *Reader) Int64() int64
- func (r *Reader) IsDelete() bool
- func (r *Reader) IsUpsert() bool
- func (r *Reader) Next() bool
- func (r *Reader) Number() float64
- func (r *Reader) Range(buf *Buffer, chunk Chunk, fn func(*Reader))
- func (r *Reader) Rewind()
- func (r *Reader) Seek(b *Buffer)
- func (r *Reader) String() string
- func (r *Reader) SwapBool(b bool) bool
- func (r *Reader) SwapBytes(v []byte) []byte
- func (r *Reader) SwapFloat32(v float32) float32
- func (r *Reader) SwapFloat64(v float64) float64
- func (r *Reader) SwapInt(v int) int
- func (r *Reader) SwapInt16(v int16) int16
- func (r *Reader) SwapInt32(v int32) int32
- func (r *Reader) SwapInt64(v int64) int64
- func (r *Reader) SwapString(v string) string
- func (r *Reader) SwapUint(v uint) uint
- func (r *Reader) SwapUint16(v uint16) uint16
- func (r *Reader) SwapUint32(v uint32) uint32
- func (r *Reader) SwapUint64(v uint64) uint64
- func (r *Reader) Uint() uint
- func (r *Reader) Uint16() uint16
- func (r *Reader) Uint32() uint32
- func (r *Reader) Uint64() uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct { Column string // The column for the queue // contains filtered or unexported fields }
Buffer represents a buffer of delta operations.
func (*Buffer) PutBitmap ¶
PutBitmap iterates over the bitmap values and appends an operation for each bit set to one
func (*Buffer) PutFloat32 ¶
PutFloat32 appends an int32 value.
func (*Buffer) PutFloat64 ¶
PutFloat64 appends a float64 value.
func (*Buffer) PutOperation ¶
PutOperation appends an operation type without a value.
func (*Buffer) RangeChunks ¶
Range iterates over the chunks present in the buffer
func (*Buffer) ReadFrom ¶
ReadFrom reads data from r until EOF or error. The return value n is the number of bytes read. Any error except EOF encountered during the read is also returned.
type Channel ¶
type Channel chan Commit
Channel represents an impementation of a commit writer that simply sends each commit into the channel.
type Chunk ¶
type Chunk uint32
Chunk represents a chunk number
type Commit ¶
type Commit struct { ID uint64 // The commit ID Chunk Chunk // The chunk number Updates []*Buffer // The update buffers }
Commit represents an individual transaction commit. If multiple chunks are committed in the same transaction, it would result in multiple commits per transaction.
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log represents a commit log that can be used to write the changes to the collection during a snapshot. It also supports reading a commit log back.
func OpenFile ¶
OpenFile opens a specified commit log file in a read/write mode. If the file does not exist, it will create it.
type OpType ¶
type OpType uint8
OpType represents a type of an operation.
const ( Delete OpType = 0 // Delete deletes an entire row or a set of rows Insert OpType = 1 // Insert inserts a new row or a set of rows PutFalse OpType = 0 // PutFalse is a combination of Put+False for boolean values PutTrue OpType = 2 // PutTrue is a combination of Put+True for boolean values Put OpType = 2 // Put stores a value regardless of a previous value Merge OpType = 3 // Applies a merge function Skip OpType = 4 // Skips the value )
Various update operations supported.
type Reader ¶
type Reader struct { Type OpType // The current operation type Offset int32 // The current offset // contains filtered or unexported fields }
Reader represnts a commit log reader (iterator).
func (*Reader) IndexAtChunk ¶
IndexAtChunk returns the current index assuming chunk starts at 0.
func (*Reader) IsDelete ¶ added in v0.2.3
IsDelete returns true if the current operation is a deletion
func (*Reader) IsUpsert ¶ added in v0.2.3
IsUpsert returns true if the current operation is an insert or update
func (*Reader) Next ¶
Next reads the current operation and returns false if there is no more operations in the log.
func (*Reader) Number ¶
Number reads a float64 value. This is used for codegen, equivalent to Float64().
func (*Reader) SwapFloat32 ¶
SwapFloat32 swaps a float32 value with a new one.
func (*Reader) SwapFloat64 ¶
SwapFloat64 swaps a float64 value with a new one.
func (*Reader) SwapString ¶ added in v0.2.0
SwapString swaps a string value with a new one.
func (*Reader) SwapUint16 ¶
SwapUint16 swaps a uint16 value with a new one.
func (*Reader) SwapUint32 ¶
SwapUint32 swaps a uint32 value with a new one.
func (*Reader) SwapUint64 ¶
SwapUint64 swaps a uint64 value with a new one.