commit
dff34939f8
|
@ -90,7 +90,7 @@ func (c *CommandLine) Run() error {
|
||||||
|
|
||||||
// Check if we will be able to prompt for the password later.
|
// Check if we will be able to prompt for the password later.
|
||||||
if promptForPassword && !hasTTY {
|
if promptForPassword && !hasTTY {
|
||||||
return errors.New("Unable to prompt for a password with no TTY.")
|
return errors.New("unable to prompt for a password with no TTY")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read environment variables for username/password.
|
// Read environment variables for username/password.
|
||||||
|
@ -166,7 +166,7 @@ func (c *CommandLine) Run() error {
|
||||||
|
|
||||||
i := v8.NewImporter(config)
|
i := v8.NewImporter(config)
|
||||||
if err := i.Import(); err != nil {
|
if err := i.Import(); err != nil {
|
||||||
err = fmt.Errorf("ERROR: %s\n", err)
|
err = fmt.Errorf("ERROR: %s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -706,7 +706,7 @@ func (c *CommandLine) parseInto(stmt string) *client.BatchPoints {
|
||||||
func (c *CommandLine) parseInsert(stmt string) (*client.BatchPoints, error) {
|
func (c *CommandLine) parseInsert(stmt string) (*client.BatchPoints, error) {
|
||||||
i, point := parseNextIdentifier(stmt)
|
i, point := parseNextIdentifier(stmt)
|
||||||
if !strings.EqualFold(i, "insert") {
|
if !strings.EqualFold(i, "insert") {
|
||||||
return nil, fmt.Errorf("found %s, expected INSERT\n", i)
|
return nil, fmt.Errorf("found %s, expected INSERT", i)
|
||||||
}
|
}
|
||||||
if i, r := parseNextIdentifier(point); strings.EqualFold(i, "into") {
|
if i, r := parseNextIdentifier(point); strings.EqualFold(i, "into") {
|
||||||
bp := c.parseInto(r)
|
bp := c.parseInto(r)
|
||||||
|
|
|
@ -62,7 +62,7 @@ func (cmd *Command) Run(args ...string) error {
|
||||||
|
|
||||||
err := cmd.isShardDir(cmd.dir)
|
err := cmd.isShardDir(cmd.dir)
|
||||||
if cmd.detailed && err != nil {
|
if cmd.detailed && err != nil {
|
||||||
return fmt.Errorf("-detailed only supported for shard dirs.")
|
return fmt.Errorf("-detailed only supported for shard dirs")
|
||||||
}
|
}
|
||||||
|
|
||||||
totalSeries := newCounterFn()
|
totalSeries := newCounterFn()
|
||||||
|
@ -79,7 +79,7 @@ func (cmd *Command) Run(args ...string) error {
|
||||||
|
|
||||||
minTime, maxTime := int64(math.MaxInt64), int64(math.MinInt64)
|
minTime, maxTime := int64(math.MaxInt64), int64(math.MinInt64)
|
||||||
var fileCount int
|
var fileCount int
|
||||||
if err := cmd.WalkShardDirs(cmd.dir, func(db, rp, id, path string) error {
|
if err := cmd.walkShardDirs(cmd.dir, func(db, rp, id, path string) error {
|
||||||
if cmd.pattern != "" && strings.Contains(path, cmd.pattern) {
|
if cmd.pattern != "" && strings.Contains(path, cmd.pattern) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ func (cmd *Command) isShardDir(dir string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *Command) WalkShardDirs(root string, fn func(db, rp, id, path string) error) error {
|
func (cmd *Command) walkShardDirs(root string, fn func(db, rp, id, path string) error) error {
|
||||||
type location struct {
|
type location struct {
|
||||||
db, rp, id, path string
|
db, rp, id, path string
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Pacage tsdb abstracts the various shard types supported by the influx_tsm command.
|
// Package tsdb abstracts the various shard types supported by the influx_tsm command.
|
||||||
package tsdb // import "github.com/influxdata/influxdb/cmd/influx_tsm/tsdb"
|
package tsdb // import "github.com/influxdata/influxdb/cmd/influx_tsm/tsdb"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// Code generated by protoc-gen-gogo.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// source: internal/meta.proto
|
// source: internal/meta.proto
|
||||||
// DO NOT EDIT!
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package internal is a generated protocol buffer package.
|
Package internal is a generated protocol buffer package.
|
||||||
|
|
|
@ -33,9 +33,10 @@ import (
|
||||||
client "github.com/influxdata/usage-client/v1"
|
client "github.com/influxdata/usage-client/v1"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
// Initialize the engine & index packages
|
|
||||||
"github.com/influxdata/influxdb/services/storage"
|
"github.com/influxdata/influxdb/services/storage"
|
||||||
|
// Initialize the engine package
|
||||||
_ "github.com/influxdata/influxdb/tsdb/engine"
|
_ "github.com/influxdata/influxdb/tsdb/engine"
|
||||||
|
// Initialize the index package
|
||||||
_ "github.com/influxdata/influxdb/tsdb/index"
|
_ "github.com/influxdata/influxdb/tsdb/index"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -109,20 +109,22 @@ func (cmd *Command) Run(args ...string) error {
|
||||||
|
|
||||||
// set defaults
|
// set defaults
|
||||||
if start != "" {
|
if start != "" {
|
||||||
if t, err := parseTime(start); err != nil {
|
t, err := parseTime(start)
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
|
||||||
cmd.startTime = t
|
|
||||||
}
|
}
|
||||||
|
cmd.startTime = t
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cmd.startTime = models.MinNanoTime
|
cmd.startTime = models.MinNanoTime
|
||||||
}
|
}
|
||||||
if end != "" {
|
if end != "" {
|
||||||
if t, err := parseTime(end); err != nil {
|
t, err := parseTime(end)
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
|
||||||
cmd.endTime = t
|
|
||||||
}
|
}
|
||||||
|
cmd.endTime = t
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// set end time to max if it is not set.
|
// set end time to max if it is not set.
|
||||||
cmd.endTime = models.MaxNanoTime
|
cmd.endTime = models.MaxNanoTime
|
||||||
|
@ -130,11 +132,11 @@ func (cmd *Command) Run(args ...string) error {
|
||||||
|
|
||||||
if cmd.agg != "" {
|
if cmd.agg != "" {
|
||||||
tm := proto.EnumValueMap("storage.Aggregate_AggregateType")
|
tm := proto.EnumValueMap("storage.Aggregate_AggregateType")
|
||||||
if agg, ok := tm[strings.ToUpper(cmd.agg)]; !ok {
|
agg, ok := tm[strings.ToUpper(cmd.agg)]
|
||||||
|
if !ok {
|
||||||
return errors.New("invalid aggregate function: " + cmd.agg)
|
return errors.New("invalid aggregate function: " + cmd.agg)
|
||||||
} else {
|
|
||||||
cmd.aggType = storage.Aggregate_AggregateType(agg)
|
|
||||||
}
|
}
|
||||||
|
cmd.aggType = storage.Aggregate_AggregateType(agg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.grouping != "" {
|
if cmd.grouping != "" {
|
||||||
|
|
Loading…
Reference in New Issue