Documentation ¶
Index ¶
- Constants
- Variables
- func AppendFloat32ToBufferBE(buffer []byte, value float32) []byte
- func AppendFloat64ToBufferBE(buffer []byte, value float64) []byte
- func AppendFloat64ToBufferLE(buffer []byte, value float64) []byte
- func AppendStringToBufferLE(buffer []byte, value string) []byte
- func AppendTimestampToBuffer(buffer []byte, ts Timestamp) ([]byte, error)
- func AppendUint16ToBufferBE(buffer []byte, v uint16) []byte
- func AppendUint32ToBufferBE(buffer []byte, v uint32) []byte
- func AppendUint32ToBufferLE(buffer []byte, v uint32) []byte
- func AppendUint64ToBufferBE(buffer []byte, v uint64) []byte
- func AppendUint64ToBufferLE(buffer []byte, v uint64) []byte
- func ByteSliceToStringZeroCopy(buffer []byte) string
- func ConvertPranaTypeToTiDBType(columnType ColumnType) *types.FieldType
- func CopyByteSlice(buff []byte) []byte
- func DecodeIndexOrPKCol(buffer []byte, offset int, colType ColumnType, outputColIndex int, pkCol bool, ...) (int, error)
- func DecodeIndexOrPKCols(buffer []byte, offset int, pk bool, indexOrPKColTypes []ColumnType, ...) (int, error)
- func DecodeRow(buffer []byte, colTypes []ColumnType, rows *Rows) error
- func DecodeRowWithIgnoredCols(buffer []byte, colTypes []ColumnType, includeCol []bool, rows *Rows) error
- func DoDumpStacks(filterSpam bool)
- func DumpDataKey(bytes []byte) string
- func DumpStacks()
- func EncodeIndexKeyCols(row *Row, colIndexes []int, colTypes []ColumnType, buffer []byte) ([]byte, error)
- func EncodeKey(key Key, colTypes []ColumnType, keyColIndexes []int, buffer []byte) ([]byte, error)
- func EncodeKeyCol(row *Row, colIndex int, colType ColumnType, buffer []byte) ([]byte, error)
- func EncodeKeyCols(row *Row, colIndexes []int, colTypes []ColumnType, buffer []byte) ([]byte, error)
- func EncodeKeyElement(value interface{}, colType ColumnType, buffer []byte) ([]byte, error)
- func EncodeRow(row *Row, colTypes []ColumnType, buffer []byte) ([]byte, error)
- func IncrementBytesBigEndian(bytes []byte) []byte
- func InvokeCloser(closer io.Closer)
- func KeyDecodeFloat64(buffer []byte, offset int) (float64, int)
- func KeyDecodeInt64(buffer []byte, offset int) (int64, int)
- func KeyDecodeString(buffer []byte, offset int) (string, int, error)
- func KeyEncodeDecimal(buffer []byte, val Decimal, precision int, scale int) ([]byte, error)
- func KeyEncodeFloat64(buffer []byte, val float64) []byte
- func KeyEncodeInt64(buffer []byte, val int64) []byte
- func KeyEncodeString(buff []byte, val string) []byte
- func KeyEncodeTimestamp(buffer []byte, val Timestamp) ([]byte, error)
- func LogInternalError(err error) errors.PranaError
- func PanicHandler()
- func ReadFloat32FromBufferBE(buffer []byte, offset int) (val float32, off int)
- func ReadFloat64FromBufferBE(buffer []byte, offset int) (val float64, off int)
- func ReadFloat64FromBufferLE(buffer []byte, offset int) (val float64, off int)
- func ReadInt64FromBufferLE(buffer []byte, offset int) (int64, int)
- func ReadStringFromBufferLE(buffer []byte, offset int) (val string, off int)
- func ReadUint16FromBufferBE(buffer []byte, offset int) (uint16, int)
- func ReadUint32FromBufferBE(buffer []byte, offset int) (uint32, int)
- func ReadUint32FromBufferLE(buffer []byte, offset int) (uint32, int)
- func ReadUint64FromBufferBE(buffer []byte, offset int) (uint64, int)
- func ReadUint64FromBufferLE(buffer []byte, offset int) (uint64, int)
- func RoundTimestampToFSP(ts *Timestamp, fsp int8) error
- func StringToByteSliceZeroCopy(str string) []byte
- func TiDBValueToPranaValue(tidbValue interface{}) interface{}
- type AtomicBool
- type ByteSliceMap
- type ColumnInfo
- type ColumnType
- type Decimal
- func KeyDecodeDecimal(buffer []byte, offset int, precision int, scale int) (Decimal, int, error)
- func NewDecFromFloat64(f float64) (*Decimal, error)
- func NewDecFromInt64(i int64) *Decimal
- func NewDecFromString(s string) (*Decimal, error)
- func NewDecFromUint64(i uint64) *Decimal
- func NewDecimal(dec *types.MyDecimal) *Decimal
- func ReadDecimalFromBuffer(buffer []byte, offset int, precision int, scale int) (val Decimal, off int, err error)
- func ZeroDecimal() *Decimal
- func (d *Decimal) Add(other *Decimal) (*Decimal, error)
- func (d *Decimal) CompareTo(dec *Decimal) int
- func (d *Decimal) Decode(buffer []byte, offset int, precision int, scale int) (int, error)
- func (d *Decimal) Encode(buffer []byte, precision int, scale int) ([]byte, error)
- func (d *Decimal) String() string
- func (d *Decimal) Subtract(other *Decimal) (*Decimal, error)
- type Encoding
- type Expression
- func NewColumnExpression(colIndex int, colType ColumnType) *Expression
- func NewConstantDouble(colType ColumnType, val float64) *Expression
- func NewConstantInt(colType ColumnType, val int64) *Expression
- func NewConstantVarchar(colType ColumnType, val string) *Expression
- func NewExpression(exp expression.Expression, ctx sessionctx.Context) *Expression
- func NewScalarFunctionExpression(colType ColumnType, funcName string, args ...*Expression) (*Expression, error)
- func (e *Expression) EvalBoolean(row *Row) (bool, bool, error)
- func (e *Expression) EvalDecimal(row *Row) (Decimal, bool, error)
- func (e *Expression) EvalFloat64(row *Row) (val float64, null bool, err error)
- func (e *Expression) EvalInt64(row *Row) (val int64, null bool, err error)
- func (e *Expression) EvalString(row *Row) (val string, null bool, err error)
- func (e *Expression) EvalTimestamp(row *Row) (Timestamp, bool, error)
- func (e *Expression) GetColumnIndex() (int, bool)
- func (e *Expression) ReturnType(colTypes []ColumnType) (ColumnType, error)
- type IndexInfo
- type InternalTableInfo
- type KafkaEncoding
- type Key
- type MaterializedViewInfo
- type MetaTableInfo
- type PreAllocatedSeqGenerator
- type Row
- func (r *Row) ColCount() int
- func (r *Row) ColumnTypes() []ColumnType
- func (r *Row) GetByte(colIndex int) byte
- func (r *Row) GetDecimal(colIndex int) Decimal
- func (r *Row) GetFloat64(colIndex int) float64
- func (r *Row) GetInt64(colIndex int) int64
- func (r *Row) GetString(colIndex int) string
- func (r *Row) GetTimestamp(colIndex int) Timestamp
- func (r *Row) IsNull(colIndex int) bool
- func (r *Row) String() string
- type Rows
- func (r *Rows) AppendAll(other *Rows)
- func (r *Rows) AppendDecimalToColumn(colIndex int, val Decimal)
- func (r *Rows) AppendFloat64ToColumn(colIndex int, val float64)
- func (r *Rows) AppendInt64ToColumn(colIndex int, val int64)
- func (r *Rows) AppendNullToColumn(colIndex int)
- func (r *Rows) AppendRow(row Row)
- func (r *Rows) AppendStringToColumn(colIndex int, val string)
- func (r *Rows) AppendTimestampToColumn(colIndex int, val Timestamp)
- func (r *Rows) ColumnTypes() []ColumnType
- func (r *Rows) Deserialize(buff []byte)
- func (r *Rows) GetRow(rowIndex int) Row
- func (r *Rows) RowCount() int
- func (r *Rows) Serialize() []byte
- func (r *Rows) String() string
- type RowsFactory
- type Schema
- func (s *Schema) DeleteIndex(tableName string, indexName string) error
- func (s *Schema) DeleteTable(name string)
- func (s *Schema) Equal(other *Schema) bool
- func (s *Schema) GetAllTableInfos() map[string]*TableInfo
- func (s *Schema) GetTable(name string) (Table, bool)
- func (s *Schema) LenTables() int
- func (s *Schema) PutIndex(indexInfo *IndexInfo) error
- func (s *Schema) PutTable(name string, table Table)
- type SeqGenerator
- type SimpleQueryExec
- type SinkInfo
- type SourceInfo
- type Table
- type TableInfo
- type Timestamp
- func KeyDecodeTimestamp(buffer []byte, offset int, fsp int8) (Timestamp, int, error)
- func NewTimestampFromGoTime(t time.Time) Timestamp
- func NewTimestampFromString(str string) Timestamp
- func NewTimestampFromUnixEpochMillis(v int64) Timestamp
- func ReadTimestampFromBuffer(buffer []byte, offset int, fsp int8) (val Timestamp, off int, err error)
- func ReadTimestampFromBufferBE(buffer []byte, offset int, fsp int8) (val Timestamp, off int, err error)
- type TopicInfo
- type Type
Constants ¶
const ( ReceiverTableID = 1 SequenceGeneratorTableID = 2 LocksTableID = 3 LastLogIndexReceivedTableID = 4 SyncTableID = 5 SchemaTableID = 6 // SchemaTableID stores table schemas ProtobufTableID = 7 IndexTableID = 8 ToDeleteTableID = 9 LocalConfigTableID = 10 ForwardDedupTableID = 11 UserTableIDBase = 1000 )
System table ids
const SignBitMask uint64 = 1 << 63
Variables ¶
var ( TinyIntColumnType = ColumnType{Type: TypeTinyInt} IntColumnType = ColumnType{Type: TypeInt} BigIntColumnType = ColumnType{Type: TypeBigInt} DoubleColumnType = ColumnType{Type: TypeDouble} VarcharColumnType = ColumnType{Type: TypeVarchar} TimestampColumnType = ColumnType{Type: TypeTimestamp} UnknownColumnType = ColumnType{Type: TypeUnknown} // ColumnTypesByType allows lookup of non-parameterised ColumnType by Type. ColumnTypesByType = map[Type]ColumnType{ TypeTinyInt: TinyIntColumnType, TypeInt: IntColumnType, TypeBigInt: BigIntColumnType, TypeDouble: DoubleColumnType, TypeVarchar: VarcharColumnType, } )
var ( KafkaEncodingUnknown = KafkaEncoding{Encoding: EncodingUnknown} KafkaEncodingRaw = KafkaEncoding{Encoding: EncodingRaw} KafkaEncodingCSV = KafkaEncoding{Encoding: EncodingCSV} KafkaEncodingJSON = KafkaEncoding{Encoding: EncodingJSON} KafkaEncodingFloat32BE = KafkaEncoding{Encoding: EncodingFloat32BE} KafkaEncodingFloat64BE = KafkaEncoding{Encoding: EncodingFloat64BE} KafkaEncodingInt32BE = KafkaEncoding{Encoding: EncodingInt32BE} KafkaEncodingInt64BE = KafkaEncoding{Encoding: EncodingInt64BE} KafkaEncodingInt16BE = KafkaEncoding{Encoding: EncodingInt16BE} KafkaEncodingStringBytes = KafkaEncoding{Encoding: EncodingStringBytes} )
var IsLittleEndian = isLittleEndian()
Functions ¶
func AppendFloat32ToBufferBE ¶
func AppendFloat64ToBufferBE ¶
func AppendFloat64ToBufferLE ¶
func AppendStringToBufferLE ¶
func AppendTimestampToBuffer ¶
func AppendUint16ToBufferBE ¶
func AppendUint32ToBufferBE ¶
func AppendUint32ToBufferLE ¶
func AppendUint64ToBufferBE ¶
func AppendUint64ToBufferLE ¶
func ConvertPranaTypeToTiDBType ¶
func ConvertPranaTypeToTiDBType(columnType ColumnType) *types.FieldType
func CopyByteSlice ¶
func DecodeIndexOrPKCol ¶
func DecodeIndexOrPKCols ¶
func DecodeRowWithIgnoredCols ¶
func DecodeRowWithIgnoredCols(buffer []byte, colTypes []ColumnType, includeCol []bool, rows *Rows) error
func DoDumpStacks ¶
func DoDumpStacks(filterSpam bool)
func DumpDataKey ¶
func DumpStacks ¶
func DumpStacks()
DumpStacks dumps stacks for all goroutines to stdout, useful when debugging
func EncodeIndexKeyCols ¶
func EncodeKeyCol ¶
func EncodeKeyCols ¶
func EncodeKeyElement ¶
func EncodeKeyElement(value interface{}, colType ColumnType, buffer []byte) ([]byte, error)
func IncrementBytesBigEndian ¶
IncrementBytesBigEndian returns a new byte slice which is 1 larger than the provided slice when represented in big endian layout, but without changing the key length
func InvokeCloser ¶
func KeyEncodeDecimal ¶
func KeyEncodeFloat64 ¶
func KeyEncodeInt64 ¶
func KeyEncodeString ¶
func LogInternalError ¶ added in v0.1.1
func LogInternalError(err error) errors.PranaError
func PanicHandler ¶
func PanicHandler()
func ReadFloat32FromBufferBE ¶
func ReadFloat64FromBufferBE ¶
func ReadFloat64FromBufferLE ¶
func ReadStringFromBufferLE ¶
func RoundTimestampToFSP ¶
func TiDBValueToPranaValue ¶
func TiDBValueToPranaValue(tidbValue interface{}) interface{}
Types ¶
type AtomicBool ¶
type AtomicBool struct {
// contains filtered or unexported fields
}
func (*AtomicBool) CompareAndSet ¶
func (a *AtomicBool) CompareAndSet(expected bool, val bool) bool
func (*AtomicBool) Get ¶
func (a *AtomicBool) Get() bool
func (*AtomicBool) Set ¶
func (a *AtomicBool) Set(val bool)
type ByteSliceMap ¶
func NewByteSliceMap ¶
func NewByteSliceMap() *ByteSliceMap
func (*ByteSliceMap) Put ¶
func (b *ByteSliceMap) Put(key []byte, value []byte)
type ColumnInfo ¶
type ColumnInfo struct { Name string ColumnType }
type ColumnType ¶
type ColumnType struct { Type Type DecPrecision int DecScale int FSP int8 // fractional seconds precision for time types }
func ConvertTiDBTypeToPranaType ¶
func ConvertTiDBTypeToPranaType(columnType *types.FieldType) ColumnType
func NewDecimalColumnType ¶
func NewDecimalColumnType(precision int, scale int) ColumnType
func NewTimestampColumnType ¶
func NewTimestampColumnType(fsp int8) ColumnType
func (*ColumnType) String ¶
func (t *ColumnType) String() string
type Decimal ¶
type Decimal struct {
// contains filtered or unexported fields
}
func KeyDecodeDecimal ¶ added in v0.1.1
func NewDecFromFloat64 ¶
func NewDecFromInt64 ¶
func NewDecFromString ¶
func NewDecFromUint64 ¶
func NewDecimal ¶
func ReadDecimalFromBuffer ¶
func ZeroDecimal ¶
func ZeroDecimal() *Decimal
type Expression ¶
type Expression struct {
// contains filtered or unexported fields
}
func NewColumnExpression ¶
func NewColumnExpression(colIndex int, colType ColumnType) *Expression
func NewConstantDouble ¶
func NewConstantDouble(colType ColumnType, val float64) *Expression
func NewConstantInt ¶
func NewConstantInt(colType ColumnType, val int64) *Expression
func NewConstantVarchar ¶
func NewConstantVarchar(colType ColumnType, val string) *Expression
func NewExpression ¶
func NewExpression(exp expression.Expression, ctx sessionctx.Context) *Expression
func NewScalarFunctionExpression ¶
func NewScalarFunctionExpression(colType ColumnType, funcName string, args ...*Expression) (*Expression, error)
func (*Expression) EvalBoolean ¶
func (e *Expression) EvalBoolean(row *Row) (bool, bool, error)
func (*Expression) EvalDecimal ¶
func (e *Expression) EvalDecimal(row *Row) (Decimal, bool, error)
func (*Expression) EvalFloat64 ¶
func (e *Expression) EvalFloat64(row *Row) (val float64, null bool, err error)
func (*Expression) EvalInt64 ¶
func (e *Expression) EvalInt64(row *Row) (val int64, null bool, err error)
func (*Expression) EvalString ¶
func (e *Expression) EvalString(row *Row) (val string, null bool, err error)
func (*Expression) EvalTimestamp ¶
func (e *Expression) EvalTimestamp(row *Row) (Timestamp, bool, error)
func (*Expression) GetColumnIndex ¶
func (e *Expression) GetColumnIndex() (int, bool)
func (*Expression) ReturnType ¶
func (e *Expression) ReturnType(colTypes []ColumnType) (ColumnType, error)
type IndexInfo ¶
type IndexInfo struct { SchemaName string ID uint64 TableName string Name string IndexCols []int // contains filtered or unexported fields }
func (*IndexInfo) ContainsColIndex ¶
type InternalTableInfo ¶
type KafkaEncoding ¶
func KafkaEncodingFromString ¶
func KafkaEncodingFromString(str string) KafkaEncoding
KafkaEncodingFromString decodes an encoding and an optional schema name from the string, in the format "<encoding>[:<schema>]". For example, for a "com.squareup.cash.Payment" protobuf, encoding should be specified as "protobuf:com.squareup.cash.Payment"
type MaterializedViewInfo ¶
func (*MaterializedViewInfo) String ¶
func (i *MaterializedViewInfo) String() string
type MetaTableInfo ¶
type MetaTableInfo struct {
*TableInfo
}
MetaTableInfo describes a system table that is neither a source or mv.
func (*MetaTableInfo) String ¶
func (i *MetaTableInfo) String() string
type PreAllocatedSeqGenerator ¶
type PreAllocatedSeqGenerator struct {
// contains filtered or unexported fields
}
PreAllocatedSeqGenerator is a sequence generator that enumerates a fixed, already obtained sequence IDs. We need to reserve the table sequences required for the DDL statement *before* we broadcast the DDL across the cluster, and those same table sequence values have to be used on every node for consistency.
func NewPreallocSeqGen ¶
func NewPreallocSeqGen(seq []uint64) *PreAllocatedSeqGenerator
func (*PreAllocatedSeqGenerator) GenerateSequence ¶
func (p *PreAllocatedSeqGenerator) GenerateSequence() uint64
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
func (*Row) ColumnTypes ¶
func (r *Row) ColumnTypes() []ColumnType
func (*Row) GetDecimal ¶
func (*Row) GetFloat64 ¶
func (*Row) GetTimestamp ¶
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
func NewRows ¶
func NewRows(columnTypes []ColumnType, capacity int) *Rows
func (*Rows) AppendDecimalToColumn ¶
func (*Rows) AppendFloat64ToColumn ¶
func (*Rows) AppendInt64ToColumn ¶
func (*Rows) AppendNullToColumn ¶
func (*Rows) AppendStringToColumn ¶
func (*Rows) AppendTimestampToColumn ¶
func (*Rows) ColumnTypes ¶
func (r *Rows) ColumnTypes() []ColumnType
func (*Rows) Deserialize ¶
type RowsFactory ¶
type RowsFactory struct { ColumnTypes []ColumnType // contains filtered or unexported fields }
RowsFactory caches the field types so we don't have to calculate them each time we create a new Rows
func NewRowsFactory ¶
func NewRowsFactory(columnTypes []ColumnType) *RowsFactory
func (*RowsFactory) NewRows ¶
func (rf *RowsFactory) NewRows(capacity int) *Rows
type Schema ¶
type Schema struct { Name string // contains filtered or unexported fields }
func (*Schema) DeleteTable ¶
func (*Schema) GetAllTableInfos ¶
type SeqGenerator ¶
type SeqGenerator interface {
GenerateSequence() uint64
}
type SimpleQueryExec ¶
type SourceInfo ¶
func (*SourceInfo) String ¶
func (i *SourceInfo) String() string
type TableInfo ¶
type TableInfo struct { ID uint64 SchemaName string Name string PrimaryKeyCols []int ColumnNames []string ColumnTypes []ColumnType IndexInfos map[string]*IndexInfo ColsVisible []bool Internal bool // contains filtered or unexported fields }
func (*TableInfo) GetTableInfo ¶
func (*TableInfo) IsPrimaryKeyCol ¶
type Timestamp ¶
func KeyDecodeTimestamp ¶ added in v0.1.1
func NewTimestampFromGoTime ¶
func NewTimestampFromString ¶
NewTimestampFromString parses a Timestamp from a string in MySQL datetime format.
func ReadTimestampFromBuffer ¶
type TopicInfo ¶
type TopicInfo struct { BrokerName string TopicName string KeyEncoding KafkaEncoding ValueEncoding KafkaEncoding HeaderEncoding KafkaEncoding ColSelectors []selector.ColumnSelector Properties map[string]string IngestFilter string }