metadata

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var END_MERGE_SCRIPT []byte
View Source
var GET_MERGE_PLAN_SCRIPT []byte
View Source
var SCRIPT_PATCH_INDEX []byte

Functions

This section is empty.

Types

type DBIndex

type DBIndex interface {
	Databases() ([]string, error)
	Tables(database string) ([]string, error)
	Paths(database string, table string) ([]string, error)
}

func NewRedisDbIndex

func NewRedisDbIndex(URL string) (DBIndex, error)

type IndexEntry

type IndexEntry struct {
	Layer     string         `json:"layer"`
	Database  string         `json:"database"`
	Table     string         `json:"table"`
	Path      string         `json:"path"`
	SizeBytes int64          `json:"size_bytes"`
	RowCount  int64          `json:"row_count"`
	ChunkTime int64          `json:"chunk_time"`
	Min       map[string]any `json:"min"`
	Max       map[string]any `json:"max"`
	MinTime   int64          `json:"min_time"`
	MaxTime   int64          `json:"max_time"`
}

type JSONIndex

type JSONIndex struct {
	// contains filtered or unexported fields
}

func (*JSONIndex) Batch

func (J *JSONIndex) Batch(add []*IndexEntry, rm []*IndexEntry) Promise[int32]

func (*JSONIndex) EndMerge

func (J *JSONIndex) EndMerge(plan *MergePlan) error

func (*JSONIndex) Get

func (J *JSONIndex) Get(_path string) *IndexEntry

func (*JSONIndex) GetDropQueue

func (J *JSONIndex) GetDropQueue() []string

func (*JSONIndex) GetMergePlan

func (J *JSONIndex) GetMergePlan(layer string, iteration int) (*MergePlan, error)

func (*JSONIndex) GetMergePlanner

func (J *JSONIndex) GetMergePlanner() TableMergePlanner

func (*JSONIndex) GetQuerier

func (J *JSONIndex) GetQuerier() TableQuerier

func (*JSONIndex) Query

func (J *JSONIndex) Query(options QueryOptions) ([]*IndexEntry, error)

func (*JSONIndex) RmFromDropQueue

func (J *JSONIndex) RmFromDropQueue(files []string) Promise[int32]

func (*JSONIndex) Run

func (J *JSONIndex) Run()

func (*JSONIndex) Stop

func (J *JSONIndex) Stop()

type MergeConfigurationsConf

type MergeConfigurationsConf [][3]int64

MergeConfiguration is array of arrays of: [[timeout_sec, max_size, merge_iteration_id], ...] You have to init MergeConfigurations in the very beginning

var MergeConfigurations MergeConfigurationsConf

type MergePlan

type MergePlan struct {
	ID        string
	Layer     string
	Database  string
	Table     string
	From      []string
	To        string
	Iteration int
}

type Promise

type Promise[T any] interface {
	Get() (T, error)
	Peek() (int32, T, error)
	Done(res T, err error)
}

func Fulfilled

func Fulfilled[T any](err error, res T) Promise[T]

func NewPromise

func NewPromise[T any]() Promise[T]

func NewWaitForAll

func NewWaitForAll[T any](promises []Promise[T]) Promise[T]

type QEntry

type QEntry struct {
	Path  string `json:"path"`
	TimeS int32  `json:"time"`
}

type QueryOptions

type QueryOptions struct {
	Folder    string
	After     time.Time
	Before    time.Time
	Iteration int
}

type RedisIndex

type RedisIndex struct {
	// contains filtered or unexported fields
}

func (*RedisIndex) AddToDropQueue

func (r *RedisIndex) AddToDropQueue(files []string) Promise[int32]

func (*RedisIndex) Batch

func (r *RedisIndex) Batch(add []*IndexEntry, rm []*IndexEntry) Promise[int32]

func (*RedisIndex) EndMerge

func (r *RedisIndex) EndMerge(plan *MergePlan) error

func (*RedisIndex) Get

func (r *RedisIndex) Get(path string) *IndexEntry

func (*RedisIndex) GetDropQueue

func (r *RedisIndex) GetDropQueue() []string

func (*RedisIndex) GetMergePlan

func (r *RedisIndex) GetMergePlan(layer string, iteration int) (*MergePlan, error)

func (*RedisIndex) GetMergePlanner

func (r *RedisIndex) GetMergePlanner() TableMergePlanner

func (*RedisIndex) GetQuerier

func (r *RedisIndex) GetQuerier() TableQuerier

func (*RedisIndex) Query

func (r *RedisIndex) Query(options QueryOptions) ([]*IndexEntry, error)

func (*RedisIndex) RmFromDropQueue

func (r *RedisIndex) RmFromDropQueue(files []string) Promise[int32]

func (*RedisIndex) Run

func (r *RedisIndex) Run()

func (*RedisIndex) Stop

func (r *RedisIndex) Stop()

type SinglePromise

type SinglePromise[T any] struct {
	// contains filtered or unexported fields
}

func (*SinglePromise[T]) Done

func (p *SinglePromise[T]) Done(res T, err error)

func (*SinglePromise[T]) Get

func (p *SinglePromise[T]) Get() (T, error)

func (*SinglePromise[T]) Peek

func (p *SinglePromise[T]) Peek() (int32, T, error)

type TableIndex

type TableIndex interface {
	Batch(add []*IndexEntry, rm []*IndexEntry) Promise[int32]
	Get(path string) *IndexEntry
	Run()
	Stop()
	RmFromDropQueue(files []string) Promise[int32]
	GetDropQueue() []string
	GetMergePlanner() TableMergePlanner
	GetQuerier() TableQuerier
}

func NewJSONIndex

func NewJSONIndex(root string, database string, table string) TableIndex

func NewRedisIndex

func NewRedisIndex(URL string, database string, table string) (TableIndex, error)

type TableMergePlanner added in v0.0.2

type TableMergePlanner interface {
	GetMergePlan(layer string, iteration int) (*MergePlan, error)
	EndMerge(plan *MergePlan) error
}

type TableQuerier added in v0.0.2

type TableQuerier interface {
	Query(options QueryOptions) ([]*IndexEntry, error)
}

type WaitForAllPromise

type WaitForAllPromise[T any] struct {
	// contains filtered or unexported fields
}

func (*WaitForAllPromise[T]) Add

func (p *WaitForAllPromise[T]) Add(promise Promise[T])

func (*WaitForAllPromise[T]) Done

func (p *WaitForAllPromise[T]) Done(res T, err error)

func (*WaitForAllPromise[T]) Get

func (p *WaitForAllPromise[T]) Get() (T, error)

func (*WaitForAllPromise[T]) Peek

func (p *WaitForAllPromise[T]) Peek() (int32, T, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL