diff options
author | Valerij Fredriksen <valerij92@gmail.com> | 2019-02-09 20:18:41 +0100 |
---|---|---|
committer | Valerij Fredriksen <valerij92@gmail.com> | 2019-02-09 20:18:41 +0100 |
commit | 8e82da7dca738bebc18514b978614091d8e4f703 (patch) | |
tree | a227b1036f14b1895eced8c642f165f0cfefe703 /node-admin | |
parent | 55fc3eec5fd3c7e15ed9eb4bdc16c89b52c883a8 (diff) |
Iterate over entry set
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java index 546bf111e39..e6a3d740273 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeadmin/NodeAdminImpl.java @@ -91,9 +91,8 @@ public class NodeAdminImpl implements NodeAdmin { Duration timeBetweenNodeAgents = spread.dividedBy(Math.max(nodeAgentContextsByHostname.size() - 1, 1)); Instant nextAgentStart = clock.instant(); // At this point, nodeAgentContextsByHostname and nodeAgentWithSchedulerByHostname should have the same keys - for (String hostname : nodeAgentContextsByHostname.keySet()) { - NodeAgentContext context = nodeAgentContextsByHostname.get(hostname); - nodeAgentWithSchedulerByHostname.get(hostname).scheduleTickWith(context, nextAgentStart); + for (Map.Entry<String, NodeAgentContext> entry : nodeAgentContextsByHostname.entrySet()) { + nodeAgentWithSchedulerByHostname.get(entry.getKey()).scheduleTickWith(entry.getValue(), nextAgentStart); nextAgentStart = nextAgentStart.plus(timeBetweenNodeAgents); } } |