/** * Reset the variables -this does not adjust the fixed attributes * of the history, but the nodemap and failed node map are cleared. */ protected synchronized void reset() throws BadConfigException { nodemap = new NodeMap(roleSize); resetAvailableNodeLists(); outstandingRequests = new OutstandingRequestTracker(); }
/** * Reset the variables -this does not adjust the fixed attributes * of the history, but the nodemap and failed node map are cleared. */ protected synchronized void reset() throws BadConfigException { nodemap = new NodeMap(roleSize); resetAvailableNodeLists(); outstandingRequests = new OutstandingRequestTracker(); }
/** * (After the start), rebuild the availability data structures */ @VisibleForTesting public synchronized void buildRecentNodeLists() { resetAvailableNodeLists(); // build the list of available nodes for (Map.Entry<String, NodeInstance> entry : nodemap.entrySet()) { NodeInstance ni = entry.getValue(); for (int i = 0; i < roleSize; i++) { NodeEntry nodeEntry = ni.get(i); if (nodeEntry != null && nodeEntry.isAvailable()) { log.debug("Adding {} for role {}", ni, i); listRecentNodesForRoleId(i).add(ni); } } } // sort the resulting arrays for (int i = 0; i < roleSize; i++) { sortRecentNodeList(i); } }
/** * (After the start), rebuild the availability data structures */ @VisibleForTesting public synchronized void buildRecentNodeLists() { resetAvailableNodeLists(); // build the list of available nodes for (Map.Entry<String, NodeInstance> entry : nodemap.entrySet()) { NodeInstance ni = entry.getValue(); for (int i = 0; i < roleSize; i++) { NodeEntry nodeEntry = ni.get(i); if (nodeEntry != null && nodeEntry.isAvailable()) { log.debug("Adding {} for role {}", ni, i); listRecentNodesForRoleId(i).add(ni); } } } // sort the resulting arrays for (int i = 0; i < roleSize; i++) { sortRecentNodeList(i); } }