Documentation ¶
Overview ¶
Package matrix abstracts the source data as Plane, and then pixelates it into a matrix for display on the front end.
Index ¶
- func CheckPartOf(src, part []string)
- func CheckReduceOf(src, part []string)
- func GetLastKey(keys []string) string
- func KeysRange(keys []string, startKey string, endKey string) (start, end int, ok bool)
- func MakeKeys(keySet map[string]struct{}) []string
- func MakeKeysWithUnlimitedEnd(keySet map[string]struct{}) []string
- func Max(a, b int) int
- func MemsetInt(slice []int, v int)
- func MemsetUint64(slice []uint64, v uint64)
- func Min(a, b int) int
- type Axis
- type FocusMode
- type KeyMap
- type Matrix
- type Plane
- type SplitStrategy
- type Splitter
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPartOf ¶
func CheckPartOf(src, part []string)
CheckPartOf checks that part keys are a subset of src keys.
func CheckReduceOf ¶
func CheckReduceOf(src, part []string)
CheckReduceOf checks that part keys are a subset of src keys and have the same StartKey and EndKey.
func MakeKeysWithUnlimitedEnd ¶
MakeKeysWithUnlimitedEnd uses a key set to build a new Key-Axis, then add a "" to the keys, indicating that the last bucket has an unlimited end.
func MemsetUint64 ¶
MemsetUint64 sets all elements of the uint64 slice to v.
Types ¶
type Axis ¶
Axis stores consecutive buckets. Each bucket has StartKey, EndKey, and some statistics. The EndKey of each bucket is the StartKey of its next bucket. The actual data structure is stored in columns. Therefore satisfies: len(Keys) == len(ValuesList[i]) + 1. In particular, ValuesList[0] is the base column.
func CreateAxis ¶
CreateAxis checks the given parameters and uses them to build the Axis.
func CreateEmptyAxis ¶
CreateEmptyAxis constructs a minimal empty Axis with the given parameters.
func (*Axis) Divide ¶
Divide uses the base column as the chunk for the Divide operation to obtain the partitioning scheme, and uses this to reduce other columns.
func (*Axis) Focus ¶
Focus uses the base column as the chunk for the Focus operation to obtain the partitioning scheme, and uses this to reduce other columns.
type Matrix ¶
type Matrix struct { Keys []string `json:"-"` DataMap map[string][][]uint64 `json:"data" binding:"required"` KeyAxis []decorator.LabelKey `json:"keyAxis" binding:"required"` TimeAxis []int64 `json:"timeAxis" binding:"required"` }
Matrix is the front end displays the required data.
type Plane ¶
Plane stores consecutive axes. Each axis has StartTime, EndTime. The EndTime of each axis is the StartTime of its next axis. Therefore satisfies: len(Times) == len(Axes) + 1.
func CreateEmptyPlane ¶
func CreateEmptyPlane(startTime, endTime time.Time, startKey, endKey string, valuesListLen int) Plane
CreateEmptyPlane constructs a minimal empty Plane with the given parameters.
func CreatePlane ¶
CreatePlane checks the given parameters and uses them to build the Plane.
func (*Plane) Compact ¶
func (plane *Plane) Compact(strategy SplitStrategy) Axis
Compact compacts Plane into an axis.
type SplitStrategy ¶
SplitStrategy is an allocation scheme. It is used to generate a Splitter for a plane to split a chunk of columns.
func AverageSplitStrategy ¶
func AverageSplitStrategy() SplitStrategy
AverageSplitStrategy adopts the strategy of equal distribution when buckets are split.
func DistanceSplitStrategy ¶
type Splitter ¶
type Splitter interface { // Split a chunk of columns. Split(dst, src chunk, tag splitTag, axesIndex int) }
type Strategy ¶
type Strategy struct { decorator.LabelStrategy SplitStrategy }
Strategy is part of the customizable strategy in Matrix generation.