MCPcopy Create free account
hub / github.com/grpc/grpc-java / getServers

Method getServers

api/src/main/java/io/grpc/InternalChannelz.java:170–180  ·  view source on GitHub ↗

Returns a server list.

(long fromId, int maxPageSize)

Source from the content-addressed store, hash-verified

168
169 /** Returns a server list. */
170 public ServerList getServers(long fromId, int maxPageSize) {
171 List<InternalInstrumented<ServerStats>> serverList
172 = new ArrayList<>(maxPageSize);
173 Iterator<InternalInstrumented<ServerStats>> iterator
174 = servers.tailMap(fromId).values().iterator();
175
176 while (iterator.hasNext() && serverList.size() < maxPageSize) {
177 serverList.add(iterator.next());
178 }
179 return new ServerList(serverList, !iterator.hasNext());
180 }
181
182 /** Returns a server. */
183 @Nullable

Callers

nothing calls this directly

Calls 6

valuesMethod · 0.80
sizeMethod · 0.65
addMethod · 0.65
nextMethod · 0.65
iteratorMethod · 0.45
hasNextMethod · 0.45

Tested by

no test coverage detected