cluster_metadata.go ×12

Frontier kind: Code frontier

unlabeled · c_f97d5e72030b

25 tests · 4137 LOC · 187 files · introduces 0 tests · 39 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
12 ranges39 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
767 ranges4137 lines · 187 files · Browse complete extent
All tests (intent)
25 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: 39 introduced LOC across 12 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite/cluster_metadata.go 39 introduced LOC · 12 ranges

Open complete file

167 ctx context.Context,
168 filter *sqlplugin.ClusterMembershipFilter,
169 > ) ([]sqlplugin.ClusterMembershipRow, error) { cluster_metadata.go
170 > var queryString strings.Builder
171 > var operands []any
172 > queryString.WriteString(templateGetClusterMembership)
173 > operands = append(operands, constMembershipPartition)
174 >
175 > if filter.HostIDEquals != nil {
176 queryString.WriteString(templateWithHostIDSuffix)
177 operands = append(operands, filter.HostIDEquals)
178 }
179
180 > if filter.RPCAddressEquals != "" { cluster_metadata.go
181 queryString.WriteString(templateWithRPCAddressSuffix)
182 operands = append(operands, filter.RPCAddressEquals)
183 }
184
185 > if filter.RoleEquals != p.All { cluster_metadata.go
186 queryString.WriteString(templateWithRoleSuffix)
187 operands = append(operands, filter.RoleEquals)
188 }
189
190 > if !filter.LastHeartbeatAfter.IsZero() { cluster_metadata.go
191 > queryString.WriteString(templateWithHeartbeatSinceSuffix)
192 > operands = append(operands, filter.LastHeartbeatAfter)
193 > }
194
195 > if !filter.RecordExpiryAfter.IsZero() { cluster_metadata.go
196 > queryString.WriteString(templateWithRecordExpirySuffix)
197 > operands = append(operands, filter.RecordExpiryAfter)
198 > }
199
200 > if !filter.SessionStartedAfter.IsZero() { cluster_metadata.go
201 queryString.WriteString(templateWithSessionStartSuffix)
202 operands = append(operands, filter.SessionStartedAfter)
203 }
204
205 > if filter.HostIDGreaterThan != nil { cluster_metadata.go
206 queryString.WriteString(templateWithHostIDGreaterSuffix)
207 operands = append(operands, filter.HostIDGreaterThan)
208 }
209
210 > queryString.WriteString(templateWithOrderBySessionStartSuffix) cluster_metadata.go
211 >
212 > if filter.MaxRecordCount > 0 {
213 queryString.WriteString(templateWithLimitSuffix)
214 operands = append(operands, filter.MaxRecordCount)
215 }
216
217 > compiledQryString := queryString.String() cluster_metadata.go
218 >
219 > var rows []sqlplugin.ClusterMembershipRow
220 > if err := mdb.conn.SelectContext(ctx,
221 > &rows,
222 > compiledQryString,
223 > operands...,
224 > ); err != nil {
225 return nil, err
226 }
227 > for i := range rows { cluster_metadata.go
228 rows[i].SessionStart = mdb.converter.FromSQLiteDateTime(rows[i].SessionStart)
229 rows[i].LastHeartbeat = mdb.converter.FromSQLiteDateTime(rows[i].LastHeartbeat)
230 rows[i].RecordExpiry = mdb.converter.FromSQLiteDateTime(rows[i].RecordExpiry)
231 }
232 > return rows, nil cluster_metadata.go
233 }
234
236 ctx context.Context,
237 filter *sqlplugin.PruneClusterMembershipFilter,
238 > ) (sql.Result, error) { cluster_metadata.go
239 > return mdb.conn.ExecContext(ctx,
240 > templatePruneStaleClusterMembership,
241 > constMembershipPartition,
242 > mdb.converter.ToSQLiteDateTime(filter.PruneRecordsBefore),
243 > )
244 > }