Skip to content

Commit

Permalink
Cleaned up blocks storage config (grafana#2937)
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Pracucci <marco@pracucci.com>
  • Loading branch information
pracucci authored Jul 28, 2020
1 parent e85298e commit 459b79c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
// Supported storage engines
const (
StorageEngineChunks = "chunks"
StorageEngineTSDB = "tsdb"
StorageEngineBlocks = "blocks"
)

type indexStoreFactories struct {
Expand Down Expand Up @@ -92,14 +92,14 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
cfg.Swift.RegisterFlags(f)
cfg.GrpcConfig.RegisterFlags(f)

f.StringVar(&cfg.Engine, "store.engine", "chunks", "The storage engine to use: chunks or tsdb. Be aware tsdb is experimental and shouldn't be used in production.")
f.StringVar(&cfg.Engine, "store.engine", "chunks", "The storage engine to use: chunks or blocks. Be aware that blocks storage is experimental and shouldn't be used in production.")
cfg.IndexQueriesCacheConfig.RegisterFlagsWithPrefix("store.index-cache-read.", "Cache config for index entry reading. ", f)
f.DurationVar(&cfg.IndexCacheValidity, "store.index-cache-validity", 5*time.Minute, "Cache validity for active index entries. Should be no higher than -ingester.max-chunk-idle.")
}

// Validate config and returns error on failure
func (cfg *Config) Validate() error {
if cfg.Engine != StorageEngineChunks && cfg.Engine != StorageEngineTSDB {
if cfg.Engine != StorageEngineChunks && cfg.Engine != StorageEngineBlocks {
return errors.New("unsupported storage engine")
}
if err := cfg.CassandraStorageConfig.Validate(); err != nil {
Expand Down

0 comments on commit 459b79c

Please sign in to comment.