-
Notifications
You must be signed in to change notification settings - Fork 805
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate timer queue ack manager in separate file, add functionality …
…to timer queue processor to be cluster aware rename SequenceID -> TimerSequenceID
- Loading branch information
Wenquan Xing
committed
Mar 24, 2018
1 parent
bdeb6d4
commit 0ef2268
Showing
21 changed files
with
1,407 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// Copyright (c) 2017 Uber Technologies, Inc. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
package history | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/stretchr/testify/mock" | ||
"github.com/uber/cadence/common/persistence" | ||
) | ||
|
||
// MockTimerQueueAckMgr is used as mock implementation for TimerQueueAckMgr | ||
type MockTimerQueueAckMgr struct { | ||
mock.Mock | ||
} | ||
|
||
// readTimerTasks is mock implementation for readTimerTasks of TimerQueueAckMgr | ||
func (_m *MockTimerQueueAckMgr) readTimerTasks(clusterName string) ([]*persistence.TimerTaskInfo, *persistence.TimerTaskInfo, bool, error) { | ||
ret := _m.Called(clusterName) | ||
|
||
var r0 []*persistence.TimerTaskInfo | ||
if rf, ok := ret.Get(0).(func(string) []*persistence.TimerTaskInfo); ok { | ||
r0 = rf(clusterName) | ||
} else { | ||
if ret.Get(0) != nil { | ||
r0 = ret.Get(0).([]*persistence.TimerTaskInfo) | ||
} | ||
} | ||
|
||
var r1 *persistence.TimerTaskInfo | ||
if rf, ok := ret.Get(1).(func(string) *persistence.TimerTaskInfo); ok { | ||
r1 = rf(clusterName) | ||
} else { | ||
if ret.Get(1) != nil { | ||
r1 = ret.Get(1).(*persistence.TimerTaskInfo) | ||
} | ||
} | ||
|
||
var r2 bool | ||
if rf, ok := ret.Get(2).(func(string) bool); ok { | ||
r2 = rf(clusterName) | ||
} else { | ||
r2 = ret.Get(2).(bool) | ||
} | ||
|
||
var r3 error | ||
if rf, ok := ret.Get(3).(func(string) error); ok { | ||
r3 = rf(clusterName) | ||
} else { | ||
r3 = ret.Error(3) | ||
} | ||
|
||
return r0, r1, r2, r3 | ||
} | ||
|
||
func (_m *MockTimerQueueAckMgr) retryTimerTask(timerTask *persistence.TimerTaskInfo) { | ||
_m.Called(timerTask) | ||
} | ||
|
||
func (_m *MockTimerQueueAckMgr) completeTimerTask(taskID TimerSequenceID) { | ||
_m.Called(taskID) | ||
} | ||
|
||
func (_m *MockTimerQueueAckMgr) updateAckLevel(clusterName string) { | ||
_m.Called(clusterName) | ||
} | ||
|
||
func (_m *MockTimerQueueAckMgr) isProcessNow(expiryTime time.Time) bool { | ||
ret := _m.Called(expiryTime) | ||
|
||
var r0 bool | ||
if rf, ok := ret.Get(0).(func(time.Time) bool); ok { | ||
r0 = rf(expiryTime) | ||
} else { | ||
r0 = ret.Get(0).(bool) | ||
} | ||
|
||
return r0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.