From f679c81136b6ed93ee04b92ce3281e98c3eee7b4 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Wed, 10 Jun 2015 14:53:12 -0700 Subject: [PATCH] Simply use "precreator" for shard precreation --- cmd/influxd/run/config.go | 14 +++++++------- cmd/influxd/run/server.go | 8 ++++---- .../{shard_precreation => precreator}/config.go | 2 +- .../config_test.go | 6 +++--- .../{shard_precreation => precreator}/notes.md | 0 .../{shard_precreation => precreator}/service.go | 2 +- .../service_test.go | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) rename services/{shard_precreation => precreator}/config.go (96%) rename services/{shard_precreation => precreator}/config_test.go (83%) rename services/{shard_precreation => precreator}/notes.md (100%) rename services/{shard_precreation => precreator}/service.go (99%) rename services/{shard_precreation => precreator}/service_test.go (99%) diff --git a/cmd/influxd/run/config.go b/cmd/influxd/run/config.go index 06b05e8c1c..898425b2a6 100644 --- a/cmd/influxd/run/config.go +++ b/cmd/influxd/run/config.go @@ -16,19 +16,19 @@ import ( "github.com/influxdb/influxdb/services/httpd" "github.com/influxdb/influxdb/services/monitor" "github.com/influxdb/influxdb/services/opentsdb" + "github.com/influxdb/influxdb/services/precreator" "github.com/influxdb/influxdb/services/retention" - "github.com/influxdb/influxdb/services/shard_precreation" "github.com/influxdb/influxdb/services/udp" "github.com/influxdb/influxdb/tsdb" ) // Config represents the configuration format for the influxd binary. type Config struct { - Meta meta.Config `toml:"meta"` - Data tsdb.Config `toml:"data"` - Cluster cluster.Config `toml:"cluster"` - Retention retention.Config `toml:"retention"` - ShardPrecreation shard_precreation.Config `toml:"shard-precreation"` + Meta meta.Config `toml:"meta"` + Data tsdb.Config `toml:"data"` + Cluster cluster.Config `toml:"cluster"` + Retention retention.Config `toml:"retention"` + Precreator precreator.Config `toml:"shard-precreation"` Admin admin.Config `toml:"admin"` HTTPD httpd.Config `toml:"http"` @@ -50,7 +50,7 @@ func NewConfig() *Config { c.Meta = meta.NewConfig() c.Data = tsdb.NewConfig() c.Cluster = cluster.NewConfig() - c.ShardPrecreation = shard_precreation.NewConfig() + c.Precreator = precreator.NewConfig() c.Admin = admin.NewConfig() c.HTTPD = httpd.NewConfig() diff --git a/cmd/influxd/run/server.go b/cmd/influxd/run/server.go index 95d164235e..db4516bb64 100644 --- a/cmd/influxd/run/server.go +++ b/cmd/influxd/run/server.go @@ -14,8 +14,8 @@ import ( "github.com/influxdb/influxdb/services/hh" "github.com/influxdb/influxdb/services/httpd" "github.com/influxdb/influxdb/services/opentsdb" + "github.com/influxdb/influxdb/services/precreator" "github.com/influxdb/influxdb/services/retention" - "github.com/influxdb/influxdb/services/shard_precreation" "github.com/influxdb/influxdb/services/udp" "github.com/influxdb/influxdb/tcp" "github.com/influxdb/influxdb/tsdb" @@ -77,7 +77,7 @@ func NewServer(c *Config) (*Server, error) { // Append services. s.appendClusterService(c.Cluster) - s.appendShardPrecreationService(c.ShardPrecreation) + s.appendPrecreatorService(c.Precreator) s.appendAdminService(c.Admin) s.appendContinuousQueryService(c.ContinuousQuery) s.appendHTTPDService(c.HTTPD) @@ -176,11 +176,11 @@ func (s *Server) appendGraphiteService(c graphite.Config) error { return nil } -func (s *Server) appendShardPrecreationService(c shard_precreation.Config) error { +func (s *Server) appendPrecreatorService(c precreator.Config) error { if !c.Enabled { return nil } - srv, err := shard_precreation.NewService(c) + srv, err := precreator.NewService(c) if err != nil { return err } diff --git a/services/shard_precreation/config.go b/services/precreator/config.go similarity index 96% rename from services/shard_precreation/config.go rename to services/precreator/config.go index 8213fc197d..af0f34b16e 100644 --- a/services/shard_precreation/config.go +++ b/services/precreator/config.go @@ -1,4 +1,4 @@ -package shard_precreation +package precreator import ( "time" diff --git a/services/shard_precreation/config_test.go b/services/precreator/config_test.go similarity index 83% rename from services/shard_precreation/config_test.go rename to services/precreator/config_test.go index 1dcbdff944..e247672830 100644 --- a/services/shard_precreation/config_test.go +++ b/services/precreator/config_test.go @@ -1,16 +1,16 @@ -package shard_precreation_test +package precreator_test import ( "testing" "time" "github.com/BurntSushi/toml" - "github.com/influxdb/influxdb/services/shard_precreation" + "github.com/influxdb/influxdb/services/precreator" ) func TestConfig_Parse(t *testing.T) { // Parse configuration. - var c shard_precreation.Config + var c precreator.Config if _, err := toml.Decode(` enabled = true check-interval = "2m" diff --git a/services/shard_precreation/notes.md b/services/precreator/notes.md similarity index 100% rename from services/shard_precreation/notes.md rename to services/precreator/notes.md diff --git a/services/shard_precreation/service.go b/services/precreator/service.go similarity index 99% rename from services/shard_precreation/service.go rename to services/precreator/service.go index 1d7edfb854..a9f320768c 100644 --- a/services/shard_precreation/service.go +++ b/services/precreator/service.go @@ -1,4 +1,4 @@ -package shard_precreation +package precreator import ( "log" diff --git a/services/shard_precreation/service_test.go b/services/precreator/service_test.go similarity index 99% rename from services/shard_precreation/service_test.go rename to services/precreator/service_test.go index 3d824fa777..2a01006861 100644 --- a/services/shard_precreation/service_test.go +++ b/services/precreator/service_test.go @@ -1,4 +1,4 @@ -package shard_precreation +package precreator import ( "testing"