You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-commits@hadoop.apache.org by zj...@apache.org on 2014/01/17 04:26:55 UTC
svn commit: r1559004 [2/4] - in
/hadoop/common/branches/YARN-321/hadoop-yarn-project: ./
hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/
hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/
hadoop-...
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ApplicationHistoryProtocolPBServiceImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ApplicationHistoryProtocolPBServiceImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ApplicationHistoryProtocolPBServiceImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/impl/pb/service/ApplicationHistoryProtocolPBServiceImpl.java Fri Jan 17 03:26:53 2014
@@ -27,17 +27,13 @@ import org.apache.hadoop.security.proto.
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenResponseProto;
import org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProto;
import org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenResponseProto;
-import org.apache.hadoop.yarn.api.ApplicationClientProtocol;
import org.apache.hadoop.yarn.api.ApplicationHistoryProtocol;
import org.apache.hadoop.yarn.api.ApplicationHistoryProtocolPB;
import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenResponse;
-import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptReportRequest;
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptReportResponse;
-import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptsRequest;
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptsResponse;
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse;
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationsResponse;
-import org.apache.hadoop.yarn.api.protocolrecords.GetContainerReportRequest;
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerReportResponse;
import org.apache.hadoop.yarn.api.protocolrecords.GetContainersResponse;
import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenResponse;
@@ -61,14 +57,14 @@ import org.apache.hadoop.yarn.api.protoc
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RenewDelegationTokenRequestPBImpl;
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RenewDelegationTokenResponsePBImpl;
import org.apache.hadoop.yarn.exceptions.YarnException;
-import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportRequestProto;
-import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportResponseProto;
-import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationsRequestProto;
-import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationsResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationAttemptReportRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationAttemptReportResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationAttemptsRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationAttemptsResponseProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportRequestProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportResponseProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationsRequestProto;
+import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationsResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerReportRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerReportResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainersRequestProto;
@@ -90,11 +86,11 @@ public class ApplicationHistoryProtocolP
public GetApplicationReportResponseProto getApplicationReport(
RpcController arg0, GetApplicationReportRequestProto proto)
throws ServiceException {
- GetApplicationReportRequestPBImpl request = new GetApplicationReportRequestPBImpl(
- proto);
+ GetApplicationReportRequestPBImpl request =
+ new GetApplicationReportRequestPBImpl(proto);
try {
- GetApplicationReportResponse response = real
- .getApplicationReport(request);
+ GetApplicationReportResponse response =
+ real.getApplicationReport(request);
return ((GetApplicationReportResponsePBImpl) response).getProto();
} catch (YarnException e) {
throw new ServiceException(e);
@@ -106,8 +102,8 @@ public class ApplicationHistoryProtocolP
@Override
public GetApplicationsResponseProto getApplications(RpcController controller,
GetApplicationsRequestProto proto) throws ServiceException {
- GetApplicationsRequestPBImpl request = new GetApplicationsRequestPBImpl(
- proto);
+ GetApplicationsRequestPBImpl request =
+ new GetApplicationsRequestPBImpl(proto);
try {
GetApplicationsResponse response = real.getApplications(request);
return ((GetApplicationsResponsePBImpl) response).getProto();
@@ -122,11 +118,11 @@ public class ApplicationHistoryProtocolP
public GetApplicationAttemptReportResponseProto getApplicationAttemptReport(
RpcController controller, GetApplicationAttemptReportRequestProto proto)
throws ServiceException {
- GetApplicationAttemptReportRequestPBImpl request = new GetApplicationAttemptReportRequestPBImpl(
- proto);
+ GetApplicationAttemptReportRequestPBImpl request =
+ new GetApplicationAttemptReportRequestPBImpl(proto);
try {
- GetApplicationAttemptReportResponse response = real
- .getApplicationAttemptReport(request);
+ GetApplicationAttemptReportResponse response =
+ real.getApplicationAttemptReport(request);
return ((GetApplicationAttemptReportResponsePBImpl) response).getProto();
} catch (YarnException e) {
throw new ServiceException(e);
@@ -139,11 +135,11 @@ public class ApplicationHistoryProtocolP
public GetApplicationAttemptsResponseProto getApplicationAttempts(
RpcController controller, GetApplicationAttemptsRequestProto proto)
throws ServiceException {
- GetApplicationAttemptsRequestPBImpl request = new GetApplicationAttemptsRequestPBImpl(
- proto);
+ GetApplicationAttemptsRequestPBImpl request =
+ new GetApplicationAttemptsRequestPBImpl(proto);
try {
- GetApplicationAttemptsResponse response = real
- .getApplicationAttempts(request);
+ GetApplicationAttemptsResponse response =
+ real.getApplicationAttempts(request);
return ((GetApplicationAttemptsResponsePBImpl) response).getProto();
} catch (YarnException e) {
throw new ServiceException(e);
@@ -156,8 +152,8 @@ public class ApplicationHistoryProtocolP
public GetContainerReportResponseProto getContainerReport(
RpcController controller, GetContainerReportRequestProto proto)
throws ServiceException {
- GetContainerReportRequestPBImpl request = new GetContainerReportRequestPBImpl(
- proto);
+ GetContainerReportRequestPBImpl request =
+ new GetContainerReportRequestPBImpl(proto);
try {
GetContainerReportResponse response = real.getContainerReport(request);
return ((GetContainerReportResponsePBImpl) response).getProto();
@@ -186,8 +182,8 @@ public class ApplicationHistoryProtocolP
public GetDelegationTokenResponseProto getDelegationToken(
RpcController controller, GetDelegationTokenRequestProto proto)
throws ServiceException {
- GetDelegationTokenRequestPBImpl request = new GetDelegationTokenRequestPBImpl(
- proto);
+ GetDelegationTokenRequestPBImpl request =
+ new GetDelegationTokenRequestPBImpl(proto);
try {
GetDelegationTokenResponse response = real.getDelegationToken(request);
return ((GetDelegationTokenResponsePBImpl) response).getProto();
@@ -202,11 +198,11 @@ public class ApplicationHistoryProtocolP
public RenewDelegationTokenResponseProto renewDelegationToken(
RpcController controller, RenewDelegationTokenRequestProto proto)
throws ServiceException {
- RenewDelegationTokenRequestPBImpl request = new RenewDelegationTokenRequestPBImpl(
- proto);
+ RenewDelegationTokenRequestPBImpl request =
+ new RenewDelegationTokenRequestPBImpl(proto);
try {
- RenewDelegationTokenResponse response = real
- .renewDelegationToken(request);
+ RenewDelegationTokenResponse response =
+ real.renewDelegationToken(request);
return ((RenewDelegationTokenResponsePBImpl) response).getProto();
} catch (YarnException e) {
throw new ServiceException(e);
@@ -219,11 +215,11 @@ public class ApplicationHistoryProtocolP
public CancelDelegationTokenResponseProto cancelDelegationToken(
RpcController controller, CancelDelegationTokenRequestProto proto)
throws ServiceException {
- CancelDelegationTokenRequestPBImpl request = new CancelDelegationTokenRequestPBImpl(
- proto);
+ CancelDelegationTokenRequestPBImpl request =
+ new CancelDelegationTokenRequestPBImpl(proto);
try {
- CancelDelegationTokenResponse response = real
- .cancelDelegationToken(request);
+ CancelDelegationTokenResponse response =
+ real.cancelDelegationToken(request);
return ((CancelDelegationTokenResponsePBImpl) response).getProto();
} catch (YarnException e) {
throw new ServiceException(e);
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportRequestPBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportRequestPBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportRequestPBImpl.java Fri Jan 17 03:26:53 2014
@@ -81,8 +81,8 @@ public class GetApplicationAttemptReport
private void mergeLocalToBuilder() {
if (applicationAttemptId != null) {
- builder.setApplicationAttemptId(
- convertToProtoFormat(this.applicationAttemptId));
+ builder
+ .setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId));
}
}
@@ -107,8 +107,8 @@ public class GetApplicationAttemptReport
if (this.applicationAttemptId != null) {
return this.applicationAttemptId;
}
- GetApplicationAttemptReportRequestProtoOrBuilder p
- = viaProto ? proto : builder;
+ GetApplicationAttemptReportRequestProtoOrBuilder p =
+ viaProto ? proto : builder;
if (!p.hasApplicationAttemptId()) {
return null;
}
@@ -118,7 +118,8 @@ public class GetApplicationAttemptReport
}
@Override
- public void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId) {
+ public void
+ setApplicationAttemptId(ApplicationAttemptId applicationAttemptId) {
maybeInitBuilder();
if (applicationAttemptId == null) {
builder.clearApplicationAttemptId();
@@ -131,7 +132,8 @@ public class GetApplicationAttemptReport
return new ApplicationAttemptIdPBImpl(p);
}
- private ApplicationAttemptIdProto convertToProtoFormat(ApplicationAttemptId t) {
+ private ApplicationAttemptIdProto
+ convertToProtoFormat(ApplicationAttemptId t) {
return ((ApplicationAttemptIdPBImpl) t).getProto();
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportResponsePBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportResponsePBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptReportResponsePBImpl.java Fri Jan 17 03:26:53 2014
@@ -81,8 +81,8 @@ public class GetApplicationAttemptReport
private void mergeLocalToBuilder() {
if (this.applicationAttemptReport != null) {
- builder.setApplicationAttemptReport(
- convertToProtoFormat(this.applicationAttemptReport));
+ builder
+ .setApplicationAttemptReport(convertToProtoFormat(this.applicationAttemptReport));
}
}
@@ -107,8 +107,8 @@ public class GetApplicationAttemptReport
if (this.applicationAttemptReport != null) {
return this.applicationAttemptReport;
}
- GetApplicationAttemptReportResponseProtoOrBuilder p
- = viaProto ? proto : builder;
+ GetApplicationAttemptReportResponseProtoOrBuilder p =
+ viaProto ? proto : builder;
if (!p.hasApplicationAttemptReport()) {
return null;
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsRequestPBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsRequestPBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsRequestPBImpl.java Fri Jan 17 03:26:53 2014
@@ -34,8 +34,8 @@ import com.google.protobuf.TextFormat;
public class GetApplicationAttemptsRequestPBImpl extends
GetApplicationAttemptsRequest {
- GetApplicationAttemptsRequestProto proto =
- GetApplicationAttemptsRequestProto.getDefaultInstance();
+ GetApplicationAttemptsRequestProto proto = GetApplicationAttemptsRequestProto
+ .getDefaultInstance();
GetApplicationAttemptsRequestProto.Builder builder = null;
boolean viaProto = false;
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsResponsePBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsResponsePBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetApplicationAttemptsResponsePBImpl.java Fri Jan 17 03:26:53 2014
@@ -148,8 +148,8 @@ public class GetApplicationAttemptsRespo
public Iterator<ApplicationAttemptReportProto> iterator() {
return new Iterator<ApplicationAttemptReportProto>() {
- Iterator<ApplicationAttemptReport> iter =
- applicationAttemptList.iterator();
+ Iterator<ApplicationAttemptReport> iter = applicationAttemptList
+ .iterator();
@Override
public boolean hasNext() {
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportRequestPBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportRequestPBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportRequestPBImpl.java Fri Jan 17 03:26:53 2014
@@ -32,8 +32,8 @@ import com.google.protobuf.TextFormat;
@Private
@Unstable
public class GetContainerReportRequestPBImpl extends GetContainerReportRequest {
- GetContainerReportRequestProto proto =
- GetContainerReportRequestProto.getDefaultInstance();
+ GetContainerReportRequestProto proto = GetContainerReportRequestProto
+ .getDefaultInstance();
GetContainerReportRequestProto.Builder builder = null;
boolean viaProto = false;
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportResponsePBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportResponsePBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainerReportResponsePBImpl.java Fri Jan 17 03:26:53 2014
@@ -27,11 +27,11 @@ import org.apache.hadoop.yarn.proto.Yarn
import com.google.protobuf.TextFormat;
-public class GetContainerReportResponsePBImpl
- extends GetContainerReportResponse {
+public class GetContainerReportResponsePBImpl extends
+ GetContainerReportResponse {
- GetContainerReportResponseProto proto =
- GetContainerReportResponseProto.getDefaultInstance();
+ GetContainerReportResponseProto proto = GetContainerReportResponseProto
+ .getDefaultInstance();
GetContainerReportResponseProto.Builder builder = null;
boolean viaProto = false;
@@ -41,8 +41,7 @@ public class GetContainerReportResponseP
builder = GetContainerReportResponseProto.newBuilder();
}
- public GetContainerReportResponsePBImpl(
- GetContainerReportResponseProto proto) {
+ public GetContainerReportResponsePBImpl(GetContainerReportResponseProto proto) {
this.proto = proto;
viaProto = true;
}
@@ -117,8 +116,7 @@ public class GetContainerReportResponseP
this.containerReport = containerReport;
}
- private ContainerReportPBImpl convertFromProtoFormat(
- ContainerReportProto p) {
+ private ContainerReportPBImpl convertFromProtoFormat(ContainerReportProto p) {
return new ContainerReportPBImpl(p);
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersRequestPBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersRequestPBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersRequestPBImpl.java Fri Jan 17 03:26:53 2014
@@ -28,8 +28,8 @@ import org.apache.hadoop.yarn.proto.Yarn
import com.google.protobuf.TextFormat;
public class GetContainersRequestPBImpl extends GetContainersRequest {
- GetContainersRequestProto proto =
- GetContainersRequestProto.getDefaultInstance();
+ GetContainersRequestProto proto = GetContainersRequestProto
+ .getDefaultInstance();
GetContainersRequestProto.Builder builder = null;
boolean viaProto = false;
@@ -74,8 +74,8 @@ public class GetContainersRequestPBImpl
private void mergeLocalToBuilder() {
if (applicationAttemptId != null) {
- builder.setApplicationAttemptId(
- convertToProtoFormat(this.applicationAttemptId));
+ builder
+ .setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId));
}
}
@@ -110,8 +110,8 @@ public class GetContainersRequestPBImpl
}
@Override
- public void setApplicationAttemptId(
- ApplicationAttemptId applicationAttemptId) {
+ public void
+ setApplicationAttemptId(ApplicationAttemptId applicationAttemptId) {
maybeInitBuilder();
if (applicationAttemptId == null) {
builder.clearApplicationAttemptId();
@@ -124,8 +124,8 @@ public class GetContainersRequestPBImpl
return new ApplicationAttemptIdPBImpl(p);
}
- private ApplicationAttemptIdProto convertToProtoFormat(
- ApplicationAttemptId t) {
+ private ApplicationAttemptIdProto
+ convertToProtoFormat(ApplicationAttemptId t) {
return ((ApplicationAttemptIdPBImpl) t).getProto();
}
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersResponsePBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersResponsePBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetContainersResponsePBImpl.java Fri Jan 17 03:26:53 2014
@@ -35,11 +35,10 @@ import com.google.protobuf.TextFormat;
@Private
@Unstable
-public class GetContainersResponsePBImpl
-extends GetContainersResponse {
+public class GetContainersResponsePBImpl extends GetContainersResponse {
- GetContainersResponseProto proto =
- GetContainersResponseProto.getDefaultInstance();
+ GetContainersResponseProto proto = GetContainersResponseProto
+ .getDefaultInstance();
GetContainersResponseProto.Builder builder = null;
boolean viaProto = false;
@@ -140,32 +139,33 @@ extends GetContainersResponse {
if (containerList == null) {
return;
}
- Iterable<ContainerReportProto> iterable = new Iterable<ContainerReportProto>() {
- @Override
- public Iterator<ContainerReportProto> iterator() {
- return new Iterator<ContainerReportProto>() {
-
- Iterator<ContainerReport> iter = containerList.iterator();
-
+ Iterable<ContainerReportProto> iterable =
+ new Iterable<ContainerReportProto>() {
@Override
- public boolean hasNext() {
- return iter.hasNext();
- }
+ public Iterator<ContainerReportProto> iterator() {
+ return new Iterator<ContainerReportProto>() {
- @Override
- public ContainerReportProto next() {
- return convertToProtoFormat(iter.next());
- }
+ Iterator<ContainerReport> iter = containerList.iterator();
- @Override
- public void remove() {
- throw new UnsupportedOperationException();
+ @Override
+ public boolean hasNext() {
+ return iter.hasNext();
+ }
+
+ @Override
+ public ContainerReportProto next() {
+ return convertToProtoFormat(iter.next());
+ }
+
+ @Override
+ public void remove() {
+ throw new UnsupportedOperationException();
+
+ }
+ };
}
};
-
- }
- };
builder.addAllContainers(iterable);
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationAttemptReportPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationAttemptReportPBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationAttemptReportPBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ApplicationAttemptReportPBImpl.java Fri Jan 17 03:26:53 2014
@@ -31,8 +31,8 @@ import org.apache.hadoop.yarn.proto.Yarn
import com.google.protobuf.TextFormat;
public class ApplicationAttemptReportPBImpl extends ApplicationAttemptReport {
- ApplicationAttemptReportProto proto =
- ApplicationAttemptReportProto.getDefaultInstance();
+ ApplicationAttemptReportProto proto = ApplicationAttemptReportProto
+ .getDefaultInstance();
ApplicationAttemptReportProto.Builder builder = null;
boolean viaProto = false;
@@ -126,7 +126,8 @@ public class ApplicationAttemptReportPBI
}
@Override
- public void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId) {
+ public void
+ setApplicationAttemptId(ApplicationAttemptId applicationAttemptId) {
maybeInitBuilder();
if (applicationAttemptId == null)
builder.clearApplicationAttemptId();
@@ -150,7 +151,7 @@ public class ApplicationAttemptReportPBI
}
@Override
- public void setTrackingUrl(String url) {
+ public void setTrackingUrl(String url) {
maybeInitBuilder();
if (url == null) {
builder.clearTrackingUrl();
@@ -212,22 +213,22 @@ public class ApplicationAttemptReportPBI
}
private void mergeLocalToBuilder() {
- if (this.ApplicationAttemptId != null &&
- !((ApplicationAttemptIdPBImpl) this.ApplicationAttemptId)
- .getProto().equals(builder.getApplicationAttemptId())) {
- builder.setApplicationAttemptId(
- convertToProtoFormat(this.ApplicationAttemptId));
+ if (this.ApplicationAttemptId != null
+ && !((ApplicationAttemptIdPBImpl) this.ApplicationAttemptId).getProto()
+ .equals(builder.getApplicationAttemptId())) {
+ builder
+ .setApplicationAttemptId(convertToProtoFormat(this.ApplicationAttemptId));
}
if (this.amContainerId != null
&& !((ContainerIdPBImpl) this.amContainerId).getProto().equals(
- builder.getAmContainerId())) {
+ builder.getAmContainerId())) {
builder.setAmContainerId(convertToProtoFormat(this.amContainerId));
}
}
private ContainerIdProto convertToProtoFormat(ContainerId amContainerId) {
- return ((ContainerIdPBImpl)amContainerId).getProto();
+ return ((ContainerIdPBImpl) amContainerId).getProto();
}
private ContainerIdPBImpl convertFromProtoFormat(
@@ -255,8 +256,7 @@ public class ApplicationAttemptReportPBI
if (!p.hasAmContainerId()) {
return null;
}
- this.amContainerId =
- convertFromProtoFormat(p.getAmContainerId());
+ this.amContainerId = convertFromProtoFormat(p.getAmContainerId());
return this.amContainerId;
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerReportPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerReportPBImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerReportPBImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerReportPBImpl.java Fri Jan 17 03:26:53 2014
@@ -268,7 +268,7 @@ public class ContainerReportPBImpl exten
private void mergeLocalToBuilder() {
if (this.containerId != null
&& !((ContainerIdPBImpl) containerId).getProto().equals(
- builder.getContainerId())) {
+ builder.getContainerId())) {
builder.setContainerId(convertToProtoFormat(this.containerId));
}
if (this.nodeId != null
@@ -277,12 +277,12 @@ public class ContainerReportPBImpl exten
}
if (this.resource != null
&& !((ResourcePBImpl) this.resource).getProto().equals(
- builder.getResource())) {
+ builder.getResource())) {
builder.setResource(convertToProtoFormat(this.resource));
}
if (this.priority != null
&& !((PriorityPBImpl) this.priority).getProto().equals(
- builder.getPriority())) {
+ builder.getPriority())) {
builder.setPriority(convertToProtoFormat(this.priority));
}
}
@@ -334,7 +334,8 @@ public class ContainerReportPBImpl exten
return ((PriorityPBImpl) p).getProto();
}
- private ContainerStateProto convertToProtoFormat(ContainerState containerState) {
+ private ContainerStateProto
+ convertToProtoFormat(ContainerState containerState) {
return ProtoUtils.convertToProtoFormat(containerState);
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/AHSProxy.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/AHSProxy.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/AHSProxy.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/AHSProxy.java Fri Jan 17 03:26:53 2014
@@ -47,11 +47,11 @@ public class AHSProxy<T> {
final Class<T> protocol, final InetSocketAddress rmAddress)
throws IOException {
return UserGroupInformation.getCurrentUser().doAs(
- new PrivilegedAction<T>() {
- @Override
- public T run() {
- return (T) YarnRPC.create(conf).getProxy(protocol, rmAddress, conf);
- }
- });
+ new PrivilegedAction<T>() {
+ @Override
+ public T run() {
+ return (T) YarnRPC.create(conf).getProxy(protocol, rmAddress, conf);
+ }
+ });
}
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryClientService.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryClientService.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryClientService.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryClientService.java Fri Jan 17 03:26:53 2014
@@ -60,7 +60,7 @@ import org.apache.hadoop.yarn.ipc.YarnRP
public class ApplicationHistoryClientService extends AbstractService {
private static final Log LOG = LogFactory
- .getLog(ApplicationHistoryClientService.class);
+ .getLog(ApplicationHistoryClientService.class);
private ApplicationHistoryManager history;
private ApplicationHistoryProtocol protocolHandler;
private Server server;
@@ -75,18 +75,21 @@ public class ApplicationHistoryClientSer
protected void serviceStart() throws Exception {
Configuration conf = getConfig();
YarnRPC rpc = YarnRPC.create(conf);
- InetSocketAddress address = conf.getSocketAddr(
- YarnConfiguration.AHS_ADDRESS, YarnConfiguration.DEFAULT_AHS_ADDRESS,
- YarnConfiguration.DEFAULT_AHS_PORT);
-
- server = rpc.getServer(ApplicationHistoryProtocol.class, protocolHandler,
- address, conf, null, conf.getInt(
+ InetSocketAddress address =
+ conf.getSocketAddr(YarnConfiguration.AHS_ADDRESS,
+ YarnConfiguration.DEFAULT_AHS_ADDRESS,
+ YarnConfiguration.DEFAULT_AHS_PORT);
+
+ server =
+ rpc.getServer(ApplicationHistoryProtocol.class, protocolHandler,
+ address, conf, null, conf.getInt(
YarnConfiguration.AHS_CLIENT_THREAD_COUNT,
YarnConfiguration.DEFAULT_AHS_CLIENT_THREAD_COUNT));
server.start();
- this.bindAddress = conf.updateConnectAddr(YarnConfiguration.AHS_ADDRESS,
- server.getListenerAddress());
+ this.bindAddress =
+ conf.updateConnectAddr(YarnConfiguration.AHS_ADDRESS,
+ server.getListenerAddress());
LOG.info("Instantiated ApplicationHistoryClientService at "
+ this.bindAddress);
@@ -126,9 +129,9 @@ public class ApplicationHistoryClientSer
GetApplicationAttemptReportRequest request) throws YarnException,
IOException {
try {
- GetApplicationAttemptReportResponse response = GetApplicationAttemptReportResponse
- .newInstance(history.getApplicationAttempt(request
- .getApplicationAttemptId()));
+ GetApplicationAttemptReportResponse response =
+ GetApplicationAttemptReportResponse.newInstance(history
+ .getApplicationAttempt(request.getApplicationAttemptId()));
return response;
} catch (IOException e) {
throw new ApplicationAttemptNotFoundException(e.getMessage());
@@ -139,8 +142,9 @@ public class ApplicationHistoryClientSer
public GetApplicationAttemptsResponse getApplicationAttempts(
GetApplicationAttemptsRequest request) throws YarnException,
IOException {
- GetApplicationAttemptsResponse response = GetApplicationAttemptsResponse
- .newInstance(new ArrayList<ApplicationAttemptReport>(history
+ GetApplicationAttemptsResponse response =
+ GetApplicationAttemptsResponse
+ .newInstance(new ArrayList<ApplicationAttemptReport>(history
.getApplicationAttempts(request.getApplicationId()).values()));
return response;
}
@@ -150,8 +154,9 @@ public class ApplicationHistoryClientSer
GetApplicationReportRequest request) throws YarnException, IOException {
try {
ApplicationId applicationId = request.getApplicationId();
- GetApplicationReportResponse response = GetApplicationReportResponse
- .newInstance(history.getApplication(applicationId));
+ GetApplicationReportResponse response =
+ GetApplicationReportResponse.newInstance(history
+ .getApplication(applicationId));
return response;
} catch (IOException e) {
throw new ApplicationNotFoundException(e.getMessage());
@@ -161,9 +166,9 @@ public class ApplicationHistoryClientSer
@Override
public GetApplicationsResponse getApplications(
GetApplicationsRequest request) throws YarnException, IOException {
- GetApplicationsResponse response = GetApplicationsResponse
- .newInstance(new ArrayList<ApplicationReport>(history
- .getAllApplications().values()));
+ GetApplicationsResponse response =
+ GetApplicationsResponse.newInstance(new ArrayList<ApplicationReport>(
+ history.getAllApplications().values()));
return response;
}
@@ -171,8 +176,9 @@ public class ApplicationHistoryClientSer
public GetContainerReportResponse getContainerReport(
GetContainerReportRequest request) throws YarnException, IOException {
try {
- GetContainerReportResponse response = GetContainerReportResponse
- .newInstance(history.getContainer(request.getContainerId()));
+ GetContainerReportResponse response =
+ GetContainerReportResponse.newInstance(history.getContainer(request
+ .getContainerId()));
return response;
} catch (IOException e) {
throw new ContainerNotFoundException(e.getMessage());
@@ -182,9 +188,9 @@ public class ApplicationHistoryClientSer
@Override
public GetContainersResponse getContainers(GetContainersRequest request)
throws YarnException, IOException {
- GetContainersResponse response = GetContainersResponse
- .newInstance(new ArrayList<ContainerReport>(history.getContainers(
- request.getApplicationAttemptId()).values()));
+ GetContainersResponse response =
+ GetContainersResponse.newInstance(new ArrayList<ContainerReport>(
+ history.getContainers(request.getApplicationAttemptId()).values()));
return response;
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerImpl.java Fri Jan 17 03:26:53 2014
@@ -45,7 +45,7 @@ import com.google.common.annotations.Vis
public class ApplicationHistoryManagerImpl extends AbstractService implements
ApplicationHistoryManager {
private static final Log LOG = LogFactory
- .getLog(ApplicationHistoryManagerImpl.class);
+ .getLog(ApplicationHistoryManagerImpl.class);
private static final String UNAVAILABLE = "N/A";
private ApplicationHistoryStore historyStore;
@@ -79,8 +79,8 @@ public class ApplicationHistoryManagerIm
protected ApplicationHistoryStore createApplicationHistoryStore(
Configuration conf) {
return ReflectionUtils.newInstance(conf.getClass(
- YarnConfiguration.AHS_STORE, FileSystemApplicationHistoryStore.class,
- ApplicationHistoryStore.class), conf);
+ YarnConfiguration.AHS_STORE, FileSystemApplicationHistoryStore.class,
+ ApplicationHistoryStore.class), conf);
}
@Override
@@ -92,9 +92,10 @@ public class ApplicationHistoryManagerIm
@Override
public Map<ApplicationId, ApplicationReport> getAllApplications()
throws IOException {
- Map<ApplicationId, ApplicationHistoryData> histData = historyStore
- .getAllApplications();
- HashMap<ApplicationId, ApplicationReport> applicationsReport = new HashMap<ApplicationId, ApplicationReport>();
+ Map<ApplicationId, ApplicationHistoryData> histData =
+ historyStore.getAllApplications();
+ HashMap<ApplicationId, ApplicationReport> applicationsReport =
+ new HashMap<ApplicationId, ApplicationReport>();
for (Entry<ApplicationId, ApplicationHistoryData> entry : histData
.entrySet()) {
applicationsReport.put(entry.getKey(),
@@ -116,8 +117,8 @@ public class ApplicationHistoryManagerIm
String host = UNAVAILABLE;
int rpcPort = -1;
- ApplicationAttemptHistoryData lastAttempt = getLastAttempt(appHistory
- .getApplicationId());
+ ApplicationAttemptHistoryData lastAttempt =
+ getLastAttempt(appHistory.getApplicationId());
if (lastAttempt != null) {
currentApplicationAttemptId = lastAttempt.getApplicationAttemptId();
trackingUrl = lastAttempt.getTrackingURL();
@@ -125,18 +126,18 @@ public class ApplicationHistoryManagerIm
rpcPort = lastAttempt.getRPCPort();
}
return ApplicationReport.newInstance(appHistory.getApplicationId(),
- currentApplicationAttemptId, appHistory.getUser(), appHistory
- .getQueue(), appHistory.getApplicationName(), host, rpcPort, null,
- appHistory.getYarnApplicationState(), appHistory.getDiagnosticsInfo(),
- trackingUrl, appHistory.getStartTime(), appHistory.getFinishTime(),
- appHistory.getFinalApplicationStatus(), null, "", 100, appHistory
- .getApplicationType(), null);
+ currentApplicationAttemptId, appHistory.getUser(), appHistory.getQueue(),
+ appHistory.getApplicationName(), host, rpcPort, null,
+ appHistory.getYarnApplicationState(), appHistory.getDiagnosticsInfo(),
+ trackingUrl, appHistory.getStartTime(), appHistory.getFinishTime(),
+ appHistory.getFinalApplicationStatus(), null, "", 100,
+ appHistory.getApplicationType(), null);
}
private ApplicationAttemptHistoryData getLastAttempt(ApplicationId appId)
throws IOException {
- Map<ApplicationAttemptId, ApplicationAttemptHistoryData> attempts = historyStore
- .getApplicationAttempts(appId);
+ Map<ApplicationAttemptId, ApplicationAttemptHistoryData> attempts =
+ historyStore.getApplicationAttempts(appId);
ApplicationAttemptId prevMaxAttemptId = null;
for (ApplicationAttemptId attemptId : attempts.keySet()) {
if (prevMaxAttemptId == null) {
@@ -152,27 +153,28 @@ public class ApplicationHistoryManagerIm
private ApplicationAttemptReport convertToApplicationAttemptReport(
ApplicationAttemptHistoryData appAttemptHistory) {
- return ApplicationAttemptReport.newInstance(appAttemptHistory
- .getApplicationAttemptId(), appAttemptHistory.getHost(),
- appAttemptHistory.getRPCPort(), appAttemptHistory.getTrackingURL(),
- appAttemptHistory.getDiagnosticsInfo(),
- appAttemptHistory.getYarnApplicationAttemptState(),
- appAttemptHistory.getMasterContainerId());
+ return ApplicationAttemptReport.newInstance(
+ appAttemptHistory.getApplicationAttemptId(), appAttemptHistory.getHost(),
+ appAttemptHistory.getRPCPort(), appAttemptHistory.getTrackingURL(),
+ appAttemptHistory.getDiagnosticsInfo(),
+ appAttemptHistory.getYarnApplicationAttemptState(),
+ appAttemptHistory.getMasterContainerId());
}
@Override
public ApplicationAttemptReport getApplicationAttempt(
ApplicationAttemptId appAttemptId) throws IOException {
return convertToApplicationAttemptReport(historyStore
- .getApplicationAttempt(appAttemptId));
+ .getApplicationAttempt(appAttemptId));
}
@Override
- public Map<ApplicationAttemptId, ApplicationAttemptReport> getApplicationAttempts(
- ApplicationId appId) throws IOException {
- Map<ApplicationAttemptId, ApplicationAttemptHistoryData> histData = historyStore
- .getApplicationAttempts(appId);
- HashMap<ApplicationAttemptId, ApplicationAttemptReport> applicationAttemptsReport = new HashMap<ApplicationAttemptId, ApplicationAttemptReport>();
+ public Map<ApplicationAttemptId, ApplicationAttemptReport>
+ getApplicationAttempts(ApplicationId appId) throws IOException {
+ Map<ApplicationAttemptId, ApplicationAttemptHistoryData> histData =
+ historyStore.getApplicationAttempts(appId);
+ HashMap<ApplicationAttemptId, ApplicationAttemptReport> applicationAttemptsReport =
+ new HashMap<ApplicationAttemptId, ApplicationAttemptReport>();
for (Entry<ApplicationAttemptId, ApplicationAttemptHistoryData> entry : histData
.entrySet()) {
applicationAttemptsReport.put(entry.getKey(),
@@ -190,20 +192,21 @@ public class ApplicationHistoryManagerIm
private ContainerReport convertToContainerReport(
ContainerHistoryData containerHistory) {
return ContainerReport.newInstance(containerHistory.getContainerId(),
- containerHistory.getAllocatedResource(), containerHistory
- .getAssignedNode(), containerHistory.getPriority(),
- containerHistory.getStartTime(), containerHistory.getFinishTime(),
- containerHistory.getDiagnosticsInfo(), containerHistory.getLogURL(),
- containerHistory.getContainerExitStatus(), containerHistory
- .getContainerState());
+ containerHistory.getAllocatedResource(),
+ containerHistory.getAssignedNode(), containerHistory.getPriority(),
+ containerHistory.getStartTime(), containerHistory.getFinishTime(),
+ containerHistory.getDiagnosticsInfo(), containerHistory.getLogURL(),
+ containerHistory.getContainerExitStatus(),
+ containerHistory.getContainerState());
}
@Override
public Map<ContainerId, ContainerReport> getContainers(
ApplicationAttemptId appAttemptId) throws IOException {
- Map<ContainerId, ContainerHistoryData> histData = historyStore
- .getContainers(appAttemptId);
- HashMap<ContainerId, ContainerReport> containersReport = new HashMap<ContainerId, ContainerReport>();
+ Map<ContainerId, ContainerHistoryData> histData =
+ historyStore.getContainers(appAttemptId);
+ HashMap<ContainerId, ContainerReport> containersReport =
+ new HashMap<ContainerId, ContainerReport>();
for (Entry<ContainerId, ContainerHistoryData> entry : histData.entrySet()) {
containersReport.put(entry.getKey(),
convertToContainerReport(entry.getValue()));
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryReader.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryReader.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryReader.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryReader.java Fri Jan 17 03:26:53 2014
@@ -37,7 +37,8 @@ public interface ApplicationHistoryReade
/**
* This method returns Application {@link ApplicationHistoryData} for the
* specified {@link ApplicationId}.
- * @param appId
+ *
+ * @param appId
*
* @return {@link ApplicationHistoryData} for the ApplicationId.
* @throws IOException
@@ -57,19 +58,21 @@ public interface ApplicationHistoryReade
* Application can have multiple application attempts
* {@link ApplicationAttemptHistoryData}. This method returns the all
* {@link ApplicationAttemptHistoryData}s for the Application.
- * @param appId
+ *
+ * @param appId
*
* @return all {@link ApplicationAttemptHistoryData}s for the Application.
* @throws IOException
*/
- Map<ApplicationAttemptId, ApplicationAttemptHistoryData> getApplicationAttempts(
- ApplicationId appId) throws IOException;
+ Map<ApplicationAttemptId, ApplicationAttemptHistoryData>
+ getApplicationAttempts(ApplicationId appId) throws IOException;
/**
* This method returns {@link ApplicationAttemptHistoryData} for specified
* {@link ApplicationId}.
*
- * @param appAttemptId {@link ApplicationAttemptId}
+ * @param appAttemptId
+ * {@link ApplicationAttemptId}
* @return {@link ApplicationAttemptHistoryData} for ApplicationAttemptId
* @throws IOException
*/
@@ -80,7 +83,8 @@ public interface ApplicationHistoryReade
* This method returns {@link ContainerHistoryData} for specified
* {@link ContainerId}.
*
- * @param containerId {@link ContainerId}
+ * @param containerId
+ * {@link ContainerId}
* @return {@link ContainerHistoryData} for ContainerId
* @throws IOException
*/
@@ -90,13 +94,14 @@ public interface ApplicationHistoryReade
* This method returns {@link ContainerHistoryData} for specified
* {@link ApplicationAttemptId}.
*
- * @param appAttemptId {@link ApplicationAttemptId}
+ * @param appAttemptId
+ * {@link ApplicationAttemptId}
* @return {@link ContainerHistoryData} for ApplicationAttemptId
* @throws IOException
*/
ContainerHistoryData getAMContainer(ApplicationAttemptId appAttemptId)
throws IOException;
-
+
/**
* This method returns Map{@link ContainerId} to {@link ContainerHistoryData}
* for specified {@link ApplicationAttemptId}.
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java Fri Jan 17 03:26:53 2014
@@ -47,7 +47,7 @@ public class ApplicationHistoryServer ex
public static final int SHUTDOWN_HOOK_PRIORITY = 30;
private static final Log LOG = LogFactory
- .getLog(ApplicationHistoryServer.class);
+ .getLog(ApplicationHistoryServer.class);
ApplicationHistoryClientService ahsClientService;
ApplicationHistoryManager historyManager;
@@ -91,8 +91,9 @@ public class ApplicationHistoryServer ex
return this.ahsClientService;
}
- protected ApplicationHistoryClientService createApplicationHistoryClientService(
- ApplicationHistoryManager historyManager) {
+ protected ApplicationHistoryClientService
+ createApplicationHistoryClientService(
+ ApplicationHistoryManager historyManager) {
return new ApplicationHistoryClientService(historyManager);
}
@@ -106,15 +107,15 @@ public class ApplicationHistoryServer ex
static ApplicationHistoryServer launchAppHistoryServer(String[] args) {
Thread
- .setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
+ .setDefaultUncaughtExceptionHandler(new YarnUncaughtExceptionHandler());
StringUtils.startupShutdownMessage(ApplicationHistoryServer.class, args,
- LOG);
+ LOG);
ApplicationHistoryServer appHistoryServer = null;
try {
appHistoryServer = new ApplicationHistoryServer();
ShutdownHookManager.get().addShutdownHook(
- new CompositeServiceShutdownHook(appHistoryServer),
- SHUTDOWN_HOOK_PRIORITY);
+ new CompositeServiceShutdownHook(appHistoryServer),
+ SHUTDOWN_HOOK_PRIORITY);
YarnConfiguration conf = new YarnConfiguration();
appHistoryServer.init(conf);
appHistoryServer.start();
@@ -138,16 +139,16 @@ public class ApplicationHistoryServer ex
String bindAddress = WebAppUtils.getAHSWebAppURLWithoutScheme(getConfig());
LOG.info("Instantiating AHSWebApp at " + bindAddress);
try {
- webApp = WebApps
- .$for("applicationhistory", ApplicationHistoryClientService.class,
+ webApp =
+ WebApps
+ .$for("applicationhistory", ApplicationHistoryClientService.class,
ahsClientService, "ws")
- .with(getConfig())
- .withHttpSpnegoPrincipalKey(
+ .with(getConfig())
+ .withHttpSpnegoPrincipalKey(
YarnConfiguration.AHS_WEBAPP_SPNEGO_USER_NAME_KEY)
- .withHttpSpnegoKeytabKey(
+ .withHttpSpnegoKeytabKey(
YarnConfiguration.AHS_WEBAPP_SPNEGO_KEYTAB_FILE_KEY)
- .at(bindAddress)
- .start(new AHSWebApp(historyManager));
+ .at(bindAddress).start(new AHSWebApp(historyManager));
} catch (Exception e) {
String msg = "AHSWebApp failed to start.";
LOG.error(msg, e);
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryWriter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryWriter.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryWriter.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryWriter.java Fri Jan 17 03:26:53 2014
@@ -70,8 +70,8 @@ public interface ApplicationHistoryWrite
* available when it starts
* @throws IOException
*/
- void applicationAttemptStarted(
- ApplicationAttemptStartData appAttemptStart) throws IOException;
+ void applicationAttemptStarted(ApplicationAttemptStartData appAttemptStart)
+ throws IOException;
/**
* This method writes the information of <code>RMAppAttempt</code> that is
@@ -82,8 +82,9 @@ public interface ApplicationHistoryWrite
* available when it finishes
* @throws IOException
*/
- void applicationAttemptFinished(
- ApplicationAttemptFinishData appAttemptFinish) throws IOException;
+ void
+ applicationAttemptFinished(ApplicationAttemptFinishData appAttemptFinish)
+ throws IOException;
/**
* This method writes the information of <code>RMContainer</code> that is
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/FileSystemApplicationHistoryStore.java Fri Jan 17 03:26:53 2014
@@ -89,16 +89,16 @@ public class FileSystemApplicationHistor
implements ApplicationHistoryStore {
private static final Log LOG = LogFactory
- .getLog(FileSystemApplicationHistoryStore.class);
+ .getLog(FileSystemApplicationHistoryStore.class);
private static final String ROOT_DIR_NAME = "ApplicationHistoryDataRoot";
private static final int MIN_BLOCK_SIZE = 256 * 1024;
private static final String START_DATA_SUFFIX = "_start";
private static final String FINISH_DATA_SUFFIX = "_finish";
- private static final FsPermission ROOT_DIR_UMASK =
- FsPermission.createImmutable((short) 0740);
- private static final FsPermission HISTORY_FILE_UMASK =
- FsPermission.createImmutable((short) 0640);
+ private static final FsPermission ROOT_DIR_UMASK = FsPermission
+ .createImmutable((short) 0740);
+ private static final FsPermission HISTORY_FILE_UMASK = FsPermission
+ .createImmutable((short) 0640);
private FileSystem fs;
private Path rootDirPath;
@@ -112,8 +112,8 @@ public class FileSystemApplicationHistor
@Override
public void serviceInit(Configuration conf) throws Exception {
- Path fsWorkingPath = new Path(
- conf.get(YarnConfiguration.FS_HISTORY_STORE_URI));
+ Path fsWorkingPath =
+ new Path(conf.get(YarnConfiguration.FS_HISTORY_STORE_URI));
rootDirPath = new Path(fsWorkingPath, ROOT_DIR_NAME);
try {
fs = fsWorkingPath.getFileSystem(conf);
@@ -130,7 +130,7 @@ public class FileSystemApplicationHistor
public void serviceStop() throws Exception {
try {
for (Entry<ApplicationId, HistoryFileWriter> entry : outstandingWriters
- .entrySet()) {
+ .entrySet()) {
entry.getValue().close();
}
outstandingWriters.clear();
@@ -148,9 +148,9 @@ public class FileSystemApplicationHistor
boolean readStartData = false;
boolean readFinishData = false;
ApplicationHistoryData historyData =
- ApplicationHistoryData.newInstance(
- appId, null, null, null, null, Long.MIN_VALUE, Long.MIN_VALUE,
- Long.MAX_VALUE, null, FinalApplicationStatus.UNDEFINED, null);
+ ApplicationHistoryData.newInstance(appId, null, null, null, null,
+ Long.MIN_VALUE, Long.MIN_VALUE, Long.MAX_VALUE, null,
+ FinalApplicationStatus.UNDEFINED, null);
while ((!readStartData || !readFinishData) && hfReader.hasNext()) {
HistoryFileReader.Entry entry = hfReader.next();
if (entry.key.id.equals(appId.toString())) {
@@ -238,15 +238,14 @@ public class FileSystemApplicationHistor
hfReader.close();
}
for (Map.Entry<ApplicationAttemptId, StartFinishDataPair<ApplicationAttemptStartData, ApplicationAttemptFinishData>> entry : startFinshDataMap
- .entrySet()) {
+ .entrySet()) {
ApplicationAttemptHistoryData historyData =
- ApplicationAttemptHistoryData.newInstance(
- entry.getKey(), null, -1, null, null, null,
- FinalApplicationStatus.UNDEFINED, null);
+ ApplicationAttemptHistoryData.newInstance(entry.getKey(), null, -1,
+ null, null, null, FinalApplicationStatus.UNDEFINED, null);
mergeApplicationAttemptHistoryData(historyData,
- entry.getValue().startData);
+ entry.getValue().startData);
mergeApplicationAttemptHistoryData(historyData,
- entry.getValue().finishData);
+ entry.getValue().finishData);
historyDataMap.put(entry.getKey(), historyData);
}
return historyDataMap;
@@ -286,9 +285,8 @@ public class FileSystemApplicationHistor
boolean readStartData = false;
boolean readFinishData = false;
ApplicationAttemptHistoryData historyData =
- ApplicationAttemptHistoryData.newInstance(
- appAttemptId, null, -1, null, null, null,
- FinalApplicationStatus.UNDEFINED, null);
+ ApplicationAttemptHistoryData.newInstance(appAttemptId, null, -1,
+ null, null, null, FinalApplicationStatus.UNDEFINED, null);
while ((!readStartData || !readFinishData) && hfReader.hasNext()) {
HistoryFileReader.Entry entry = hfReader.next();
if (entry.key.id.equals(appAttemptId.toString())) {
@@ -333,20 +331,19 @@ public class FileSystemApplicationHistor
throws IOException {
HistoryFileReader hfReader =
getHistoryFileReader(containerId.getApplicationAttemptId()
- .getApplicationId());
+ .getApplicationId());
try {
boolean readStartData = false;
boolean readFinishData = false;
ContainerHistoryData historyData =
- ContainerHistoryData.newInstance(containerId, null, null, null,
- Long.MIN_VALUE, Long.MAX_VALUE, null, null, Integer.MAX_VALUE,
- null);
+ ContainerHistoryData
+ .newInstance(containerId, null, null, null, Long.MIN_VALUE,
+ Long.MAX_VALUE, null, null, Integer.MAX_VALUE, null);
while ((!readStartData || !readFinishData) && hfReader.hasNext()) {
HistoryFileReader.Entry entry = hfReader.next();
if (entry.key.id.equals(containerId.toString())) {
if (entry.key.suffix.equals(START_DATA_SUFFIX)) {
- ContainerStartData startData =
- parseContainerStartData(entry.value);
+ ContainerStartData startData = parseContainerStartData(entry.value);
mergeContainerHistoryData(historyData, startData);
readStartData = true;
} else if (entry.key.suffix.equals(FINISH_DATA_SUFFIX)) {
@@ -404,10 +401,10 @@ public class FileSystemApplicationHistor
if (entry.key.id.startsWith(ConverterUtils.CONTAINER_PREFIX)) {
if (entry.key.suffix.equals(START_DATA_SUFFIX)) {
retrieveStartFinishData(appAttemptId, entry, startFinshDataMap,
- true);
+ true);
} else if (entry.key.suffix.equals(FINISH_DATA_SUFFIX)) {
retrieveStartFinishData(appAttemptId, entry, startFinshDataMap,
- false);
+ false);
}
}
}
@@ -420,11 +417,11 @@ public class FileSystemApplicationHistor
hfReader.close();
}
for (Map.Entry<ContainerId, StartFinishDataPair<ContainerStartData, ContainerFinishData>> entry : startFinshDataMap
- .entrySet()) {
+ .entrySet()) {
ContainerHistoryData historyData =
- ContainerHistoryData.newInstance(entry.getKey(), null, null, null,
- Long.MIN_VALUE, Long.MAX_VALUE, null, null, Integer.MAX_VALUE,
- null);
+ ContainerHistoryData
+ .newInstance(entry.getKey(), null, null, null, Long.MIN_VALUE,
+ Long.MAX_VALUE, null, null, Integer.MAX_VALUE, null);
mergeContainerHistoryData(historyData, entry.getValue().startData);
mergeContainerHistoryData(historyData, entry.getValue().finishData);
historyDataMap.put(entry.getKey(), historyData);
@@ -439,8 +436,7 @@ public class FileSystemApplicationHistor
HistoryFileReader.Entry entry,
Map<ContainerId, StartFinishDataPair<ContainerStartData, ContainerFinishData>> startFinshDataMap,
boolean start) throws IOException {
- ContainerId containerId =
- ConverterUtils.toContainerId(entry.key.id);
+ ContainerId containerId = ConverterUtils.toContainerId(entry.key.id);
if (containerId.getApplicationAttemptId().equals(appAttemptId)) {
StartFinishDataPair<ContainerStartData, ContainerFinishData> pair =
startFinshDataMap.get(containerId);
@@ -482,9 +478,8 @@ public class FileSystemApplicationHistor
assert appStart instanceof ApplicationStartDataPBImpl;
try {
hfWriter.writeHistoryData(new HistoryDataKey(appStart.getApplicationId()
- .toString(), START_DATA_SUFFIX),
- ((ApplicationStartDataPBImpl) appStart)
- .getProto().toByteArray());
+ .toString(), START_DATA_SUFFIX),
+ ((ApplicationStartDataPBImpl) appStart).getProto().toByteArray());
LOG.info("Start information of application "
+ appStart.getApplicationId() + " is written");
} catch (IOException e) {
@@ -501,10 +496,9 @@ public class FileSystemApplicationHistor
getHistoryFileWriter(appFinish.getApplicationId());
assert appFinish instanceof ApplicationFinishDataPBImpl;
try {
- hfWriter.writeHistoryData(
- new HistoryDataKey(appFinish.getApplicationId().toString(),
- FINISH_DATA_SUFFIX),
- ((ApplicationFinishDataPBImpl) appFinish).getProto().toByteArray());
+ hfWriter.writeHistoryData(new HistoryDataKey(appFinish.getApplicationId()
+ .toString(), FINISH_DATA_SUFFIX),
+ ((ApplicationFinishDataPBImpl) appFinish).getProto().toByteArray());
LOG.info("Finish information of application "
+ appFinish.getApplicationId() + " is written");
} catch (IOException e) {
@@ -522,15 +516,13 @@ public class FileSystemApplicationHistor
ApplicationAttemptStartData appAttemptStart) throws IOException {
HistoryFileWriter hfWriter =
getHistoryFileWriter(appAttemptStart.getApplicationAttemptId()
- .getApplicationId());
+ .getApplicationId());
assert appAttemptStart instanceof ApplicationAttemptStartDataPBImpl;
try {
- hfWriter.writeHistoryData(
- new HistoryDataKey(appAttemptStart.getApplicationAttemptId()
- .toString(),
- START_DATA_SUFFIX),
- ((ApplicationAttemptStartDataPBImpl) appAttemptStart).getProto()
- .toByteArray());
+ hfWriter.writeHistoryData(new HistoryDataKey(appAttemptStart
+ .getApplicationAttemptId().toString(), START_DATA_SUFFIX),
+ ((ApplicationAttemptStartDataPBImpl) appAttemptStart).getProto()
+ .toByteArray());
LOG.info("Start information of application attempt "
+ appAttemptStart.getApplicationAttemptId() + " is written");
} catch (IOException e) {
@@ -545,15 +537,13 @@ public class FileSystemApplicationHistor
ApplicationAttemptFinishData appAttemptFinish) throws IOException {
HistoryFileWriter hfWriter =
getHistoryFileWriter(appAttemptFinish.getApplicationAttemptId()
- .getApplicationId());
+ .getApplicationId());
assert appAttemptFinish instanceof ApplicationAttemptFinishDataPBImpl;
try {
- hfWriter.writeHistoryData(
- new HistoryDataKey(appAttemptFinish.getApplicationAttemptId()
- .toString(),
- FINISH_DATA_SUFFIX),
- ((ApplicationAttemptFinishDataPBImpl) appAttemptFinish).getProto()
- .toByteArray());
+ hfWriter.writeHistoryData(new HistoryDataKey(appAttemptFinish
+ .getApplicationAttemptId().toString(), FINISH_DATA_SUFFIX),
+ ((ApplicationAttemptFinishDataPBImpl) appAttemptFinish).getProto()
+ .toByteArray());
LOG.info("Finish information of application attempt "
+ appAttemptFinish.getApplicationAttemptId() + " is written");
} catch (IOException e) {
@@ -568,14 +558,12 @@ public class FileSystemApplicationHistor
throws IOException {
HistoryFileWriter hfWriter =
getHistoryFileWriter(containerStart.getContainerId()
- .getApplicationAttemptId()
- .getApplicationId());
+ .getApplicationAttemptId().getApplicationId());
assert containerStart instanceof ContainerStartDataPBImpl;
try {
- hfWriter.writeHistoryData(
- new HistoryDataKey(containerStart.getContainerId().toString(),
- START_DATA_SUFFIX),
- ((ContainerStartDataPBImpl) containerStart).getProto().toByteArray());
+ hfWriter.writeHistoryData(new HistoryDataKey(containerStart
+ .getContainerId().toString(), START_DATA_SUFFIX),
+ ((ContainerStartDataPBImpl) containerStart).getProto().toByteArray());
LOG.info("Start information of container "
+ containerStart.getContainerId() + " is written");
} catch (IOException e) {
@@ -590,14 +578,12 @@ public class FileSystemApplicationHistor
throws IOException {
HistoryFileWriter hfWriter =
getHistoryFileWriter(containerFinish.getContainerId()
- .getApplicationAttemptId().getApplicationId());
+ .getApplicationAttemptId().getApplicationId());
assert containerFinish instanceof ContainerFinishDataPBImpl;
try {
- hfWriter.writeHistoryData(
- new HistoryDataKey(containerFinish.getContainerId().toString(),
- FINISH_DATA_SUFFIX),
- ((ContainerFinishDataPBImpl) containerFinish).getProto()
- .toByteArray());
+ hfWriter.writeHistoryData(new HistoryDataKey(containerFinish
+ .getContainerId().toString(), FINISH_DATA_SUFFIX),
+ ((ContainerFinishDataPBImpl) containerFinish).getProto().toByteArray());
LOG.info("Finish information of container "
+ containerFinish.getContainerId() + " is written");
} catch (IOException e) {
@@ -609,43 +595,42 @@ public class FileSystemApplicationHistor
private static ApplicationStartData parseApplicationStartData(byte[] value)
throws InvalidProtocolBufferException {
return new ApplicationStartDataPBImpl(
- ApplicationStartDataProto.parseFrom(value));
+ ApplicationStartDataProto.parseFrom(value));
}
private static ApplicationFinishData parseApplicationFinishData(byte[] value)
throws InvalidProtocolBufferException {
return new ApplicationFinishDataPBImpl(
- ApplicationFinishDataProto.parseFrom(value));
+ ApplicationFinishDataProto.parseFrom(value));
}
private static ApplicationAttemptStartData parseApplicationAttemptStartData(
byte[] value) throws InvalidProtocolBufferException {
return new ApplicationAttemptStartDataPBImpl(
- ApplicationAttemptStartDataProto.parseFrom(value));
+ ApplicationAttemptStartDataProto.parseFrom(value));
}
private static ApplicationAttemptFinishData
- parseApplicationAttemptFinishData(
- byte[] value) throws InvalidProtocolBufferException {
+ parseApplicationAttemptFinishData(byte[] value)
+ throws InvalidProtocolBufferException {
return new ApplicationAttemptFinishDataPBImpl(
- ApplicationAttemptFinishDataProto.parseFrom(value));
+ ApplicationAttemptFinishDataProto.parseFrom(value));
}
private static ContainerStartData parseContainerStartData(byte[] value)
throws InvalidProtocolBufferException {
return new ContainerStartDataPBImpl(
- ContainerStartDataProto.parseFrom(value));
+ ContainerStartDataProto.parseFrom(value));
}
private static ContainerFinishData parseContainerFinishData(byte[] value)
throws InvalidProtocolBufferException {
return new ContainerFinishDataPBImpl(
- ContainerFinishDataProto.parseFrom(value));
+ ContainerFinishDataProto.parseFrom(value));
}
private static void mergeApplicationHistoryData(
- ApplicationHistoryData historyData,
- ApplicationStartData startData) {
+ ApplicationHistoryData historyData, ApplicationStartData startData) {
historyData.setApplicationName(startData.getApplicationName());
historyData.setApplicationType(startData.getApplicationType());
historyData.setQueue(startData.getQueue());
@@ -655,12 +640,11 @@ public class FileSystemApplicationHistor
}
private static void mergeApplicationHistoryData(
- ApplicationHistoryData historyData,
- ApplicationFinishData finishData) {
+ ApplicationHistoryData historyData, ApplicationFinishData finishData) {
historyData.setFinishTime(finishData.getFinishTime());
historyData.setDiagnosticsInfo(finishData.getDiagnosticsInfo());
historyData.setFinalApplicationStatus(finishData
- .getFinalApplicationStatus());
+ .getFinalApplicationStatus());
historyData.setYarnApplicationState(finishData.getYarnApplicationState());
}
@@ -678,9 +662,9 @@ public class FileSystemApplicationHistor
historyData.setDiagnosticsInfo(finishData.getDiagnosticsInfo());
historyData.setTrackingURL(finishData.getTrackingURL());
historyData.setFinalApplicationStatus(finishData
- .getFinalApplicationStatus());
+ .getFinalApplicationStatus());
historyData.setYarnApplicationAttemptState(finishData
- .getYarnApplicationAttemptState());
+ .getYarnApplicationAttemptState());
}
private static void mergeContainerHistoryData(
@@ -696,8 +680,7 @@ public class FileSystemApplicationHistor
historyData.setFinishTime(finishData.getFinishTime());
historyData.setDiagnosticsInfo(finishData.getDiagnosticsInfo());
historyData.setLogURL(finishData.getLogURL());
- historyData.setContainerExitStatus(finishData
- .getContainerExitStatus());
+ historyData.setContainerExitStatus(finishData.getContainerExitStatus());
historyData.setContainerState(finishData.getContainerState());
}
@@ -746,7 +729,7 @@ public class FileSystemApplicationHistor
FSDataInputStream fsdis = fs.open(historyFile);
reader =
new TFile.Reader(fsdis, fs.getFileStatus(historyFile).getLen(),
- getConfig());
+ getConfig());
reset();
}
@@ -782,8 +765,7 @@ public class FileSystemApplicationHistor
private FSDataOutputStream fsdos;
private TFile.Writer writer;
- public HistoryFileWriter(Path historyFile)
- throws IOException {
+ public HistoryFileWriter(Path historyFile) throws IOException {
if (fs.exists(historyFile)) {
fsdos = fs.append(historyFile);
} else {
@@ -792,9 +774,9 @@ public class FileSystemApplicationHistor
fs.setPermission(historyFile, HISTORY_FILE_UMASK);
writer =
new TFile.Writer(fsdos, MIN_BLOCK_SIZE, getConfig().get(
- YarnConfiguration.FS_HISTORY_STORE_COMPRESSION_TYPE,
- YarnConfiguration.DEFAULT_FS_HISTORY_STORE_COMPRESSION_TYPE),
- null, getConfig());
+ YarnConfiguration.FS_HISTORY_STORE_COMPRESSION_TYPE,
+ YarnConfiguration.DEFAULT_FS_HISTORY_STORE_COMPRESSION_TYPE), null,
+ getConfig());
}
public synchronized void close() {
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/MemoryApplicationHistoryStore.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/MemoryApplicationHistoryStore.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/MemoryApplicationHistoryStore.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/MemoryApplicationHistoryStore.java Fri Jan 17 03:26:53 2014
@@ -42,16 +42,16 @@ import org.apache.hadoop.yarn.server.app
import org.apache.hadoop.yarn.server.applicationhistoryservice.records.ContainerStartData;
/**
- * In-memory implementation of {@link ApplicationHistoryStore}.
- * This implementation is for test purpose only. If users improperly instantiate
- * it, they may encounter reading and writing history data in different memory
+ * In-memory implementation of {@link ApplicationHistoryStore}. This
+ * implementation is for test purpose only. If users improperly instantiate it,
+ * they may encounter reading and writing history data in different memory
* store.
*
*/
@Private
@Unstable
-public class MemoryApplicationHistoryStore extends AbstractService
- implements ApplicationHistoryStore {
+public class MemoryApplicationHistoryStore extends AbstractService implements
+ ApplicationHistoryStore {
private final ConcurrentMap<ApplicationId, ApplicationHistoryData> applicationData =
new ConcurrentHashMap<ApplicationId, ApplicationHistoryData>();
@@ -66,8 +66,7 @@ public class MemoryApplicationHistorySto
@Override
public Map<ApplicationId, ApplicationHistoryData> getAllApplications() {
- return new HashMap<ApplicationId, ApplicationHistoryData>(
- applicationData);
+ return new HashMap<ApplicationId, ApplicationHistoryData>(applicationData);
}
@Override
@@ -77,14 +76,15 @@ public class MemoryApplicationHistorySto
@Override
public Map<ApplicationAttemptId, ApplicationAttemptHistoryData>
- getApplicationAttempts(
- ApplicationId appId) {
+ getApplicationAttempts(ApplicationId appId) {
ConcurrentMap<ApplicationAttemptId, ApplicationAttemptHistoryData> subMap =
applicationAttemptData.get(appId);
if (subMap == null) {
- return Collections.<ApplicationAttemptId, ApplicationAttemptHistoryData>emptyMap();
+ return Collections
+ .<ApplicationAttemptId, ApplicationAttemptHistoryData> emptyMap();
} else {
- return new HashMap<ApplicationAttemptId, ApplicationAttemptHistoryData>(subMap);
+ return new HashMap<ApplicationAttemptId, ApplicationAttemptHistoryData>(
+ subMap);
}
}
@@ -101,8 +101,7 @@ public class MemoryApplicationHistorySto
}
@Override
- public ContainerHistoryData getAMContainer(
- ApplicationAttemptId appAttemptId) {
+ public ContainerHistoryData getAMContainer(ApplicationAttemptId appAttemptId) {
ApplicationAttemptHistoryData appAttempt =
getApplicationAttempt(appAttemptId);
if (appAttempt == null || appAttempt.getMasterContainerId() == null) {
@@ -129,7 +128,7 @@ public class MemoryApplicationHistorySto
ConcurrentMap<ContainerId, ContainerHistoryData> subMap =
containerData.get(appAttemptId);
if (subMap == null) {
- return Collections.<ContainerId, ContainerHistoryData>emptyMap();
+ return Collections.<ContainerId, ContainerHistoryData> emptyMap();
} else {
return new HashMap<ContainerId, ContainerHistoryData>(subMap);
}
@@ -140,15 +139,10 @@ public class MemoryApplicationHistorySto
throws IOException {
ApplicationHistoryData oldData =
applicationData.putIfAbsent(appStart.getApplicationId(),
- ApplicationHistoryData.newInstance(
- appStart.getApplicationId(),
- appStart.getApplicationName(),
- appStart.getApplicationType(),
- appStart.getQueue(),
- appStart.getUser(),
- appStart.getSubmitTime(),
- appStart.getStartTime(),
- Long.MAX_VALUE, null, null, null));
+ ApplicationHistoryData.newInstance(appStart.getApplicationId(),
+ appStart.getApplicationName(), appStart.getApplicationType(),
+ appStart.getQueue(), appStart.getUser(), appStart.getSubmitTime(),
+ appStart.getStartTime(), Long.MAX_VALUE, null, null, null));
if (oldData != null) {
throw new IOException("The start information of application "
+ appStart.getApplicationId() + " is already stored.");
@@ -182,18 +176,15 @@ public class MemoryApplicationHistorySto
ApplicationAttemptStartData appAttemptStart) throws IOException {
ConcurrentMap<ApplicationAttemptId, ApplicationAttemptHistoryData> subMap =
getSubMap(appAttemptStart.getApplicationAttemptId().getApplicationId());
- ApplicationAttemptHistoryData oldData = subMap.putIfAbsent(
- appAttemptStart.getApplicationAttemptId(),
- ApplicationAttemptHistoryData.newInstance(
+ ApplicationAttemptHistoryData oldData =
+ subMap.putIfAbsent(appAttemptStart.getApplicationAttemptId(),
+ ApplicationAttemptHistoryData.newInstance(
appAttemptStart.getApplicationAttemptId(),
- appAttemptStart.getHost(),
- appAttemptStart.getRPCPort(),
- appAttemptStart.getMasterContainerId(),
- null, null, null, null));
+ appAttemptStart.getHost(), appAttemptStart.getRPCPort(),
+ appAttemptStart.getMasterContainerId(), null, null, null, null));
if (oldData != null) {
throw new IOException("The start information of application attempt "
- + appAttemptStart.getApplicationAttemptId()
- + " is already stored.");
+ + appAttemptStart.getApplicationAttemptId() + " is already stored.");
}
}
@@ -213,20 +204,22 @@ public class MemoryApplicationHistorySto
// if the finish information is already recorded
if (data.getYarnApplicationAttemptState() != null) {
throw new IOException("The finish information of application attempt "
- + appAttemptFinish.getApplicationAttemptId()
- + " is already stored.");
+ + appAttemptFinish.getApplicationAttemptId() + " is already stored.");
}
data.setTrackingURL(appAttemptFinish.getTrackingURL());
data.setDiagnosticsInfo(appAttemptFinish.getDiagnosticsInfo());
- data.setFinalApplicationStatus(appAttemptFinish.getFinalApplicationStatus());
- data.setYarnApplicationAttemptState(appAttemptFinish.getYarnApplicationAttemptState());
+ data
+ .setFinalApplicationStatus(appAttemptFinish.getFinalApplicationStatus());
+ data.setYarnApplicationAttemptState(appAttemptFinish
+ .getYarnApplicationAttemptState());
}
private ConcurrentMap<ApplicationAttemptId, ApplicationAttemptHistoryData>
getSubMap(ApplicationId appId) {
- applicationAttemptData.putIfAbsent(appId,
- new ConcurrentHashMap<ApplicationAttemptId,
- ApplicationAttemptHistoryData>());
+ applicationAttemptData
+ .putIfAbsent(
+ appId,
+ new ConcurrentHashMap<ApplicationAttemptId, ApplicationAttemptHistoryData>());
return applicationAttemptData.get(appId);
}
@@ -235,15 +228,13 @@ public class MemoryApplicationHistorySto
throws IOException {
ConcurrentMap<ContainerId, ContainerHistoryData> subMap =
getSubMap(containerStart.getContainerId().getApplicationAttemptId());
- ContainerHistoryData oldData = subMap.putIfAbsent(
- containerStart.getContainerId(),
- ContainerHistoryData.newInstance(
- containerStart.getContainerId(),
+ ContainerHistoryData oldData =
+ subMap.putIfAbsent(containerStart.getContainerId(),
+ ContainerHistoryData.newInstance(containerStart.getContainerId(),
containerStart.getAllocatedResource(),
- containerStart.getAssignedNode(),
- containerStart.getPriority(),
- containerStart.getStartTime(),
- Long.MAX_VALUE, null, null, Integer.MAX_VALUE, null));
+ containerStart.getAssignedNode(), containerStart.getPriority(),
+ containerStart.getStartTime(), Long.MAX_VALUE, null, null,
+ Integer.MAX_VALUE, null));
if (oldData != null) {
throw new IOException("The start information of container "
+ containerStart.getContainerId() + " is already stored.");
@@ -277,7 +268,7 @@ public class MemoryApplicationHistorySto
private ConcurrentMap<ContainerId, ContainerHistoryData> getSubMap(
ApplicationAttemptId appAttemptId) {
containerData.putIfAbsent(appAttemptId,
- new ConcurrentHashMap<ContainerId, ContainerHistoryData>());
+ new ConcurrentHashMap<ContainerId, ContainerHistoryData>());
return containerData.get(appAttemptId);
}
Modified: hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/records/ApplicationAttemptHistoryData.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/records/ApplicationAttemptHistoryData.java?rev=1559004&r1=1559003&r2=1559004&view=diff
==============================================================================
--- hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/records/ApplicationAttemptHistoryData.java (original)
+++ hadoop/common/branches/YARN-321/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/records/ApplicationAttemptHistoryData.java Fri Jan 17 03:26:53 2014
@@ -54,8 +54,7 @@ public class ApplicationAttemptHistoryDa
public static ApplicationAttemptHistoryData newInstance(
ApplicationAttemptId appAttemptId, String host, int rpcPort,
ContainerId masterContainerId, String diagnosticsInfo,
- String trackingURL,
- FinalApplicationStatus finalApplicationStatus,
+ String trackingURL, FinalApplicationStatus finalApplicationStatus,
YarnApplicationAttemptState yarnApplicationAttemptState) {
ApplicationAttemptHistoryData appAttemptHD =
new ApplicationAttemptHistoryData();
@@ -78,8 +77,8 @@ public class ApplicationAttemptHistoryDa
@Public
@Unstable
- public void setApplicationAttemptId(
- ApplicationAttemptId applicationAttemptId) {
+ public void
+ setApplicationAttemptId(ApplicationAttemptId applicationAttemptId) {
this.applicationAttemptId = applicationAttemptId;
}