Skip to content

Commit

Permalink
ddress PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
e-dard committed Mar 6, 2019
1 parent 8a53b2b commit 183741d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
6 changes: 3 additions & 3 deletions models/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -2478,11 +2478,11 @@ func appendField(b []byte, k string, v interface{}) []byte {
// ValidToken returns true if the provided token is a valid unicode string, and
// only contains printable, non-replacement characters.
func ValidToken(a []byte) bool {
s := string(a)
if !utf8.ValidString(s) {
if !utf8.Valid(a) {
return false
}
for _, r := range s {

for _, r := range string(a) {
if !unicode.IsPrint(r) || r == unicode.ReplacementChar {
return false
}
Expand Down
17 changes: 5 additions & 12 deletions storage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import (

// Default configuration values.
const (
DefaultRetentionInterval = time.Hour
DefaultTraceLoggingEnabled = false

DefaultRetentionInterval = time.Hour
DefaultSeriesFileDirectoryName = "_series"
DefaultIndexDirectoryName = "index"
DefaultWALDirectoryName = "wal"
Expand All @@ -25,9 +23,6 @@ type Config struct {
// Frequency of retention in seconds.
RetentionInterval toml.Duration `toml:"retention-interval"`

// Enables trace logging for the engine.
TraceLoggingEnabled bool `toml:"trace-logging-enabled"`

// Series file config.
SeriesFilePath string `toml:"series-file-path"` // Overrides the default path.

Expand All @@ -47,12 +42,10 @@ type Config struct {
// NewConfig initialises a new config for an Engine.
func NewConfig() Config {
return Config{
RetentionInterval: toml.Duration(DefaultRetentionInterval),
TraceLoggingEnabled: DefaultTraceLoggingEnabled,

WAL: tsm1.NewWALConfig(),
Engine: tsm1.NewConfig(),
Index: tsi1.NewConfig(),
RetentionInterval: toml.Duration(DefaultRetentionInterval),
WAL: tsm1.NewWALConfig(),
Engine: tsm1.NewConfig(),
Index: tsi1.NewConfig(),
}
}

Expand Down
2 changes: 0 additions & 2 deletions storage/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"sync"
"time"

"github.com/opentracing/opentracing-go"

platform "github.com/influxdata/influxdb"
"github.com/influxdata/influxdb/logger"
"github.com/influxdata/influxdb/models"
Expand Down
2 changes: 1 addition & 1 deletion tsdb/explode.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func ExplodePoints(org, bucket platform.ID, points []models.Point) ([]models.Poi

t := pt.Time()
itr := pt.FieldIterator()
tags = append(tags, models.Tag{}) // Make room for
tags = append(tags, models.Tag{}) // Make room for field key and value.

for itr.Next() {
tags[len(tags)-1] = models.NewTag(models.FieldKeyTagKeyBytes, itr.FieldKey())
Expand Down

0 comments on commit 183741d

Please sign in to comment.