Documentation ¶
Index ¶
Constants ¶
const ( NilFlag byte = 0 NotNilFlag byte = 1 )
NilFlag and NotNilFlag are used to indicate whether a pointer/interface type field inside struct is nil or not. like a structure:
type MyStruct struct { a *OtherStruct }
Once a is nil, we should hash the NilFlag, otherwise, we should hash the NotNilFlag nil : [0] not nil : [1] [xxx] the NotNilFlag should not be missed, otherwise, once [xxx] is []byte{0}, it will be treated as nil.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Equals ¶
Equals is the interface for equality check. When we need to compare two objects when countering hash conflicts, we can use this interface to check whether they are equal.
type Hash64 ¶
type Hash64 interface { // Hash64 returns the uint64 digest of an object. Hash64(h Hasher) }
Hash64 is the interface for hashcode. It is used to calculate the lossy digest of an object to return uint64 rather than compacted bytes from cascaded operators bottom-up.
type HashEquals ¶
HashEquals is the interface for hash64 and equality check.
type Hasher ¶
type Hasher interface { HashBool(val bool) HashInt(val int) HashInt64(val int64) HashUint64(val uint64) HashFloat64(val float64) HashRune(val rune) HashString(val string) HashByte(val byte) HashBytes(val []byte) Reset() SetCache([]byte) Cache() []byte Sum64() uint64 }
Hasher is the interface for computing hash values of different types.
type Scheduler ¶
type Scheduler interface { // ExecuteTasks start the internal scheduling. ExecuteTasks() error // Destroy release the internal resource if any. Destroy() // PushTask is outside portal for inserting a new task in. task running can also trigger another successive task. PushTask(task Task) }
Scheduler is a scheduling interface defined for serializing(single thread)/concurrent(multi thread) running.
type Stack ¶
Stack is abstract definition of task container.(TaskStack is a kind of array stack implementation of it)
type Task ¶
type Task interface { // Execute task self executing logic Execute() error // Desc task self description string. Desc(w util.StrBufferWriter) }
Task is an interface defined for all type of optimizing work: exploring, implementing, deriving-stats, join-reordering and so on.