visibility_archiver.go ×5

Frontier kind: Joint frontier

unlabeled · c_4f9eb05e14b2

1 test · 2066 LOC · 89 files · introduces 1 test · 13 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges13 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
329 ranges2066 lines · 89 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

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

go.temporal.io/server/common/archiver/gcloud/visibility_archiver.go 9 introduced LOC · 5 ranges

Open complete file

100 }
101
102 > if err := archiver.ValidateVisibilityArchivalRequest(request); err != nil { visibility_archiver.go
103 logger.Error(archiver.ArchiveNonRetryableErrorMsg, tag.ArchivalArchiveFailReason(archiver.ErrReasonInvalidArchiveRequest), tag.Error(err))
104 return err
105 }
106
107 > encodedVisibilityRecord, err := encode(request) visibility_archiver.go
108 > if err != nil {
109 logger.Error(archiver.ArchiveNonRetryableErrorMsg, tag.ArchivalArchiveFailReason(errEncodeVisibilityRecord), tag.Error(err))
110 return err
113 // The filename has the format: closeTimestamp_hash(runID).visibility
114 // This format allows the archiver to sort all records without reading the file contents
115 > filename := constructVisibilityFilename(request.GetNamespaceId(), request.WorkflowTypeName, request.GetWorkflowId(), request.GetRunId(), indexKeyCloseTimeout, request.CloseTime.AsTime()) visibility_archiver.go
116 > if err := v.gcloudStorage.Upload(ctx, URI, filename, encodedVisibilityRecord); err != nil {
117 logger.Error(archiver.ArchiveTransientErrorMsg, tag.ArchivalArchiveFailReason(errWriteFile), tag.Error(err))
118 return errRetryable
119 }
120
121 > filename = constructVisibilityFilename(request.GetNamespaceId(), request.WorkflowTypeName, request.GetWorkflowId(), request.GetRunId(), indexKeyStartTimeout, request.StartTime.AsTime()) visibility_archiver.go
122 > if err := v.gcloudStorage.Upload(ctx, URI, filename, encodedVisibilityRecord); err != nil {
123 logger.Error(archiver.ArchiveTransientErrorMsg, tag.ArchivalArchiveFailReason(errWriteFile), tag.Error(err))
124 return errRetryable
125 }
126
127 > metrics.VisibilityArchiveSuccessCount.With(handler).Record(1) visibility_archiver.go
128 > return nil
129 }
130
go.temporal.io/server/common/archiver/gcloud/util.go 4 introduced LOC · 1 range

Open complete file

20 )
21
22 > func encode(message proto.Message) ([]byte, error) { util.go
23 > encoder := codec.NewJSONPBEncoder()
24 > return encoder.Encode(message)
25 > }
26
27 func constructHistoryFilenameMultipart(namespaceID, workflowID, runID string, version int64, partNumber int) string {