task_fetcher_mock.go ×8

Frontier kind: Code frontier

unlabeled · c_e910b9e1e466

15 tests · 4194 LOC · 191 files · introduces 0 tests · 69 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges69 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
605 ranges4194 lines · 191 files · Browse complete extent
All tests (intent)
15 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 69 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/replication/task_fetcher_mock.go 38 introduced LOC · 8 ranges

Open complete file

92
93 // NewMocktaskFetcher creates a new mock instance.
94 > func NewMocktaskFetcher(ctrl *gomock.Controller) *MocktaskFetcher { task_fetcher_mock.go
95 > mock := &MocktaskFetcher{ctrl: ctrl}
96 > mock.recorder = &MocktaskFetcherMockRecorder{mock}
97 > return mock
98 > }
99
100 // EXPECT returns an object that allows the caller to indicate expected use.
101 > func (m *MocktaskFetcher) EXPECT() *MocktaskFetcherMockRecorder { task_fetcher_mock.go
102 > return m.recorder
103 > }
104
105 // Stop mocks base method.
116
117 // getRateLimiter mocks base method.
118 > func (m *MocktaskFetcher) getRateLimiter() quotas.RateLimiter { task_fetcher_mock.go
119 > m.ctrl.T.Helper()
120 > ret := m.ctrl.Call(m, "getRateLimiter")
121 > ret0, _ := ret[0].(quotas.RateLimiter)
122 > return ret0
123 > }
124
125 // getRateLimiter indicates an expected call of getRateLimiter.
126 > func (mr *MocktaskFetcherMockRecorder) getRateLimiter() *gomock.Call { task_fetcher_mock.go
127 > mr.mock.ctrl.T.Helper()
128 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getRateLimiter", reflect.TypeOf((*MocktaskFetcher)(nil).getRateLimiter))
129 > }
130
131 // getRequestChan mocks base method.
132 > func (m *MocktaskFetcher) getRequestChan() chan<- *replicationTaskRequest { task_fetcher_mock.go
133 > m.ctrl.T.Helper()
134 > ret := m.ctrl.Call(m, "getRequestChan")
135 > ret0, _ := ret[0].(chan<- *replicationTaskRequest)
136 > return ret0
137 > }
138
139 // getRequestChan indicates an expected call of getRequestChan.
140 > func (mr *MocktaskFetcherMockRecorder) getRequestChan() *gomock.Call { task_fetcher_mock.go
141 > mr.mock.ctrl.T.Helper()
142 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getRequestChan", reflect.TypeOf((*MocktaskFetcher)(nil).getRequestChan))
143 > }
144
145 // getSourceCluster mocks base method.
146 > func (m *MocktaskFetcher) getSourceCluster() string { task_fetcher_mock.go
147 > m.ctrl.T.Helper()
148 > ret := m.ctrl.Call(m, "getSourceCluster")
149 > ret0, _ := ret[0].(string)
150 > return ret0
151 > }
152
153 // getSourceCluster indicates an expected call of getSourceCluster.
154 > func (mr *MocktaskFetcherMockRecorder) getSourceCluster() *gomock.Call { task_fetcher_mock.go
155 > mr.mock.ctrl.T.Helper()
156 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "getSourceCluster", reflect.TypeOf((*MocktaskFetcher)(nil).getSourceCluster))
157 > }
go.temporal.io/server/service/history/replication/task_processor.go 31 introduced LOC · 1 range

Open complete file

105 testHooks testhooks.TestHooks,
106 dlqWriter DLQWriter,
107 > ) TaskProcessor { task_processor.go
108 > shardID := shardContext.GetShardID()
109 > taskRetryPolicy := backoff.NewExponentialRetryPolicy(config.ReplicationTaskProcessorErrorRetryWait(shardID)).
110 > WithBackoffCoefficient(config.ReplicationTaskProcessorErrorRetryBackoffCoefficient(shardID)).
111 > WithMaximumInterval(config.ReplicationTaskProcessorErrorRetryMaxInterval(shardID)).
112 > WithMaximumAttempts(config.ReplicationTaskProcessorErrorRetryMaxAttempts(shardID)).
113 > WithExpirationInterval(config.ReplicationTaskProcessorErrorRetryExpiration(shardID))
114 >
115 > // TODO: define separate set of configs for dlq retry
116 > dlqRetryPolicy := backoff.NewExponentialRetryPolicy(config.ReplicationTaskProcessorErrorRetryWait(shardID)).
117 > WithBackoffCoefficient(config.ReplicationTaskProcessorErrorRetryBackoffCoefficient(shardID)).
118 > WithMaximumInterval(config.ReplicationTaskProcessorErrorRetryMaxInterval(shardID)).
119 > WithMaximumAttempts(config.ReplicationTaskProcessorErrorRetryMaxAttempts(shardID)).
120 > WithExpirationInterval(config.ReplicationTaskProcessorErrorRetryExpiration(shardID))
121 >
122 > return &taskProcessorImpl{
123 > status: common.DaemonStatusInitialized,
124 > sourceShardID: sourceShardID,
125 > sourceCluster: replicationTaskFetcher.getSourceCluster(),
126 > shard: shardContext,
127 > historyEngine: historyEngine,
128 > historySerializer: eventSerializer,
129 > config: config,
130 > metricsHandler: metricsHandler,
131 > logger: shardContext.GetLogger(),
132 > testHooks: testHooks,
133 > replicationTaskExecutor: replicationTaskExecutor,
134 > dlqWriter: dlqWriter,
135 > rateLimiter: quotas.NewMultiRateLimiter([]quotas.RateLimiter{
136 > quotas.NewDefaultOutgoingRateLimiter(
137 > func() float64 { return config.ReplicationTaskProcessorShardQPS() },
138 ),
139 replicationTaskFetcher.getRateLimiter(),