convert.go ×10

Frontier kind: Code frontier

unlabeled · c_fc116f606b65

3 tests · 2663 LOC · 132 files · introduces 0 tests · 56 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges56 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
418 ranges2663 lines · 132 files · Browse complete extent
All tests (intent)
3 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: 56 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/queues/convert.go 46 introduced LOC · 10 ranges

Open complete file

109 case *predicates.EmptyImpl[tasks.Task]:
110 return ToPersistenceEmptyPredicate(predicate)
111 > case *predicates.AndImpl[tasks.Task]: convert.go
112 > return ToPersistenceAndPredicate(predicate)
113 > case *predicates.OrImpl[tasks.Task]:
114 > return ToPersistenceOrPredicate(predicate)
115 case *predicates.NotImpl[tasks.Task]:
116 return ToPersistenceNotPredicate(predicate)
138 case enumsspb.PREDICATE_TYPE_EMPTY:
139 return FromPersistenceEmptyPredicate(predicate.GetEmptyPredicateAttributes())
140 > case enumsspb.PREDICATE_TYPE_AND: convert.go
141 > return FromPersistenceAndPredicate(predicate.GetAndPredicateAttributes())
142 > case enumsspb.PREDICATE_TYPE_OR:
143 > return FromPersistenceOrPredicate(predicate.GetOrPredicateAttributes())
144 case enumsspb.PREDICATE_TYPE_NOT:
145 return FromPersistenceNotPredicate(predicate.GetNotPredicateAttributes())
191 func ToPersistenceAndPredicate(
192 andPredicate *predicates.AndImpl[tasks.Task],
193 > ) *persistencespb.Predicate { convert.go
194 > persistencePredicates := make([]*persistencespb.Predicate, 0, len(andPredicate.Predicates))
195 > for _, p := range andPredicate.Predicates {
196 > persistencePredicates = append(persistencePredicates, ToPersistencePredicate(p))
197 > }
198
199 > return &persistencespb.Predicate{ convert.go
200 > PredicateType: enumsspb.PREDICATE_TYPE_AND,
201 > Attributes: &persistencespb.Predicate_AndPredicateAttributes{
202 > AndPredicateAttributes: &persistencespb.AndPredicateAttributes{
203 > Predicates: persistencePredicates,
204 > },
205 > },
206 > }
207 }
208
209 func FromPersistenceAndPredicate(
210 attributes *persistencespb.AndPredicateAttributes,
211 > ) tasks.Predicate { convert.go
212 > taskPredicates := make([]predicates.Predicate[tasks.Task], 0, len(attributes.Predicates))
213 > for _, p := range attributes.Predicates {
214 > taskPredicates = append(taskPredicates, FromPersistencePredicate(p))
215 > }
216
217 > return predicates.And(taskPredicates...) convert.go
218 }
219
220 func ToPersistenceOrPredicate(
221 orPredicate *predicates.OrImpl[tasks.Task],
222 > ) *persistencespb.Predicate { convert.go
223 > persistencePredicates := make([]*persistencespb.Predicate, 0, len(orPredicate.Predicates))
224 > for _, p := range orPredicate.Predicates {
225 > persistencePredicates = append(persistencePredicates, ToPersistencePredicate(p))
226 > }
227
228 > return &persistencespb.Predicate{ convert.go
229 > PredicateType: enumsspb.PREDICATE_TYPE_OR,
230 > Attributes: &persistencespb.Predicate_OrPredicateAttributes{
231 > OrPredicateAttributes: &persistencespb.OrPredicateAttributes{
232 > Predicates: persistencePredicates,
233 > },
234 > },
235 > }
236 }
237
238 func FromPersistenceOrPredicate(
239 attributes *persistencespb.OrPredicateAttributes,
240 > ) tasks.Predicate { convert.go
241 > taskPredicates := make([]predicates.Predicate[tasks.Task], 0, len(attributes.Predicates))
242 > for _, p := range attributes.Predicates {
243 > taskPredicates = append(taskPredicates, FromPersistencePredicate(p))
244 > }
245
246 > return predicates.Or(taskPredicates...) convert.go
247 }
248
go.temporal.io/server/api/persistence/v1/predicates.pb.go 10 introduced LOC · 2 ranges

Open complete file

106 }
107
108 > func (x *Predicate) GetAndPredicateAttributes() *AndPredicateAttributes { predicates.pb.go
109 > if x != nil {
110 > if x, ok := x.Attributes.(*Predicate_AndPredicateAttributes); ok {
111 > return x.AndPredicateAttributes
112 > }
113 }
114 return nil
115 }
116
117 > func (x *Predicate) GetOrPredicateAttributes() *OrPredicateAttributes { predicates.pb.go
118 > if x != nil {
119 > if x, ok := x.Attributes.(*Predicate_OrPredicateAttributes); ok {
120 > return x.OrPredicateAttributes
121 > }
122 }
123 return nil