private String containerName = null;
private ExecutorService executor;
protected boolean stopping;
+ private static boolean hostRefresh = true;
+ private static int hostRetryCount = 5;
private static class ARPPending {
protected InetAddress hostIP;
protected short sent_count;
int num = 1;
for (ArrayList<String> hierarchy : hierarchies) {
StringBuffer buf = new StringBuffer();
- buf.append("Hierarchy#" + num + " : ");
+ buf.append("Hierarchy#").append(num).append(" : ");
for (String switchName : hierarchy) {
- buf.append(switchName + "/");
+ buf.append(switchName).append("/");
}
logger.debug("{} -> {}", getContainerName(), buf);
num++;
*/
@SuppressWarnings("unchecked")
private void updateCurrentHierarchy(Node node, ArrayList<String> currHierarchy, List<List<String>> fullHierarchy) {
- // currHierarchy.add(String.format("%x", currSw.getId()));
currHierarchy.add(dpidToHostNameHack((Long) node.getID()));
// Shallow copy as required
ArrayList<String> currHierarchyClone = (ArrayList<String>) currHierarchy.clone();
ARPPendingList.remove(entry.getKey());
continue;
}
- if (arphost.getSent_count() < switchManager.getHostRetryCount()) {
+ if (arphost.getSent_count() < hostRetryCount) {
/*
* No reply has been received of first ARP Req, send the
* next one. Before sending the ARP, check if ARPHandler is
hostFinder.find(arphost.getHostIP());
arphost.sent_count++;
logger.debug("ARP Sent from ARPPending List, IP: {}", arphost.getHostIP().getHostAddress());
- } else if (arphost.getSent_count() >= switchManager.getHostRetryCount()) {
+ } else if (arphost.getSent_count() >= hostRetryCount) {
/*
* ARP requests have been sent without receiving a reply,
* remove this from the pending list
if ((clusterContainerService != null) && !clusterContainerService.amICoordinator()) {
return;
}
- if ((switchManager != null) && !switchManager.isHostRefreshEnabled()) {
+ if (!hostRefresh) {
/*
- * The host probe procedure was disabled by CLI
+ * The host probe procedure is turned off
*/
return;
}
short arp_cntdown = host.getArpSendCountDown();
arp_cntdown--;
- if (arp_cntdown > switchManager.getHostRetryCount()) {
+ if (arp_cntdown > hostRetryCount) {
host.setArpSendCountDown(arp_cntdown);
} else if (arp_cntdown <= 0) {
/*
*/
removeKnownHost(entry.getKey());
notifyHostLearnedOrRemoved(host, false);
- } else if (arp_cntdown <= switchManager.getHostRetryCount()) {
+ } else if (arp_cntdown <= hostRetryCount) {
/*
* Use the services of arphandler to check if host is still
* there