Skip to content

Commit

Permalink
Remove unused MaxNumDocsPerSegment
Browse files Browse the repository at this point in the history
  • Loading branch information
xichen2020 committed Mar 12, 2019
1 parent 1920f9d commit 0c9a94c
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 27 deletions.
1 change: 0 additions & 1 deletion config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ database:
namespaceFieldName: service
timestampFieldName: "@timestamp"
tickMinInterval: 1m
maxNumDocsPerSegment: 1048576
segmentUnloadAfterUnreadFor: 5m
persist:
writeBufferSize: 65536
Expand Down
1 change: 0 additions & 1 deletion integration/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ database:
namespaceFieldName: service
timestampFieldName: "@timestamp"
tickMinInterval: 1m
maxNumDocsPerSegment: 1048576
segmentUnloadAfterUnreadFor: 5m
persist:
writeBufferSize: 65536
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ func TestRawQueryNoFilterWithOrderByFromDiskGRPC(t *testing.T) {
ts.dbOpts = ts.dbOpts.
SetFilePathPrefix(os.TempDir()).
SetSegmentUnloadAfterUnreadFor(time.Second).
SetTickMinInterval(time.Second).
SetMaxNumDocsPerSegment(5)
SetTickMinInterval(time.Second)
defer ts.close(t)

// Start the server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ func TestRawQueryNoFilterWithOrderByFromDiskHTTP(t *testing.T) {
ts.dbOpts = ts.dbOpts.
SetFilePathPrefix(os.TempDir()).
SetSegmentUnloadAfterUnreadFor(time.Second).
SetTickMinInterval(time.Second).
SetMaxNumDocsPerSegment(5)
SetTickMinInterval(time.Second)
defer ts.close(t)

// Start the server.
Expand Down
4 changes: 0 additions & 4 deletions services/eventdb/config/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type DatabaseConfiguration struct {
TimestampFieldName *string `yaml:"timestampFieldName"`
RawDocSourceFieldName *string `yaml:"rawDocSourceFieldName"`
TickMinInterval *time.Duration `yaml:"tickMinInterval"`
MaxNumDocsPerSegment *int32 `yaml:"maxNumDocsPerSegment"`
SegmentUnloadAfterUnreadFor *time.Duration `yaml:"segmentUnloadAfterUnreadFor"`
PersistManager *persistManagerConfiguration `yaml:"persist"`
BoolArrayPool *pool.BucketizedBoolArrayPoolConfiguration `yaml:"boolArrayPool"`
Expand Down Expand Up @@ -81,9 +80,6 @@ func (c *DatabaseConfiguration) NewOptions(instrumentOpts instrument.Options) (*
if c.TickMinInterval != nil {
opts = opts.SetTickMinInterval(*c.TickMinInterval)
}
if c.MaxNumDocsPerSegment != nil {
opts = opts.SetMaxNumDocsPerSegment(*c.MaxNumDocsPerSegment)
}
if c.SegmentUnloadAfterUnreadFor != nil {
opts = opts.SetSegmentUnloadAfterUnreadFor(*c.SegmentUnloadAfterUnreadFor)
}
Expand Down
3 changes: 1 addition & 2 deletions storage/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ func newTestDatabase() (*testDatabase, error) {
}

dbOpts := NewOptions().
SetNamespaceFieldName(string(testNamespace)).
SetMaxNumDocsPerSegment(testMaxDocsPerSegment)
SetNamespaceFieldName(string(testNamespace))

db := NewDatabase(namespaces, dbOpts)
if err := db.Open(); err != nil {
Expand Down
15 changes: 0 additions & 15 deletions storage/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const (
defaultFieldPathSeparator = '.'
defaultNamespaceFieldName = "service"
defaultTickMinInterval = time.Minute
defaultMaxNumDocsPerSegment = 1024 * 1024
defaultSegmentUnloadAfterUnreadFor = 5 * time.Minute
)

Expand All @@ -41,7 +40,6 @@ type Options struct {
rawDocSourceFieldPath []string
persistManager persist.Manager
tickMinInterval time.Duration
maxNumDocsPerSegment int32
segmentUnloadAfterUnreadFor time.Duration
fieldRetriever persist.FieldRetriever
queryExecutor executor.Executor
Expand All @@ -65,7 +63,6 @@ func NewOptions() *Options {
rawDocSourceFieldPath: defaultRawDocSourceFieldPath,
persistManager: defaultPersistManager,
tickMinInterval: defaultTickMinInterval,
maxNumDocsPerSegment: defaultMaxNumDocsPerSegment,
segmentUnloadAfterUnreadFor: defaultSegmentUnloadAfterUnreadFor,
queryExecutor: executor.NewExecutor(),
}
Expand Down Expand Up @@ -199,18 +196,6 @@ func (o *Options) TickMinInterval() time.Duration {
return o.tickMinInterval
}

// SetMaxNumDocsPerSegment sets the maximum number of documents per segment.
func (o *Options) SetMaxNumDocsPerSegment(v int32) *Options {
opts := *o
opts.maxNumDocsPerSegment = v
return &opts
}

// MaxNumDocsPerSegment returns the maximum number of documents per segment.
func (o *Options) MaxNumDocsPerSegment() int32 {
return o.maxNumDocsPerSegment
}

// SetSegmentUnloadAfterUnreadFor sets the segment unload after unread for duration.
// If a segment is unread for longer than the configuration duration since its
// last read access, it is eligible to be unloaded from memory.
Expand Down

0 comments on commit 0c9a94c

Please sign in to comment.