Skip to content

Commit e9a7737

Browse files
committed
Rename trigger flush to maxIdle
1 parent ec3d6f3 commit e9a7737

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/dataobj/index/builder.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ var ErrPartitionRevoked = errors.New("partition revoked")
3030
type triggerType string
3131

3232
const (
33-
triggerTypeAppend triggerType = "append"
34-
triggerTypeFlush triggerType = "flush"
33+
triggerTypeAppend triggerType = "append"
34+
triggerTypeMaxIdle triggerType = "max-idle"
3535
)
3636

3737
func (tt triggerType) String() string {
3838
switch tt {
3939
case triggerTypeAppend:
4040
return "append"
41-
case triggerTypeFlush:
42-
return "flush"
41+
case triggerTypeMaxIdle:
42+
return "max-idle"
4343
default:
4444
return "unknown"
4545
}
@@ -384,7 +384,7 @@ func (p *Builder) checkAndFlushStalePartitions(ctx context.Context) {
384384
}
385385

386386
func (p *Builder) flushPartition(ctx context.Context, partition int32) {
387-
calculationCtx, eventsToFlush := p.bufferAndTryProcess(ctx, partition, nil, triggerTypeFlush)
387+
calculationCtx, eventsToFlush := p.bufferAndTryProcess(ctx, partition, nil, triggerTypeMaxIdle)
388388
if len(eventsToFlush) == 0 {
389389
return
390390
}
@@ -398,7 +398,7 @@ func (p *Builder) flushPartition(ctx context.Context, partition int32) {
398398
"partition", partition, "events", len(eventsToFlush))
399399

400400
// Submit to indexer service and wait for completion
401-
records, err := p.indexer.submitBuild(calculationCtx, eventsToFlush, partition, triggerTypeFlush)
401+
records, err := p.indexer.submitBuild(calculationCtx, eventsToFlush, partition, triggerTypeMaxIdle)
402402
if err != nil {
403403
if errors.Is(context.Cause(calculationCtx), ErrPartitionRevoked) {
404404
level.Debug(p.logger).Log("msg", "partition revoked during flush", "partition", partition)
@@ -447,7 +447,7 @@ func (p *Builder) bufferAndTryProcess(ctx context.Context, partition int32, newE
447447
if len(state.events) < p.cfg.EventsPerIndex {
448448
return nil, nil
449449
}
450-
case triggerTypeFlush:
450+
case triggerTypeMaxIdle:
451451
if time.Since(state.lastActivity) < p.cfg.MaxIdleTime {
452452
return nil, nil
453453
}

0 commit comments

Comments
 (0)