YARN-753. Added individual factory methods for all api protocol records and converted the records to be abstract classes. Contributed by Jian He.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1489644 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2013-06-04 21:52:11 +00:00
parent c4382e7565
commit 707b310c79
99 changed files with 1562 additions and 303 deletions

View File

@ -96,6 +96,9 @@ Release 2.1.0-beta - UNRELEASED
YARN-755. Renamed AllocateResponse.reboot to AllocateResponse.resync. (Bikas YARN-755. Renamed AllocateResponse.reboot to AllocateResponse.resync. (Bikas
Saha via vinodkv) Saha via vinodkv)
YARN-753. Added individual factory methods for all api protocol records and
converted the records to be abstract classes. (Jian He via vinodkv)
NEW FEATURES NEW FEATURES
YARN-482. FS: Extend SchedulingMode to intermediate queues. YARN-482. FS: Extend SchedulingMode to intermediate queues.

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.util.Records;
/** /**
* The request issued by the client to the {@code ResourceManager} to cancel a * The request issued by the client to the {@code ResourceManager} to cancel a
@ -28,7 +29,15 @@
*/ */
@Public @Public
@Evolving @Evolving
public interface CancelDelegationTokenRequest { public abstract class CancelDelegationTokenRequest {
Token getDelegationToken();
void setDelegationToken(Token dToken); public static CancelDelegationTokenRequest newInstance(Token dToken) {
CancelDelegationTokenRequest request =
Records.newRecord(CancelDelegationTokenRequest.class);
request.setDelegationToken(dToken);
return request;
}
public abstract Token getDelegationToken();
public abstract void setDelegationToken(Token dToken);
} }

View File

@ -20,6 +20,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.yarn.util.Records;
/** /**
* The response from the {@code ResourceManager} to a cancelDelegationToken * The response from the {@code ResourceManager} to a cancelDelegationToken
@ -27,5 +28,10 @@
*/ */
@Public @Public
@Evolving @Evolving
public interface CancelDelegationTokenResponse { public abstract class CancelDelegationTokenResponse {
public static CancelDelegationTokenResponse newInstance() {
CancelDelegationTokenResponse response =
Records.newRecord(CancelDelegationTokenResponse.class);
return response;
}
} }

View File

@ -23,6 +23,7 @@
import org.apache.hadoop.yarn.api.AMRMProtocol; import org.apache.hadoop.yarn.api.AMRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus; import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The finalization request sent by the <code>ApplicationMaster</code> to * <p>The finalization request sent by the <code>ApplicationMaster</code> to
@ -45,7 +46,19 @@
* *
* @see AMRMProtocol#finishApplicationMaster(FinishApplicationMasterRequest) * @see AMRMProtocol#finishApplicationMaster(FinishApplicationMasterRequest)
*/ */
public interface FinishApplicationMasterRequest { public abstract class FinishApplicationMasterRequest {
public static FinishApplicationMasterRequest newInstance(
ApplicationAttemptId appAttemptId, FinalApplicationStatus finalAppStatus,
String diagnostics, String url) {
FinishApplicationMasterRequest request =
Records.newRecord(FinishApplicationMasterRequest.class);
request.setAppAttemptId(appAttemptId);
request.setFinishApplicationStatus(finalAppStatus);
request.setDiagnostics(diagnostics);
request.setTrackingUrl(url);
return request;
}
/** /**
* Get the <code>ApplicationAttemptId</code> being managed by the * Get the <code>ApplicationAttemptId</code> being managed by the
@ -55,7 +68,7 @@ public interface FinishApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
ApplicationAttemptId getApplicationAttemptId(); public abstract ApplicationAttemptId getApplicationAttemptId();
/** /**
* Set the <code>ApplicationAttemptId</code> being managed by the * Set the <code>ApplicationAttemptId</code> being managed by the
@ -65,7 +78,7 @@ public interface FinishApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
void setAppAttemptId(ApplicationAttemptId applicationAttemptId); public abstract void setAppAttemptId(ApplicationAttemptId applicationAttemptId);
/** /**
* Get <em>final state</em> of the <code>ApplicationMaster</code>. * Get <em>final state</em> of the <code>ApplicationMaster</code>.
@ -73,7 +86,7 @@ public interface FinishApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
FinalApplicationStatus getFinalApplicationStatus(); public abstract FinalApplicationStatus getFinalApplicationStatus();
/** /**
* Set the <em>finish state</em> of the <code>ApplicationMaster</code> * Set the <em>finish state</em> of the <code>ApplicationMaster</code>
@ -81,7 +94,7 @@ public interface FinishApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
void setFinishApplicationStatus(FinalApplicationStatus finishState); public abstract void setFinishApplicationStatus(FinalApplicationStatus finishState);
/** /**
* Get <em>diagnostic information</em> on application failure. * Get <em>diagnostic information</em> on application failure.
@ -89,7 +102,7 @@ public interface FinishApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
String getDiagnostics(); public abstract String getDiagnostics();
/** /**
* Set <em>diagnostic information</em> on application failure. * Set <em>diagnostic information</em> on application failure.
@ -97,7 +110,7 @@ public interface FinishApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
void setDiagnostics(String diagnostics); public abstract void setDiagnostics(String diagnostics);
/** /**
* Get the <em>tracking URL</em> for the <code>ApplicationMaster</code>. * Get the <em>tracking URL</em> for the <code>ApplicationMaster</code>.
@ -105,7 +118,7 @@ public interface FinishApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
String getTrackingUrl(); public abstract String getTrackingUrl();
/** /**
* Set the <em>tracking URL</em>for the <code>ApplicationMaster</code> * Set the <em>tracking URL</em>for the <code>ApplicationMaster</code>
@ -114,6 +127,6 @@ public interface FinishApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
void setTrackingUrl(String url); public abstract void setTrackingUrl(String url);
} }

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.AMRMProtocol; import org.apache.hadoop.yarn.api.AMRMProtocol;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to a * <p>The response sent by the <code>ResourceManager</code> to a
@ -32,6 +33,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface FinishApplicationMasterResponse { public abstract class FinishApplicationMasterResponse {
public static FinishApplicationMasterResponse newInstance() {
FinishApplicationMasterResponse response =
Records.newRecord(FinishApplicationMasterResponse.class);
return response;
}
} }

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request from clients to get a report of all Applications * <p>The request from clients to get a report of all Applications
@ -32,5 +33,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetAllApplicationsRequest { public abstract class GetAllApplicationsRequest {
public static GetAllApplicationsRequest newInstance() {
GetAllApplicationsRequest request =
Records.newRecord(GetAllApplicationsRequest.class);
return request;
}
} }

View File

@ -26,6 +26,7 @@
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to a client * <p>The response sent by the <code>ResourceManager</code> to a client
@ -40,16 +41,25 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetAllApplicationsResponse { public abstract class GetAllApplicationsResponse {
public static GetAllApplicationsResponse newInstance(
List<ApplicationReport> applications) {
GetAllApplicationsResponse response =
Records.newRecord(GetAllApplicationsResponse.class);
response.setApplicationList(applications);
return response;
}
/** /**
* Get <code>ApplicationReport</code> for all applications. * Get <code>ApplicationReport</code> for all applications.
* @return <code>ApplicationReport</code> for all applications * @return <code>ApplicationReport</code> for all applications
*/ */
@Public @Public
@Stable @Stable
List<ApplicationReport> getApplicationList(); public abstract List<ApplicationReport> getApplicationList();
@Private @Private
@Unstable @Unstable
void setApplicationList(List<ApplicationReport> applications); public abstract void setApplicationList(List<ApplicationReport> applications);
} }

View File

@ -23,6 +23,7 @@
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by a client to the <code>ResourceManager</code> to * <p>The request sent by a client to the <code>ResourceManager</code> to
@ -36,16 +37,25 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetApplicationReportRequest { public abstract class GetApplicationReportRequest {
public static GetApplicationReportRequest newInstance(
ApplicationId applicationId) {
GetApplicationReportRequest request =
Records.newRecord(GetApplicationReportRequest.class);
request.setApplicationId(applicationId);
return request;
}
/** /**
* Get the <code>ApplicationId</code> of the application. * Get the <code>ApplicationId</code> of the application.
* @return <code>ApplicationId</code> of the application * @return <code>ApplicationId</code> of the application
*/ */
public ApplicationId getApplicationId(); public abstract ApplicationId getApplicationId();
/** /**
* Set the <code>ApplicationId</code> of the application * Set the <code>ApplicationId</code> of the application
* @param applicationId <code>ApplicationId</code> of the application * @param applicationId <code>ApplicationId</code> of the application
*/ */
public void setApplicationId(ApplicationId applicationId); public abstract void setApplicationId(ApplicationId applicationId);
} }

View File

@ -24,6 +24,7 @@
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to a client * <p>The response sent by the <code>ResourceManager</code> to a client
@ -37,16 +38,25 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetApplicationReportResponse { public abstract class GetApplicationReportResponse {
public static GetApplicationReportResponse newInstance(
ApplicationReport ApplicationReport) {
GetApplicationReportResponse response =
Records.newRecord(GetApplicationReportResponse.class);
response.setApplicationReport(ApplicationReport);
return response;
}
/** /**
* Get the <code>ApplicationReport</code> for the application. * Get the <code>ApplicationReport</code> for the application.
* @return <code>ApplicationReport</code> for the application * @return <code>ApplicationReport</code> for the application
*/ */
@Public @Public
@Stable @Stable
public ApplicationReport getApplicationReport(); public abstract ApplicationReport getApplicationReport();
@Private @Private
@Unstable @Unstable
public void setApplicationReport(ApplicationReport ApplicationReport); public abstract void setApplicationReport(ApplicationReport ApplicationReport);
} }

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by clients to get cluster metrics from the * <p>The request sent by clients to get cluster metrics from the
@ -32,6 +33,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetClusterMetricsRequest { public abstract class GetClusterMetricsRequest {
public static GetClusterMetricsRequest newInstance() {
GetClusterMetricsRequest request =
Records.newRecord(GetClusterMetricsRequest.class);
return request;
}
} }

View File

@ -24,6 +24,7 @@
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.YarnClusterMetrics; import org.apache.hadoop.yarn.api.records.YarnClusterMetrics;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to a client * <p>The response sent by the <code>ResourceManager</code> to a client
@ -34,16 +35,25 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetClusterMetricsResponse { public abstract class GetClusterMetricsResponse {
public static GetClusterMetricsResponse
newInstance(YarnClusterMetrics metrics) {
GetClusterMetricsResponse response =
Records.newRecord(GetClusterMetricsResponse.class);
response.setClusterMetrics(metrics);
return response;
}
/** /**
* Get the <code>YarnClusterMetrics</code> for the cluster. * Get the <code>YarnClusterMetrics</code> for the cluster.
* @return <code>YarnClusterMetrics</code> for the cluster * @return <code>YarnClusterMetrics</code> for the cluster
*/ */
@Public @Public
@Stable @Stable
public YarnClusterMetrics getClusterMetrics(); public abstract YarnClusterMetrics getClusterMetrics();
@Private @Private
@Unstable @Unstable
public void setClusterMetrics(YarnClusterMetrics metrics); public abstract void setClusterMetrics(YarnClusterMetrics metrics);
} }

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request from clients to get a report of all nodes * <p>The request from clients to get a report of all nodes
@ -32,6 +33,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetClusterNodesRequest { public abstract class GetClusterNodesRequest {
public static GetClusterNodesRequest newInstance() {
GetClusterNodesRequest request =
Records.newRecord(GetClusterNodesRequest.class);
return request;
}
} }

View File

@ -26,6 +26,7 @@
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.NodeReport; import org.apache.hadoop.yarn.api.records.NodeReport;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to a client * <p>The response sent by the <code>ResourceManager</code> to a client
@ -40,16 +41,25 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetClusterNodesResponse { public abstract class GetClusterNodesResponse {
public static GetClusterNodesResponse
newInstance(List<NodeReport> nodeReports) {
GetClusterNodesResponse response =
Records.newRecord(GetClusterNodesResponse.class);
response.setNodeReports(nodeReports);
return response;
}
/** /**
* Get <code>NodeReport</code> for all nodes in the cluster. * Get <code>NodeReport</code> for all nodes in the cluster.
* @return <code>NodeReport</code> for all nodes in the cluster * @return <code>NodeReport</code> for all nodes in the cluster
*/ */
@Public @Public
@Stable @Stable
List<NodeReport> getNodeReports(); public abstract List<NodeReport> getNodeReports();
@Private @Private
@Unstable @Unstable
void setNodeReports(List<NodeReport> nodeReports); public abstract void setNodeReports(List<NodeReport> nodeReports);
} }

View File

@ -23,6 +23,7 @@
import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.ContainerManager;
import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.ContainerStatus; import org.apache.hadoop.yarn.api.records.ContainerStatus;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by the <code>ApplicationMaster</code> to the * <p>The request sent by the <code>ApplicationMaster</code> to the
@ -32,7 +33,15 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetContainerStatusRequest { public abstract class GetContainerStatusRequest {
public static GetContainerStatusRequest newInstance(ContainerId containerId) {
GetContainerStatusRequest request =
Records.newRecord(GetContainerStatusRequest.class);
request.setContainerId(containerId);
return request;
}
/** /**
* Get the <code>ContainerId</code> of container for which to obtain the * Get the <code>ContainerId</code> of container for which to obtain the
* <code>ContainerStatus</code>. * <code>ContainerStatus</code>.

View File

@ -24,6 +24,7 @@
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.ContainerManager;
import org.apache.hadoop.yarn.api.records.ContainerStatus; import org.apache.hadoop.yarn.api.records.ContainerStatus;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>NodeManager</code> to the * <p>The response sent by the <code>NodeManager</code> to the
@ -34,7 +35,16 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetContainerStatusResponse { public abstract class GetContainerStatusResponse {
public static GetContainerStatusResponse newInstance(
ContainerStatus containerStatus) {
GetContainerStatusResponse response =
Records.newRecord(GetContainerStatusResponse.class);
response.setStatus(containerStatus);
return response;
}
/** /**
* Get the <code>ContainerStatus</code> of the container. * Get the <code>ContainerStatus</code> of the container.
* @return <code>ContainerStatus</code> of the container * @return <code>ContainerStatus</code> of the container

View File

@ -20,6 +20,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.yarn.util.Records;
/** /**
* The request issued by the client to get a delegation token from * The request issued by the client to get a delegation token from
@ -28,7 +29,15 @@
*/ */
@Public @Public
@Evolving @Evolving
public interface GetDelegationTokenRequest { public abstract class GetDelegationTokenRequest {
String getRenewer();
void setRenewer(String renewer); public GetDelegationTokenRequest newInstance(String renewer) {
GetDelegationTokenRequest request =
Records.newRecord(GetDelegationTokenRequest.class);
request.setRenewer(renewer);
return request;
}
public abstract String getRenewer();
public abstract void setRenewer(String renewer);
} }

View File

@ -22,6 +22,7 @@
import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier; import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier;
import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.util.Records;
/** /**
@ -32,13 +33,20 @@
*/ */
@Public @Public
@Evolving @Evolving
public interface GetDelegationTokenResponse { public abstract class GetDelegationTokenResponse {
public static GetDelegationTokenResponse newInstance(Token rmDTToken) {
GetDelegationTokenResponse response =
Records.newRecord(GetDelegationTokenResponse.class);
response.setRMDelegationToken(rmDTToken);
return response;
}
/** /**
* The Delegation tokens have a identifier which maps to * The Delegation tokens have a identifier which maps to
* {@link AbstractDelegationTokenIdentifier}. * {@link AbstractDelegationTokenIdentifier}.
* *
*/ */
Token getRMDelegationToken(); public abstract Token getRMDelegationToken();
void setRMDelegationToken(Token rmDTToken); public abstract void setRMDelegationToken(Token rmDTToken);
} }

View File

@ -22,6 +22,7 @@
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by clients to get a new {@link ApplicationId} for * <p>The request sent by clients to get a new {@link ApplicationId} for
@ -33,6 +34,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetNewApplicationRequest { public abstract class GetNewApplicationRequest {
public static GetNewApplicationRequest newInstance() {
GetNewApplicationRequest request =
Records.newRecord(GetNewApplicationRequest.class);
return request;
}
} }

View File

@ -25,6 +25,7 @@
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to the client for * <p>The response sent by the <code>ResourceManager</code> to the client for
@ -34,7 +35,19 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetNewApplicationResponse { public abstract class GetNewApplicationResponse {
public static GetNewApplicationResponse newInstance(
ApplicationId applicationId, Resource minCapability,
Resource maxCapability) {
GetNewApplicationResponse response =
Records.newRecord(GetNewApplicationResponse.class);
response.setApplicationId(applicationId);
response.setMinimumResourceCapability(minCapability);
response.setMaximumResourceCapability(maxCapability);
return response;
}
/** /**
* Get the <em>new</em> <code>ApplicationId</code> allocated by the * Get the <em>new</em> <code>ApplicationId</code> allocated by the
* <code>ResourceManager</code>. * <code>ResourceManager</code>.
@ -56,11 +69,11 @@ public interface GetNewApplicationResponse {
*/ */
@Public @Public
@Stable @Stable
public Resource getMinimumResourceCapability(); public abstract Resource getMinimumResourceCapability();
@Private @Private
@Unstable @Unstable
public void setMinimumResourceCapability(Resource capability); public abstract void setMinimumResourceCapability(Resource capability);
/** /**
* Get the maximum capability for any {@link Resource} allocated by the * Get the maximum capability for any {@link Resource} allocated by the
@ -69,9 +82,9 @@ public interface GetNewApplicationResponse {
*/ */
@Public @Public
@Stable @Stable
public Resource getMaximumResourceCapability(); public abstract Resource getMaximumResourceCapability();
@Private @Private
@Unstable @Unstable
public void setMaximumResourceCapability(Resource capability); public abstract void setMaximumResourceCapability(Resource capability);
} }

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by clients to get <em>queue information</em> * <p>The request sent by clients to get <em>queue information</em>
@ -30,58 +31,70 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetQueueInfoRequest { public abstract class GetQueueInfoRequest {
public static GetQueueInfoRequest
newInstance(String queueName, boolean includeApplications,
boolean includeChildQueues, boolean recursive) {
GetQueueInfoRequest request = Records.newRecord(GetQueueInfoRequest.class);
request.setQueueName(queueName);
request.setIncludeApplications(includeApplications);
request.setIncludeChildQueues(includeChildQueues);
request.setRecursive(recursive);
return request;
}
/** /**
* Get the <em>queue name</em> for which to get queue information. * Get the <em>queue name</em> for which to get queue information.
* @return <em>queue name</em> for which to get queue information * @return <em>queue name</em> for which to get queue information
*/ */
String getQueueName(); public abstract String getQueueName();
/** /**
* Set the <em>queue name</em> for which to get queue information * Set the <em>queue name</em> for which to get queue information
* @param queueName <em>queue name</em> for which to get queue information * @param queueName <em>queue name</em> for which to get queue information
*/ */
void setQueueName(String queueName); public abstract void setQueueName(String queueName);
/** /**
* Is information about <em>active applications<e/m> required? * Is information about <em>active applications<e/m> required?
* @return <code>true</code> if applications' information is to be included, * @return <code>true</code> if applications' information is to be included,
* else <code>false</code> * else <code>false</code>
*/ */
boolean getIncludeApplications(); public abstract boolean getIncludeApplications();
/** /**
* Should we get fetch information about <em>active applications</em>? * Should we get fetch information about <em>active applications</em>?
* @param includeApplications fetch information about <em>active * @param includeApplications fetch information about <em>active
* applications</em>? * applications</em>?
*/ */
void setIncludeApplications(boolean includeApplications); public abstract void setIncludeApplications(boolean includeApplications);
/** /**
* Is information about <em>child queues</em> required? * Is information about <em>child queues</em> required?
* @return <code>true</code> if information about child queues is required, * @return <code>true</code> if information about child queues is required,
* else <code>false</code> * else <code>false</code>
*/ */
boolean getIncludeChildQueues(); public abstract boolean getIncludeChildQueues();
/** /**
* Should we fetch information about <em>child queues</em>? * Should we fetch information about <em>child queues</em>?
* @param includeChildQueues fetch information about <em>child queues</em>? * @param includeChildQueues fetch information about <em>child queues</em>?
*/ */
void setIncludeChildQueues(boolean includeChildQueues); public abstract void setIncludeChildQueues(boolean includeChildQueues);
/** /**
* Is information on the entire <em>child queue hierarchy</em> required? * Is information on the entire <em>child queue hierarchy</em> required?
* @return <code>true</code> if information about entire hierarchy is * @return <code>true</code> if information about entire hierarchy is
* required, <code>false</code> otherwise * required, <code>false</code> otherwise
*/ */
boolean getRecursive(); public abstract boolean getRecursive();
/** /**
* Should we fetch information on the entire <em>child queue hierarchy</em>? * Should we fetch information on the entire <em>child queue hierarchy</em>?
* @param recursive fetch information on the entire <em>child queue * @param recursive fetch information on the entire <em>child queue
* hierarchy</em>? * hierarchy</em>?
*/ */
void setRecursive(boolean recursive); public abstract void setRecursive(boolean recursive);
} }

View File

@ -24,6 +24,7 @@
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.QueueInfo; import org.apache.hadoop.yarn.api.records.QueueInfo;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to a client * <p>The response sent by the <code>ResourceManager</code> to a client
@ -38,14 +39,21 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetQueueInfoResponse { public abstract class GetQueueInfoResponse {
public static GetQueueInfoResponse newInstance(QueueInfo queueInfo) {
GetQueueInfoResponse response = Records.newRecord(GetQueueInfoResponse.class);
response.setQueueInfo(queueInfo);
return response;
}
/** /**
* Get the <code>QueueInfo</code> for the specified queue. * Get the <code>QueueInfo</code> for the specified queue.
* @return <code>QueueInfo</code> for the specified queue * @return <code>QueueInfo</code> for the specified queue
*/ */
QueueInfo getQueueInfo(); public abstract QueueInfo getQueueInfo();
@Private @Private
@Unstable @Unstable
void setQueueInfo(QueueInfo queueInfo); public abstract void setQueueInfo(QueueInfo queueInfo);
} }

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by clients to the <code>ResourceManager</code> to * <p>The request sent by clients to the <code>ResourceManager</code> to
@ -32,6 +33,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetQueueUserAclsInfoRequest { public abstract class GetQueueUserAclsInfoRequest {
public static GetQueueUserAclsInfoRequest newInstance() {
GetQueueUserAclsInfoRequest request =
Records.newRecord(GetQueueUserAclsInfoRequest.class);
return request;
}
} }

View File

@ -27,6 +27,7 @@
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.QueueACL; import org.apache.hadoop.yarn.api.records.QueueACL;
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; import org.apache.hadoop.yarn.api.records.QueueUserACLInfo;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to clients * <p>The response sent by the <code>ResourceManager</code> to clients
@ -41,7 +42,15 @@
*/ */
@Public @Public
@Stable @Stable
public interface GetQueueUserAclsInfoResponse { public abstract class GetQueueUserAclsInfoResponse {
public static GetQueueUserAclsInfoResponse newInstance(
List<QueueUserACLInfo> queueUserAclsList) {
GetQueueUserAclsInfoResponse response =
Records.newRecord(GetQueueUserAclsInfoResponse.class);
response.setUserAclsInfoList(queueUserAclsList);
return response;
}
/** /**
* Get the <code>QueueUserACLInfo</code> per queue for the user. * Get the <code>QueueUserACLInfo</code> per queue for the user.
@ -49,10 +58,11 @@ public interface GetQueueUserAclsInfoResponse {
*/ */
@Public @Public
@Stable @Stable
public List<QueueUserACLInfo> getUserAclsInfoList(); public abstract List<QueueUserACLInfo> getUserAclsInfoList();
@Private @Private
@Unstable @Unstable
public void setUserAclsInfoList(List<QueueUserACLInfo> queueUserAclsList); public abstract void setUserAclsInfoList(
List<QueueUserACLInfo> queueUserAclsList);
} }

View File

@ -24,6 +24,7 @@
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by the client to the <code>ResourceManager</code> * <p>The request sent by the client to the <code>ResourceManager</code>
@ -36,7 +37,15 @@
*/ */
@Public @Public
@Stable @Stable
public interface KillApplicationRequest { public abstract class KillApplicationRequest {
public static KillApplicationRequest newInstance(ApplicationId applicationId) {
KillApplicationRequest request =
Records.newRecord(KillApplicationRequest.class);
request.setApplicationId(applicationId);
return request;
}
/** /**
* Get the <code>ApplicationId</code> of the application to be aborted. * Get the <code>ApplicationId</code> of the application to be aborted.
* @return <code>ApplicationId</code> of the application to be aborted * @return <code>ApplicationId</code> of the application to be aborted

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to the client * <p>The response sent by the <code>ResourceManager</code> to the client
@ -32,6 +33,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface KillApplicationResponse { public abstract class KillApplicationResponse {
public static KillApplicationResponse newInstance() {
KillApplicationResponse response =
Records.newRecord(KillApplicationResponse.class);
return response;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshAdminAclsRequest { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshAdminAclsRequest {
public static RefreshAdminAclsRequest newInstance() {
RefreshAdminAclsRequest request =
Records.newRecord(RefreshAdminAclsRequest.class);
return request;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshAdminAclsResponse { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshAdminAclsResponse {
public static RefreshAdminAclsResponse newInstance() {
RefreshAdminAclsResponse response =
Records.newRecord(RefreshAdminAclsResponse.class);
return response;
}
} }

View File

@ -18,6 +18,11 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshNodesRequest { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshNodesRequest {
public static RefreshNodesRequest newInstance() {
RefreshNodesRequest request = Records.newRecord(RefreshNodesRequest.class);
return request;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshNodesResponse { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshNodesResponse {
public static RefreshNodesResponse newInstance() {
RefreshNodesResponse response =
Records.newRecord(RefreshNodesResponse.class);
return response;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshQueuesRequest { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshQueuesRequest {
public static RefreshQueuesRequest newInstance() {
RefreshQueuesRequest request =
Records.newRecord(RefreshQueuesRequest.class);
return request;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshQueuesResponse { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshQueuesResponse {
public static RefreshQueuesResponse newInstance() {
RefreshQueuesResponse response =
Records.newRecord(RefreshQueuesResponse.class);
return response;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshServiceAclsRequest { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshServiceAclsRequest {
public static RefreshServiceAclsRequest newInstance() {
RefreshServiceAclsRequest request =
Records.newRecord(RefreshServiceAclsRequest.class);
return request;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshServiceAclsResponse { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshServiceAclsResponse {
public static RefreshServiceAclsResponse newInstance() {
RefreshServiceAclsResponse response =
Records.newRecord(RefreshServiceAclsResponse.class);
return response;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshSuperUserGroupsConfigurationRequest { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshSuperUserGroupsConfigurationRequest {
public static RefreshSuperUserGroupsConfigurationRequest newInstance() {
RefreshSuperUserGroupsConfigurationRequest request =
Records.newRecord(RefreshSuperUserGroupsConfigurationRequest.class);
return request;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshSuperUserGroupsConfigurationResponse { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshSuperUserGroupsConfigurationResponse {
public static RefreshSuperUserGroupsConfigurationResponse newInstance() {
RefreshSuperUserGroupsConfigurationResponse response =
Records.newRecord(RefreshSuperUserGroupsConfigurationResponse.class);
return response;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshUserToGroupsMappingsRequest { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshUserToGroupsMappingsRequest {
public static RefreshUserToGroupsMappingsRequest newInstance() {
RefreshUserToGroupsMappingsRequest request =
Records.newRecord(RefreshUserToGroupsMappingsRequest.class);
return request;
}
} }

View File

@ -18,6 +18,12 @@
package org.apache.hadoop.yarn.api.protocolrecords; package org.apache.hadoop.yarn.api.protocolrecords;
public interface RefreshUserToGroupsMappingsResponse { import org.apache.hadoop.yarn.util.Records;
public abstract class RefreshUserToGroupsMappingsResponse {
public static RefreshUserToGroupsMappingsResponse newInstance() {
RefreshUserToGroupsMappingsResponse response =
Records.newRecord(RefreshUserToGroupsMappingsResponse.class);
return response;
}
} }

View File

@ -24,6 +24,7 @@
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.AMRMProtocol; import org.apache.hadoop.yarn.api.AMRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by the <code>ApplicationMaster</code> to * <p>The request sent by the <code>ApplicationMaster</code> to
@ -45,7 +46,19 @@
*/ */
@Public @Public
@Stable @Stable
public interface RegisterApplicationMasterRequest { public abstract class RegisterApplicationMasterRequest {
public static RegisterApplicationMasterRequest newInstance(
ApplicationAttemptId applicationAttemptId, String host, int port,
String trackingUrl) {
RegisterApplicationMasterRequest request =
Records.newRecord(RegisterApplicationMasterRequest.class);
request.setApplicationAttemptId(applicationAttemptId);
request.setHost(host);
request.setRpcPort(port);
request.setTrackingUrl(trackingUrl);
return request;
}
/** /**
* Get the <code>ApplicationAttemptId</code> being managed by the * Get the <code>ApplicationAttemptId</code> being managed by the
@ -55,7 +68,7 @@ public interface RegisterApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
ApplicationAttemptId getApplicationAttemptId(); public abstract ApplicationAttemptId getApplicationAttemptId();
/** /**
* Set the <code>ApplicationAttemptId</code> being managed by the * Set the <code>ApplicationAttemptId</code> being managed by the
@ -65,7 +78,7 @@ public interface RegisterApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId); public abstract void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId);
/** /**
* Get the <em>host</em> on which the <code>ApplicationMaster</code> is * Get the <em>host</em> on which the <code>ApplicationMaster</code> is
@ -74,7 +87,7 @@ public interface RegisterApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
String getHost(); public abstract String getHost();
/** /**
* Set the <em>host</em> on which the <code>ApplicationMaster</code> is * Set the <em>host</em> on which the <code>ApplicationMaster</code> is
@ -84,7 +97,7 @@ public interface RegisterApplicationMasterRequest {
*/ */
@Private @Private
@Unstable @Unstable
void setHost(String host); public abstract void setHost(String host);
/** /**
* Get the <em>RPC port</em> on which the <code>ApplicationMaster</code> * Get the <em>RPC port</em> on which the <code>ApplicationMaster</code>
@ -94,7 +107,7 @@ public interface RegisterApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
int getRpcPort(); public abstract int getRpcPort();
/** /**
* Set the <em>RPC port<em> on which the <code>ApplicationMaster</code> is * Set the <em>RPC port<em> on which the <code>ApplicationMaster</code> is
@ -104,7 +117,7 @@ public interface RegisterApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
void setRpcPort(int port); public abstract void setRpcPort(int port);
/** /**
* Get the <em>tracking URL</em> for the <code>ApplicationMaster</code>. * Get the <em>tracking URL</em> for the <code>ApplicationMaster</code>.
@ -112,7 +125,7 @@ public interface RegisterApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
String getTrackingUrl(); public abstract String getTrackingUrl();
/** /**
* Set the <em>tracking URL</em> for the <code>ApplicationMaster</code>. * Set the <em>tracking URL</em> for the <code>ApplicationMaster</code>.
@ -121,5 +134,5 @@ public interface RegisterApplicationMasterRequest {
*/ */
@Public @Public
@Stable @Stable
void setTrackingUrl(String trackingUrl); public abstract void setTrackingUrl(String trackingUrl);
} }

View File

@ -27,6 +27,7 @@
import org.apache.hadoop.yarn.api.AMRMProtocol; import org.apache.hadoop.yarn.api.AMRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationAccessType; import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to a new * <p>The response sent by the <code>ResourceManager</code> to a new
@ -43,7 +44,18 @@
*/ */
@Public @Public
@Stable @Stable
public interface RegisterApplicationMasterResponse { public abstract class RegisterApplicationMasterResponse {
public static RegisterApplicationMasterResponse newInstance(
Resource minCapability, Resource maxCapability,
Map<ApplicationAccessType, String> acls) {
RegisterApplicationMasterResponse response =
Records.newRecord(RegisterApplicationMasterResponse.class);
response.setMinimumResourceCapability(minCapability);
response.setMaximumResourceCapability(maxCapability);
response.setApplicationACLs(acls);
return response;
}
/** /**
* Get the minimum capability for any {@link Resource} allocated by the * Get the minimum capability for any {@link Resource} allocated by the
@ -52,11 +64,11 @@ public interface RegisterApplicationMasterResponse {
*/ */
@Public @Public
@Stable @Stable
public Resource getMinimumResourceCapability(); public abstract Resource getMinimumResourceCapability();
@Private @Private
@Unstable @Unstable
public void setMinimumResourceCapability(Resource capability); public abstract void setMinimumResourceCapability(Resource capability);
/** /**
* Get the maximum capability for any {@link Resource} allocated by the * Get the maximum capability for any {@link Resource} allocated by the
@ -65,11 +77,11 @@ public interface RegisterApplicationMasterResponse {
*/ */
@Public @Public
@Stable @Stable
public Resource getMaximumResourceCapability(); public abstract Resource getMaximumResourceCapability();
@Private @Private
@Unstable @Unstable
public void setMaximumResourceCapability(Resource capability); public abstract void setMaximumResourceCapability(Resource capability);
/** /**
* Get the <code>ApplicationACL</code>s for the application. * Get the <code>ApplicationACL</code>s for the application.
@ -77,7 +89,7 @@ public interface RegisterApplicationMasterResponse {
*/ */
@Public @Public
@Stable @Stable
public Map<ApplicationAccessType, String> getApplicationACLs(); public abstract Map<ApplicationAccessType, String> getApplicationACLs();
/** /**
* Set the <code>ApplicationACL</code>s for the application. * Set the <code>ApplicationACL</code>s for the application.
@ -85,5 +97,5 @@ public interface RegisterApplicationMasterResponse {
*/ */
@Private @Private
@Unstable @Unstable
public void setApplicationACLs(Map<ApplicationAccessType, String> acls); public abstract void setApplicationACLs(Map<ApplicationAccessType, String> acls);
} }

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.util.Records;
/** /**
* The request issued by the client to renew a delegation token from * The request issued by the client to renew a delegation token from
@ -28,7 +29,16 @@
*/ */
@Public @Public
@Evolving @Evolving
public interface RenewDelegationTokenRequest { public abstract class RenewDelegationTokenRequest {
Token getDelegationToken();
void setDelegationToken(Token dToken); public static RenewDelegationTokenRequest newInstance(Token dToken) {
RenewDelegationTokenRequest request =
Records.newRecord(RenewDelegationTokenRequest.class);
request.setDelegationToken(dToken);
return request;
}
public abstract Token getDelegationToken();
public abstract void setDelegationToken(Token dToken);
} }

View File

@ -20,13 +20,23 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.yarn.util.Records;
/** /**
* The response to a renewDelegationToken call to the {@code ResourceManager}. * The response to a renewDelegationToken call to the {@code ResourceManager}.
*/ */
@Public @Public
@Evolving @Evolving
public interface RenewDelegationTokenResponse { public abstract class RenewDelegationTokenResponse {
long getNextExpirationTime();
void setNextExpirationTime(long expTime); public static RenewDelegationTokenResponse newInstance(long expTime) {
RenewDelegationTokenResponse response =
Records.newRecord(RenewDelegationTokenResponse.class);
response.setNextExpirationTime(expTime);
return response;
}
public abstract long getNextExpirationTime();
public abstract void setNextExpirationTime(long expTime);
} }

View File

@ -23,6 +23,7 @@
import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.ContainerManager;
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by the <code>ApplicationMaster</code> to the * <p>The request sent by the <code>ApplicationMaster</code> to the
@ -38,7 +39,17 @@
*/ */
@Public @Public
@Stable @Stable
public interface StartContainerRequest { public abstract class StartContainerRequest {
public static StartContainerRequest newInstance(
ContainerLaunchContext context, Token container) {
StartContainerRequest request =
Records.newRecord(StartContainerRequest.class);
request.setContainerLaunchContext(context);
request.setContainerToken(container);
return request;
}
/** /**
* Get the <code>ContainerLaunchContext</code> for the container to be started * Get the <code>ContainerLaunchContext</code> for the container to be started
* by the <code>NodeManager</code>. * by the <code>NodeManager</code>.
@ -62,9 +73,9 @@ public interface StartContainerRequest {
@Public @Public
@Stable @Stable
public Token getContainerToken(); public abstract Token getContainerToken();
@Public @Public
@Stable @Stable
public void setContainerToken(Token container); public abstract void setContainerToken(Token container);
} }

View File

@ -24,6 +24,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.ContainerManager;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>NodeManager</code> to the * <p>The response sent by the <code>NodeManager</code> to the
@ -34,7 +35,16 @@
*/ */
@Public @Public
@Stable @Stable
public interface StartContainerResponse { public abstract class StartContainerResponse {
public static StartContainerResponse newInstance(
Map<String, ByteBuffer> serviceResponses) {
StartContainerResponse response =
Records.newRecord(StartContainerResponse.class);
response.setAllServiceResponse(serviceResponses);
return response;
}
/** /**
* <p>Get the responses from all auxiliary services running on the * <p>Get the responses from all auxiliary services running on the
* <code>NodeManager</code>.</p> * <code>NodeManager</code>.</p>
@ -42,7 +52,7 @@ public interface StartContainerResponse {
* and their corresponding opaque blob <code>ByteBuffer</code>s</p> * and their corresponding opaque blob <code>ByteBuffer</code>s</p>
* @return a Map between the auxiliary service names and their outputs * @return a Map between the auxiliary service names and their outputs
*/ */
Map<String, ByteBuffer> getAllServiceResponse(); public abstract Map<String, ByteBuffer> getAllServiceResponse();
/** /**
* Set to the list of auxiliary services which have been started on the * Set to the list of auxiliary services which have been started on the
@ -51,5 +61,5 @@ public interface StartContainerResponse {
* @param serviceResponses A map from auxiliary service names to the opaque * @param serviceResponses A map from auxiliary service names to the opaque
* blob <code>ByteBuffer</code>s for that auxiliary service * blob <code>ByteBuffer</code>s for that auxiliary service
*/ */
void setAllServiceResponse(Map<String, ByteBuffer> serviceResponses); public abstract void setAllServiceResponse(Map<String, ByteBuffer> serviceResponses);
} }

View File

@ -22,6 +22,7 @@
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.ContainerManager;
import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by the <code>ApplicationMaster</code> to the * <p>The request sent by the <code>ApplicationMaster</code> to the
@ -31,14 +32,22 @@
*/ */
@Public @Public
@Stable @Stable
public interface StopContainerRequest { public abstract class StopContainerRequest {
public static StopContainerRequest newInstance(ContainerId containerId) {
StopContainerRequest request =
Records.newRecord(StopContainerRequest.class);
request.setContainerId(containerId);
return request;
}
/** /**
* Get the <code>ContainerId</code> of the container to be stopped. * Get the <code>ContainerId</code> of the container to be stopped.
* @return <code>ContainerId</code> of container to be stopped * @return <code>ContainerId</code> of container to be stopped
*/ */
@Public @Public
@Stable @Stable
ContainerId getContainerId(); public abstract ContainerId getContainerId();
/** /**
* Set the <code>ContainerId</code> of the container to be stopped. * Set the <code>ContainerId</code> of the container to be stopped.
@ -46,5 +55,5 @@ public interface StopContainerRequest {
*/ */
@Public @Public
@Stable @Stable
void setContainerId(ContainerId containerId); public abstract void setContainerId(ContainerId containerId);
} }

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ContainerManager; import org.apache.hadoop.yarn.api.ContainerManager;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>NodeManager</code> to the * <p>The response sent by the <code>NodeManager</code> to the
@ -33,6 +34,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface StopContainerResponse { public abstract class StopContainerResponse {
public static StopContainerResponse newInstance() {
StopContainerResponse response =
Records.newRecord(StopContainerResponse.class);
return response;
}
} }

View File

@ -24,6 +24,7 @@
import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext; import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The request sent by a client to <em>submit an application</em> to the * <p>The request sent by a client to <em>submit an application</em> to the
@ -39,7 +40,16 @@
*/ */
@Public @Public
@Stable @Stable
public interface SubmitApplicationRequest { public abstract class SubmitApplicationRequest {
public static SubmitApplicationRequest newInstance(
ApplicationSubmissionContext context) {
SubmitApplicationRequest request =
Records.newRecord(SubmitApplicationRequest.class);
request.setApplicationSubmissionContext(context);
return request;
}
/** /**
* Get the <code>ApplicationSubmissionContext</code> for the application. * Get the <code>ApplicationSubmissionContext</code> for the application.
* @return <code>ApplicationSubmissionContext</code> for the application * @return <code>ApplicationSubmissionContext</code> for the application

View File

@ -21,6 +21,7 @@
import org.apache.hadoop.classification.InterfaceAudience.Public; import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable; import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol; import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.util.Records;
/** /**
* <p>The response sent by the <code>ResourceManager</code> to a client on * <p>The response sent by the <code>ResourceManager</code> to a client on
@ -32,6 +33,10 @@
*/ */
@Public @Public
@Stable @Stable
public interface SubmitApplicationResponse { public abstract class SubmitApplicationResponse {
public static SubmitApplicationResponse newInstance() {
SubmitApplicationResponse response =
Records.newRecord(SubmitApplicationResponse.class);
return response;
}
} }

View File

@ -21,12 +21,10 @@
import org.apache.hadoop.security.proto.SecurityProtos.CancelDelegationTokenRequestProtoOrBuilder; import org.apache.hadoop.security.proto.SecurityProtos.CancelDelegationTokenRequestProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto; import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl;
public class CancelDelegationTokenRequestPBImpl extends public class CancelDelegationTokenRequestPBImpl extends
ProtoBase<CancelDelegationTokenRequestProto> implements
CancelDelegationTokenRequest { CancelDelegationTokenRequest {
CancelDelegationTokenRequestProto proto = CancelDelegationTokenRequestProto CancelDelegationTokenRequestProto proto = CancelDelegationTokenRequestProto
@ -64,7 +62,6 @@ public void setDelegationToken(Token token) {
this.token = token; this.token = token;
} }
@Override
public CancelDelegationTokenRequestProto getProto() { public CancelDelegationTokenRequestProto getProto() {
mergeLocalToProto(); mergeLocalToProto();
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
@ -72,6 +69,26 @@ public CancelDelegationTokenRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (token != null) { if (token != null) {
builder.setToken(convertToProtoFormat(this.token)); builder.setToken(convertToProtoFormat(this.token));

View File

@ -19,11 +19,8 @@
import org.apache.hadoop.security.proto.SecurityProtos.CancelDelegationTokenResponseProto; import org.apache.hadoop.security.proto.SecurityProtos.CancelDelegationTokenResponseProto;
import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenResponse; import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
public class CancelDelegationTokenResponsePBImpl extends public class CancelDelegationTokenResponsePBImpl extends CancelDelegationTokenResponse {
ProtoBase<CancelDelegationTokenResponseProto> implements
CancelDelegationTokenResponse {
CancelDelegationTokenResponseProto proto = CancelDelegationTokenResponseProto CancelDelegationTokenResponseProto proto = CancelDelegationTokenResponseProto
.getDefaultInstance(); .getDefaultInstance();
@ -36,9 +33,27 @@ public CancelDelegationTokenResponsePBImpl(
this.proto = proto; this.proto = proto;
} }
@Override
public CancelDelegationTokenResponseProto getProto() { public CancelDelegationTokenResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -22,7 +22,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest; import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus; import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationAttemptIdProto; import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationAttemptIdProto;
import org.apache.hadoop.yarn.proto.YarnProtos.FinalApplicationStatusProto; import org.apache.hadoop.yarn.proto.YarnProtos.FinalApplicationStatusProto;
@ -31,7 +30,7 @@
import org.apache.hadoop.yarn.util.ProtoUtils; import org.apache.hadoop.yarn.util.ProtoUtils;
public class FinishApplicationMasterRequestPBImpl extends ProtoBase<FinishApplicationMasterRequestProto> implements FinishApplicationMasterRequest { public class FinishApplicationMasterRequestPBImpl extends FinishApplicationMasterRequest {
FinishApplicationMasterRequestProto proto = FinishApplicationMasterRequestProto.getDefaultInstance(); FinishApplicationMasterRequestProto proto = FinishApplicationMasterRequestProto.getDefaultInstance();
FinishApplicationMasterRequestProto.Builder builder = null; FinishApplicationMasterRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -55,6 +54,26 @@ public FinishApplicationMasterRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.appAttemptId != null) { if (this.appAttemptId != null) {
builder.setApplicationAttemptId(convertToProtoFormat(this.appAttemptId)); builder.setApplicationAttemptId(convertToProtoFormat(this.appAttemptId));

View File

@ -20,12 +20,11 @@
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse; import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationMasterResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationMasterResponseProto;
public class FinishApplicationMasterResponsePBImpl extends ProtoBase<FinishApplicationMasterResponseProto> implements FinishApplicationMasterResponse { public class FinishApplicationMasterResponsePBImpl extends FinishApplicationMasterResponse {
FinishApplicationMasterResponseProto proto = FinishApplicationMasterResponseProto.getDefaultInstance(); FinishApplicationMasterResponseProto proto = FinishApplicationMasterResponseProto.getDefaultInstance();
FinishApplicationMasterResponseProto.Builder builder = null; FinishApplicationMasterResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -45,6 +44,26 @@ public FinishApplicationMasterResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void maybeInitBuilder() { private void maybeInitBuilder() {
if (viaProto || builder == null) { if (viaProto || builder == null) {
builder = FinishApplicationMasterResponseProto.newBuilder(proto); builder = FinishApplicationMasterResponseProto.newBuilder(proto);

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsRequestProto;
public class GetAllApplicationsRequestPBImpl extends public class GetAllApplicationsRequestPBImpl extends GetAllApplicationsRequest {
ProtoBase<GetAllApplicationsRequestProto> implements GetAllApplicationsRequest {
GetAllApplicationsRequestProto proto = GetAllApplicationsRequestProto.getDefaultInstance(); GetAllApplicationsRequestProto proto = GetAllApplicationsRequestProto.getDefaultInstance();
GetAllApplicationsRequestProto.Builder builder = null; GetAllApplicationsRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -37,11 +35,29 @@ public GetAllApplicationsRequestPBImpl(GetAllApplicationsRequestProto proto) {
viaProto = true; viaProto = true;
} }
@Override
public GetAllApplicationsRequestProto getProto() { public GetAllApplicationsRequestProto getProto() {
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -24,15 +24,13 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationReportPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationReportPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto; import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProtoOrBuilder; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProtoOrBuilder;
public class GetAllApplicationsResponsePBImpl public class GetAllApplicationsResponsePBImpl
extends ProtoBase<GetAllApplicationsResponseProto> implements extends GetAllApplicationsResponse {
GetAllApplicationsResponse {
GetAllApplicationsResponseProto proto = GetAllApplicationsResponseProto proto =
GetAllApplicationsResponseProto.getDefaultInstance(); GetAllApplicationsResponseProto.getDefaultInstance();
@ -64,7 +62,6 @@ public void setApplicationList(List<ApplicationReport> applications) {
this.applicationList = applications; this.applicationList = applications;
} }
@Override
public GetAllApplicationsResponseProto getProto() { public GetAllApplicationsResponseProto getProto() {
mergeLocalToProto(); mergeLocalToProto();
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
@ -72,6 +69,26 @@ public GetAllApplicationsResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.applicationList != null) { if (this.applicationList != null) {
addLocalApplicationsToProto(); addLocalApplicationsToProto();

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest;
import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto; import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportRequestProto;
@ -29,7 +28,7 @@
public class GetApplicationReportRequestPBImpl extends ProtoBase<GetApplicationReportRequestProto> implements GetApplicationReportRequest { public class GetApplicationReportRequestPBImpl extends GetApplicationReportRequest {
GetApplicationReportRequestProto proto = GetApplicationReportRequestProto.getDefaultInstance(); GetApplicationReportRequestProto proto = GetApplicationReportRequestProto.getDefaultInstance();
GetApplicationReportRequestProto.Builder builder = null; GetApplicationReportRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public GetApplicationReportRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (applicationId != null) { if (applicationId != null) {
builder.setApplicationId(convertToProtoFormat(this.applicationId)); builder.setApplicationId(convertToProtoFormat(this.applicationId));

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse;
import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationReportPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationReportPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto; import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportResponseProto;
@ -29,7 +28,7 @@
public class GetApplicationReportResponsePBImpl extends ProtoBase<GetApplicationReportResponseProto> implements GetApplicationReportResponse { public class GetApplicationReportResponsePBImpl extends GetApplicationReportResponse {
GetApplicationReportResponseProto proto = GetApplicationReportResponseProto.getDefaultInstance(); GetApplicationReportResponseProto proto = GetApplicationReportResponseProto.getDefaultInstance();
GetApplicationReportResponseProto.Builder builder = null; GetApplicationReportResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public GetApplicationReportResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.applicationReport != null) { if (this.applicationReport != null) {
builder.setApplicationReport(convertToProtoFormat(this.applicationReport)); builder.setApplicationReport(convertToProtoFormat(this.applicationReport));

View File

@ -20,12 +20,11 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterMetricsRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterMetricsRequestProto;
public class GetClusterMetricsRequestPBImpl extends ProtoBase<GetClusterMetricsRequestProto> implements GetClusterMetricsRequest { public class GetClusterMetricsRequestPBImpl extends GetClusterMetricsRequest {
GetClusterMetricsRequestProto proto = GetClusterMetricsRequestProto.getDefaultInstance(); GetClusterMetricsRequestProto proto = GetClusterMetricsRequestProto.getDefaultInstance();
GetClusterMetricsRequestProto.Builder builder = null; GetClusterMetricsRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -45,15 +44,23 @@ public GetClusterMetricsRequestProto getProto() {
return proto; return proto;
} }
private void maybeInitBuilder() { @Override
if (viaProto || builder == null) { public int hashCode() {
builder = GetClusterMetricsRequestProto.newBuilder(proto); return getProto().hashCode();
}
viaProto = false;
} }
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -20,7 +20,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.YarnClusterMetrics; import org.apache.hadoop.yarn.api.records.YarnClusterMetrics;
import org.apache.hadoop.yarn.api.records.impl.pb.YarnClusterMetricsPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.YarnClusterMetricsPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.YarnClusterMetricsProto; import org.apache.hadoop.yarn.proto.YarnProtos.YarnClusterMetricsProto;
@ -29,7 +28,7 @@
public class GetClusterMetricsResponsePBImpl extends ProtoBase<GetClusterMetricsResponseProto> implements GetClusterMetricsResponse { public class GetClusterMetricsResponsePBImpl extends GetClusterMetricsResponse {
GetClusterMetricsResponseProto proto = GetClusterMetricsResponseProto.getDefaultInstance(); GetClusterMetricsResponseProto proto = GetClusterMetricsResponseProto.getDefaultInstance();
GetClusterMetricsResponseProto.Builder builder = null; GetClusterMetricsResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public GetClusterMetricsResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.yarnClusterMetrics != null) { if (this.yarnClusterMetrics != null) {
builder.setClusterMetrics(convertToProtoFormat(this.yarnClusterMetrics)); builder.setClusterMetrics(convertToProtoFormat(this.yarnClusterMetrics));

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesRequestProto;
public class GetClusterNodesRequestPBImpl extends public class GetClusterNodesRequestPBImpl extends GetClusterNodesRequest {
ProtoBase<GetClusterNodesRequestProto> implements GetClusterNodesRequest {
GetClusterNodesRequestProto proto = GetClusterNodesRequestProto.getDefaultInstance(); GetClusterNodesRequestProto proto = GetClusterNodesRequestProto.getDefaultInstance();
GetClusterNodesRequestProto.Builder builder = null; GetClusterNodesRequestProto.Builder builder = null;
@ -38,11 +36,29 @@ public GetClusterNodesRequestPBImpl(GetClusterNodesRequestProto proto) {
viaProto = true; viaProto = true;
} }
@Override
public GetClusterNodesRequestProto getProto() { public GetClusterNodesRequestProto getProto() {
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -24,14 +24,12 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
import org.apache.hadoop.yarn.api.records.NodeReport; import org.apache.hadoop.yarn.api.records.NodeReport;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.NodeReportPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.NodeReportPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.NodeReportProto; import org.apache.hadoop.yarn.proto.YarnProtos.NodeReportProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProtoOrBuilder; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProtoOrBuilder;
public class GetClusterNodesResponsePBImpl extends public class GetClusterNodesResponsePBImpl extends GetClusterNodesResponse {
ProtoBase<GetClusterNodesResponseProto> implements GetClusterNodesResponse {
GetClusterNodesResponseProto proto = GetClusterNodesResponseProto proto =
GetClusterNodesResponseProto.getDefaultInstance(); GetClusterNodesResponseProto.getDefaultInstance();
@ -63,7 +61,6 @@ public void setNodeReports(List<NodeReport> nodeManagers) {
this.nodeManagerInfoList = nodeManagers; this.nodeManagerInfoList = nodeManagers;
} }
@Override
public GetClusterNodesResponseProto getProto() { public GetClusterNodesResponseProto getProto() {
mergeLocalToProto(); mergeLocalToProto();
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
@ -71,6 +68,26 @@ public GetClusterNodesResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.nodeManagerInfoList != null) { if (this.nodeManagerInfoList != null) {
addLocalNodeManagerInfosToProto(); addLocalNodeManagerInfosToProto();

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest;
import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ContainerIdPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ContainerIdPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto; import org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusRequestProto;
@ -29,7 +28,7 @@
public class GetContainerStatusRequestPBImpl extends ProtoBase<GetContainerStatusRequestProto> implements GetContainerStatusRequest { public class GetContainerStatusRequestPBImpl extends GetContainerStatusRequest {
GetContainerStatusRequestProto proto = GetContainerStatusRequestProto.getDefaultInstance(); GetContainerStatusRequestProto proto = GetContainerStatusRequestProto.getDefaultInstance();
GetContainerStatusRequestProto.Builder builder = null; GetContainerStatusRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public GetContainerStatusRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.containerId != null) { if (this.containerId != null) {
builder.setContainerId(convertToProtoFormat(this.containerId)); builder.setContainerId(convertToProtoFormat(this.containerId));

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse;
import org.apache.hadoop.yarn.api.records.ContainerStatus; import org.apache.hadoop.yarn.api.records.ContainerStatus;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ContainerStatusPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ContainerStatusPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto; import org.apache.hadoop.yarn.proto.YarnProtos.ContainerStatusProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusResponseProto;
@ -29,7 +28,7 @@
public class GetContainerStatusResponsePBImpl extends ProtoBase<GetContainerStatusResponseProto> implements GetContainerStatusResponse { public class GetContainerStatusResponsePBImpl extends GetContainerStatusResponse {
GetContainerStatusResponseProto proto = GetContainerStatusResponseProto.getDefaultInstance(); GetContainerStatusResponseProto proto = GetContainerStatusResponseProto.getDefaultInstance();
GetContainerStatusResponseProto.Builder builder = null; GetContainerStatusResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public GetContainerStatusResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.containerStatus != null) { if (this.containerStatus != null) {
builder.setStatus(convertToProtoFormat(this.containerStatus)); builder.setStatus(convertToProtoFormat(this.containerStatus));

View File

@ -20,10 +20,8 @@
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRequestProto; import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRequestProto;
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRequestProtoOrBuilder; import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRequestProtoOrBuilder;
import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
public class GetDelegationTokenRequestPBImpl extends public class GetDelegationTokenRequestPBImpl extends GetDelegationTokenRequest {
ProtoBase<GetDelegationTokenRequestProto> implements GetDelegationTokenRequest {
String renewer; String renewer;
@ -60,7 +58,6 @@ public void setRenewer(String renewer) {
this.renewer = renewer; this.renewer = renewer;
} }
@Override
public GetDelegationTokenRequestProto getProto() { public GetDelegationTokenRequestProto getProto() {
mergeLocalToProto(); mergeLocalToProto();
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
@ -68,6 +65,25 @@ public GetDelegationTokenRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (renewer != null) { if (renewer != null) {

View File

@ -22,12 +22,10 @@
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenResponseProtoOrBuilder; import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenResponseProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto; import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl;
public class GetDelegationTokenResponsePBImpl extends public class GetDelegationTokenResponsePBImpl extends GetDelegationTokenResponse {
ProtoBase<GetDelegationTokenResponseProto> implements GetDelegationTokenResponse {
Token appToken; Token appToken;
@ -68,7 +66,6 @@ public void setRMDelegationToken(Token appToken) {
this.appToken = appToken; this.appToken = appToken;
} }
@Override
public GetDelegationTokenResponseProto getProto() { public GetDelegationTokenResponseProto getProto() {
mergeLocalToProto(); mergeLocalToProto();
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
@ -76,6 +73,25 @@ public GetDelegationTokenResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (appToken != null) { if (appToken != null) {

View File

@ -20,11 +20,10 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationRequestProto;
public class GetNewApplicationRequestPBImpl extends ProtoBase<GetNewApplicationRequestProto> implements GetNewApplicationRequest { public class GetNewApplicationRequestPBImpl extends GetNewApplicationRequest {
GetNewApplicationRequestProto proto = GetNewApplicationRequestProto.getDefaultInstance(); GetNewApplicationRequestProto proto = GetNewApplicationRequestProto.getDefaultInstance();
GetNewApplicationRequestProto.Builder builder = null; GetNewApplicationRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -44,15 +43,23 @@ public GetNewApplicationRequestProto getProto() {
return proto; return proto;
} }
private void maybeInitBuilder() { @Override
if (viaProto || builder == null) { public int hashCode() {
builder = GetNewApplicationRequestProto.newBuilder(proto); return getProto().hashCode();
}
viaProto = false;
} }
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationResponse;
import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl;
@ -30,7 +29,7 @@
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationResponseProtoOrBuilder; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationResponseProtoOrBuilder;
public class GetNewApplicationResponsePBImpl extends ProtoBase<GetNewApplicationResponseProto> implements GetNewApplicationResponse { public class GetNewApplicationResponsePBImpl extends GetNewApplicationResponse {
GetNewApplicationResponseProto proto = GetNewApplicationResponseProto.getDefaultInstance(); GetNewApplicationResponseProto proto = GetNewApplicationResponseProto.getDefaultInstance();
GetNewApplicationResponseProto.Builder builder = null; GetNewApplicationResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -55,6 +54,26 @@ public GetNewApplicationResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (applicationId != null) { if (applicationId != null) {
builder.setApplicationId(convertToProtoFormat(this.applicationId)); builder.setApplicationId(convertToProtoFormat(this.applicationId));

View File

@ -19,12 +19,10 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetQueueInfoRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetQueueInfoRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoRequestProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoRequestProtoOrBuilder; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoRequestProtoOrBuilder;
public class GetQueueInfoRequestPBImpl extends public class GetQueueInfoRequestPBImpl extends GetQueueInfoRequest {
ProtoBase<GetQueueInfoRequestProto> implements GetQueueInfoRequest {
GetQueueInfoRequestProto proto = GetQueueInfoRequestProto proto =
GetQueueInfoRequestProto.getDefaultInstance(); GetQueueInfoRequestProto.getDefaultInstance();
@ -99,11 +97,29 @@ private void maybeInitBuilder() {
viaProto = false; viaProto = false;
} }
@Override
public GetQueueInfoRequestProto getProto() { public GetQueueInfoRequestProto getProto() {
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,15 +19,13 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetQueueInfoResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetQueueInfoResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.QueueInfo; import org.apache.hadoop.yarn.api.records.QueueInfo;
import org.apache.hadoop.yarn.api.records.impl.pb.QueueInfoPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.QueueInfoPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.QueueInfoProto; import org.apache.hadoop.yarn.proto.YarnProtos.QueueInfoProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoResponseProtoOrBuilder; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoResponseProtoOrBuilder;
public class GetQueueInfoResponsePBImpl extends ProtoBase<GetQueueInfoResponseProto> public class GetQueueInfoResponsePBImpl extends GetQueueInfoResponse {
implements GetQueueInfoResponse {
QueueInfo queueInfo; QueueInfo queueInfo;
@ -45,7 +43,6 @@ public GetQueueInfoResponsePBImpl(GetQueueInfoResponseProto proto) {
viaProto = true; viaProto = true;
} }
@Override
public GetQueueInfoResponseProto getProto() { public GetQueueInfoResponseProto getProto() {
mergeLocalToProto(); mergeLocalToProto();
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
@ -53,6 +50,26 @@ public GetQueueInfoResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
@Override @Override
public QueueInfo getQueueInfo() { public QueueInfo getQueueInfo() {
if (this.queueInfo != null) { if (this.queueInfo != null) {

View File

@ -19,12 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoRequest; import org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoRequestProto;
public class GetQueueUserAclsInfoRequestPBImpl extends public class GetQueueUserAclsInfoRequestPBImpl extends GetQueueUserAclsInfoRequest {
ProtoBase<GetQueueUserAclsInfoRequestProto> implements
GetQueueUserAclsInfoRequest {
GetQueueUserAclsInfoRequestProto proto = GetQueueUserAclsInfoRequestProto proto =
GetQueueUserAclsInfoRequestProto.getDefaultInstance(); GetQueueUserAclsInfoRequestProto.getDefaultInstance();
@ -40,11 +37,29 @@ public GetQueueUserAclsInfoRequestPBImpl(GetQueueUserAclsInfoRequestProto proto)
viaProto = true; viaProto = true;
} }
@Override
public GetQueueUserAclsInfoRequestProto getProto() { public GetQueueUserAclsInfoRequestProto getProto() {
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -24,15 +24,12 @@
import org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoResponse; import org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoResponse;
import org.apache.hadoop.yarn.api.records.QueueUserACLInfo; import org.apache.hadoop.yarn.api.records.QueueUserACLInfo;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.QueueUserACLInfoPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.QueueUserACLInfoPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.QueueUserACLInfoProto; import org.apache.hadoop.yarn.proto.YarnProtos.QueueUserACLInfoProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoResponseProtoOrBuilder; import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoResponseProtoOrBuilder;
public class GetQueueUserAclsInfoResponsePBImpl extends public class GetQueueUserAclsInfoResponsePBImpl extends GetQueueUserAclsInfoResponse {
ProtoBase<GetQueueUserAclsInfoResponseProto>
implements GetQueueUserAclsInfoResponse {
List<QueueUserACLInfo> queueUserAclsInfoList; List<QueueUserACLInfo> queueUserAclsInfoList;
@ -65,7 +62,6 @@ public void setUserAclsInfoList(List<QueueUserACLInfo> queueUserAclsList) {
this.queueUserAclsInfoList = queueUserAclsList; this.queueUserAclsInfoList = queueUserAclsList;
} }
@Override
public GetQueueUserAclsInfoResponseProto getProto() { public GetQueueUserAclsInfoResponseProto getProto() {
mergeLocalToProto(); mergeLocalToProto();
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
@ -73,6 +69,26 @@ public GetQueueUserAclsInfoResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.queueUserAclsInfoList != null) { if (this.queueUserAclsInfoList != null) {
addLocalQueueUserACLInfosToProto(); addLocalQueueUserACLInfosToProto();

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.KillApplicationRequest; import org.apache.hadoop.yarn.api.protocolrecords.KillApplicationRequest;
import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationId;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto; import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.KillApplicationRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.KillApplicationRequestProto;
@ -29,7 +28,7 @@
public class KillApplicationRequestPBImpl extends ProtoBase<KillApplicationRequestProto> implements KillApplicationRequest { public class KillApplicationRequestPBImpl extends KillApplicationRequest {
KillApplicationRequestProto proto = KillApplicationRequestProto.getDefaultInstance(); KillApplicationRequestProto proto = KillApplicationRequestProto.getDefaultInstance();
KillApplicationRequestProto.Builder builder = null; KillApplicationRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public KillApplicationRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.applicationId != null) { if (this.applicationId != null) {
builder.setApplicationId(convertToProtoFormat(this.applicationId)); builder.setApplicationId(convertToProtoFormat(this.applicationId));

View File

@ -20,12 +20,11 @@
import org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse; import org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.KillApplicationResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.KillApplicationResponseProto;
public class KillApplicationResponsePBImpl extends ProtoBase<KillApplicationResponseProto> implements KillApplicationResponse { public class KillApplicationResponsePBImpl extends KillApplicationResponse {
KillApplicationResponseProto proto = KillApplicationResponseProto.getDefaultInstance(); KillApplicationResponseProto proto = KillApplicationResponseProto.getDefaultInstance();
KillApplicationResponseProto.Builder builder = null; KillApplicationResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -45,15 +44,30 @@ public KillApplicationResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void maybeInitBuilder() { private void maybeInitBuilder() {
if (viaProto || builder == null) { if (viaProto || builder == null) {
builder = KillApplicationResponseProto.newBuilder(proto); builder = KillApplicationResponseProto.newBuilder(proto);
} }
viaProto = false; viaProto = false;
} }
} }

View File

@ -19,12 +19,10 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshAdminAclsRequest; import org.apache.hadoop.yarn.api.protocolrecords.RefreshAdminAclsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshAdminAclsRequestProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshAdminAclsRequestProto;
public class RefreshAdminAclsRequestPBImpl public class RefreshAdminAclsRequestPBImpl
extends ProtoBase<RefreshAdminAclsRequestProto> extends RefreshAdminAclsRequest {
implements RefreshAdminAclsRequest {
RefreshAdminAclsRequestProto proto = RefreshAdminAclsRequestProto.getDefaultInstance(); RefreshAdminAclsRequestProto proto = RefreshAdminAclsRequestProto.getDefaultInstance();
RefreshAdminAclsRequestProto.Builder builder = null; RefreshAdminAclsRequestProto.Builder builder = null;
@ -44,4 +42,24 @@ public RefreshAdminAclsRequestProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshAdminAclsResponse; import org.apache.hadoop.yarn.api.protocolrecords.RefreshAdminAclsResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshAdminAclsResponseProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshAdminAclsResponseProto;
public class RefreshAdminAclsResponsePBImpl extends ProtoBase<RefreshAdminAclsResponseProto> public class RefreshAdminAclsResponsePBImpl extends RefreshAdminAclsResponse {
implements RefreshAdminAclsResponse {
RefreshAdminAclsResponseProto proto = RefreshAdminAclsResponseProto.getDefaultInstance(); RefreshAdminAclsResponseProto proto = RefreshAdminAclsResponseProto.getDefaultInstance();
RefreshAdminAclsResponseProto.Builder builder = null; RefreshAdminAclsResponseProto.Builder builder = null;
@ -43,4 +41,24 @@ public RefreshAdminAclsResponseProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshNodesRequest; import org.apache.hadoop.yarn.api.protocolrecords.RefreshNodesRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshNodesRequestProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshNodesRequestProto;
public class RefreshNodesRequestPBImpl extends ProtoBase<RefreshNodesRequestProto> public class RefreshNodesRequestPBImpl extends RefreshNodesRequest {
implements RefreshNodesRequest {
RefreshNodesRequestProto proto = RefreshNodesRequestProto.getDefaultInstance(); RefreshNodesRequestProto proto = RefreshNodesRequestProto.getDefaultInstance();
RefreshNodesRequestProto.Builder builder = null; RefreshNodesRequestProto.Builder builder = null;
@ -43,4 +41,24 @@ public RefreshNodesRequestProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshNodesResponse; import org.apache.hadoop.yarn.api.protocolrecords.RefreshNodesResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshNodesResponseProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshNodesResponseProto;
public class RefreshNodesResponsePBImpl extends ProtoBase<RefreshNodesResponseProto> public class RefreshNodesResponsePBImpl extends RefreshNodesResponse {
implements RefreshNodesResponse {
RefreshNodesResponseProto proto = RefreshNodesResponseProto.getDefaultInstance(); RefreshNodesResponseProto proto = RefreshNodesResponseProto.getDefaultInstance();
RefreshNodesResponseProto.Builder builder = null; RefreshNodesResponseProto.Builder builder = null;
@ -43,4 +41,24 @@ public RefreshNodesResponseProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshQueuesRequest; import org.apache.hadoop.yarn.api.protocolrecords.RefreshQueuesRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshQueuesRequestProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshQueuesRequestProto;
public class RefreshQueuesRequestPBImpl extends ProtoBase<RefreshQueuesRequestProto> public class RefreshQueuesRequestPBImpl extends RefreshQueuesRequest {
implements RefreshQueuesRequest {
RefreshQueuesRequestProto proto = RefreshQueuesRequestProto.getDefaultInstance(); RefreshQueuesRequestProto proto = RefreshQueuesRequestProto.getDefaultInstance();
RefreshQueuesRequestProto.Builder builder = null; RefreshQueuesRequestProto.Builder builder = null;
@ -43,4 +41,24 @@ public RefreshQueuesRequestProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshQueuesResponse; import org.apache.hadoop.yarn.api.protocolrecords.RefreshQueuesResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshQueuesResponseProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshQueuesResponseProto;
public class RefreshQueuesResponsePBImpl extends ProtoBase<RefreshQueuesResponseProto> public class RefreshQueuesResponsePBImpl extends RefreshQueuesResponse {
implements RefreshQueuesResponse {
RefreshQueuesResponseProto proto = RefreshQueuesResponseProto.getDefaultInstance(); RefreshQueuesResponseProto proto = RefreshQueuesResponseProto.getDefaultInstance();
RefreshQueuesResponseProto.Builder builder = null; RefreshQueuesResponseProto.Builder builder = null;
@ -43,4 +41,24 @@ public RefreshQueuesResponseProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,12 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshServiceAclsRequest; import org.apache.hadoop.yarn.api.protocolrecords.RefreshServiceAclsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshServiceAclsRequestProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshServiceAclsRequestProto;
public class RefreshServiceAclsRequestPBImpl public class RefreshServiceAclsRequestPBImpl extends RefreshServiceAclsRequest {
extends ProtoBase<RefreshServiceAclsRequestProto>
implements RefreshServiceAclsRequest {
RefreshServiceAclsRequestProto proto = RefreshServiceAclsRequestProto proto =
RefreshServiceAclsRequestProto.getDefaultInstance(); RefreshServiceAclsRequestProto.getDefaultInstance();
@ -46,4 +43,24 @@ public RefreshServiceAclsRequestProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,12 +19,10 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshServiceAclsResponse; import org.apache.hadoop.yarn.api.protocolrecords.RefreshServiceAclsResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshServiceAclsResponseProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshServiceAclsResponseProto;
public class RefreshServiceAclsResponsePBImpl public class RefreshServiceAclsResponsePBImpl extends
extends ProtoBase<RefreshServiceAclsResponseProto> RefreshServiceAclsResponse {
implements RefreshServiceAclsResponse {
RefreshServiceAclsResponseProto proto = RefreshServiceAclsResponseProto proto =
RefreshServiceAclsResponseProto.getDefaultInstance(); RefreshServiceAclsResponseProto.getDefaultInstance();
@ -46,4 +44,24 @@ public RefreshServiceAclsResponseProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,12 +19,10 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshSuperUserGroupsConfigurationRequest; import org.apache.hadoop.yarn.api.protocolrecords.RefreshSuperUserGroupsConfigurationRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshSuperUserGroupsConfigurationRequestProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshSuperUserGroupsConfigurationRequestProto;
public class RefreshSuperUserGroupsConfigurationRequestPBImpl public class RefreshSuperUserGroupsConfigurationRequestPBImpl
extends ProtoBase<RefreshSuperUserGroupsConfigurationRequestProto> extends RefreshSuperUserGroupsConfigurationRequest {
implements RefreshSuperUserGroupsConfigurationRequest {
RefreshSuperUserGroupsConfigurationRequestProto proto = RefreshSuperUserGroupsConfigurationRequestProto.getDefaultInstance(); RefreshSuperUserGroupsConfigurationRequestProto proto = RefreshSuperUserGroupsConfigurationRequestProto.getDefaultInstance();
RefreshSuperUserGroupsConfigurationRequestProto.Builder builder = null; RefreshSuperUserGroupsConfigurationRequestProto.Builder builder = null;
@ -44,4 +42,24 @@ public RefreshSuperUserGroupsConfigurationRequestProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -22,8 +22,7 @@
import org.apache.hadoop.yarn.api.records.ProtoBase; import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshSuperUserGroupsConfigurationResponseProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshSuperUserGroupsConfigurationResponseProto;
public class RefreshSuperUserGroupsConfigurationResponsePBImpl extends ProtoBase<RefreshSuperUserGroupsConfigurationResponseProto> public class RefreshSuperUserGroupsConfigurationResponsePBImpl extends RefreshSuperUserGroupsConfigurationResponse {
implements RefreshSuperUserGroupsConfigurationResponse {
RefreshSuperUserGroupsConfigurationResponseProto proto = RefreshSuperUserGroupsConfigurationResponseProto.getDefaultInstance(); RefreshSuperUserGroupsConfigurationResponseProto proto = RefreshSuperUserGroupsConfigurationResponseProto.getDefaultInstance();
RefreshSuperUserGroupsConfigurationResponseProto.Builder builder = null; RefreshSuperUserGroupsConfigurationResponseProto.Builder builder = null;
@ -43,4 +42,24 @@ public RefreshSuperUserGroupsConfigurationResponseProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,12 +19,10 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshUserToGroupsMappingsRequest; import org.apache.hadoop.yarn.api.protocolrecords.RefreshUserToGroupsMappingsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshUserToGroupsMappingsRequestProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshUserToGroupsMappingsRequestProto;
public class RefreshUserToGroupsMappingsRequestPBImpl public class RefreshUserToGroupsMappingsRequestPBImpl
extends ProtoBase<RefreshUserToGroupsMappingsRequestProto> extends RefreshUserToGroupsMappingsRequest {
implements RefreshUserToGroupsMappingsRequest {
RefreshUserToGroupsMappingsRequestProto proto = RefreshUserToGroupsMappingsRequestProto.getDefaultInstance(); RefreshUserToGroupsMappingsRequestProto proto = RefreshUserToGroupsMappingsRequestProto.getDefaultInstance();
RefreshUserToGroupsMappingsRequestProto.Builder builder = null; RefreshUserToGroupsMappingsRequestProto.Builder builder = null;
@ -44,4 +42,24 @@ public RefreshUserToGroupsMappingsRequestProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb; package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshUserToGroupsMappingsResponse; import org.apache.hadoop.yarn.api.protocolrecords.RefreshUserToGroupsMappingsResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshUserToGroupsMappingsResponseProto; import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshUserToGroupsMappingsResponseProto;
public class RefreshUserToGroupsMappingsResponsePBImpl extends ProtoBase<RefreshUserToGroupsMappingsResponseProto> public class RefreshUserToGroupsMappingsResponsePBImpl extends RefreshUserToGroupsMappingsResponse {
implements RefreshUserToGroupsMappingsResponse {
RefreshUserToGroupsMappingsResponseProto proto = RefreshUserToGroupsMappingsResponseProto.getDefaultInstance(); RefreshUserToGroupsMappingsResponseProto proto = RefreshUserToGroupsMappingsResponseProto.getDefaultInstance();
RefreshUserToGroupsMappingsResponseProto.Builder builder = null; RefreshUserToGroupsMappingsResponseProto.Builder builder = null;
@ -43,4 +41,24 @@ public RefreshUserToGroupsMappingsResponseProto getProto() {
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest; import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationAttemptIdPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationAttemptIdProto; import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationAttemptIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterRequestProto;
@ -29,7 +28,7 @@
public class RegisterApplicationMasterRequestPBImpl extends ProtoBase<RegisterApplicationMasterRequestProto> implements RegisterApplicationMasterRequest { public class RegisterApplicationMasterRequestPBImpl extends RegisterApplicationMasterRequest {
RegisterApplicationMasterRequestProto proto = RegisterApplicationMasterRequestProto.getDefaultInstance(); RegisterApplicationMasterRequestProto proto = RegisterApplicationMasterRequestProto.getDefaultInstance();
RegisterApplicationMasterRequestProto.Builder builder = null; RegisterApplicationMasterRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public RegisterApplicationMasterRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.applicationAttemptId != null && !((ApplicationAttemptIdPBImpl)this.applicationAttemptId).getProto().equals(builder.getApplicationAttemptId())) { if (this.applicationAttemptId != null && !((ApplicationAttemptIdPBImpl)this.applicationAttemptId).getProto().equals(builder.getApplicationAttemptId())) {
builder.setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId)); builder.setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId));

View File

@ -26,7 +26,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse; import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
import org.apache.hadoop.yarn.api.records.ApplicationAccessType; import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.Resource; import org.apache.hadoop.yarn.api.records.Resource;
import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationACLMapProto; import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationACLMapProto;
@ -36,9 +35,8 @@
import org.apache.hadoop.yarn.util.ProtoUtils; import org.apache.hadoop.yarn.util.ProtoUtils;
public class RegisterApplicationMasterResponsePBImpl public class RegisterApplicationMasterResponsePBImpl extends
extends ProtoBase<RegisterApplicationMasterResponseProto> RegisterApplicationMasterResponse {
implements RegisterApplicationMasterResponse {
RegisterApplicationMasterResponseProto proto = RegisterApplicationMasterResponseProto proto =
RegisterApplicationMasterResponseProto.getDefaultInstance(); RegisterApplicationMasterResponseProto.getDefaultInstance();
RegisterApplicationMasterResponseProto.Builder builder = null; RegisterApplicationMasterResponseProto.Builder builder = null;
@ -64,6 +62,26 @@ public RegisterApplicationMasterResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToProto() { private void mergeLocalToProto() {
if (viaProto) if (viaProto)
maybeInitBuilder(); maybeInitBuilder();

View File

@ -21,12 +21,10 @@
import org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProtoOrBuilder; import org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto; import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.yarn.api.protocolrecords.RenewDelegationTokenRequest; import org.apache.hadoop.yarn.api.protocolrecords.RenewDelegationTokenRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl;
public class RenewDelegationTokenRequestPBImpl extends public class RenewDelegationTokenRequestPBImpl extends
ProtoBase<RenewDelegationTokenRequestProto> implements
RenewDelegationTokenRequest { RenewDelegationTokenRequest {
RenewDelegationTokenRequestProto proto = RenewDelegationTokenRequestProto proto =
RenewDelegationTokenRequestProto.getDefaultInstance(); RenewDelegationTokenRequestProto.getDefaultInstance();
@ -63,7 +61,6 @@ public void setDelegationToken(Token token) {
this.token = token; this.token = token;
} }
@Override
public RenewDelegationTokenRequestProto getProto() { public RenewDelegationTokenRequestProto getProto() {
mergeLocalToProto(); mergeLocalToProto();
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
@ -71,6 +68,25 @@ public RenewDelegationTokenRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (token != null) { if (token != null) {

View File

@ -23,7 +23,6 @@
import org.apache.hadoop.yarn.api.records.ProtoBase; import org.apache.hadoop.yarn.api.records.ProtoBase;
public class RenewDelegationTokenResponsePBImpl extends public class RenewDelegationTokenResponsePBImpl extends
ProtoBase<RenewDelegationTokenResponseProto> implements
RenewDelegationTokenResponse { RenewDelegationTokenResponse {
RenewDelegationTokenResponseProto proto = RenewDelegationTokenResponseProto proto =
@ -41,13 +40,32 @@ public RenewDelegationTokenResponsePBImpl (
this.viaProto = true; this.viaProto = true;
} }
@Override
public RenewDelegationTokenResponseProto getProto() { public RenewDelegationTokenResponseProto getProto() {
proto = viaProto ? proto : builder.build(); proto = viaProto ? proto : builder.build();
viaProto = true; viaProto = true;
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void maybeInitBuilder() { private void maybeInitBuilder() {
if (viaProto || builder == null) { if (viaProto || builder == null) {
builder = RenewDelegationTokenResponseProto.newBuilder(proto); builder = RenewDelegationTokenResponseProto.newBuilder(proto);

View File

@ -22,7 +22,6 @@
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto; import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest; import org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest;
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext; import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.Token; import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.api.records.impl.pb.ContainerLaunchContextPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ContainerLaunchContextPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl;
@ -32,7 +31,7 @@
public class StartContainerRequestPBImpl extends ProtoBase<StartContainerRequestProto> implements StartContainerRequest { public class StartContainerRequestPBImpl extends StartContainerRequest {
StartContainerRequestProto proto = StartContainerRequestProto.getDefaultInstance(); StartContainerRequestProto proto = StartContainerRequestProto.getDefaultInstance();
StartContainerRequestProto.Builder builder = null; StartContainerRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -57,6 +56,26 @@ public StartContainerRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.containerLaunchContext != null) { if (this.containerLaunchContext != null) {
builder.setContainerLaunchContext(convertToProtoFormat(this.containerLaunchContext)); builder.setContainerLaunchContext(convertToProtoFormat(this.containerLaunchContext));

View File

@ -22,17 +22,18 @@
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.hadoop.yarn.api.protocolrecords.StartContainerResponse; import org.apache.hadoop.yarn.api.protocolrecords.StartContainerResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase; import org.apache.hadoop.yarn.proto.YarnProtos.StringBytesMapProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.StartContainerResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.StartContainerResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.StartContainerResponseProtoOrBuilder; import org.apache.hadoop.yarn.proto.YarnServiceProtos.StartContainerResponseProtoOrBuilder;
import org.apache.hadoop.yarn.proto.YarnProtos.StringBytesMapProto; import org.apache.hadoop.yarn.util.ProtoUtils;
public class StartContainerResponsePBImpl extends ProtoBase<StartContainerResponseProto> implements StartContainerResponse { import com.google.protobuf.ByteString;
public class StartContainerResponsePBImpl extends StartContainerResponse {
StartContainerResponseProto proto = StartContainerResponseProto.getDefaultInstance(); StartContainerResponseProto proto = StartContainerResponseProto.getDefaultInstance();
StartContainerResponseProto.Builder builder = null; StartContainerResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -55,12 +56,40 @@ public synchronized StartContainerResponseProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private synchronized void mergeLocalToBuilder() { private synchronized void mergeLocalToBuilder() {
if (this.serviceResponse != null) { if (this.serviceResponse != null) {
addServiceResponseToProto(); addServiceResponseToProto();
} }
} }
protected final ByteBuffer convertFromProtoFormat(ByteString byteString) {
return ProtoUtils.convertFromProtoFormat(byteString);
}
protected final ByteString convertToProtoFormat(ByteBuffer byteBuffer) {
return ProtoUtils.convertToProtoFormat(byteBuffer);
}
private synchronized void mergeLocalToProto() { private synchronized void mergeLocalToProto() {
if (viaProto) { if (viaProto) {
maybeInitBuilder(); maybeInitBuilder();

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.StopContainerRequest; import org.apache.hadoop.yarn.api.protocolrecords.StopContainerRequest;
import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ContainerIdPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ContainerIdPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto; import org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.StopContainerRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.StopContainerRequestProto;
@ -29,7 +28,7 @@
public class StopContainerRequestPBImpl extends ProtoBase<StopContainerRequestProto> implements StopContainerRequest { public class StopContainerRequestPBImpl extends StopContainerRequest {
StopContainerRequestProto proto = StopContainerRequestProto.getDefaultInstance(); StopContainerRequestProto proto = StopContainerRequestProto.getDefaultInstance();
StopContainerRequestProto.Builder builder = null; StopContainerRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public StopContainerRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.containerId != null) { if (this.containerId != null) {
builder.setContainerId(convertToProtoFormat(this.containerId)); builder.setContainerId(convertToProtoFormat(this.containerId));

View File

@ -20,12 +20,11 @@
import org.apache.hadoop.yarn.api.protocolrecords.StopContainerResponse; import org.apache.hadoop.yarn.api.protocolrecords.StopContainerResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.StopContainerResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.StopContainerResponseProto;
public class StopContainerResponsePBImpl extends ProtoBase<StopContainerResponseProto> implements StopContainerResponse { public class StopContainerResponsePBImpl extends StopContainerResponse {
StopContainerResponseProto proto = StopContainerResponseProto.getDefaultInstance(); StopContainerResponseProto proto = StopContainerResponseProto.getDefaultInstance();
StopContainerResponseProto.Builder builder = null; StopContainerResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -45,15 +44,23 @@ public StopContainerResponseProto getProto() {
return proto; return proto;
} }
private void maybeInitBuilder() { @Override
if (viaProto || builder == null) { public int hashCode() {
builder = StopContainerResponseProto.newBuilder(proto); return getProto().hashCode();
}
viaProto = false;
} }
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -21,7 +21,6 @@
import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest; import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest;
import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext; import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl; import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationSubmissionContextProto; import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationSubmissionContextProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SubmitApplicationRequestProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.SubmitApplicationRequestProto;
@ -29,7 +28,7 @@
public class SubmitApplicationRequestPBImpl extends ProtoBase<SubmitApplicationRequestProto> implements SubmitApplicationRequest { public class SubmitApplicationRequestPBImpl extends SubmitApplicationRequest {
SubmitApplicationRequestProto proto = SubmitApplicationRequestProto.getDefaultInstance(); SubmitApplicationRequestProto proto = SubmitApplicationRequestProto.getDefaultInstance();
SubmitApplicationRequestProto.Builder builder = null; SubmitApplicationRequestProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -53,6 +52,26 @@ public SubmitApplicationRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToBuilder() { private void mergeLocalToBuilder() {
if (this.applicationSubmissionContext != null) { if (this.applicationSubmissionContext != null) {
builder.setApplicationSubmissionContext(convertToProtoFormat(this.applicationSubmissionContext)); builder.setApplicationSubmissionContext(convertToProtoFormat(this.applicationSubmissionContext));

View File

@ -20,12 +20,11 @@
import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse; import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SubmitApplicationResponseProto; import org.apache.hadoop.yarn.proto.YarnServiceProtos.SubmitApplicationResponseProto;
public class SubmitApplicationResponsePBImpl extends ProtoBase<SubmitApplicationResponseProto> implements SubmitApplicationResponse { public class SubmitApplicationResponsePBImpl extends SubmitApplicationResponse {
SubmitApplicationResponseProto proto = SubmitApplicationResponseProto.getDefaultInstance(); SubmitApplicationResponseProto proto = SubmitApplicationResponseProto.getDefaultInstance();
SubmitApplicationResponseProto.Builder builder = null; SubmitApplicationResponseProto.Builder builder = null;
boolean viaProto = false; boolean viaProto = false;
@ -45,15 +44,23 @@ public SubmitApplicationResponseProto getProto() {
return proto; return proto;
} }
private void maybeInitBuilder() { @Override
if (viaProto || builder == null) { public int hashCode() {
builder = SubmitApplicationResponseProto.newBuilder(proto); return getProto().hashCode();
}
viaProto = false;
} }
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
} }

View File

@ -22,13 +22,21 @@
import org.apache.hadoop.classification.InterfaceStability.Evolving; import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.classification.InterfaceStability.Unstable; import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest; import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest;
import org.apache.hadoop.yarn.util.Records;
/** /**
* Description of resources requested back by the cluster. * Description of resources requested back by the cluster.
* @see PreemptionContract * @see PreemptionContract
* @see AllocateRequest#setAskList(java.util.List) * @see AllocateRequest#setAskList(java.util.List)
*/ */
public interface PreemptionResourceRequest { public abstract class PreemptionResourceRequest {
public static PreemptionResourceRequest newInstance(ResourceRequest req) {
PreemptionResourceRequest request =
Records.newRecord(PreemptionResourceRequest.class);
request.setResourceRequest(req);
return request;
}
/** /**
* @return Resource described in this request, to be matched against running * @return Resource described in this request, to be matched against running
@ -36,10 +44,9 @@ public interface PreemptionResourceRequest {
*/ */
@Public @Public
@Evolving @Evolving
public ResourceRequest getResourceRequest(); public abstract ResourceRequest getResourceRequest();
@Private @Private
@Unstable @Unstable
public void setResourceRequest(ResourceRequest req); public abstract void setResourceRequest(ResourceRequest req);
} }

View File

@ -48,6 +48,26 @@ public synchronized PreemptionContainerProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToProto() { private void mergeLocalToProto() {
if (viaProto) if (viaProto)
maybeInitBuilder(); maybeInitBuilder();

View File

@ -56,6 +56,26 @@ public synchronized PreemptionContractProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToProto() { private void mergeLocalToProto() {
if (viaProto) if (viaProto)
maybeInitBuilder(); maybeInitBuilder();

View File

@ -50,6 +50,26 @@ public synchronized PreemptionMessageProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToProto() { private void mergeLocalToProto() {
if (viaProto) if (viaProto)
maybeInitBuilder(); maybeInitBuilder();

View File

@ -23,7 +23,7 @@
import org.apache.hadoop.yarn.proto.YarnProtos.PreemptionResourceRequestProtoOrBuilder; import org.apache.hadoop.yarn.proto.YarnProtos.PreemptionResourceRequestProtoOrBuilder;
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceRequestProto; import org.apache.hadoop.yarn.proto.YarnProtos.ResourceRequestProto;
public class PreemptionResourceRequestPBImpl implements PreemptionResourceRequest { public class PreemptionResourceRequestPBImpl extends PreemptionResourceRequest {
PreemptionResourceRequestProto proto = PreemptionResourceRequestProto proto =
PreemptionResourceRequestProto.getDefaultInstance(); PreemptionResourceRequestProto.getDefaultInstance();
@ -48,6 +48,26 @@ public synchronized PreemptionResourceRequestProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToProto() { private void mergeLocalToProto() {
if (viaProto) if (viaProto)
maybeInitBuilder(); maybeInitBuilder();

View File

@ -53,6 +53,26 @@ public synchronized StrictPreemptionContractProto getProto() {
return proto; return proto;
} }
@Override
public int hashCode() {
return getProto().hashCode();
}
@Override
public boolean equals(Object other) {
if (other == null)
return false;
if (other.getClass().isAssignableFrom(this.getClass())) {
return this.getProto().equals(this.getClass().cast(other).getProto());
}
return false;
}
@Override
public String toString() {
return getProto().toString().replaceAll("\\n", ", ").replaceAll("\\s+", " ");
}
private void mergeLocalToProto() { private void mergeLocalToProto() {
if (viaProto) if (viaProto)
maybeInitBuilder(); maybeInitBuilder();