archiver.go ×3

Frontier kind: Code frontier

unlabeled · c_4503c94f5f36

13 tests · 2576 LOC · 137 files · introduces 0 tests · 33 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges33 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
403 ranges2576 lines · 137 files · Browse complete extent
All tests (intent)
13 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.

3 files ranked by introduced lines: 33 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/archival/archiver.go 20 introduced LOC · 3 ranges

Open complete file

105 }
106
107 > func (a *archiver) Archive(ctx context.Context, request *Request) (res *Response, err error) { archiver.go
108 > logger := log.With(
109 > a.logger,
110 > tag.ShardID(request.ShardID),
111 > tag.ArchivalCallerServiceName(request.CallerService),
112 > tag.ArchivalRequestNamespaceID(request.NamespaceID),
113 > tag.ArchivalRequestNamespace(request.Namespace),
114 > tag.ArchivalRequestWorkflowID(request.WorkflowID),
115 > tag.ArchivalRequestRunID(request.RunID),
116 > )
117 >
118 > defer func(start time.Time) {
119 > metricsScope := a.metricsHandler
120 >
121 > status := "ok"
122 > if err != nil {
123 status = "err"
124
132 }
133
134 > metrics.ArchiverArchiveLatency.With(metricsScope). archiver.go
135 > Record(time.Since(start), metrics.StringTag("status", status))
136 }(time.Now())
137
138 > numTargets := len(request.Targets) archiver.go
139 > if err := a.rateLimiter.WaitN(ctx, numTargets); err != nil {
140 return nil, &serviceerror.ResourceExhausted{
141 Cause: enumspb.RESOURCE_EXHAUSTED_CAUSE_RPS_LIMIT,
go.temporal.io/server/common/quotas/rate_limiter_mock.go 10 introduced LOC · 2 ranges

Open complete file

167
168 // WaitN mocks base method.
169 > func (m *MockRateLimiter) WaitN(ctx context.Context, numToken int) error { rate_limiter_mock.go
170 > m.ctrl.T.Helper()
171 > ret := m.ctrl.Call(m, "WaitN", ctx, numToken)
172 > ret0, _ := ret[0].(error)
173 > return ret0
174 > }
175
176 // WaitN indicates an expected call of WaitN.
177 > func (mr *MockRateLimiterMockRecorder) WaitN(ctx, numToken any) *gomock.Call { rate_limiter_mock.go
178 > mr.mock.ctrl.T.Helper()
179 > return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitN", reflect.TypeOf((*MockRateLimiter)(nil).WaitN), ctx, numToken)
180 > }
go.temporal.io/server/common/log/tag/tags.go 3 introduced LOC · 1 range

Open complete file

839
840 // ArchivalCallerServiceName returns tag for the service name calling archival client
841 > func ArchivalCallerServiceName(callerServiceName string) ZapTag { tags.go
842 > return NewStringTag("archival-caller-service-name", callerServiceName)
843 > }
844
845 // ArchivalRequestNamespaceID returns tag for RequestNamespaceID