本文整理汇总了Java中org.apache.hadoop.mapreduce.TaskTrackerInfo类的典型用法代码示例。如果您正苦于以下问题:Java TaskTrackerInfo类的具体用法?Java TaskTrackerInfo怎么用?Java TaskTrackerInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TaskTrackerInfo类属于org.apache.hadoop.mapreduce包,在下文中一共展示了TaskTrackerInfo类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActiveTrackers
import org.apache.hadoop.mapreduce.TaskTrackerInfo; //导入依赖的package包/类
public TaskTrackerInfo[] getActiveTrackers() throws IOException,
InterruptedException {
try {
return TypeConverter.fromYarnNodes(
client.getNodeReports(NodeState.RUNNING));
} catch (YarnException e) {
throw new IOException(e);
}
}
示例2: arrayToStringList
import org.apache.hadoop.mapreduce.TaskTrackerInfo; //导入依赖的package包/类
private Collection<String> arrayToStringList(TaskTrackerInfo[] objs) {
Collection<String> list = new ArrayList<String>();
for (TaskTrackerInfo info: objs) {
list.add(info.getTaskTrackerName());
}
return list;
}
示例3: arrayToBlackListInfo
import org.apache.hadoop.mapreduce.TaskTrackerInfo; //导入依赖的package包/类
private Collection<BlackListInfo> arrayToBlackListInfo(TaskTrackerInfo[] objs) {
Collection<BlackListInfo> list = new ArrayList<BlackListInfo>();
for (TaskTrackerInfo info: objs) {
BlackListInfo binfo = new BlackListInfo();
binfo.setTrackerName(info.getTaskTrackerName());
binfo.setReasonForBlackListing(info.getReasonForBlacklist());
binfo.setBlackListReport(info.getBlacklistReport());
list.add(binfo);
}
return list;
}
示例4: listActiveTrackers
import org.apache.hadoop.mapreduce.TaskTrackerInfo; //导入依赖的package包/类
/**
* Display the list of active trackers
*/
private void listActiveTrackers(Cluster cluster)
throws IOException, InterruptedException {
TaskTrackerInfo[] trackers = cluster.getActiveTaskTrackers();
for (TaskTrackerInfo tracker : trackers) {
System.out.println(tracker.getTaskTrackerName());
}
}
示例5: listBlacklistedTrackers
import org.apache.hadoop.mapreduce.TaskTrackerInfo; //导入依赖的package包/类
/**
* Display the list of blacklisted trackers
*/
private void listBlacklistedTrackers(Cluster cluster)
throws IOException, InterruptedException {
TaskTrackerInfo[] trackers = cluster.getBlackListedTaskTrackers();
if (trackers.length > 0) {
System.out.println("BlackListedNode \t Reason");
}
for (TaskTrackerInfo tracker : trackers) {
System.out.println(tracker.getTaskTrackerName() + "\t" +
tracker.getReasonForBlacklist());
}
}