Files
tasks/service/history/replication/executable_noop_task.go
Yu XiaandGitHub 31840b32b5 Add new rate limiter priority to support high/low replication tier (#7745)
## What changed?
Add new rate limiter priority to support high/low replication tier

## Why?
high replication tier has higher priority than the low replication tier.
The task processing part is separated. This change allow us throttled
low replication tier first.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)
2025-06-13 12:25:48 -07:00

59 lines
1023 B
Go

package replication
import (
"time"
"go.temporal.io/server/common/metrics"
ctasks "go.temporal.io/server/common/tasks"
)
type (
ExecutableNoopTask struct {
ExecutableTask
}
)
const (
noopTaskID = "noop-task-id"
)
var _ ctasks.Task = (*ExecutableNoopTask)(nil)
var _ TrackableExecutableTask = (*ExecutableNoopTask)(nil)
func NewExecutableNoopTask(
processToolBox ProcessToolBox,
taskID int64,
taskCreationTime time.Time,
sourceClusterName string,
sourceShardKey ClusterShardKey,
) *ExecutableNoopTask {
return &ExecutableNoopTask{
ExecutableTask: NewExecutableTask(
processToolBox,
taskID,
metrics.NoopTaskScope,
taskCreationTime,
time.Now().UTC(),
sourceClusterName,
sourceShardKey,
nil,
),
}
}
func (e *ExecutableNoopTask) QueueID() interface{} {
return noopTaskID
}
func (e *ExecutableNoopTask) Execute() error {
return nil
}
func (e *ExecutableNoopTask) HandleErr(err error) error {
return err
}
func (e *ExecutableNoopTask) MarkPoisonPill() error {
return nil
}