cluster_metadata_store.go ×10

Frontier kind: Code frontier

unlabeled · c_8edd3e6cb60e

7 tests · 4647 LOC · 200 files · introduces 0 tests · 39 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges39 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
865 ranges4647 lines · 200 files · Browse complete extent
All tests (intent)
7 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 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/cassandra/cluster_metadata_store.go 39 introduced LOC · 10 ranges

Open complete file

170 ctx context.Context,
171 request *p.GetClusterMembersRequest,
172 > ) (*p.GetClusterMembersResponse, error) { cluster_metadata_store.go
173 > var queryString strings.Builder
174 > var operands []any
175 > queryString.WriteString(templateGetClusterMembership)
176 > operands = append(operands, constMembershipPartition)
177 >
178 > if len(request.HostIDEquals) != 0 {
179 queryString.WriteString(templateWithHostIDSuffix)
180 operands = append(operands, request.HostIDEquals)
181 }
182
183 > if request.RPCAddressEquals != nil { cluster_metadata_store.go
184 queryString.WriteString(templateWithRPCAddressSuffix)
185 operands = append(operands, request.RPCAddressEquals)
186 }
187
188 > if request.RoleEquals != p.All { cluster_metadata_store.go
189 queryString.WriteString(templateWithRoleSuffix)
190 operands = append(operands, request.RoleEquals)
191 }
192
193 > if !request.SessionStartedAfter.IsZero() { cluster_metadata_store.go
194 queryString.WriteString(templateWithSessionSuffix)
195 operands = append(operands, request.SessionStartedAfter)
197
198 // LastHeartbeat needs to be the last one as it needs AllowFilteringSuffix
199 > if request.LastHeartbeatWithin > 0 { cluster_metadata_store.go
200 > queryString.WriteString(templateWithHeartbeatSinceSuffix)
201 > operands = append(operands, time.Now().UTC().Add(-request.LastHeartbeatWithin))
202 > }
203
204 > queryString.WriteString(templateAllowFiltering) cluster_metadata_store.go
205 > query := m.session.Query(queryString.String(), operands...).WithContext(ctx)
206 >
207 > iter := query.PageSize(request.PageSize).PageState(request.NextPageToken).Iter()
208 >
209 > var clusterMembers []*p.ClusterMember
210 >
211 > cqlHostID := make([]byte, 0, 16)
212 > rpcAddress := net.IP{}
213 > rpcPort := uint16(0)
214 > role := p.All
215 > sessionStart := time.Time{}
216 > lastHeartbeat := time.Time{}
217 > ttl := 0
218 > cassNow := time.Time{}
219 >
220 > for iter.Scan(&cqlHostID, &rpcAddress, &rpcPort, &role, &sessionStart, &lastHeartbeat, &cassNow, &ttl) {
221 member := p.ClusterMember{
222 HostID: cqlHostID,
231 }
232
233 > var pagingToken []byte cluster_metadata_store.go
234 > // contract of this API expect nil as pagination token instead of empty byte array
235 > if len(iter.PageState()) > 0 {
236 pagingToken = iter.PageState()
237 }
238
239 > if err := iter.Close(); err != nil { cluster_metadata_store.go
240 return nil, gocql.ConvertError("GetClusterMembers", err)
241 }
242
243 > return &p.GetClusterMembersResponse{ActiveMembers: clusterMembers, NextPageToken: pagingToken}, nil cluster_metadata_store.go
244 }
245
271 _ context.Context,
272 request *p.PruneClusterMembershipRequest,
273 > ) error { cluster_metadata_store.go
274 > return nil
275 > }
276
277 func (m *ClusterMetadataStore) GetName() string {