Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(args ...interface{})
- func DecodeFlags()
- func EncodeFlags()
- func Error(args ...interface{})
- func FilterAndAggRecords(querySpec *QuerySpec, recordsPtr *RecordList) int
- func GetVersionInfo() map[string]interface{}
- func ListTables() []string
- func LoadRowBlockCB(digestname string, records RecordList)
- func Max(x, y int64) int64
- func Min(x, y int64) int64
- func NewFalseFlag() *bool
- func NewTrueFlag() *bool
- func Print(args ...interface{})
- func PrintBytes(obj interface{})
- func PrintTables()
- func PrintVersionInfo()
- func RecoverLock(lock RecoverableLock) bool
- func RenameAndMod(src, dst string) error
- func SearchBlocks(querySpec *QuerySpec, block_list map[string]*TableBlock) map[string]*QuerySpec
- func UnloadTable(name string)
- func Warn(args ...interface{})
- type AfterLoadQueryCB
- type AfterRowBlockLoad
- type Aggregation
- type BasicHist
- func (h *BasicHist) AddValue(value int64)
- func (h *BasicHist) AddWeightedValue(value int64, weight int64)
- func (h *BasicHist) Combine(oh interface{})
- func (h *BasicHist) GetPercentiles() []int64
- func (h *BasicHist) GetSparseBuckets() map[int64]int64
- func (h *BasicHist) GetStdDev() float64
- func (h *BasicHist) GetStrBuckets() map[string]int64
- func (h *BasicHist) GetVariance() float64
- func (h *BasicHist) Print()
- func (h *BasicHist) SetupBuckets(buckets int, min, max int64)
- func (h *BasicHist) Sum() int64
- func (h *BasicHist) TrackPercentiles()
- type BasicHistCachedInfo
- type BlockLock
- type CacheLock
- type ColumnInfo
- type DigestLock
- type FileDecoder
- type FileEncoder
- type Filter
- type FilterSpec
- type FlagDefs
- type GobFileDecoder
- type GobFileEncoder
- type Grouping
- type HistCompat
- func (h *HistCompat) GetIntBuckets() map[int64]int64
- func (h *HistCompat) GetMeanVariance() float64
- func (hc *HistCompat) Max() int64
- func (h *HistCompat) Mean() float64
- func (hc *HistCompat) Min() int64
- func (hc *HistCompat) NewHist() Histogram
- func (h *HistCompat) Range() (int64, int64)
- func (h *HistCompat) StdDev() float64
- func (h *HistCompat) TotalCount() int64
- type Histogram
- type InfoLock
- type IntArr
- type IntField
- type IntFilter
- type IntInfo
- type IntInfoTable
- type KeyInfo
- type LoadSpec
- type Lock
- type MultiHist
- func (h *MultiHist) AddValue(value int64)
- func (h *MultiHist) AddWeightedValue(value int64, weight int64)
- func (h *MultiHist) Combine(oh interface{})
- func (h *MultiHist) GetMeanVariance() float64
- func (h *MultiHist) GetNonZeroBuckets() map[string]int64
- func (h *MultiHist) GetPercentiles() []int64
- func (h *MultiHist) GetSparseBuckets() map[int64]int64
- func (h *MultiHist) GetStdDev() float64
- func (h *MultiHist) GetStrBuckets() map[string]int64
- func (h *MultiHist) GetVariance() float64
- func (h *MultiHist) Print()
- func (h *MultiHist) Sum() int64
- func (h *MultiHist) TrackPercentiles()
- type MultiHistCompat
- func (h *MultiHistCompat) GetIntBuckets() map[int64]int64
- func (h *MultiHistCompat) GetMeanVariance() float64
- func (hc *MultiHistCompat) Max() int64
- func (h *MultiHistCompat) Mean() float64
- func (hc *MultiHistCompat) Min() int64
- func (hc *MultiHistCompat) NewHist() Histogram
- func (h *MultiHistCompat) Range() (int64, int64)
- func (h *MultiHistCompat) StdDev() float64
- func (h *MultiHistCompat) TotalCount() int64
- type NoFilter
- type NoProfile
- type NodeResults
- type OptionDefs
- type ProfilerStart
- type ProfilerStop
- type QueryParams
- type QueryResults
- type QuerySpec
- func CombineAndPrune(querySpec *QuerySpec, block_specs map[string]*QuerySpec) *QuerySpec
- func CombineResults(querySpec *QuerySpec, block_specs map[string]*QuerySpec) *QuerySpec
- func CopyQuerySpec(querySpec *QuerySpec) *QuerySpec
- func MultiCombineResults(querySpec *QuerySpec, block_specs map[string]*QuerySpec) *QuerySpec
- func (querySpec *QuerySpec) CalculateICC() map[string]float64
- func (qs *QuerySpec) GetCacheKey(blockname string) string
- func (querySpec *QuerySpec) GetCacheRelevantFilters(blockname string) []Filter
- func (qs *QuerySpec) GetCacheStruct(blockname string) QueryParams
- func (qs *QuerySpec) LoadCachedResults(blockname string) bool
- func (qs *QuerySpec) NewResult() *Result
- func (qs *QuerySpec) PrintResults()
- func (qs *QuerySpec) PruneResults(limit int)
- func (querySpec *QuerySpec) Punctuate()
- func (querySpec *QuerySpec) ResetResults()
- func (qs *QuerySpec) SaveCachedResults(blockname string)
- func (qs *QuerySpec) SortResults(orderBy string, orderAsc bool)
- type Record
- func (r *Record) AddIntField(name string, val int64)
- func (r *Record) AddSetField(name string, val []string)
- func (r *Record) AddStrField(name string, val string)
- func (r *Record) CopyRecord() *Record
- func (r *Record) GetIntVal(name string) (int, bool)
- func (r *Record) GetSetVal(name string) ([]string, bool)
- func (r *Record) GetStrVal(name string) (string, bool)
- func (r *Record) ResizeFields(length int16)
- type RecordList
- type RecoverableLock
- type Result
- type ResultJSON
- type ResultMap
- type RowSavedInt
- type RowSavedSet
- type RowSavedStr
- type Sample
- type SaveBlockChunkCB
- type SavedBlockCache
- type SavedColumnInfo
- type SavedIntBucket
- type SavedIntColumn
- type SavedIntInfo
- type SavedRecord
- type SavedRecordBlock
- type SavedSetBucket
- type SavedSetColumn
- type SavedStrBucket
- type SavedStrColumn
- type SavedStrInfo
- type SeparatedColumns
- type SetArr
- type SetField
- type SetFilter
- type SetMap
- type SortBlocksByEndTime
- type SortBlocksByTime
- type SortMatchedByCol
- type SortRecordsByTime
- type SortResultsByCol
- type SortStrsByCount
- type StrArr
- type StrField
- type StrFilter
- type StrInfo
- type StrInfoCol
- type StrInfoTable
- type StrReplace
- type Table
- func (t *Table) Aggregation(name string, op string) Aggregation
- func (t *Table) AppendRecordsToLog(records RecordList, blockname string)
- func (t *Table) ChunkAndSave()
- func (t *Table) CompactRecords()
- func (t *Table) DeduceTableInfoFromBlocks()
- func (t *Table) DigestRecords()
- func (t *Table) FillPartialBlock() bool
- func (t *Table) FindPartialBlocks() []*TableBlock
- func (t *Table) GetColumnType(v string) int8
- func (t *Table) GrabBlockLock(name string) bool
- func (t *Table) GrabCacheLock() bool
- func (t *Table) GrabDigestLock() bool
- func (t *Table) GrabInfoLock() bool
- func (t *Table) Grouping(name string) Grouping
- func (t *Table) HasFlagFile() bool
- func (t *Table) IngestRecords(blockname string)
- func (t *Table) IntFilter(name string, op string, value int) IntFilter
- func (t *Table) IsNotExist() bool
- func (t *Table) LoadAndQueryRecords(loadSpec *LoadSpec, querySpec *QuerySpec) int
- func (t *Table) LoadBlockCache()
- func (t *Table) LoadBlockFromDir(dirname string, loadSpec *LoadSpec, load_records bool) *TableBlock
- func (t *Table) LoadBlockInfo(dirname string) *SavedColumnInfo
- func (t *Table) LoadRecords(loadSpec *LoadSpec) int
- func (t *Table) LoadRecordsFromLog(filename string) RecordList
- func (t *Table) LoadRowStoreRecords(digest string, after_block_load_cb AfterRowBlockLoad)
- func (t *Table) LoadTableInfo() bool
- func (t *Table) LoadTableInfoFrom(filename string) bool
- func (t *Table) MakeDir()
- func (t *Table) MatchAndAggregate(querySpec *QuerySpec)
- func (t *Table) MaybeCompactRecords()
- func (t *Table) NewHist(info *IntInfo) Histogram
- func (t *Table) NewLoadSpec() LoadSpec
- func (t *Table) NewRecord() *Record
- func (t *Table) NewTDigestHist(info *IntInfo) Histogram
- func (t *Table) PrintRecord(r *Record)
- func (t *Table) PrintRecords(records RecordList)
- func (t *Table) PrintSamples(qs *QuerySpec)
- func (t *Table) PrintTableInfo()
- func (t *Table) ReadBlockInfoFromDir(dirname string) *SavedColumnInfo
- func (t *Table) ReleaseBlockLock(name string) bool
- func (t *Table) ReleaseCacheLock() bool
- func (t *Table) ReleaseDigestLock() bool
- func (t *Table) ReleaseInfoLock() bool
- func (t *Table) ReleaseRecords()
- func (t *Table) ResetBlockCache()
- func (t *Table) RestoreUningestedFiles()
- func (t *Table) SaveRecordsToBlock(records RecordList, filename string) bool
- func (t *Table) SaveRecordsToColumns() bool
- func (t *Table) SaveTableInfo(fname string)
- func (t *Table) SetFilter(name string, op string, value string) SetFilter
- func (t *Table) ShortenKeyTable()
- func (t *Table) ShouldCompactRowStore(digest string) bool
- func (t *Table) ShouldLoadBlockFromDir(dirname string, querySpec *QuerySpec) bool
- func (t *Table) StrFilter(name string, op string, value string) StrFilter
- func (t *Table) TableInfo() *TableInfo
- func (t *Table) TrimTable(trimSpec *TrimSpec) []*TableBlock
- func (t *Table) UseKeys(keys []string)
- func (t *Table) WriteBlockCache()
- func (t *Table) WriteQueryCache(to_cache_specs map[string]*QuerySpec)
- type TableBlock
- func (b *TableBlock) ExportBlockData()
- func (tb *TableBlock) GetColumnInfo(name_id int16) *TableColumn
- func (tb *TableBlock) RecycleSlab(loadSpec *LoadSpec)
- func (tb *TableBlock) SaveInfoToColumns(dirname string)
- func (tb *TableBlock) SaveIntsToColumns(dirname string, same_ints map[int16]ValueMap)
- func (tb *TableBlock) SaveSetsToColumns(dirname string, same_sets map[int16]ValueMap)
- func (tb *TableBlock) SaveStrsToColumns(dirname string, same_strs map[int16]ValueMap)
- func (tb *TableBlock) SaveToColumns(filename string) bool
- func (tb *TableBlock) SeparateRecordsIntoColumns() SeparatedColumns
- type TableColumn
- type TableInfo
- type TrimSpec
- type VTable
- type ValueMap
Constants ¶
const ( NO_OP = "" OP_AVG = "avg" OP_HIST = "hist" OP_DISTINCT = "distinct" )
const ( INT_VAL = iota STR_VAL = iota SET_VAL = iota )
const DISTINCT_STR = "distinct"
const FALSE = false
const HIST_STR = "hist"
const NUM_DISTINCT = "distinct-limit"
const SORT_COUNT = "$COUNT"
const TRUE = true
Variables ¶
var BLOCKS_PER_CACHE_FILE = 64
var BLOCK_VERSION = int32(1)
the BLOCK_VERSION is how we get hints about decoding blocks for backwards compatibility. at least, it will be in the future
var BREAK_MAP = make(map[string]int, 0)
var CACHE_DIR = "cache"
var CARDINALITY_THRESHOLD = 5000
After testing various cardinalities for timestamps, the optimal seems to be about 5000 (or even less) unique values. TODO: determine optimal for different sized integers other than timestamps
var CHUNKS_BEFORE_GC = 16
var CHUNK_SIZE = 1024 * 8 * 8
var CHUNK_THRESHOLD = CHUNK_SIZE / 8
var COPY_RECORD_INTERNS = false
var DEBUG_OUTLIERS = false
var DEBUG_RECORD_CONSISTENCY = false
var DEBUG_TIMING = false
var DELETE_BLOCKS = make([]string, 0)
var DELETE_BLOCKS_AFTER_QUERY = true
var EMPTY = ""
var ENABLE_LUA = false
var ENABLE_TDIGEST = false
var ENV_FLAG = os.Getenv("DEBUG")
extracted from and influenced by https://groups.google.com/forum/#!topic/golang-nuts/ct99dtK2Jo4 use env variable DEBUG=1 to turn on debug output
var FILE_DIGEST_THRESHOLD = 256
var FLAGS = FlagDefs{}
TODO: merge these two into one thing current problem is that FLAGS needs pointers
var FREE_MEM_AFTER = uint64(1024)
var GOB_GZIP_EXT = ".db.gz"
var GROUP_BY_WIDTH = 8 // bytes
var GROUP_DELIMITER = "\t"
var GZIP_EXT = ".gz"
var HIST_FACTOR_POW = uint(1)
var HOLD_MATCHES = false
var INGEST_DIR = "ingest"
var INTERNAL_RESULT_LIMIT = 100000
var KB = int64(1024)
var LOADED_TABLES = make(map[string]*Table)
var LOCK_TRIES = 50
var LOCK_US = time.Millisecond * 3
var MAX_LOCK_BREAKS = 5
var MAX_MEM = uint64(1024)
var MAX_ROW_STORE_TRIES = 20
var MIN_CUTOFF = 5 // need at least this many elements before we determine min/max
var MIN_FILES_TO_DIGEST = 0
var MISSING_VALUE = uint64(math.MaxUint64)
var NO_MORE_BLOCKS = GROUP_DELIMITER
var NULL_BLOCK = "NULL_BLOCK"
var NUM_BUCKETS = 1000
var OPTS = OptionDefs{}
var PROFILE *bool = &PROFILER_ENABLED
var PROFILER_ENABLED bool
var READ_ROWS_ONLY = false
var REGEX_CACHE_SIZE = 100000
var ROW_STORE_BLOCK = "ROW_STORE"
var RUN_PROFILER = func() ProfilerStop { return NoProfile{} }
var SIZE_DIGEST_THRESHOLD = int64(1024) * 2
var STD_CUTOFF = 1000.0 // if value is 1000 SDs away, we ignore it
var STOMACHE_DIR = "stomache"
var STOP_PROFILER = func() {
}
var TEMP_INGEST_DIR = ".ingest.temp"
var TEST_MODE = false
var TOP_STRING_COUNT = 20
var VERSION_STRING = "0.5.2"
Functions ¶
func DecodeFlags ¶ added in v0.5.0
func DecodeFlags()
func EncodeFlags ¶ added in v0.5.0
func EncodeFlags()
func FilterAndAggRecords ¶
func FilterAndAggRecords(querySpec *QuerySpec, recordsPtr *RecordList) int
func GetVersionInfo ¶ added in v0.2.0
func GetVersionInfo() map[string]interface{}
func ListTables ¶ added in v0.5.0
func ListTables() []string
func LoadRowBlockCB ¶
func LoadRowBlockCB(digestname string, records RecordList)
func NewFalseFlag ¶ added in v0.5.0
func NewFalseFlag() *bool
func NewTrueFlag ¶ added in v0.5.0
func NewTrueFlag() *bool
func PrintBytes ¶ added in v0.5.0
func PrintBytes(obj interface{})
func PrintTables ¶
func PrintTables()
func PrintVersionInfo ¶ added in v0.2.0
func PrintVersionInfo()
func RecoverLock ¶
func RecoverLock(lock RecoverableLock) bool
func RenameAndMod ¶ added in v0.2.0
TODO: We should really split this into two functions based on dir / file
func SearchBlocks ¶
func SearchBlocks(querySpec *QuerySpec, block_list map[string]*TableBlock) map[string]*QuerySpec
OLD SEARCHING FUNCTIONS BELOW HERE
Types ¶
type AfterLoadQueryCB ¶
type AfterLoadQueryCB struct {
// contains filtered or unexported fields
}
func (*AfterLoadQueryCB) CB ¶
func (cb *AfterLoadQueryCB) CB(digestname string, records RecordList)
type AfterRowBlockLoad ¶
type AfterRowBlockLoad func(string, RecordList)
type Aggregation ¶
type BasicHist ¶ added in v0.5.0
type BasicHist struct { BasicHistCachedInfo // contains filtered or unexported fields }
func (*BasicHist) AddWeightedValue ¶ added in v0.5.0
func (*BasicHist) GetPercentiles ¶ added in v0.5.0
func (*BasicHist) GetSparseBuckets ¶ added in v0.5.0
func (*BasicHist) GetStrBuckets ¶ added in v0.5.0
func (*BasicHist) GetVariance ¶ added in v0.5.0
VARIANCE is defined as the squared error from the mean
func (*BasicHist) SetupBuckets ¶ added in v0.5.0
func (*BasicHist) TrackPercentiles ¶ added in v0.5.0
func (h *BasicHist) TrackPercentiles()
type BasicHistCachedInfo ¶ added in v0.5.0
type ColumnInfo ¶ added in v0.5.2
type DigestLock ¶
type DigestLock struct {
Lock
}
func (*DigestLock) Recover ¶
func (l *DigestLock) Recover() bool
type FileDecoder ¶ added in v0.5.0
func GetFileDecoder ¶ added in v0.2.0
func GetFileDecoder(filename string) FileDecoder
type FileEncoder ¶ added in v0.5.0
func GetFileEncoder ¶ added in v0.5.0
func GetFileEncoder(filename string) FileEncoder
type Filter ¶
func BuildFilters ¶
func BuildFilters(t *Table, loadSpec *LoadSpec, filterSpec FilterSpec) []Filter
type FilterSpec ¶
This is the passed in flags
func (*FilterSpec) GetFilterCols ¶ added in v0.5.2
func (filterSpec *FilterSpec) GetFilterCols() []string
type FlagDefs ¶
type FlagDefs struct { OP string PRINT bool // print results out EXPORT bool // save records that match filter to tsv files LIST_TABLES bool // list the tables in the db dir // for usage with distributed queries DECODE_FLAGS bool // load query flags from stdin as gob encoded data ENCODE_FLAGS bool // print the query flags to stdout as binary ENCODE_RESULTS bool // print the querySpec results to stdout as binary INT_FILTERS string STR_FILTERS string STR_REPLACE string // regex replacement for strings SET_FILTERS string INTS string STRS string SETS string SAMPLE_COLS string GROUPS string DISTINCT string ADD_RECORDS int TIME bool TIME_COL string TIME_BUCKET int HIST_BUCKET int HDR_HIST bool LOG_HIST bool T_DIGEST bool FIELD_SEPARATOR string FILTER_SEPARATOR string PRINT_KEYS bool LOAD_AND_QUERY bool LOAD_THEN_QUERY bool READ_INGESTION_LOG bool READ_ROWSTORE bool SKIP_COMPACT bool SAVE_AS_SRB bool PROFILE bool PROFILE_MEM bool RECYCLE_MEM bool FAST_RECYCLE bool CACHED_QUERIES bool SHORTEN_KEY_TABLE bool WEIGHT_COL string LIMIT int NUM_DISTINCT int DEBUG bool JSON bool GC bool DIR string SORT string SORT_ASC bool PRUNE_BY string TABLE string PRINT_INFO bool SAMPLES bool UPDATE_TABLE_INFO bool SKIP_OUTLIERS bool }
type GobFileDecoder ¶ added in v0.5.0
func (GobFileDecoder) CloseFile ¶ added in v0.5.0
func (gfd GobFileDecoder) CloseFile() bool
type GobFileEncoder ¶ added in v0.5.0
func (GobFileEncoder) CloseFile ¶ added in v0.5.0
func (pb GobFileEncoder) CloseFile() bool
type HistCompat ¶ added in v0.5.0
type HistCompat struct {
*BasicHist
}
func (*HistCompat) GetIntBuckets ¶ added in v0.5.0
func (h *HistCompat) GetIntBuckets() map[int64]int64
func (*HistCompat) GetMeanVariance ¶ added in v0.5.0
func (h *HistCompat) GetMeanVariance() float64
func (*HistCompat) Max ¶ added in v0.5.0
func (hc *HistCompat) Max() int64
func (*HistCompat) Mean ¶ added in v0.5.0
func (h *HistCompat) Mean() float64
func (*HistCompat) Min ¶ added in v0.5.0
func (hc *HistCompat) Min() int64
func (*HistCompat) NewHist ¶ added in v0.5.0
func (hc *HistCompat) NewHist() Histogram
func (*HistCompat) Range ¶ added in v0.5.0
func (h *HistCompat) Range() (int64, int64)
func (*HistCompat) StdDev ¶ added in v0.5.0
func (h *HistCompat) StdDev() float64
func (*HistCompat) TotalCount ¶ added in v0.5.0
func (h *HistCompat) TotalCount() int64
type IntFilter ¶
type IntInfoTable ¶
type KeyInfo ¶ added in v0.5.2
type KeyInfo struct { Table *Table KeyTypes map[int16]int8 KeyTable map[string]int16 IntInfo IntInfoTable StrInfo StrInfoTable KeyExchange map[int16]int16 // the key exchange maps the original table's keytable -> new key table }
type LoadSpec ¶
type LoadSpec struct { LoadAllColumns bool // contains filtered or unexported fields }
func NewLoadSpec ¶
func NewLoadSpec() LoadSpec
type Lock ¶
func (*Lock) ForceDeleteFile ¶
func (l *Lock) ForceDeleteFile()
func (*Lock) ForceMakeFile ¶
type MultiHist ¶ added in v0.5.0
type MultiHist struct { Max int64 Min int64 Samples int Count int64 Avg float64 PercentileMode bool Subhists []*HistCompat Info *IntInfo // contains filtered or unexported fields }
func (*MultiHist) AddWeightedValue ¶ added in v0.5.0
func (*MultiHist) GetMeanVariance ¶ added in v0.5.0
func (*MultiHist) GetNonZeroBuckets ¶ added in v0.5.0
func (*MultiHist) GetPercentiles ¶ added in v0.5.0
func (*MultiHist) GetSparseBuckets ¶ added in v0.5.0
func (*MultiHist) GetStdDev ¶ added in v0.5.0
VARIANCE is defined as the squared error from the mean STD DEV is defined as sqrt(VARIANCE)
func (*MultiHist) GetStrBuckets ¶ added in v0.5.0
func (*MultiHist) GetVariance ¶ added in v0.5.0
func (*MultiHist) TrackPercentiles ¶ added in v0.5.0
func (h *MultiHist) TrackPercentiles()
type MultiHistCompat ¶ added in v0.5.0
func (*MultiHistCompat) GetIntBuckets ¶ added in v0.5.0
func (h *MultiHistCompat) GetIntBuckets() map[int64]int64
func (*MultiHistCompat) GetMeanVariance ¶ added in v0.5.0
func (h *MultiHistCompat) GetMeanVariance() float64
func (*MultiHistCompat) Max ¶ added in v0.5.0
func (hc *MultiHistCompat) Max() int64
func (*MultiHistCompat) Mean ¶ added in v0.5.0
func (h *MultiHistCompat) Mean() float64
func (*MultiHistCompat) Min ¶ added in v0.5.0
func (hc *MultiHistCompat) Min() int64
func (*MultiHistCompat) NewHist ¶ added in v0.5.0
func (hc *MultiHistCompat) NewHist() Histogram
func (*MultiHistCompat) Range ¶ added in v0.5.0
func (h *MultiHistCompat) Range() (int64, int64)
func (*MultiHistCompat) StdDev ¶ added in v0.5.0
func (h *MultiHistCompat) StdDev() float64
func (*MultiHistCompat) TotalCount ¶ added in v0.5.0
func (h *MultiHistCompat) TotalCount() int64
type NoProfile ¶
type NoProfile struct{}
func (NoProfile) Start ¶
func (p NoProfile) Start() ProfilerStart
type NodeResults ¶ added in v0.5.0
type OptionDefs ¶
type ProfilerStart ¶
type ProfilerStart interface {
Stop()
}
type ProfilerStop ¶
type ProfilerStop interface {
Start() ProfilerStart
}
type QueryResults ¶ added in v0.5.0
type QueryResults savedQueryResults
type QuerySpec ¶
type QuerySpec struct { QueryParams QueryResults BlockList map[string]TableBlock Table *Table }
func CombineAndPrune ¶ added in v0.5.0
func CombineResults ¶
func CopyQuerySpec ¶
func MultiCombineResults ¶ added in v0.5.0
func (*QuerySpec) CalculateICC ¶
to calculate SSW and SSB, we do: SSW = sum of squares within groups. Take each group and calculate its variance, then add all those variances together SSB = sum of square between groups. Take each group's averages and calculate their variance against the overall average.
func (*QuerySpec) GetCacheKey ¶ added in v0.5.0
func (*QuerySpec) GetCacheRelevantFilters ¶ added in v0.5.0
for a per block query cache, we exclude any trivial filters (that are true for all records in the block) when creating our cache key
func (*QuerySpec) GetCacheStruct ¶ added in v0.5.0
func (qs *QuerySpec) GetCacheStruct(blockname string) QueryParams
func (*QuerySpec) LoadCachedResults ¶ added in v0.5.0
func (*QuerySpec) PrintResults ¶
func (qs *QuerySpec) PrintResults()
func (*QuerySpec) PruneResults ¶ added in v0.5.0
func (*QuerySpec) ResetResults ¶
func (querySpec *QuerySpec) ResetResults()
func (*QuerySpec) SaveCachedResults ¶ added in v0.5.0
func (*QuerySpec) SortResults ¶ added in v0.5.0
type Record ¶
type Record struct { Strs []StrField Ints []IntField SetMap map[int16]SetField Populated []int8 Timestamp int64 // contains filtered or unexported fields }
func (*Record) AddIntField ¶
func (*Record) AddSetField ¶
func (*Record) AddStrField ¶
func (*Record) CopyRecord ¶
func (*Record) ResizeFields ¶
type RecordList ¶
type RecordList []*Record
Before we save the new record list in a table, we tend to sort by time
func CombineMatches ¶
func CombineMatches(block_specs map[string]*QuerySpec) RecordList
func (RecordList) Len ¶
func (a RecordList) Len() int
func (RecordList) ResetRecords ¶ added in v0.2.0
func (rl RecordList) ResetRecords(tb *TableBlock)
recycle allocated records between blocks that means we need a wash and rinse cycle we can re-use blocks if:
same loadSpec table is the same NumRecords are the same
to do so,
we clean out the different arrays inside a block re-home the record list into the table block
func (RecordList) Swap ¶
func (a RecordList) Swap(i, j int)
type RecoverableLock ¶
Every LockFile should have a recovery plan
type Result ¶
type ResultJSON ¶
type ResultJSON map[string]interface{}
type RowSavedInt ¶
type RowSavedSet ¶
type RowSavedStr ¶
type SaveBlockChunkCB ¶
type SaveBlockChunkCB struct {
// contains filtered or unexported fields
}
func (*SaveBlockChunkCB) CB ¶
func (cb *SaveBlockChunkCB) CB(digestname string, records RecordList)
type SavedBlockCache ¶ added in v0.2.0
type SavedBlockCache map[string]*SavedColumnInfo
type SavedColumnInfo ¶
type SavedColumnInfo struct { NumRecords int32 StrInfoMap SavedStrInfo IntInfoMap SavedIntInfo }
type SavedIntBucket ¶
type SavedIntColumn ¶
type SavedIntColumn struct { Name string DeltaEncodedIDs bool ValueEncoded bool BucketEncoded bool Bins []SavedIntBucket Values []int64 VERSION int32 }
func NewSavedIntColumn ¶
func NewSavedIntColumn() SavedIntColumn
type SavedIntInfo ¶
type SavedRecord ¶
type SavedRecord struct { Ints []RowSavedInt Strs []RowSavedStr Sets []RowSavedSet }
type SavedRecordBlock ¶ added in v0.5.2
type SavedRecordBlock struct { RecordList []*SavedRecord KeyTable *map[string]int16 // contains filtered or unexported fields }
type SavedSetBucket ¶
type SavedSetColumn ¶
type SavedSetColumn struct { Name string Bins []SavedSetBucket Values [][]int32 StringTable []string DeltaEncodedIDs bool BucketEncoded bool VERSION int32 }
func NewSavedSetColumn ¶
func NewSavedSetColumn() SavedSetColumn
type SavedStrBucket ¶
type SavedStrColumn ¶
type SavedStrColumn struct { Name string DeltaEncodedIDs bool BucketEncoded bool Bins []SavedStrBucket Values []int32 StringTable []string VERSION int32 }
func NewSavedStrColumn ¶
func NewSavedStrColumn() SavedStrColumn
type SavedStrInfo ¶
type SeparatedColumns ¶
type SeparatedColumns struct {
// contains filtered or unexported fields
}
type SetFilter ¶
type SortBlocksByEndTime ¶
type SortBlocksByEndTime []*TableBlock
func (SortBlocksByEndTime) Len ¶
func (a SortBlocksByEndTime) Len() int
func (SortBlocksByEndTime) Less ¶
func (a SortBlocksByEndTime) Less(i, j int) bool
func (SortBlocksByEndTime) Swap ¶
func (a SortBlocksByEndTime) Swap(i, j int)
type SortBlocksByTime ¶
type SortBlocksByTime []*TableBlock
func (SortBlocksByTime) Len ¶
func (a SortBlocksByTime) Len() int
func (SortBlocksByTime) Less ¶
func (a SortBlocksByTime) Less(i, j int) bool
func (SortBlocksByTime) Swap ¶
func (a SortBlocksByTime) Swap(i, j int)
type SortMatchedByCol ¶ added in v0.5.2
func (SortMatchedByCol) Len ¶ added in v0.5.2
func (a SortMatchedByCol) Len() int
func (SortMatchedByCol) Less ¶ added in v0.5.2
func (a SortMatchedByCol) Less(i, j int) bool
This sorts the records in descending order
func (SortMatchedByCol) Swap ¶ added in v0.5.2
func (a SortMatchedByCol) Swap(i, j int)
type SortRecordsByTime ¶
type SortRecordsByTime struct {
RecordList
}
func (SortRecordsByTime) Less ¶
func (a SortRecordsByTime) Less(i, j int) bool
type SortResultsByCol ¶
func (SortResultsByCol) Len ¶
func (a SortResultsByCol) Len() int
func (SortResultsByCol) Less ¶
func (a SortResultsByCol) Less(i, j int) bool
This sorts the records in descending order
func (SortResultsByCol) Swap ¶
func (a SortResultsByCol) Swap(i, j int)
type SortStrsByCount ¶
type SortStrsByCount []StrInfoCol
func (SortStrsByCount) Len ¶
func (a SortStrsByCount) Len() int
func (SortStrsByCount) Less ¶
func (a SortStrsByCount) Less(i, j int) bool
func (SortStrsByCount) Swap ¶
func (a SortStrsByCount) Swap(i, j int)
type StrFilter ¶
type StrInfo ¶
StrInfo and IntInfo contains interesting tidbits about columns they also get serialized to disk in the block's info.db
type StrInfoCol ¶
type StrInfoTable ¶
type StrReplace ¶
type Table ¶
type Table struct { Name string BlockList map[string]*TableBlock KeyTable map[string]int16 // String Key Names KeyTypes map[int16]int8 ShortKeyInfo *KeyInfo // Keys that we will be using during a query AllKeyInfo *KeyInfo // The original table KeyInfo before key shortening // Need to keep track of the last block we've used, right? LastBlock TableBlock RowBlock *TableBlock StrInfo StrInfoTable IntInfo IntInfoTable BlockInfoCache map[string]*SavedColumnInfo NewBlockInfos []string // contains filtered or unexported fields }
func (*Table) Aggregation ¶
func (t *Table) Aggregation(name string, op string) Aggregation
func (*Table) AppendRecordsToLog ¶
func (t *Table) AppendRecordsToLog(records RecordList, blockname string)
func (*Table) ChunkAndSave ¶
func (t *Table) ChunkAndSave()
func (*Table) CompactRecords ¶ added in v0.2.0
func (t *Table) CompactRecords()
TODO: figure out how often we actually do a collation check by storing last collation inside a file somewhere
func (*Table) DeduceTableInfoFromBlocks ¶
func (t *Table) DeduceTableInfoFromBlocks()
Alright, so... I accidentally broke my info.db file How can I go about loading the TableInfo based off the blocks? I think I go through each block and load the block, verifying the different column types
func (*Table) DigestRecords ¶
func (t *Table) DigestRecords()
Go through rowstore and save records out to column store
func (*Table) FillPartialBlock ¶
TODO: find any open blocks and then fill them...
func (*Table) FindPartialBlocks ¶
func (t *Table) FindPartialBlocks() []*TableBlock
func (*Table) GetColumnType ¶
func (*Table) GrabBlockLock ¶
func (*Table) GrabCacheLock ¶ added in v0.2.0
func (*Table) GrabDigestLock ¶
func (*Table) GrabInfoLock ¶
func (*Table) HasFlagFile ¶
func (*Table) IngestRecords ¶
Go through newRecords list and save all the new records out to a row store
func (*Table) IsNotExist ¶ added in v0.2.0
func (*Table) LoadAndQueryRecords ¶
func (*Table) LoadBlockCache ¶ added in v0.2.0
func (t *Table) LoadBlockCache()
func (*Table) LoadBlockFromDir ¶
func (t *Table) LoadBlockFromDir(dirname string, loadSpec *LoadSpec, load_records bool) *TableBlock
TODO: have this only pull the blocks into column format and not materialize the columns immediately
func (*Table) LoadBlockInfo ¶ added in v0.2.0
func (t *Table) LoadBlockInfo(dirname string) *SavedColumnInfo
func (*Table) LoadRecords ¶
func (*Table) LoadRecordsFromLog ¶
func (t *Table) LoadRecordsFromLog(filename string) RecordList
func (*Table) LoadRowStoreRecords ¶
func (t *Table) LoadRowStoreRecords(digest string, after_block_load_cb AfterRowBlockLoad)
func (*Table) LoadTableInfo ¶
func (*Table) LoadTableInfoFrom ¶
func (*Table) MatchAndAggregate ¶
func (*Table) MaybeCompactRecords ¶
func (t *Table) MaybeCompactRecords()
we compact if: we have over X files we have over X megabytes of data remember, there is no reason to actually read the data off disk until we decide to compact
func (*Table) NewLoadSpec ¶
func (*Table) NewTDigestHist ¶ added in v0.5.2
func (*Table) PrintRecord ¶
func (*Table) PrintRecords ¶
func (t *Table) PrintRecords(records RecordList)
func (*Table) PrintSamples ¶
func (*Table) PrintTableInfo ¶ added in v0.5.2
func (t *Table) PrintTableInfo()
func (*Table) ReadBlockInfoFromDir ¶
func (t *Table) ReadBlockInfoFromDir(dirname string) *SavedColumnInfo
TODO: have this only pull the blocks into column format and not materialize the columns immediately
func (*Table) ReleaseBlockLock ¶
func (*Table) ReleaseCacheLock ¶ added in v0.2.0
func (*Table) ReleaseDigestLock ¶
func (*Table) ReleaseInfoLock ¶
func (*Table) ReleaseRecords ¶
func (t *Table) ReleaseRecords()
Remove our pointer to the blocklist so a GC is triggered and a bunch of new memory becomes available
func (*Table) ResetBlockCache ¶ added in v0.2.0
func (t *Table) ResetBlockCache()
func (*Table) RestoreUningestedFiles ¶
func (t *Table) RestoreUningestedFiles()
func (*Table) SaveRecordsToBlock ¶
func (t *Table) SaveRecordsToBlock(records RecordList, filename string) bool
func (*Table) SaveRecordsToColumns ¶
func (*Table) SaveTableInfo ¶
func (*Table) ShortenKeyTable ¶ added in v0.5.2
func (t *Table) ShortenKeyTable()
func (*Table) ShouldCompactRowStore ¶ added in v0.2.0
func (*Table) ShouldLoadBlockFromDir ¶
optimizing for integer pre-cached info
func (*Table) TrimTable ¶
func (t *Table) TrimTable(trimSpec *TrimSpec) []*TableBlock
List all the blocks that should be trimmed to keep the table within it's memory limits
func (*Table) WriteBlockCache ¶ added in v0.2.0
func (t *Table) WriteBlockCache()
func (*Table) WriteQueryCache ¶ added in v0.5.0
type TableBlock ¶
type TableBlock struct { Name string RecordList RecordList Info *SavedColumnInfo Size int64 Matched RecordList IntInfo IntInfoTable StrInfo StrInfoTable // contains filtered or unexported fields }
Table Block should have a bunch of metadata next to it, too
func (*TableBlock) ExportBlockData ¶ added in v0.2.0
func (b *TableBlock) ExportBlockData()
func (*TableBlock) GetColumnInfo ¶
func (tb *TableBlock) GetColumnInfo(name_id int16) *TableColumn
func (*TableBlock) RecycleSlab ¶ added in v0.2.0
func (tb *TableBlock) RecycleSlab(loadSpec *LoadSpec)
func (*TableBlock) SaveInfoToColumns ¶
func (tb *TableBlock) SaveInfoToColumns(dirname string)
func (*TableBlock) SaveIntsToColumns ¶
func (tb *TableBlock) SaveIntsToColumns(dirname string, same_ints map[int16]ValueMap)
func (*TableBlock) SaveSetsToColumns ¶
func (tb *TableBlock) SaveSetsToColumns(dirname string, same_sets map[int16]ValueMap)
func (*TableBlock) SaveStrsToColumns ¶
func (tb *TableBlock) SaveStrsToColumns(dirname string, same_strs map[int16]ValueMap)
func (*TableBlock) SaveToColumns ¶
func (tb *TableBlock) SaveToColumns(filename string) bool
func (*TableBlock) SeparateRecordsIntoColumns ¶
func (tb *TableBlock) SeparateRecordsIntoColumns() SeparatedColumns
type TableColumn ¶
type TableInfo ¶ added in v0.5.2
type TableInfo struct { Count int64 `json:"count"` Size int64 `json:"storageSize"` AverageObjectSize float64 `json:"avgObjSize"` Columns ColumnInfo `json:"columns"` }
type VTable ¶ added in v0.5.0
func (*VTable) AggregateInfo ¶ added in v0.5.0
func (*VTable) AggregateSamples ¶ added in v0.5.0
func (*VTable) AggregateSpecs ¶ added in v0.5.0
func (*VTable) AggregateTables ¶ added in v0.5.0
func (*VTable) StitchResults ¶ added in v0.5.0
Source Files ¶
- aggregate.go
- column_store.go
- column_store_io.go
- config.go
- debug.go
- file_decoder.go
- file_encoder.go
- file_utils.go
- filter.go
- hist.go
- hist_basic.go
- hist_compat.go
- hist_multi.go
- hist_tdigest_disabled.go
- node_aggregator.go
- printer.go
- profiler.go
- profiler_disable.go
- query_cache.go
- query_spec.go
- record.go
- record_fields.go
- record_slab.go
- row_store.go
- shorten_key_table.go
- stats.go
- table.go
- table_block.go
- table_block_io.go
- table_block_sort.go
- table_column.go
- table_column_info.go
- table_ingest.go
- table_io.go
- table_load_spec.go
- table_lock.go
- table_query.go
- table_recover_info.go
- table_trim.go
- version.go