Documentation
¶
Index ¶
- Constants
- Variables
- type ColumnRef
- type FieldRef
- func (f *FieldRef) Equals(rhs *FieldRef) bool
- func (f *FieldRef) IsNegativeInfinity() bool
- func (f *FieldRef) IsNull() bool
- func (f *FieldRef) IsPositiveInfinity() bool
- func (f *FieldRef) Less(rhs *FieldRef) bool
- func (f *FieldRef) Set(cols []*ColumnRef, column, row int)
- func (f *FieldRef) SetNegativeInfinity()
- func (f *FieldRef) SetPositiveInfinity()
- type FunctionBase
- type IndexProperty
- type IndexReader
- type IndexReaderImpl
- type IndexWriter
- type IndexWriterImpl
- type KeyCondition
- type KeyConditionImpl
- func (kc *KeyConditionImpl) CanDoBinarySearch() bool
- func (kc *KeyConditionImpl) CheckInRange(rgs []*Range, dataTypes []int) (Mark, error)
- func (kc *KeyConditionImpl) GetMaxKeyIndex() int
- func (kc *KeyConditionImpl) GetRPN() []*RPNElement
- func (kc *KeyConditionImpl) HavePrimaryKey() bool
- func (kc *KeyConditionImpl) IsFirstPrimaryKey() bool
- func (kc *KeyConditionImpl) MayBeInRange(usedKeySize int, leftKeys []*FieldRef, rightKeys []*FieldRef, dataTypes []int) (bool, error)
- func (kc *KeyConditionImpl) SetRPN(rpn []*RPNElement)
- type Mark
- type RPNElement
- type Range
- type SetIndex
Constants ¶
const Continuous = "continuous"
const Empty = "empty"
Variables ¶
var ConsiderOnlyBeTrue = NewMark(false, true)
var ( // InitIndexFragmentFixedSize means that each fragment is fixed in size except the last fragment. InitIndexFragmentFixedSize = true )
var NEGATIVE_INFINITY = &FieldRef{row: math.MinInt64}
var POSITIVE_INFINITY = &FieldRef{row: math.MaxInt64}
Functions ¶
This section is empty.
Types ¶
type FieldRef ¶
type FieldRef struct {
// contains filtered or unexported fields
}
func (*FieldRef) IsNegativeInfinity ¶
func (*FieldRef) IsPositiveInfinity ¶
func (*FieldRef) SetNegativeInfinity ¶
func (f *FieldRef) SetNegativeInfinity()
func (*FieldRef) SetPositiveInfinity ¶
func (f *FieldRef) SetPositiveInfinity()
type FunctionBase ¶
type FunctionBase struct {
}
type IndexProperty ¶
func NewIndexProperty ¶
func NewIndexProperty(rowsNumPerFragment, coarseIndexFragment, minRowsForSeek int) *IndexProperty
type IndexReader ¶
type IndexReader interface {
Scan(pkFile string,
pkRec *record.Record,
pkMark fragment.IndexFragment,
keyCondition KeyCondition,
) (fragment.FragmentRanges, error)
Close() error
}
type IndexReaderImpl ¶
type IndexReaderImpl struct {
// contains filtered or unexported fields
}
func NewIndexReader ¶
func NewIndexReader(rowsNumPerFragment int, coarseIndexFragment int, minRowsForSeek int) *IndexReaderImpl
func (*IndexReaderImpl) Close ¶
func (s *IndexReaderImpl) Close() error
func (*IndexReaderImpl) Scan ¶
func (s *IndexReaderImpl) Scan( pkFile string, pkRec *record.Record, pkMark fragment.IndexFragment, keyCondition KeyCondition, ) (fragment.FragmentRanges, error)
Scan is used to filter fragment ranges based on the primary key in the condition, and it determines whether to do binary search or exclusion search according to the sequence of keys in the primary key. give a specific example to illustrate the usage of scan.
origin record: x -> [1, 2, 1, 2, 1, 2, 2, 1] y -> [1, 1, 3, 4, 2, 2, 3, 4]
sorted record(sorted by x, y): x -> [1, 1, 1, 1, 2, 2, 2, 2] y -> [1, 2, 3, 4, 1, 2, 3, 4]
primary index record(fragment size is 2): x -> [1, 1, 2, 2, 2] y -> [1, 3, 1, 3, 4] fragment index -> [0, 1, 2, 3]
key condition: x > 1 and y < 3
scan results: fragment range -> [1, 3)
type IndexWriter ¶
type IndexWriterImpl ¶
type IndexWriterImpl struct {
}
func NewIndexWriter ¶
func NewIndexWriter() *IndexWriterImpl
func (*IndexWriterImpl) Close ¶
func (w *IndexWriterImpl) Close() error
func (*IndexWriterImpl) CreatePrimaryIndex ¶
func (w *IndexWriterImpl) CreatePrimaryIndex( srcRec *record.Record, pkSchema record.Schemas, rowsNumPerFragment int, tcLocation int8, ) ( *record.Record, fragment.IndexFragment, error, )
CretePrimaryIndex generates sparse primary index based on sorted data to be flushed to disks.
type KeyCondition ¶
type KeyConditionImpl ¶
type KeyConditionImpl struct {
// contains filtered or unexported fields
}
func NewKeyCondition ¶
func (*KeyConditionImpl) CanDoBinarySearch ¶
func (kc *KeyConditionImpl) CanDoBinarySearch() bool
func (*KeyConditionImpl) CheckInRange ¶
func (kc *KeyConditionImpl) CheckInRange( rgs []*Range, dataTypes []int, ) (Mark, error)
CheckInRange check Whether the condition and its negation are feasible in the direct product of single column ranges specified by hyper-rectangle.
func (*KeyConditionImpl) GetMaxKeyIndex ¶
func (kc *KeyConditionImpl) GetMaxKeyIndex() int
func (*KeyConditionImpl) GetRPN ¶
func (kc *KeyConditionImpl) GetRPN() []*RPNElement
func (*KeyConditionImpl) HavePrimaryKey ¶
func (kc *KeyConditionImpl) HavePrimaryKey() bool
func (*KeyConditionImpl) IsFirstPrimaryKey ¶
func (kc *KeyConditionImpl) IsFirstPrimaryKey() bool
func (*KeyConditionImpl) MayBeInRange ¶
func (kc *KeyConditionImpl) MayBeInRange( usedKeySize int, leftKeys []*FieldRef, rightKeys []*FieldRef, dataTypes []int, ) (bool, error)
MayBeInRange is used to check whether the condition is likely to be in the target range.
func (*KeyConditionImpl) SetRPN ¶
func (kc *KeyConditionImpl) SetRPN(rpn []*RPNElement)
type Mark ¶
type Mark struct {
// contains filtered or unexported fields
}
Mark these special constants are used to implement KeyCondition. When used as an initial_mask argument in KeyCondition.CheckInRange methods, they effectively prevent calculation of discarded Mark component as it is already set to true.
type RPNElement ¶
type RPNElement struct {
// contains filtered or unexported fields
}
RPNElement means that Reverse Polish notation (RPN) is a method for conveying mathematical expressions without the use of separators such as brackets and parentheses. In this notation, the operators follow their operands, hence removing the need for brackets to define evaluation priority. More details: https://en.wikipedia.org/wiki/Reverse_Polish_notation.