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
- func AddAlias(aliasTerm *protocol.AliasTerm) error
- func BuildIndex(index *core.Index, template *protocol.IndexTemplate)
- func CheckIndexValid(index *core.Index) error
- func CheckMappings(mappings *protocol.Mappings) error
- func CheckSettings(settings *protocol.Settings) error
- func CheckTemplateValid(template *protocol.IndexTemplate) error
- func CreateIndex(index *core.Index) error
- func CreateIndexTemplate(template *protocol.IndexTemplate) error
- func DeleteIndex(indexName string) error
- func DeleteIndexTemplate(templateName string) error
- func FillTemplateAsDefault(template *protocol.IndexTemplate)
- func FindTemplates(indexName string) *protocol.IndexTemplate
- func GetAliasTerms(index, alias string) []*protocol.AliasTerm
- func GetIndexExplicitly(indexName string) (*core.Index, error)
- func GetIndexTemplateExplicitly(templateName string) (*protocol.IndexTemplate, error)
- func GetShard(indexName string, shardID int) (*core.Shard, error)
- func RemoveAlias(aliasTerm *protocol.AliasTerm) error
- func RemoveAliasesByIndex(index string) error
- func ResolveAliases(name string) []string
- func ResolveIndexTemplates(exp string) ([]*protocol.IndexTemplate, error)
- func ResolveIndexes(exp string) ([]*core.Index, error)
- func SaveIndex(index *core.Index) error
- func SaveIndexTemplate(template *protocol.IndexTemplate) error
- type Metadata
Constants ¶
const ( DefaultNumberOfShards = 1 MaxNumberOfShards = 100 DefaultNumberOfReplicas = 1 MaxNumberOfReplicas = 5 )
const AliasPath = "/_alias/"
const IndexPath = "/_index/"
const IndexTemplatePath = "/_index_template/"
Variables ¶
This section is empty.
Functions ¶
func BuildIndex ¶
func BuildIndex(index *core.Index, template *protocol.IndexTemplate)
func CheckIndexValid ¶
func CheckMappings ¶
func CheckSettings ¶
func CheckTemplateValid ¶
func CheckTemplateValid(template *protocol.IndexTemplate) error
func CreateIndex ¶
func CreateIndexTemplate ¶
func CreateIndexTemplate(template *protocol.IndexTemplate) error
func DeleteIndex ¶
func DeleteIndexTemplate ¶
func FillTemplateAsDefault ¶
func FillTemplateAsDefault(template *protocol.IndexTemplate)
func FindTemplates ¶
func FindTemplates(indexName string) *protocol.IndexTemplate
func GetAliasTerms ¶
func GetIndexExplicitly ¶
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 RemoveAlias ¶
RemoveAlias supports removing alias terms in the form of wildcards
func RemoveAliasesByIndex ¶
func ResolveAliases ¶
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 ¶
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 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 }
Source Files ¶
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 |