coordinator

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package coordinator implements all features necessary to initialize and monitor elasticsearch components

On-start :

* Load Configuration :

  • Instances + Logical Indices + Cron

* Check if any corresponding indices exists * If so, Check if any corresponding aliases exists * Check if any corresponding templates exists

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	Initialized    bool
	Name           string
	Urls           []string
	Executor       *elasticsearch.EsExecutor
	LogicalIndices map[string]*LogicalIndex
}

Instance represents a functional Myrtea instance

func (*Instance) InitLogicalIndices

func (instance *Instance) InitLogicalIndices(models map[int64]modeler.Model) error

InitLogicalIndices initialize an ensemble of logical indices (each based on a specific elasticsearch model)

type LogicalIndex

type LogicalIndex struct {
	Initialized bool
	Name        string
	Cron        *cron.Cron
	Executor    *elasticsearch.EsExecutor
	Model       modeler.Model
}

LogicalIndex abstracts a group a technical elasticsearch indices, which are accessibles with specific aliases

type Master

type Master struct {
	Initialized bool
	Instances   map[string]*Instance
}

Master is a singleton component which operates and coordinates Myrtea instances

func GetInstance

func GetInstance() *Master

GetInstance returns a pointer to a singleton of the coordinator master component This singleton must be initialized at least one time with Initialize()

func (*Master) InitInstance

func (master *Master) InitInstance(instanceName string, urls []string, models map[int64]modeler.Model) error

InitInstance initialize the a new instance

type RollMode

type RollMode int

RollMode is a enumeration of all indices roll mode

const (
	// Rollover is the native elasticsearch roll mode, based on /_rollover API
	Rollover RollMode = iota + 1
	// Timebased is ...
	Timebased
)

Jump to

Keyboard shortcuts

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