applied travis suggestions

This commit is contained in:
Todd Gruben 2019-02-11 14:31:15 -06:00 • committed by Matt Jaffee
parent 27492a11cc
commit 8edd2b3d13
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
4 changed files with 10 additions and 12 deletions

View file

@ -58,6 +58,10 @@ const (
FieldTypeBool = "bool"
)
func defaultShardValidator(shard uint64) bool {
return true
}
// Field represents a container for views.
type Field struct {
mu sync.RWMutex
@ -208,9 +212,7 @@ func newField(path, index, name string, opts FieldOption) (*Field, error) {
remoteAvailableShards: roaring.NewBitmap(),
shardValidator: func(uint64) bool {
return true
},
shardValidator: defaultShardValidator,
logger: logger.NopLogger,
}
return f, nil

View file

@ -77,7 +77,7 @@ type Holder struct {
// The interval at which the cached row ids are persisted to disk.
cacheFlushInterval time.Duration
shardValidatorfn func(index string, shard uint64) bool
shardValidatorFunc func(index string, shard uint64) bool
Logger logger.Logger
}
@ -125,7 +125,7 @@ func NewHolder() *Holder {
NewAttrStore: newNopAttrStore,
cacheFlushInterval: defaultCacheFlushInterval,
shardValidatorfn: func(index string, shard uint64) bool {
shardValidatorFunc: func(index string, shard uint64) bool {
return true //default
},
@ -431,7 +431,7 @@ func (h *Holder) newIndex(path, name string) (*Index, error) {
index.newAttrStore = h.NewAttrStore
index.columnAttrs = h.NewAttrStore(filepath.Join(index.path, ".data"))
index.shardValidator = func(shard uint64) bool {
return h.shardValidatorfn(name, shard)
return h.shardValidatorFunc(name, shard)
}
return index, nil
}

View file

@ -75,9 +75,7 @@ func NewIndex(path, name string) (*Index, error) {
broadcaster: NopBroadcaster,
Stats: stats.NopStatsClient,
logger: logger.NopLogger,
shardValidator: func(uint64) bool {
return true
},
shardValidator: defaultShardValidator,
trackExistence: true,
}, nil
}

View file

@ -76,9 +76,7 @@ func newView(path, index, field, name string, fieldOptions FieldOptions) *view {
broadcaster: NopBroadcaster,
stats: stats.NopStatsClient,
logger: logger.NopLogger,
shardValidator: func(uint64) bool {
return true
},
shardValidator: defaultShardValidator,
}
}