metadata

package
v0.0.0-...-04d6450 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package metadata is about the management of metadata (i.e. index)

Package metadata is about the management of metadata (i.e. index)

Index

Constants

View Source
const (
	DefaultNumberOfShards   = 1
	MaxNumberOfShards       = 100
	DefaultNumberOfReplicas = 1
	MaxNumberOfReplicas     = 5
)
View Source
const AliasPath = "/_alias/"
View Source
const IndexPath = "/_index/"
View Source
const IndexTemplatePath = "/_index_template/"

Variables

This section is empty.

Functions

func AddAlias

func AddAlias(aliasTerm *protocol.AliasTerm) error

func BuildIndex

func BuildIndex(index *core.Index, template *protocol.IndexTemplate)

func CheckIndexValid

func CheckIndexValid(index *core.Index) error

func CheckMappings

func CheckMappings(mappings *protocol.Mappings) error

func CheckSettings

func CheckSettings(settings *protocol.Settings) error

func CheckTemplateValid

func CheckTemplateValid(template *protocol.IndexTemplate) error

func CreateIndex

func CreateIndex(index *core.Index) error

func CreateIndexTemplate

func CreateIndexTemplate(template *protocol.IndexTemplate) error

func DeleteIndex

func DeleteIndex(indexName string) error

func DeleteIndexTemplate

func DeleteIndexTemplate(templateName string) error

func FillTemplateAsDefault

func FillTemplateAsDefault(template *protocol.IndexTemplate)

func FindTemplates

func FindTemplates(indexName string) *protocol.IndexTemplate

func GetAliasTerms

func GetAliasTerms(index, alias string) []*protocol.AliasTerm

func GetIndexExplicitly

func GetIndexExplicitly(indexName string) (*core.Index, error)

GetIndexExplicitly gets the index precisely by name, rather than trying to resolve that by wildcards or aliases

func GetIndexTemplateExplicitly

func GetIndexTemplateExplicitly(templateName string) (*protocol.IndexTemplate, error)

GetIndexTemplateExplicitly gets the index template precisely by name, rather than trying to resolve that by wildcards.

func GetShard

func GetShard(indexName string, shardID int) (*core.Shard, error)

func RemoveAlias

func RemoveAlias(aliasTerm *protocol.AliasTerm) error

RemoveAlias supports removing alias terms in the form of wildcards

func RemoveAliasesByIndex

func RemoveAliasesByIndex(index string) error

func ResolveAliases

func ResolveAliases(name string) []string

ResolveAliases tries to resolve index names by alias expressions

func ResolveIndexTemplates

func ResolveIndexTemplates(exp string) ([]*protocol.IndexTemplate, error)

ResolveIndexTemplates resolved index templates by comma-separated expressions, each expression may be a native template name or a wildcard. If you know the complete name of the index template exactly, please use GetIndexTemplateExplicitly for better performance. errs.IndexTemplateNotFoundError will be returned if there is an expression that does not match any index templates.

func ResolveIndexes

func ResolveIndexes(exp string) ([]*core.Index, error)

ResolveIndexes resolved indexes by comma-separated expressions, each expression may be a native index name, a wildcard or an alias. If you know the complete name of the index exactly, please use GetIndexExplicitly for better performance. errs.IndexNotFoundError will be returned if there is an expression that does not match any indexes.

func SaveIndex

func SaveIndex(index *core.Index) error

func SaveIndexTemplate

func SaveIndexTemplate(template *protocol.IndexTemplate) error

Types

type Metadata

type Metadata struct {
	// MStore completes direct access to metadata physical storage
	MStore storage.MetaStore
	// IndexCache caches { name -> Index }
	IndexCache *cache.Cache
	// AliasTermsCache caches { index&alias -> AliasTerm }
	AliasTermsCache *cache.Cache
	// TemplateCache caches { name -> IndexTemplate }
	TemplateCache *cache.Cache
}

func Instance

func Instance() *Metadata

Instance lazily initializes a Metadata singleton and returns it

Directories

Path Synopsis
Package storage is about the physical storage of metadata
Package storage is about the physical storage of metadata
boltdb
Package boltdb describes an implementation of boltdb-based metadata storage
Package boltdb describes an implementation of boltdb-based metadata storage

Jump to

Keyboard shortcuts

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