|
@@ -60,7 +60,9 @@ public class ClusterStatus implements Writable {
|
|
|
private int numActiveTrackers;
|
|
|
private Collection<String> activeTrackers = new ArrayList<String>();
|
|
|
private Collection<String> blacklistedTrackers = new ArrayList<String>();
|
|
|
+ private Collection<String> graylistedTrackers = new ArrayList<String>();
|
|
|
private int numBlacklistedTrackers;
|
|
|
+ private int numGraylistedTrackers;
|
|
|
private int numExcludedNodes;
|
|
|
private long ttExpiryInterval;
|
|
|
private int map_tasks;
|
|
@@ -78,7 +80,7 @@ public class ClusterStatus implements Writable {
|
|
|
/**
|
|
|
* Construct a new cluster status.
|
|
|
*
|
|
|
- * @param trackers no. of tasktrackers in the cluster
|
|
|
+ * @param trackers no. of active tasktrackers in the cluster
|
|
|
* @param maps no. of currently running map-tasks in the cluster
|
|
|
* @param reduces no. of currently running reduce-tasks in the cluster
|
|
|
* @param maxMaps the maximum no. of map tasks in the cluster
|
|
@@ -89,15 +91,16 @@ public class ClusterStatus implements Writable {
|
|
|
@Deprecated
|
|
|
ClusterStatus(int trackers, int maps, int reduces, int maxMaps,
|
|
|
int maxReduces, JobTracker.State state) {
|
|
|
- this(trackers, 0, JobTracker.TASKTRACKER_EXPIRY_INTERVAL, maps, reduces,
|
|
|
+ this(trackers, 0, 0, JobTracker.TASKTRACKER_EXPIRY_INTERVAL, maps, reduces,
|
|
|
maxMaps, maxReduces, state);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Construct a new cluster status.
|
|
|
*
|
|
|
- * @param trackers no. of tasktrackers in the cluster
|
|
|
- * @param blacklists no of blacklisted task trackers in the cluster
|
|
|
+ * @param trackers no. of active tasktrackers in the cluster (includes gray)
|
|
|
+ * @param blacklists no. of blacklisted task trackers in the cluster
|
|
|
+ * @param graylists no. of graylisted task trackers in the cluster
|
|
|
* @param ttExpiryInterval the tasktracker expiry interval
|
|
|
* @param maps no. of currently running map-tasks in the cluster
|
|
|
* @param reduces no. of currently running reduce-tasks in the cluster
|
|
@@ -105,17 +108,19 @@ public class ClusterStatus implements Writable {
|
|
|
* @param maxReduces the maximum no. of reduce tasks in the cluster
|
|
|
* @param state the {@link JobTracker.State} of the <code>JobTracker</code>
|
|
|
*/
|
|
|
- ClusterStatus(int trackers, int blacklists, long ttExpiryInterval,
|
|
|
- int maps, int reduces,
|
|
|
+ ClusterStatus(int trackers, int blacklists, int graylists,
|
|
|
+ long ttExpiryInterval, int maps, int reduces,
|
|
|
int maxMaps, int maxReduces, JobTracker.State state) {
|
|
|
- this(trackers, blacklists, ttExpiryInterval, maps, reduces, maxMaps,
|
|
|
- maxReduces, state, 0);
|
|
|
+ this(trackers, blacklists, graylists, ttExpiryInterval, maps, reduces,
|
|
|
+ maxMaps, maxReduces, state, 0);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Construct a new cluster status.
|
|
|
- * @param trackers no. of tasktrackers in the cluster
|
|
|
- * @param blacklists no of blacklisted task trackers in the cluster
|
|
|
+ *
|
|
|
+ * @param trackers no. of active tasktrackers in the cluster (includes gray)
|
|
|
+ * @param blacklists no. of blacklisted task trackers in the cluster
|
|
|
+ * @param graylists no. of graylisted task trackers in the cluster
|
|
|
* @param ttExpiryInterval the tasktracker expiry interval
|
|
|
* @param maps no. of currently running map-tasks in the cluster
|
|
|
* @param reduces no. of currently running reduce-tasks in the cluster
|
|
@@ -124,10 +129,11 @@ public class ClusterStatus implements Writable {
|
|
|
* @param state the {@link JobTracker.State} of the <code>JobTracker</code>
|
|
|
* @param numDecommissionedNodes number of decommission trackers
|
|
|
*/
|
|
|
- ClusterStatus(int trackers, int blacklists, long ttExpiryInterval,
|
|
|
+ ClusterStatus(int trackers, int blacklists, int graylists,
|
|
|
+ long ttExpiryInterval,
|
|
|
int maps, int reduces, int maxMaps, int maxReduces,
|
|
|
JobTracker.State state, int numDecommissionedNodes) {
|
|
|
- this(trackers, blacklists, ttExpiryInterval, maps, reduces,
|
|
|
+ this(trackers, blacklists, graylists, ttExpiryInterval, maps, reduces,
|
|
|
maxMaps, maxReduces, state, numDecommissionedNodes,
|
|
|
UNINITIALIZED_MEMORY_VALUE, UNINITIALIZED_MEMORY_VALUE);
|
|
|
}
|
|
@@ -135,8 +141,9 @@ public class ClusterStatus implements Writable {
|
|
|
/**
|
|
|
* Construct a new cluster status.
|
|
|
*
|
|
|
- * @param activeTrackers active tasktrackers in the cluster
|
|
|
+ * @param activeTrackers active tasktrackers in the cluster (includes gray)
|
|
|
* @param blacklistedTrackers blacklisted tasktrackers in the cluster
|
|
|
+ * @param graylistedTrackers graylisted tasktrackers in the cluster
|
|
|
* @param ttExpiryInterval the tasktracker expiry interval
|
|
|
* @param maps no. of currently running map-tasks in the cluster
|
|
|
* @param reduces no. of currently running reduce-tasks in the cluster
|
|
@@ -144,21 +151,23 @@ public class ClusterStatus implements Writable {
|
|
|
* @param maxReduces the maximum no. of reduce tasks in the cluster
|
|
|
* @param state the {@link JobTracker.State} of the <code>JobTracker</code>
|
|
|
*/
|
|
|
- ClusterStatus(Collection<String> activeTrackers,
|
|
|
- Collection<String> blacklistedTrackers,
|
|
|
- long ttExpiryInterval,
|
|
|
- int maps, int reduces, int maxMaps, int maxReduces,
|
|
|
- JobTracker.State state) {
|
|
|
- this(activeTrackers, blacklistedTrackers, ttExpiryInterval, maps, reduces,
|
|
|
- maxMaps, maxReduces, state, 0);
|
|
|
+ ClusterStatus(Collection<String> activeTrackers,
|
|
|
+ Collection<String> blacklistedTrackers,
|
|
|
+ Collection<String> graylistedTrackers,
|
|
|
+ long ttExpiryInterval,
|
|
|
+ int maps, int reduces, int maxMaps, int maxReduces,
|
|
|
+ JobTracker.State state) {
|
|
|
+ this(activeTrackers, blacklistedTrackers, graylistedTrackers,
|
|
|
+ ttExpiryInterval, maps, reduces, maxMaps, maxReduces, state, 0);
|
|
|
}
|
|
|
|
|
|
- ClusterStatus(int trackers, int blacklists, long ttExpiryInterval,
|
|
|
- int maps, int reduces, int maxMaps, int maxReduces,
|
|
|
- JobTracker.State state, int numDecommissionedNodes,
|
|
|
- long used_memory, long max_memory) {
|
|
|
+ ClusterStatus(int trackers, int blacklists, int graylists,
|
|
|
+ long ttExpiryInterval, int maps, int reduces, int maxMaps,
|
|
|
+ int maxReduces, JobTracker.State state,
|
|
|
+ int numDecommissionedNodes, long used_memory, long max_memory) {
|
|
|
numActiveTrackers = trackers;
|
|
|
numBlacklistedTrackers = blacklists;
|
|
|
+ numGraylistedTrackers = graylists;
|
|
|
this.numExcludedNodes = numDecommissionedNodes;
|
|
|
this.ttExpiryInterval = ttExpiryInterval;
|
|
|
map_tasks = maps;
|
|
@@ -172,8 +181,9 @@ public class ClusterStatus implements Writable {
|
|
|
|
|
|
/**
|
|
|
* Construct a new cluster status.
|
|
|
- * @param activeTrackers active tasktrackers in the cluster
|
|
|
+ * @param activeTrackers active tasktrackers in the cluster (includes gray)
|
|
|
* @param blacklistedTrackers blacklisted tasktrackers in the cluster
|
|
|
+ * @param graylistedTrackers graylisted tasktrackers in the cluster
|
|
|
* @param ttExpiryInterval the tasktracker expiry interval
|
|
|
* @param maps no. of currently running map-tasks in the cluster
|
|
|
* @param reduces no. of currently running reduce-tasks in the cluster
|
|
@@ -183,28 +193,33 @@ public class ClusterStatus implements Writable {
|
|
|
* @param numDecommissionNodes number of decommission trackers
|
|
|
*/
|
|
|
ClusterStatus(Collection<String> activeTrackers,
|
|
|
- Collection<String> blacklistedTrackers, long ttExpiryInterval,
|
|
|
+ Collection<String> blacklistedTrackers,
|
|
|
+ Collection<String> graylistedTrackers, long ttExpiryInterval,
|
|
|
int maps, int reduces, int maxMaps, int maxReduces,
|
|
|
JobTracker.State state, int numDecommissionNodes) {
|
|
|
- this(activeTrackers.size(), blacklistedTrackers.size(), ttExpiryInterval,
|
|
|
- maps, reduces, maxMaps, maxReduces, state, numDecommissionNodes,
|
|
|
+ this(activeTrackers.size(), blacklistedTrackers.size(),
|
|
|
+ graylistedTrackers.size(), ttExpiryInterval, maps, reduces,
|
|
|
+ maxMaps, maxReduces, state, numDecommissionNodes,
|
|
|
Runtime.getRuntime().totalMemory(), Runtime.getRuntime().maxMemory());
|
|
|
this.activeTrackers = activeTrackers;
|
|
|
this.blacklistedTrackers = blacklistedTrackers;
|
|
|
+ this.graylistedTrackers = graylistedTrackers;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get the number of task trackers in the cluster.
|
|
|
- *
|
|
|
- * @return the number of task trackers in the cluster.
|
|
|
+ * Get the number of active task trackers in the cluster. Includes
|
|
|
+ * graylisted but not blacklisted trackers.
|
|
|
+ *
|
|
|
+ * @return the number of active task trackers in the cluster.
|
|
|
*/
|
|
|
public int getTaskTrackers() {
|
|
|
return numActiveTrackers;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get the names of task trackers in the cluster.
|
|
|
- *
|
|
|
+ * Get the names of active task trackers in the cluster. Includes
|
|
|
+ * graylisted but not blacklisted trackers.
|
|
|
+ *
|
|
|
* @return the active task trackers in the cluster.
|
|
|
*/
|
|
|
public Collection<String> getActiveTrackerNames() {
|
|
@@ -212,14 +227,14 @@ public class ClusterStatus implements Writable {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Get the names of task trackers in the cluster.
|
|
|
+ * Get the names of blacklisted task trackers in the cluster.
|
|
|
*
|
|
|
* @return the blacklisted task trackers in the cluster.
|
|
|
*/
|
|
|
public Collection<String> getBlacklistedTrackerNames() {
|
|
|
return blacklistedTrackers;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* Get the number of blacklisted task trackers in the cluster.
|
|
|
*
|
|
@@ -228,7 +243,25 @@ public class ClusterStatus implements Writable {
|
|
|
public int getBlacklistedTrackers() {
|
|
|
return numBlacklistedTrackers;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the names of graylisted task trackers in the cluster.
|
|
|
+ *
|
|
|
+ * @return the graylisted task trackers in the cluster.
|
|
|
+ */
|
|
|
+ public Collection<String> getGraylistedTrackerNames() {
|
|
|
+ return graylistedTrackers;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the number of graylisted task trackers in the cluster.
|
|
|
+ *
|
|
|
+ * @return the number of graylisted task trackers in the cluster.
|
|
|
+ */
|
|
|
+ public int getGraylistedTrackers() {
|
|
|
+ return numGraylistedTrackers;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Get the number of excluded hosts in the cluster.
|
|
|
* @return the number of excluded hosts in the cluster.
|
|
@@ -330,6 +363,16 @@ public class ClusterStatus implements Writable {
|
|
|
Text.writeString(out, tracker);
|
|
|
}
|
|
|
}
|
|
|
+ if (graylistedTrackers.size() == 0) {
|
|
|
+ out.writeInt(numGraylistedTrackers);
|
|
|
+ out.writeInt(0);
|
|
|
+ } else {
|
|
|
+ out.writeInt(graylistedTrackers.size());
|
|
|
+ out.writeInt(graylistedTrackers.size());
|
|
|
+ for (String tracker : graylistedTrackers) {
|
|
|
+ Text.writeString(out, tracker);
|
|
|
+ }
|
|
|
+ }
|
|
|
out.writeInt(numExcludedNodes);
|
|
|
out.writeLong(ttExpiryInterval);
|
|
|
out.writeInt(map_tasks);
|
|
@@ -358,6 +401,14 @@ public class ClusterStatus implements Writable {
|
|
|
blacklistedTrackers.add(name);
|
|
|
}
|
|
|
}
|
|
|
+ numGraylistedTrackers = in.readInt();
|
|
|
+ numTrackerNames = in.readInt();
|
|
|
+ if (numTrackerNames > 0) {
|
|
|
+ for (int i = 0; i < numTrackerNames; i++) {
|
|
|
+ String name = Text.readString(in);
|
|
|
+ graylistedTrackers.add(name);
|
|
|
+ }
|
|
|
+ }
|
|
|
numExcludedNodes = in.readInt();
|
|
|
ttExpiryInterval = in.readLong();
|
|
|
map_tasks = in.readInt();
|