Set<ReasonForBlackListing> getReasonForBlackListing(String hostName) { synchronized (potentiallyFaultyTrackers) { FaultInfo fi = null; if ((fi = potentiallyFaultyTrackers.get(hostName)) != null) { return fi.getReasonforblacklisting(); } } return null; }
synchronized Set<ReasonForBlackListing> getReasonForBlackList(String host) { FaultInfo fi = faultyTrackers.getFaultInfo(host, false); if (fi == null) { return new HashSet<ReasonForBlackListing>(); } return fi.getReasonforblacklisting(); }
Set<ReasonForBlackListing> getReasonForBlackListing(String hostName) { synchronized (potentiallyFaultyTrackers) { FaultInfo fi = null; if ((fi = potentiallyFaultyTrackers.get(hostName)) != null) { return fi.getReasonforblacklisting(); } } return null; }
private void blackListTracker(String hostName, String reason, ReasonForBlackListing rfb) { FaultInfo fi = getFaultInfo(hostName, true); boolean blackListed = fi.isBlacklisted(); if (blackListed) { if (LOG.isDebugEnabled()) { LOG.debug("Adding blacklisted reason for tracker : " + hostName + " Reason for blacklisting is : " + rfb); } if (!fi.getReasonforblacklisting().contains(rfb)) { LOG.info("Adding blacklisted reason for tracker : " + hostName + " Reason for blacklisting is : " + rfb); } fi.addBlackListedReason(rfb, reason); } else { LOG.info("Blacklisting tracker : " + hostName + " Reason for blacklisting is : " + rfb); Set<TaskTracker> trackers = hostnameToTaskTracker.get(hostName); synchronized (trackers) { for (TaskTracker tracker : trackers) { tracker.cancelAllReservations(); } } removeHostCapacity(hostName); fi.setBlacklist(rfb, reason); } }
private void blackListTracker(String hostName, String reason, ReasonForBlackListing rfb) { FaultInfo fi = getFaultInfo(hostName, true); boolean blackListed = fi.isBlacklisted(); if(blackListed) { if (LOG.isDebugEnabled()) { LOG.debug("Adding blacklisted reason for tracker : " + hostName + " Reason for blacklisting is : " + rfb); } if (!fi.getReasonforblacklisting().contains(rfb)) { LOG.info("Adding blacklisted reason for tracker : " + hostName + " Reason for blacklisting is : " + rfb); } fi.addBlackListedReason(rfb, reason); } else { LOG.info("Blacklisting tracker : " + hostName + " Reason for blacklisting is : " + rfb); Set<TaskTracker> trackers = hostnameToTaskTracker.get(hostName); synchronized (trackers) { for (TaskTracker tracker : trackers) { tracker.cancelAllReservations(); } } removeHostCapacity(hostName); fi.setBlacklist(rfb, reason); } }
/** * Update the node health failure statistics of the given * host. * * We increment the count only when the host transitions * from healthy -> unhealthy. * * @param hostName * @param fi Fault info object for the host. */ private void updateNodeHealthFailureStatistics(String hostName, FaultInfo fi) { //Check if the node was already blacklisted due to //unhealthy reason. If so dont increment the count. if (!fi.getReasonforblacklisting().contains( ReasonForBlackListing.NODE_UNHEALTHY)) { Set<TaskTracker> trackers = hostnameToTaskTracker.get(hostName); synchronized (trackers) { for (TaskTracker t : trackers) { TaskTrackerStat stat = statistics.getTaskTrackerStat( t.getTrackerName()); stat.incrHealthCheckFailed(); } } } }
private void unBlackListTracker(String hostName, ReasonForBlackListing rfb) { // check if you can black list the tracker then call this methods FaultInfo fi = getFaultInfo(hostName, false); if(fi.removeBlackListedReason(rfb)) { if(fi.getReasonforblacklisting().isEmpty()) { addHostCapacity(hostName); LOG.info("Unblacklisting tracker : " + hostName); fi.unBlacklist(); //We have unBlackListed tracker, so tracker should //definitely be healthy. Check fault count if fault count //is zero don't keep it memory. if(fi.getFaultCount() == 0) { potentiallyFaultyTrackers.remove(hostName); } } } }
private void unBlackListTracker(String hostName, ReasonForBlackListing rfb) { // check if you can black list the tracker then call this methods FaultInfo fi = getFaultInfo(hostName, false); if (fi.removeBlackListedReason(rfb)) { if (fi.getReasonforblacklisting().isEmpty()) { addHostCapacity(hostName); LOG.info("Unblacklisting tracker : " + hostName); fi.unBlacklist(); //We have unBlackListed tracker, so tracker should //definitely be healthy. Check fault count if fault count //is zero don't keep it memory. if (fi.numFaults == 0) { potentiallyFaultyTrackers.remove(hostName); } } } }
private boolean canUnBlackListTracker(String hostName, ReasonForBlackListing rfb) { FaultInfo fi = getFaultInfo(hostName, false); if (fi == null) { return false; } Set<ReasonForBlackListing> rfbSet = fi.getReasonforblacklisting(); return fi.isBlacklisted() && rfbSet.contains(rfb); }
/** Test Methods */ synchronized Set<ReasonForBlackListing> getReasonForBlackList(String host) { FaultInfo fi = faultyTrackers.getFaultInfo(host, false); if (fi == null) { return new HashSet<ReasonForBlackListing>(); } return fi.getReasonforblacklisting(); }
private boolean canUnBlackListTracker(String hostName, ReasonForBlackListing rfb) { FaultInfo fi = getFaultInfo(hostName, false); if(fi == null) { return false; } Set<ReasonForBlackListing> rfbSet = fi.getReasonforblacklisting(); return fi.isBlacklisted() && rfbSet.contains(rfb); }