|
@@ -43,6 +43,7 @@ import org.apache.hadoop.yarn.api.records.ApplicationId;
|
|
import org.apache.hadoop.yarn.api.records.YarnClusterMetrics;
|
|
import org.apache.hadoop.yarn.api.records.YarnClusterMetrics;
|
|
import org.apache.hadoop.yarn.client.YarnClientImpl;
|
|
import org.apache.hadoop.yarn.client.YarnClientImpl;
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
|
|
+import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
|
|
import org.apache.hadoop.yarn.util.ProtoUtils;
|
|
import org.apache.hadoop.yarn.util.ProtoUtils;
|
|
|
|
|
|
public class ResourceMgrDelegate extends YarnClientImpl {
|
|
public class ResourceMgrDelegate extends YarnClientImpl {
|
|
@@ -65,11 +66,19 @@ public class ResourceMgrDelegate extends YarnClientImpl {
|
|
|
|
|
|
public TaskTrackerInfo[] getActiveTrackers() throws IOException,
|
|
public TaskTrackerInfo[] getActiveTrackers() throws IOException,
|
|
InterruptedException {
|
|
InterruptedException {
|
|
- return TypeConverter.fromYarnNodes(super.getNodeReports());
|
|
|
|
|
|
+ try {
|
|
|
|
+ return TypeConverter.fromYarnNodes(super.getNodeReports());
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public JobStatus[] getAllJobs() throws IOException, InterruptedException {
|
|
public JobStatus[] getAllJobs() throws IOException, InterruptedException {
|
|
- return TypeConverter.fromYarnApps(super.getApplicationList(), this.conf);
|
|
|
|
|
|
+ try {
|
|
|
|
+ return TypeConverter.fromYarnApps(super.getApplicationList(), this.conf);
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public TaskTrackerInfo[] getBlacklistedTrackers() throws IOException,
|
|
public TaskTrackerInfo[] getBlacklistedTrackers() throws IOException,
|
|
@@ -81,11 +90,17 @@ public class ResourceMgrDelegate extends YarnClientImpl {
|
|
|
|
|
|
public ClusterMetrics getClusterMetrics() throws IOException,
|
|
public ClusterMetrics getClusterMetrics() throws IOException,
|
|
InterruptedException {
|
|
InterruptedException {
|
|
- YarnClusterMetrics metrics = super.getYarnClusterMetrics();
|
|
|
|
- ClusterMetrics oldMetrics = new ClusterMetrics(1, 1, 1, 1, 1, 1,
|
|
|
|
- metrics.getNumNodeManagers() * 10, metrics.getNumNodeManagers() * 2, 1,
|
|
|
|
- metrics.getNumNodeManagers(), 0, 0);
|
|
|
|
- return oldMetrics;
|
|
|
|
|
|
+ try {
|
|
|
|
+ YarnClusterMetrics metrics = super.getYarnClusterMetrics();
|
|
|
|
+ ClusterMetrics oldMetrics =
|
|
|
|
+ new ClusterMetrics(1, 1, 1, 1, 1, 1,
|
|
|
|
+ metrics.getNumNodeManagers() * 10,
|
|
|
|
+ metrics.getNumNodeManagers() * 2, 1,
|
|
|
|
+ metrics.getNumNodeManagers(), 0, 0);
|
|
|
|
+ return oldMetrics;
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
InetSocketAddress getConnectAddress() {
|
|
InetSocketAddress getConnectAddress() {
|
|
@@ -95,8 +110,12 @@ public class ResourceMgrDelegate extends YarnClientImpl {
|
|
@SuppressWarnings("rawtypes")
|
|
@SuppressWarnings("rawtypes")
|
|
public Token getDelegationToken(Text renewer) throws IOException,
|
|
public Token getDelegationToken(Text renewer) throws IOException,
|
|
InterruptedException {
|
|
InterruptedException {
|
|
- return ProtoUtils.convertFromProtoFormat(
|
|
|
|
- super.getRMDelegationToken(renewer), rmAddress);
|
|
|
|
|
|
+ try {
|
|
|
|
+ return ProtoUtils.convertFromProtoFormat(
|
|
|
|
+ super.getRMDelegationToken(renewer), rmAddress);
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public String getFilesystemName() throws IOException, InterruptedException {
|
|
public String getFilesystemName() throws IOException, InterruptedException {
|
|
@@ -104,36 +123,62 @@ public class ResourceMgrDelegate extends YarnClientImpl {
|
|
}
|
|
}
|
|
|
|
|
|
public JobID getNewJobID() throws IOException, InterruptedException {
|
|
public JobID getNewJobID() throws IOException, InterruptedException {
|
|
- this.application = super.getNewApplication();
|
|
|
|
- this.applicationId = this.application.getApplicationId();
|
|
|
|
- return TypeConverter.fromYarn(applicationId);
|
|
|
|
|
|
+ try {
|
|
|
|
+ this.application = super.getNewApplication();
|
|
|
|
+ this.applicationId = this.application.getApplicationId();
|
|
|
|
+ return TypeConverter.fromYarn(applicationId);
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public QueueInfo getQueue(String queueName) throws IOException,
|
|
public QueueInfo getQueue(String queueName) throws IOException,
|
|
InterruptedException {
|
|
InterruptedException {
|
|
- org.apache.hadoop.yarn.api.records.QueueInfo queueInfo =
|
|
|
|
- super.getQueueInfo(queueName);
|
|
|
|
- return (queueInfo == null) ? null : TypeConverter.fromYarn(queueInfo, conf);
|
|
|
|
|
|
+ try {
|
|
|
|
+ org.apache.hadoop.yarn.api.records.QueueInfo queueInfo =
|
|
|
|
+ super.getQueueInfo(queueName);
|
|
|
|
+ return (queueInfo == null) ? null : TypeConverter.fromYarn(queueInfo,
|
|
|
|
+ conf);
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public QueueAclsInfo[] getQueueAclsForCurrentUser() throws IOException,
|
|
public QueueAclsInfo[] getQueueAclsForCurrentUser() throws IOException,
|
|
InterruptedException {
|
|
InterruptedException {
|
|
- return TypeConverter.fromYarnQueueUserAclsInfo(super
|
|
|
|
- .getQueueAclsInfo());
|
|
|
|
|
|
+ try {
|
|
|
|
+ return TypeConverter.fromYarnQueueUserAclsInfo(super
|
|
|
|
+ .getQueueAclsInfo());
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public QueueInfo[] getQueues() throws IOException, InterruptedException {
|
|
public QueueInfo[] getQueues() throws IOException, InterruptedException {
|
|
- return TypeConverter.fromYarnQueueInfo(super.getAllQueues(), this.conf);
|
|
|
|
|
|
+ try {
|
|
|
|
+ return TypeConverter.fromYarnQueueInfo(super.getAllQueues(), this.conf);
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public QueueInfo[] getRootQueues() throws IOException, InterruptedException {
|
|
public QueueInfo[] getRootQueues() throws IOException, InterruptedException {
|
|
- return TypeConverter.fromYarnQueueInfo(super.getRootQueueInfos(), this.conf);
|
|
|
|
|
|
+ try {
|
|
|
|
+ return TypeConverter.fromYarnQueueInfo(super.getRootQueueInfos(),
|
|
|
|
+ this.conf);
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public QueueInfo[] getChildQueues(String parent) throws IOException,
|
|
public QueueInfo[] getChildQueues(String parent) throws IOException,
|
|
InterruptedException {
|
|
InterruptedException {
|
|
- return TypeConverter.fromYarnQueueInfo(super.getChildQueueInfos(parent),
|
|
|
|
- this.conf);
|
|
|
|
|
|
+ try {
|
|
|
|
+ return TypeConverter.fromYarnQueueInfo(super.getChildQueueInfos(parent),
|
|
|
|
+ this.conf);
|
|
|
|
+ } catch (YarnRemoteException e) {
|
|
|
|
+ throw new IOException(e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public String getStagingAreaDir() throws IOException, InterruptedException {
|
|
public String getStagingAreaDir() throws IOException, InterruptedException {
|