Skip to content

Commit

Permalink
Rename UpdateQueueState to SetQueueState (#4187)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxing1292 authored Apr 19, 2023
1 parent becc2f3 commit bdbec13
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion service/history/queues/queue_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func (p *queueBase) updateQueueState(
}
}

err := p.shard.UpdateQueueState(p.category, ToPersistenceQueueState(&queueState{
err := p.shard.SetQueueState(p.category, ToPersistenceQueueState(&queueState{
readerScopes: readerScopes,
exclusiveReaderHighWatermark: p.nonReadableScope.Range.InclusiveMin,
}))
Expand Down
2 changes: 1 addition & 1 deletion service/history/shard/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type (
GetQueueClusterAckLevel(category tasks.Category, cluster string) tasks.Key
UpdateQueueClusterAckLevel(category tasks.Category, cluster string, ackLevel tasks.Key) error
GetQueueState(category tasks.Category) (*persistencespb.QueueState, bool)
UpdateQueueState(category tasks.Category, state *persistencespb.QueueState) error
SetQueueState(category tasks.Category, state *persistencespb.QueueState) error

GetReplicatorDLQAckLevel(sourceCluster string) int64
UpdateReplicatorDLQAckLevel(sourCluster string, ackLevel int64) error
Expand Down
2 changes: 1 addition & 1 deletion service/history/shard/context_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func (s *ContextImpl) GetQueueState(
return queueState, ok
}

func (s *ContextImpl) UpdateQueueState(
func (s *ContextImpl) SetQueueState(
category tasks.Category,
state *persistencespb.QueueState,
) error {
Expand Down
28 changes: 14 additions & 14 deletions service/history/shard/context_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/history/visibilityQueueTaskExecutor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ func (s *visibilityQueueTaskExecutorSuite) TestProcessorDeleteExecution() {
})
s.Run("MultiCursorQueue", func() {
const highWatermark int64 = 5
s.NoError(s.mockShard.UpdateQueueState(tasks.CategoryVisibility, &persistencespb.QueueState{
s.NoError(s.mockShard.SetQueueState(tasks.CategoryVisibility, &persistencespb.QueueState{
ReaderStates: nil,
ExclusiveReaderHighWatermark: &persistencespb.TaskKey{
TaskId: highWatermark,
Expand Down

0 comments on commit bdbec13

Please sign in to comment.