Simply use "precreator" for shard precreation
parent
1ddab4627f
commit
f679c81136
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package shard_precreation
|
||||
package precreator
|
||||
|
||||
import (
|
||||
"time"
|
|
@ -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"
|
|
@ -1,4 +1,4 @@
|
|||
package shard_precreation
|
||||
package precreator
|
||||
|
||||
import (
|
||||
"log"
|
|
@ -1,4 +1,4 @@
|
|||
package shard_precreation
|
||||
package precreator
|
||||
|
||||
import (
|
||||
"testing"
|
Loading…
Reference in New Issue