util.go ×24

Frontier kind: Code frontier

unlabeled · c_47a1af3d82eb

17 tests · 4447 LOC · 182 files · introduces 0 tests · 220 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
24 ranges220 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
836 ranges4447 lines · 182 files · Browse complete extent
All tests (intent)
17 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.

1 file ranked by introduced lines: 220 introduced LOC across 24 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/cassandra/util.go 220 introduced LOC · 24 ranges

Open complete file

145 shardID int32,
146 workflowSnapshot *p.InternalWorkflowSnapshot,
147 > ) error { util.go
148 >
149 > // TODO: update call site
150 > // cqlNowTimestampMillis := p.UnixMilliseconds(time.Now().UTC())
151 >
152 > namespaceID := workflowSnapshot.NamespaceID
153 > workflowID := workflowSnapshot.WorkflowID
154 > runID := workflowSnapshot.RunID
155 >
156 > if err := updateExecution(
157 > batch,
158 > shardID,
159 > namespaceID,
160 > workflowID,
161 > runID,
162 > workflowSnapshot.ExecutionInfoBlob,
163 > workflowSnapshot.ExecutionState,
164 > workflowSnapshot.ExecutionStateBlob,
165 > workflowSnapshot.NextEventID,
166 > workflowSnapshot.Condition,
167 > workflowSnapshot.DBRecordVersion,
168 > workflowSnapshot.Checksum,
169 > ); err != nil {
170 return err
171 }
172
173 > if err := resetActivityInfos( util.go
174 > batch,
175 > workflowSnapshot.ActivityInfos,
176 > shardID,
177 > namespaceID,
178 > workflowID,
179 > runID,
180 > ); err != nil {
181 return err
182 }
183
184 > if err := resetTimerInfos( util.go
185 > batch,
186 > workflowSnapshot.TimerInfos,
187 > shardID,
188 > namespaceID,
189 > workflowID,
190 > runID,
191 > ); err != nil {
192 return err
193 }
194
195 > if err := resetChildExecutionInfos( util.go
196 > batch,
197 > workflowSnapshot.ChildExecutionInfos,
198 > shardID,
199 > namespaceID,
200 > workflowID,
201 > runID,
202 > ); err != nil {
203 return err
204 }
205
206 > if err := resetRequestCancelInfos( util.go
207 > batch,
208 > workflowSnapshot.RequestCancelInfos,
209 > shardID,
210 > namespaceID,
211 > workflowID,
212 > runID,
213 > ); err != nil {
214 return err
215 }
216
217 > if err := resetSignalInfos( util.go
218 > batch,
219 > workflowSnapshot.SignalInfos,
220 > shardID,
221 > namespaceID,
222 > workflowID,
223 > runID,
224 > ); err != nil {
225 return err
226 }
227
228 > if err := resetChasmNodes( util.go
229 > batch,
230 > workflowSnapshot.ChasmNodes,
231 > shardID,
232 > namespaceID,
233 > workflowID,
234 > runID,
235 > ); err != nil {
236 return err
237 }
238
239 > resetSignalRequested( util.go
240 > batch,
241 > workflowSnapshot.SignalRequestedIDs,
242 > shardID,
243 > namespaceID,
244 > workflowID,
245 > runID,
246 > )
247 >
248 > deleteBufferedEvents(
249 > batch,
250 > shardID,
251 > namespaceID,
252 > workflowID,
253 > runID,
254 > )
255 >
256 > // transfer / replication / timer tasks
257 > return applyTasks(
258 > batch,
259 > shardID,
260 > workflowSnapshot.Tasks,
261 > )
262 }
263
652 workflowID string,
653 runID string,
654 > ) { util.go
655 > batch.Query(templateDeleteBufferedEventsQuery,
656 > shardID,
657 > rowTypeExecution,
658 > namespaceID,
659 > workflowID,
660 > runID,
661 > defaultVisibilityTimestamp,
662 > rowTypeExecutionTaskID,
663 > )
664 > }
665
666 func resetActivityInfos(
671 workflowID string,
672 runID string,
673 > ) error { util.go
674 > infoMap, encoding, err := convertBlobMapToByteMap(activityInfos)
675 > if err != nil {
676 return err
677 }
678
679 > batch.Query(templateResetActivityInfoQuery, util.go
680 > infoMap,
681 > encoding.String(),
682 > shardID,
683 > rowTypeExecution,
684 > namespaceID,
685 > workflowID,
686 > runID,
687 > defaultVisibilityTimestamp,
688 > rowTypeExecutionTaskID)
689 >
690 > return nil
691 }
692
736 workflowID string,
737 runID string,
738 > ) error { util.go
739 > timerMap, timerMapEncoding, err := convertBlobMapToByteMap(timerInfos)
740 > if err != nil {
741 return err
742 }
743
744 > batch.Query(templateResetTimerInfoQuery, util.go
745 > timerMap,
746 > timerMapEncoding.String(),
747 > shardID,
748 > rowTypeExecution,
749 > namespaceID,
750 > workflowID,
751 > runID,
752 > defaultVisibilityTimestamp,
753 > rowTypeExecutionTaskID)
754 >
755 > return nil
756 }
757
801 workflowID string,
802 runID string,
803 > ) error { util.go
804 > infoMap, encoding, err := convertBlobMapToByteMap(childExecutionInfos)
805 > if err != nil {
806 return err
807 }
808
809 > batch.Query(templateResetChildExecutionInfoQuery, util.go
810 > infoMap,
811 > encoding.String(),
812 > shardID,
813 > rowTypeExecution,
814 > namespaceID,
815 > workflowID,
816 > runID,
817 > defaultVisibilityTimestamp,
818 > rowTypeExecutionTaskID)
819 >
820 > return nil
821 }
822
866 workflowID string,
867 runID string,
868 > ) error { util.go
869 > rciMap, rciMapEncoding, err := convertBlobMapToByteMap(requestCancelInfos)
870 > if err != nil {
871 return err
872 }
873
874 > batch.Query(templateResetRequestCancelInfoQuery, util.go
875 > rciMap,
876 > rciMapEncoding.String(),
877 > shardID,
878 > rowTypeExecution,
879 > namespaceID,
880 > workflowID,
881 > runID,
882 > defaultVisibilityTimestamp,
883 > rowTypeExecutionTaskID)
884 >
885 > return nil
886 }
887
931 workflowID string,
932 runID string,
933 > ) error { util.go
934 > sMap, sMapEncoding, err := convertBlobMapToByteMap(signalInfos)
935 > if err != nil {
936 return err
937 }
938
939 > batch.Query(templateResetSignalInfoQuery, util.go
940 > sMap,
941 > sMapEncoding.String(),
942 > shardID,
943 > rowTypeExecution,
944 > namespaceID,
945 > workflowID,
946 > runID,
947 > defaultVisibilityTimestamp,
948 > rowTypeExecutionTaskID)
949 >
950 > return nil
951 }
952
958 workflowID string,
959 runID string,
960 > ) error { util.go
961 > blobMap := make(map[string][]byte, len(nodes))
962 > var encoding enumspb.EncodingType
963 > for path, node := range nodes {
964 > blobMap[path] = node.CassandraBlob.Data
965 > encoding = node.CassandraBlob.EncodingType // TODO - we only support a single encoding
966 > }
967
968 > batch.Query(templateResetChasmNodeQuery, util.go
969 > blobMap,
970 > encoding.String(),
971 > shardID,
972 > rowTypeExecution,
973 > namespaceID,
974 > workflowID,
975 > runID,
976 > defaultVisibilityTimestamp,
977 > rowTypeExecutionTaskID)
978 >
979 > return nil
980 }
981
1060 workflowID string,
1061 runID string,
1062 > ) { util.go
1063 >
1064 > batch.Query(templateResetSignalRequestedQuery,
1065 > convert.StringSetToSlice(signalRequested),
1066 > shardID,
1067 > rowTypeExecution,
1068 > namespaceID,
1069 > workflowID,
1070 > runID,
1071 > defaultVisibilityTimestamp,
1072 > rowTypeExecutionTaskID)
1073 > }
1074
1075 func updateBufferedEvents(
1112 func convertBlobMapToByteMap[T comparable](
1113 input map[T]*commonpb.DataBlob,
1114 > ) (map[T][]byte, enumspb.EncodingType, error) { util.go
1115 > sMap := make(map[T][]byte)
1116 >
1117 > var encoding enumspb.EncodingType
1118 > for key, blob := range input {
1119 > encoding = blob.EncodingType
1120 > sMap[key] = blob.Data
1121 > }
1122
1123 > return sMap, encoding, nil util.go
1124 }
1125