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
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
YARN-482. FS: Extend SchedulingMode to intermediate queues.

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
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
@ -28,7 +29,15 @@ import org.apache.hadoop.yarn.api.records.Token;
*/
@Public
@Evolving
public interface CancelDelegationTokenRequest {
Token getDelegationToken();
void setDelegationToken(Token dToken);
public abstract class CancelDelegationTokenRequest {
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 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.yarn.util.Records;
/**
* The response from the {@code ResourceManager} to a cancelDelegationToken
@ -27,5 +28,10 @@ import org.apache.hadoop.classification.InterfaceStability.Evolving;
*/
@Public
@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.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.AMRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
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
@ -45,7 +46,19 @@ import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
*
* @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
@ -55,7 +68,7 @@ public interface FinishApplicationMasterRequest {
*/
@Public
@Stable
ApplicationAttemptId getApplicationAttemptId();
public abstract ApplicationAttemptId getApplicationAttemptId();
/**
* Set the <code>ApplicationAttemptId</code> being managed by the
@ -65,7 +78,7 @@ public interface FinishApplicationMasterRequest {
*/
@Public
@Stable
void setAppAttemptId(ApplicationAttemptId applicationAttemptId);
public abstract void setAppAttemptId(ApplicationAttemptId applicationAttemptId);
/**
* Get <em>final state</em> of the <code>ApplicationMaster</code>.
@ -73,7 +86,7 @@ public interface FinishApplicationMasterRequest {
*/
@Public
@Stable
FinalApplicationStatus getFinalApplicationStatus();
public abstract FinalApplicationStatus getFinalApplicationStatus();
/**
* Set the <em>finish state</em> of the <code>ApplicationMaster</code>
@ -81,7 +94,7 @@ public interface FinishApplicationMasterRequest {
*/
@Public
@Stable
void setFinishApplicationStatus(FinalApplicationStatus finishState);
public abstract void setFinishApplicationStatus(FinalApplicationStatus finishState);
/**
* Get <em>diagnostic information</em> on application failure.
@ -89,7 +102,7 @@ public interface FinishApplicationMasterRequest {
*/
@Public
@Stable
String getDiagnostics();
public abstract String getDiagnostics();
/**
* Set <em>diagnostic information</em> on application failure.
@ -97,7 +110,7 @@ public interface FinishApplicationMasterRequest {
*/
@Public
@Stable
void setDiagnostics(String diagnostics);
public abstract void setDiagnostics(String diagnostics);
/**
* Get the <em>tracking URL</em> for the <code>ApplicationMaster</code>.
@ -105,7 +118,7 @@ public interface FinishApplicationMasterRequest {
*/
@Public
@Stable
String getTrackingUrl();
public abstract String getTrackingUrl();
/**
* Set the <em>tracking URL</em>for the <code>ApplicationMaster</code>
@ -114,6 +127,6 @@ public interface FinishApplicationMasterRequest {
*/
@Public
@Stable
void setTrackingUrl(String url);
public abstract void setTrackingUrl(String url);
}

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -32,6 +33,10 @@ import org.apache.hadoop.yarn.api.AMRMProtocol;
*/
@Public
@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 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -32,5 +33,10 @@ import org.apache.hadoop.yarn.api.ClientRMProtocol;
*/
@Public
@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.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
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
@ -40,16 +41,25 @@ import org.apache.hadoop.yarn.api.records.ApplicationReport;
*/
@Public
@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.
* @return <code>ApplicationReport</code> for all applications
*/
@Public
@Stable
List<ApplicationReport> getApplicationList();
public abstract List<ApplicationReport> getApplicationList();
@Private
@Unstable
void setApplicationList(List<ApplicationReport> applications);
public abstract void setApplicationList(List<ApplicationReport> applications);
}

View File

@ -23,6 +23,7 @@ import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationId;
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
@ -36,16 +37,25 @@ import org.apache.hadoop.yarn.api.records.ApplicationReport;
*/
@Public
@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.
* @return <code>ApplicationId</code> of the application
*/
public ApplicationId getApplicationId();
public abstract ApplicationId getApplicationId();
/**
* Set the <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.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
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
@ -37,16 +38,25 @@ import org.apache.hadoop.yarn.api.records.ApplicationReport;
*/
@Public
@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.
* @return <code>ApplicationReport</code> for the application
*/
@Public
@Stable
public ApplicationReport getApplicationReport();
public abstract ApplicationReport getApplicationReport();
@Private
@Unstable
public void setApplicationReport(ApplicationReport ApplicationReport);
public abstract void setApplicationReport(ApplicationReport ApplicationReport);
}

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -32,6 +33,10 @@ import org.apache.hadoop.yarn.api.ClientRMProtocol;
*/
@Public
@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.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
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
@ -34,16 +35,25 @@ import org.apache.hadoop.yarn.api.records.YarnClusterMetrics;
*/
@Public
@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.
* @return <code>YarnClusterMetrics</code> for the cluster
*/
@Public
@Stable
public YarnClusterMetrics getClusterMetrics();
public abstract YarnClusterMetrics getClusterMetrics();
@Private
@Unstable
public void setClusterMetrics(YarnClusterMetrics metrics);
public abstract void setClusterMetrics(YarnClusterMetrics metrics);
}

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -32,6 +33,10 @@ import org.apache.hadoop.yarn.api.ClientRMProtocol;
*/
@Public
@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.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
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
@ -40,16 +41,25 @@ import org.apache.hadoop.yarn.api.records.NodeReport;
*/
@Public
@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.
* @return <code>NodeReport</code> for all nodes in the cluster
*/
@Public
@Stable
List<NodeReport> getNodeReports();
public abstract List<NodeReport> getNodeReports();
@Private
@Unstable
void setNodeReports(List<NodeReport> nodeReports);
public abstract void setNodeReports(List<NodeReport> nodeReports);
}

View File

@ -23,6 +23,7 @@ import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ContainerManager;
import org.apache.hadoop.yarn.api.records.ContainerId;
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
@ -32,7 +33,15 @@ import org.apache.hadoop.yarn.api.records.ContainerStatus;
*/
@Public
@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
* <code>ContainerStatus</code>.

View File

@ -24,6 +24,7 @@ import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ContainerManager;
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
@ -34,7 +35,16 @@ import org.apache.hadoop.yarn.api.records.ContainerStatus;
*/
@Public
@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.
* @return <code>ContainerStatus</code> of the container

View File

@ -20,6 +20,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
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
@ -28,7 +29,15 @@ import org.apache.hadoop.classification.InterfaceStability.Evolving;
*/
@Public
@Evolving
public interface GetDelegationTokenRequest {
String getRenewer();
void setRenewer(String renewer);
public abstract class GetDelegationTokenRequest {
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.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier;
import org.apache.hadoop.yarn.api.records.Token;
import org.apache.hadoop.yarn.util.Records;
/**
@ -32,13 +33,20 @@ import org.apache.hadoop.yarn.api.records.Token;
*/
@Public
@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
* {@link AbstractDelegationTokenIdentifier}.
*
*/
Token getRMDelegationToken();
void setRMDelegationToken(Token rmDTToken);
public abstract Token getRMDelegationToken();
public abstract void setRMDelegationToken(Token rmDTToken);
}

View File

@ -22,6 +22,7 @@ import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
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
@ -33,6 +34,10 @@ import org.apache.hadoop.yarn.api.records.ApplicationId;
*/
@Public
@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.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationId;
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
@ -34,7 +35,19 @@ import org.apache.hadoop.yarn.api.records.Resource;
*/
@Public
@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
* <code>ResourceManager</code>.
@ -56,11 +69,11 @@ public interface GetNewApplicationResponse {
*/
@Public
@Stable
public Resource getMinimumResourceCapability();
public abstract Resource getMinimumResourceCapability();
@Private
@Unstable
public void setMinimumResourceCapability(Resource capability);
public abstract void setMinimumResourceCapability(Resource capability);
/**
* Get the maximum capability for any {@link Resource} allocated by the
@ -69,9 +82,9 @@ public interface GetNewApplicationResponse {
*/
@Public
@Stable
public Resource getMaximumResourceCapability();
public abstract Resource getMaximumResourceCapability();
@Private
@Unstable
public void setMaximumResourceCapability(Resource capability);
public abstract void setMaximumResourceCapability(Resource capability);
}

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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>
@ -30,58 +31,70 @@ import org.apache.hadoop.yarn.api.ClientRMProtocol;
*/
@Public
@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.
* @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
* @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?
* @return <code>true</code> if applications' information is to be included,
* else <code>false</code>
*/
boolean getIncludeApplications();
public abstract boolean getIncludeApplications();
/**
* Should we get fetch information about <em>active applications</em>?
* @param includeApplications fetch information about <em>active
* applications</em>?
*/
void setIncludeApplications(boolean includeApplications);
public abstract void setIncludeApplications(boolean includeApplications);
/**
* Is information about <em>child queues</em> required?
* @return <code>true</code> if information about child queues is required,
* else <code>false</code>
*/
boolean getIncludeChildQueues();
public abstract boolean getIncludeChildQueues();
/**
* Should we 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?
* @return <code>true</code> if information about entire hierarchy is
* required, <code>false</code> otherwise
*/
boolean getRecursive();
public abstract boolean getRecursive();
/**
* Should we fetch information on the entire <em>child queue hierarchy</em>?
* @param recursive fetch information on the entire <em>child queue
* hierarchy</em>?
*/
void setRecursive(boolean recursive);
public abstract void setRecursive(boolean recursive);
}

View File

@ -24,6 +24,7 @@ import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
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
@ -38,14 +39,21 @@ import org.apache.hadoop.yarn.api.records.QueueInfo;
*/
@Public
@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.
* @return <code>QueueInfo</code> for the specified queue
*/
QueueInfo getQueueInfo();
public abstract QueueInfo getQueueInfo();
@Private
@Unstable
void setQueueInfo(QueueInfo queueInfo);
public abstract void setQueueInfo(QueueInfo queueInfo);
}

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -32,6 +33,10 @@ import org.apache.hadoop.yarn.api.ClientRMProtocol;
*/
@Public
@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.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.QueueACL;
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
@ -41,7 +42,15 @@ import org.apache.hadoop.yarn.api.records.QueueUserACLInfo;
*/
@Public
@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.
@ -49,10 +58,11 @@ public interface GetQueueUserAclsInfoResponse {
*/
@Public
@Stable
public List<QueueUserACLInfo> getUserAclsInfoList();
public abstract List<QueueUserACLInfo> getUserAclsInfoList();
@Private
@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.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.ClientRMProtocol;
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>
@ -36,7 +37,15 @@ import org.apache.hadoop.yarn.api.records.ApplicationId;
*/
@Public
@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.
* @return <code>ApplicationId</code> of the application to be aborted

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -32,6 +33,10 @@ import org.apache.hadoop.yarn.api.ClientRMProtocol;
*/
@Public
@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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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.Stable;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.AMRMProtocol;
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
@ -45,7 +46,19 @@ import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
*/
@Public
@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
@ -55,7 +68,7 @@ public interface RegisterApplicationMasterRequest {
*/
@Public
@Stable
ApplicationAttemptId getApplicationAttemptId();
public abstract ApplicationAttemptId getApplicationAttemptId();
/**
* Set the <code>ApplicationAttemptId</code> being managed by the
@ -65,7 +78,7 @@ public interface RegisterApplicationMasterRequest {
*/
@Public
@Stable
void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId);
public abstract void setApplicationAttemptId(ApplicationAttemptId applicationAttemptId);
/**
* Get the <em>host</em> on which the <code>ApplicationMaster</code> is
@ -74,7 +87,7 @@ public interface RegisterApplicationMasterRequest {
*/
@Public
@Stable
String getHost();
public abstract String getHost();
/**
* Set the <em>host</em> on which the <code>ApplicationMaster</code> is
@ -84,7 +97,7 @@ public interface RegisterApplicationMasterRequest {
*/
@Private
@Unstable
void setHost(String host);
public abstract void setHost(String host);
/**
* Get the <em>RPC port</em> on which the <code>ApplicationMaster</code>
@ -94,7 +107,7 @@ public interface RegisterApplicationMasterRequest {
*/
@Public
@Stable
int getRpcPort();
public abstract int getRpcPort();
/**
* Set the <em>RPC port<em> on which the <code>ApplicationMaster</code> is
@ -104,7 +117,7 @@ public interface RegisterApplicationMasterRequest {
*/
@Public
@Stable
void setRpcPort(int port);
public abstract void setRpcPort(int port);
/**
* Get the <em>tracking URL</em> for the <code>ApplicationMaster</code>.
@ -112,7 +125,7 @@ public interface RegisterApplicationMasterRequest {
*/
@Public
@Stable
String getTrackingUrl();
public abstract String getTrackingUrl();
/**
* Set the <em>tracking URL</em> for the <code>ApplicationMaster</code>.
@ -121,5 +134,5 @@ public interface RegisterApplicationMasterRequest {
*/
@Public
@Stable
void setTrackingUrl(String trackingUrl);
public abstract void setTrackingUrl(String trackingUrl);
}

View File

@ -27,6 +27,7 @@ import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.AMRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
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
@ -43,8 +44,19 @@ import org.apache.hadoop.yarn.api.records.Resource;
*/
@Public
@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
* <code>ResourceManager</code> in the cluster.
@ -52,11 +64,11 @@ public interface RegisterApplicationMasterResponse {
*/
@Public
@Stable
public Resource getMinimumResourceCapability();
public abstract Resource getMinimumResourceCapability();
@Private
@Unstable
public void setMinimumResourceCapability(Resource capability);
public abstract void setMinimumResourceCapability(Resource capability);
/**
* Get the maximum capability for any {@link Resource} allocated by the
@ -65,11 +77,11 @@ public interface RegisterApplicationMasterResponse {
*/
@Public
@Stable
public Resource getMaximumResourceCapability();
public abstract Resource getMaximumResourceCapability();
@Private
@Unstable
public void setMaximumResourceCapability(Resource capability);
public abstract void setMaximumResourceCapability(Resource capability);
/**
* Get the <code>ApplicationACL</code>s for the application.
@ -77,7 +89,7 @@ public interface RegisterApplicationMasterResponse {
*/
@Public
@Stable
public Map<ApplicationAccessType, String> getApplicationACLs();
public abstract Map<ApplicationAccessType, String> getApplicationACLs();
/**
* Set the <code>ApplicationACL</code>s for the application.
@ -85,5 +97,5 @@ public interface RegisterApplicationMasterResponse {
*/
@Private
@Unstable
public void setApplicationACLs(Map<ApplicationAccessType, String> acls);
public abstract void setApplicationACLs(Map<ApplicationAccessType, String> acls);
}

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
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
@ -28,7 +29,16 @@ import org.apache.hadoop.yarn.api.records.Token;
*/
@Public
@Evolving
public interface RenewDelegationTokenRequest {
Token getDelegationToken();
void setDelegationToken(Token dToken);
public abstract class RenewDelegationTokenRequest {
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 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.yarn.util.Records;
/**
* The response to a renewDelegationToken call to the {@code ResourceManager}.
*/
@Public
@Evolving
public interface RenewDelegationTokenResponse {
long getNextExpirationTime();
void setNextExpirationTime(long expTime);
public abstract class RenewDelegationTokenResponse {
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.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ContainerManager;
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
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
@ -38,7 +39,17 @@ import org.apache.hadoop.yarn.api.records.Token;
*/
@Public
@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
* by the <code>NodeManager</code>.
@ -62,9 +73,9 @@ public interface StartContainerRequest {
@Public
@Stable
public Token getContainerToken();
public abstract Token getContainerToken();
@Public
@Stable
public void setContainerToken(Token container);
public abstract void setContainerToken(Token container);
}

View File

@ -24,6 +24,7 @@ import java.util.Map;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -34,7 +35,16 @@ import org.apache.hadoop.yarn.api.ContainerManager;
*/
@Public
@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
* <code>NodeManager</code>.</p>
@ -42,7 +52,7 @@ public interface StartContainerResponse {
* and their corresponding opaque blob <code>ByteBuffer</code>s</p>
* @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
@ -51,5 +61,5 @@ public interface StartContainerResponse {
* @param serviceResponses A map from auxiliary service names to the opaque
* 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.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
import org.apache.hadoop.yarn.api.ContainerManager;
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
@ -31,14 +32,22 @@ import org.apache.hadoop.yarn.api.records.ContainerId;
*/
@Public
@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.
* @return <code>ContainerId</code> of container to be stopped
*/
@Public
@Stable
ContainerId getContainerId();
public abstract ContainerId getContainerId();
/**
* Set the <code>ContainerId</code> of the container to be stopped.
@ -46,5 +55,5 @@ public interface StopContainerRequest {
*/
@Public
@Stable
void setContainerId(ContainerId containerId);
public abstract void setContainerId(ContainerId containerId);
}

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -33,6 +34,10 @@ import org.apache.hadoop.yarn.api.ContainerManager;
*/
@Public
@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.ClientRMProtocol;
import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
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
@ -39,7 +40,16 @@ import org.apache.hadoop.yarn.api.records.Resource;
*/
@Public
@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.
* @return <code>ApplicationSubmissionContext</code> for the application

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.api.protocolrecords;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Stable;
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
@ -32,6 +33,10 @@ import org.apache.hadoop.yarn.api.ClientRMProtocol;
*/
@Public
@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.CancelDelegationTokenRequ
import org.apache.hadoop.security.proto.SecurityProtos.CancelDelegationTokenRequestProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
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.impl.pb.TokenPBImpl;
public class CancelDelegationTokenRequestPBImpl extends
ProtoBase<CancelDelegationTokenRequestProto> implements
CancelDelegationTokenRequest {
CancelDelegationTokenRequestProto proto = CancelDelegationTokenRequestProto
@ -64,7 +62,6 @@ public class CancelDelegationTokenRequestPBImpl extends
this.token = token;
}
@Override
public CancelDelegationTokenRequestProto getProto() {
mergeLocalToProto();
proto = viaProto ? proto : builder.build();
@ -72,6 +69,26 @@ public class CancelDelegationTokenRequestPBImpl extends
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() {
if (token != null) {
builder.setToken(convertToProtoFormat(this.token));

View File

@ -19,11 +19,8 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.security.proto.SecurityProtos.CancelDelegationTokenResponseProto;
import org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
public class CancelDelegationTokenResponsePBImpl extends
ProtoBase<CancelDelegationTokenResponseProto> implements
CancelDelegationTokenResponse {
public class CancelDelegationTokenResponsePBImpl extends CancelDelegationTokenResponse {
CancelDelegationTokenResponseProto proto = CancelDelegationTokenResponseProto
.getDefaultInstance();
@ -36,9 +33,27 @@ public class CancelDelegationTokenResponsePBImpl extends
this.proto = proto;
}
@Override
public CancelDelegationTokenResponseProto getProto() {
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 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
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.proto.YarnProtos.ApplicationAttemptIdProto;
import org.apache.hadoop.yarn.proto.YarnProtos.FinalApplicationStatusProto;
@ -31,7 +30,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.FinishApplicationMasterReq
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.Builder builder = null;
boolean viaProto = false;
@ -55,6 +54,26 @@ public class FinishApplicationMasterRequestPBImpl extends ProtoBase<FinishApplic
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() {
if (this.appAttemptId != null) {
builder.setApplicationAttemptId(convertToProtoFormat(this.appAttemptId));

View File

@ -20,12 +20,11 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
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.Builder builder = null;
boolean viaProto = false;
@ -45,6 +44,26 @@ public class FinishApplicationMasterResponsePBImpl extends ProtoBase<FinishAppli
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() {
if (viaProto || builder == null) {
builder = FinishApplicationMasterResponseProto.newBuilder(proto);

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsRequestProto;
public class GetAllApplicationsRequestPBImpl extends
ProtoBase<GetAllApplicationsRequestProto> implements GetAllApplicationsRequest {
public class GetAllApplicationsRequestPBImpl extends GetAllApplicationsRequest {
GetAllApplicationsRequestProto proto = GetAllApplicationsRequestProto.getDefaultInstance();
GetAllApplicationsRequestProto.Builder builder = null;
boolean viaProto = false;
@ -37,11 +35,29 @@ public class GetAllApplicationsRequestPBImpl extends
viaProto = true;
}
@Override
public GetAllApplicationsRequestProto getProto() {
proto = viaProto ? proto : builder.build();
viaProto = true;
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 java.util.List;
import org.apache.hadoop.yarn.api.protocolrecords.GetAllApplicationsResponse;
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.proto.YarnProtos.ApplicationReportProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetAllApplicationsResponseProtoOrBuilder;
public class GetAllApplicationsResponsePBImpl
extends ProtoBase<GetAllApplicationsResponseProto> implements
GetAllApplicationsResponse {
extends GetAllApplicationsResponse {
GetAllApplicationsResponseProto proto =
GetAllApplicationsResponseProto.getDefaultInstance();
@ -64,7 +62,6 @@ GetAllApplicationsResponse {
this.applicationList = applications;
}
@Override
public GetAllApplicationsResponseProto getProto() {
mergeLocalToProto();
proto = viaProto ? proto : builder.build();
@ -72,6 +69,26 @@ GetAllApplicationsResponse {
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() {
if (this.applicationList != null) {
addLocalApplicationsToProto();

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest;
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.proto.YarnProtos.ApplicationIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportRequestProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportReques
public class GetApplicationReportRequestPBImpl extends ProtoBase<GetApplicationReportRequestProto> implements GetApplicationReportRequest {
public class GetApplicationReportRequestPBImpl extends GetApplicationReportRequest {
GetApplicationReportRequestProto proto = GetApplicationReportRequestProto.getDefaultInstance();
GetApplicationReportRequestProto.Builder builder = null;
boolean viaProto = false;
@ -53,6 +52,26 @@ public class GetApplicationReportRequestPBImpl extends ProtoBase<GetApplicationR
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() {
if (applicationId != null) {
builder.setApplicationId(convertToProtoFormat(this.applicationId));

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportResponse;
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.proto.YarnProtos.ApplicationReportProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportResponseProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetApplicationReportRespon
public class GetApplicationReportResponsePBImpl extends ProtoBase<GetApplicationReportResponseProto> implements GetApplicationReportResponse {
public class GetApplicationReportResponsePBImpl extends GetApplicationReportResponse {
GetApplicationReportResponseProto proto = GetApplicationReportResponseProto.getDefaultInstance();
GetApplicationReportResponseProto.Builder builder = null;
boolean viaProto = false;
@ -53,6 +52,26 @@ public class GetApplicationReportResponsePBImpl extends ProtoBase<GetApplication
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() {
if (this.applicationReport != null) {
builder.setApplicationReport(convertToProtoFormat(this.applicationReport));

View File

@ -20,12 +20,11 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
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.Builder builder = null;
boolean viaProto = false;
@ -45,15 +44,23 @@ public class GetClusterMetricsRequestPBImpl extends ProtoBase<GetClusterMetricsR
return proto;
}
private void maybeInitBuilder() {
if (viaProto || builder == null) {
builder = GetClusterMetricsRequestProto.newBuilder(proto);
}
viaProto = false;
@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

@ -20,7 +20,6 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
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.impl.pb.YarnClusterMetricsPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.YarnClusterMetricsProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterMetricsResponseP
public class GetClusterMetricsResponsePBImpl extends ProtoBase<GetClusterMetricsResponseProto> implements GetClusterMetricsResponse {
public class GetClusterMetricsResponsePBImpl extends GetClusterMetricsResponse {
GetClusterMetricsResponseProto proto = GetClusterMetricsResponseProto.getDefaultInstance();
GetClusterMetricsResponseProto.Builder builder = null;
boolean viaProto = false;
@ -53,6 +52,26 @@ public class GetClusterMetricsResponsePBImpl extends ProtoBase<GetClusterMetrics
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() {
if (this.yarnClusterMetrics != null) {
builder.setClusterMetrics(convertToProtoFormat(this.yarnClusterMetrics));

View File

@ -19,11 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesRequestProto;
public class GetClusterNodesRequestPBImpl extends
ProtoBase<GetClusterNodesRequestProto> implements GetClusterNodesRequest {
public class GetClusterNodesRequestPBImpl extends GetClusterNodesRequest {
GetClusterNodesRequestProto proto = GetClusterNodesRequestProto.getDefaultInstance();
GetClusterNodesRequestProto.Builder builder = null;
@ -38,11 +36,29 @@ public class GetClusterNodesRequestPBImpl extends
viaProto = true;
}
@Override
public GetClusterNodesRequestProto getProto() {
proto = viaProto ? proto : builder.build();
viaProto = true;
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 java.util.List;
import org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesResponse;
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.proto.YarnProtos.NodeReportProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetClusterNodesResponseProtoOrBuilder;
public class GetClusterNodesResponsePBImpl extends
ProtoBase<GetClusterNodesResponseProto> implements GetClusterNodesResponse {
public class GetClusterNodesResponsePBImpl extends GetClusterNodesResponse {
GetClusterNodesResponseProto proto =
GetClusterNodesResponseProto.getDefaultInstance();
@ -63,7 +61,6 @@ public class GetClusterNodesResponsePBImpl extends
this.nodeManagerInfoList = nodeManagers;
}
@Override
public GetClusterNodesResponseProto getProto() {
mergeLocalToProto();
proto = viaProto ? proto : builder.build();
@ -71,6 +68,26 @@ public class GetClusterNodesResponsePBImpl extends
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() {
if (this.nodeManagerInfoList != null) {
addLocalNodeManagerInfosToProto();

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusRequest;
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.proto.YarnProtos.ContainerIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusRequestProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusRequestP
public class GetContainerStatusRequestPBImpl extends ProtoBase<GetContainerStatusRequestProto> implements GetContainerStatusRequest {
public class GetContainerStatusRequestPBImpl extends GetContainerStatusRequest {
GetContainerStatusRequestProto proto = GetContainerStatusRequestProto.getDefaultInstance();
GetContainerStatusRequestProto.Builder builder = null;
boolean viaProto = false;
@ -53,6 +52,26 @@ public class GetContainerStatusRequestPBImpl extends ProtoBase<GetContainerStatu
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() {
if (this.containerId != null) {
builder.setContainerId(convertToProtoFormat(this.containerId));

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetContainerStatusResponse;
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.proto.YarnProtos.ContainerStatusProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusResponseProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetContainerStatusResponse
public class GetContainerStatusResponsePBImpl extends ProtoBase<GetContainerStatusResponseProto> implements GetContainerStatusResponse {
public class GetContainerStatusResponsePBImpl extends GetContainerStatusResponse {
GetContainerStatusResponseProto proto = GetContainerStatusResponseProto.getDefaultInstance();
GetContainerStatusResponseProto.Builder builder = null;
boolean viaProto = false;
@ -53,6 +52,26 @@ public class GetContainerStatusResponsePBImpl extends ProtoBase<GetContainerStat
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() {
if (this.containerStatus != null) {
builder.setStatus(convertToProtoFormat(this.containerStatus));

View File

@ -20,10 +20,8 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRequestProto;
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRequestProtoOrBuilder;
import org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
public class GetDelegationTokenRequestPBImpl extends
ProtoBase<GetDelegationTokenRequestProto> implements GetDelegationTokenRequest {
public class GetDelegationTokenRequestPBImpl extends GetDelegationTokenRequest {
String renewer;
@ -60,7 +58,6 @@ public class GetDelegationTokenRequestPBImpl extends
this.renewer = renewer;
}
@Override
public GetDelegationTokenRequestProto getProto() {
mergeLocalToProto();
proto = viaProto ? proto : builder.build();
@ -68,6 +65,25 @@ public class GetDelegationTokenRequestPBImpl extends
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() {
if (renewer != null) {

View File

@ -22,12 +22,10 @@ import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenRespons
import org.apache.hadoop.security.proto.SecurityProtos.GetDelegationTokenResponseProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
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.impl.pb.TokenPBImpl;
public class GetDelegationTokenResponsePBImpl extends
ProtoBase<GetDelegationTokenResponseProto> implements GetDelegationTokenResponse {
public class GetDelegationTokenResponsePBImpl extends GetDelegationTokenResponse {
Token appToken;
@ -68,7 +66,6 @@ ProtoBase<GetDelegationTokenResponseProto> implements GetDelegationTokenResponse
this.appToken = appToken;
}
@Override
public GetDelegationTokenResponseProto getProto() {
mergeLocalToProto();
proto = viaProto ? proto : builder.build();
@ -76,6 +73,25 @@ ProtoBase<GetDelegationTokenResponseProto> implements GetDelegationTokenResponse
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() {
if (appToken != null) {

View File

@ -20,11 +20,10 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
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.Builder builder = null;
boolean viaProto = false;
@ -44,15 +43,23 @@ public class GetNewApplicationRequestPBImpl extends ProtoBase<GetNewApplicationR
return proto;
}
private void maybeInitBuilder() {
if (viaProto || builder == null) {
builder = GetNewApplicationRequestProto.newBuilder(proto);
}
viaProto = false;
@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 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationResponse;
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.impl.pb.ApplicationIdPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl;
@ -30,7 +29,7 @@ import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetNewApplicationResponseProto;
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.Builder builder = null;
boolean viaProto = false;
@ -55,6 +54,26 @@ public class GetNewApplicationResponsePBImpl extends ProtoBase<GetNewApplication
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() {
if (applicationId != null) {
builder.setApplicationId(convertToProtoFormat(this.applicationId));

View File

@ -19,12 +19,10 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
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.GetQueueInfoRequestProtoOrBuilder;
public class GetQueueInfoRequestPBImpl extends
ProtoBase<GetQueueInfoRequestProto> implements GetQueueInfoRequest {
public class GetQueueInfoRequestPBImpl extends GetQueueInfoRequest {
GetQueueInfoRequestProto proto =
GetQueueInfoRequestProto.getDefaultInstance();
@ -99,11 +97,29 @@ public class GetQueueInfoRequestPBImpl extends
viaProto = false;
}
@Override
public GetQueueInfoRequestProto getProto() {
proto = viaProto ? proto : builder.build();
viaProto = true;
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;
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.impl.pb.QueueInfoPBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.QueueInfoProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueInfoResponseProtoOrBuilder;
public class GetQueueInfoResponsePBImpl extends ProtoBase<GetQueueInfoResponseProto>
implements GetQueueInfoResponse {
public class GetQueueInfoResponsePBImpl extends GetQueueInfoResponse {
QueueInfo queueInfo;
@ -45,7 +43,6 @@ implements GetQueueInfoResponse {
viaProto = true;
}
@Override
public GetQueueInfoResponseProto getProto() {
mergeLocalToProto();
proto = viaProto ? proto : builder.build();
@ -53,6 +50,26 @@ implements GetQueueInfoResponse {
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
public QueueInfo getQueueInfo() {
if (this.queueInfo != null) {

View File

@ -19,12 +19,9 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoRequestProto;
public class GetQueueUserAclsInfoRequestPBImpl extends
ProtoBase<GetQueueUserAclsInfoRequestProto> implements
GetQueueUserAclsInfoRequest {
public class GetQueueUserAclsInfoRequestPBImpl extends GetQueueUserAclsInfoRequest {
GetQueueUserAclsInfoRequestProto proto =
GetQueueUserAclsInfoRequestProto.getDefaultInstance();
@ -40,11 +37,29 @@ public class GetQueueUserAclsInfoRequestPBImpl extends
viaProto = true;
}
@Override
public GetQueueUserAclsInfoRequestProto getProto() {
proto = viaProto ? proto : builder.build();
viaProto = true;
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 java.util.List;
import org.apache.hadoop.yarn.api.protocolrecords.GetQueueUserAclsInfoResponse;
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.proto.YarnProtos.QueueUserACLInfoProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoResponseProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.GetQueueUserAclsInfoResponseProtoOrBuilder;
public class GetQueueUserAclsInfoResponsePBImpl extends
ProtoBase<GetQueueUserAclsInfoResponseProto>
implements GetQueueUserAclsInfoResponse {
public class GetQueueUserAclsInfoResponsePBImpl extends GetQueueUserAclsInfoResponse {
List<QueueUserACLInfo> queueUserAclsInfoList;
@ -65,7 +62,6 @@ implements GetQueueUserAclsInfoResponse {
this.queueUserAclsInfoList = queueUserAclsList;
}
@Override
public GetQueueUserAclsInfoResponseProto getProto() {
mergeLocalToProto();
proto = viaProto ? proto : builder.build();
@ -73,6 +69,26 @@ implements GetQueueUserAclsInfoResponse {
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() {
if (this.queueUserAclsInfoList != null) {
addLocalQueueUserACLInfosToProto();

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.KillApplicationRequest;
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.proto.YarnProtos.ApplicationIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.KillApplicationRequestProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.KillApplicationRequestProt
public class KillApplicationRequestPBImpl extends ProtoBase<KillApplicationRequestProto> implements KillApplicationRequest {
public class KillApplicationRequestPBImpl extends KillApplicationRequest {
KillApplicationRequestProto proto = KillApplicationRequestProto.getDefaultInstance();
KillApplicationRequestProto.Builder builder = null;
boolean viaProto = false;
@ -53,6 +52,26 @@ public class KillApplicationRequestPBImpl extends ProtoBase<KillApplicationReque
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() {
if (this.applicationId != null) {
builder.setApplicationId(convertToProtoFormat(this.applicationId));

View File

@ -20,12 +20,11 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
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.Builder builder = null;
boolean viaProto = false;
@ -45,15 +44,30 @@ public class KillApplicationResponsePBImpl extends ProtoBase<KillApplicationResp
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() {
if (viaProto || builder == null) {
builder = KillApplicationResponseProto.newBuilder(proto);
}
viaProto = false;
}
}

View File

@ -19,12 +19,10 @@
package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshAdminAclsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshAdminAclsRequestProto;
public class RefreshAdminAclsRequestPBImpl
extends ProtoBase<RefreshAdminAclsRequestProto>
implements RefreshAdminAclsRequest {
extends RefreshAdminAclsRequest {
RefreshAdminAclsRequestProto proto = RefreshAdminAclsRequestProto.getDefaultInstance();
RefreshAdminAclsRequestProto.Builder builder = null;
@ -44,4 +42,24 @@ implements RefreshAdminAclsRequest {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshAdminAclsResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshAdminAclsResponseProto;
public class RefreshAdminAclsResponsePBImpl extends ProtoBase<RefreshAdminAclsResponseProto>
implements RefreshAdminAclsResponse {
public class RefreshAdminAclsResponsePBImpl extends RefreshAdminAclsResponse {
RefreshAdminAclsResponseProto proto = RefreshAdminAclsResponseProto.getDefaultInstance();
RefreshAdminAclsResponseProto.Builder builder = null;
@ -43,4 +41,24 @@ implements RefreshAdminAclsResponse {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshNodesRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshNodesRequestProto;
public class RefreshNodesRequestPBImpl extends ProtoBase<RefreshNodesRequestProto>
implements RefreshNodesRequest {
public class RefreshNodesRequestPBImpl extends RefreshNodesRequest {
RefreshNodesRequestProto proto = RefreshNodesRequestProto.getDefaultInstance();
RefreshNodesRequestProto.Builder builder = null;
@ -43,4 +41,24 @@ implements RefreshNodesRequest {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshNodesResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshNodesResponseProto;
public class RefreshNodesResponsePBImpl extends ProtoBase<RefreshNodesResponseProto>
implements RefreshNodesResponse {
public class RefreshNodesResponsePBImpl extends RefreshNodesResponse {
RefreshNodesResponseProto proto = RefreshNodesResponseProto.getDefaultInstance();
RefreshNodesResponseProto.Builder builder = null;
@ -43,4 +41,24 @@ implements RefreshNodesResponse {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshQueuesRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshQueuesRequestProto;
public class RefreshQueuesRequestPBImpl extends ProtoBase<RefreshQueuesRequestProto>
implements RefreshQueuesRequest {
public class RefreshQueuesRequestPBImpl extends RefreshQueuesRequest {
RefreshQueuesRequestProto proto = RefreshQueuesRequestProto.getDefaultInstance();
RefreshQueuesRequestProto.Builder builder = null;
@ -43,4 +41,24 @@ implements RefreshQueuesRequest {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshQueuesResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshQueuesResponseProto;
public class RefreshQueuesResponsePBImpl extends ProtoBase<RefreshQueuesResponseProto>
implements RefreshQueuesResponse {
public class RefreshQueuesResponsePBImpl extends RefreshQueuesResponse {
RefreshQueuesResponseProto proto = RefreshQueuesResponseProto.getDefaultInstance();
RefreshQueuesResponseProto.Builder builder = null;
@ -43,4 +41,24 @@ implements RefreshQueuesResponse {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshServiceAclsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshServiceAclsRequestProto;
public class RefreshServiceAclsRequestPBImpl
extends ProtoBase<RefreshServiceAclsRequestProto>
implements RefreshServiceAclsRequest {
public class RefreshServiceAclsRequestPBImpl extends RefreshServiceAclsRequest {
RefreshServiceAclsRequestProto proto =
RefreshServiceAclsRequestProto.getDefaultInstance();
@ -46,4 +43,24 @@ implements RefreshServiceAclsRequest {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshServiceAclsResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshServiceAclsResponseProto;
public class RefreshServiceAclsResponsePBImpl
extends ProtoBase<RefreshServiceAclsResponseProto>
implements RefreshServiceAclsResponse {
public class RefreshServiceAclsResponsePBImpl extends
RefreshServiceAclsResponse {
RefreshServiceAclsResponseProto proto =
RefreshServiceAclsResponseProto.getDefaultInstance();
@ -46,4 +44,24 @@ implements RefreshServiceAclsResponse {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshSuperUserGroupsConfigurationRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshSuperUserGroupsConfigurationRequestProto;
public class RefreshSuperUserGroupsConfigurationRequestPBImpl
extends ProtoBase<RefreshSuperUserGroupsConfigurationRequestProto>
implements RefreshSuperUserGroupsConfigurationRequest {
extends RefreshSuperUserGroupsConfigurationRequest {
RefreshSuperUserGroupsConfigurationRequestProto proto = RefreshSuperUserGroupsConfigurationRequestProto.getDefaultInstance();
RefreshSuperUserGroupsConfigurationRequestProto.Builder builder = null;
@ -44,4 +42,24 @@ implements RefreshSuperUserGroupsConfigurationRequest {
viaProto = true;
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.protocolrecords.RefreshSuperUserGroupsConfigur
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshSuperUserGroupsConfigurationResponseProto;
public class RefreshSuperUserGroupsConfigurationResponsePBImpl extends ProtoBase<RefreshSuperUserGroupsConfigurationResponseProto>
implements RefreshSuperUserGroupsConfigurationResponse {
public class RefreshSuperUserGroupsConfigurationResponsePBImpl extends RefreshSuperUserGroupsConfigurationResponse {
RefreshSuperUserGroupsConfigurationResponseProto proto = RefreshSuperUserGroupsConfigurationResponseProto.getDefaultInstance();
RefreshSuperUserGroupsConfigurationResponseProto.Builder builder = null;
@ -43,4 +42,24 @@ implements RefreshSuperUserGroupsConfigurationResponse {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshUserToGroupsMappingsRequest;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshUserToGroupsMappingsRequestProto;
public class RefreshUserToGroupsMappingsRequestPBImpl
extends ProtoBase<RefreshUserToGroupsMappingsRequestProto>
implements RefreshUserToGroupsMappingsRequest {
extends RefreshUserToGroupsMappingsRequest {
RefreshUserToGroupsMappingsRequestProto proto = RefreshUserToGroupsMappingsRequestProto.getDefaultInstance();
RefreshUserToGroupsMappingsRequestProto.Builder builder = null;
@ -44,4 +42,24 @@ implements RefreshUserToGroupsMappingsRequest {
viaProto = true;
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;
import org.apache.hadoop.yarn.api.protocolrecords.RefreshUserToGroupsMappingsResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.RefreshUserToGroupsMappingsResponseProto;
public class RefreshUserToGroupsMappingsResponsePBImpl extends ProtoBase<RefreshUserToGroupsMappingsResponseProto>
implements RefreshUserToGroupsMappingsResponse {
public class RefreshUserToGroupsMappingsResponsePBImpl extends RefreshUserToGroupsMappingsResponse {
RefreshUserToGroupsMappingsResponseProto proto = RefreshUserToGroupsMappingsResponseProto.getDefaultInstance();
RefreshUserToGroupsMappingsResponseProto.Builder builder = null;
@ -43,4 +41,24 @@ implements RefreshUserToGroupsMappingsResponse {
viaProto = true;
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 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest;
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.proto.YarnProtos.ApplicationAttemptIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterRequestProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterR
public class RegisterApplicationMasterRequestPBImpl extends ProtoBase<RegisterApplicationMasterRequestProto> implements RegisterApplicationMasterRequest {
public class RegisterApplicationMasterRequestPBImpl extends RegisterApplicationMasterRequest {
RegisterApplicationMasterRequestProto proto = RegisterApplicationMasterRequestProto.getDefaultInstance();
RegisterApplicationMasterRequestProto.Builder builder = null;
boolean viaProto = false;
@ -53,6 +52,26 @@ public class RegisterApplicationMasterRequestPBImpl extends ProtoBase<RegisterAp
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() {
if (this.applicationAttemptId != null && !((ApplicationAttemptIdPBImpl)this.applicationAttemptId).getProto().equals(builder.getApplicationAttemptId())) {
builder.setApplicationAttemptId(convertToProtoFormat(this.applicationAttemptId));

View File

@ -26,7 +26,6 @@ import java.util.Map;
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
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.impl.pb.ResourcePBImpl;
import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationACLMapProto;
@ -36,9 +35,8 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.RegisterApplicationMasterR
import org.apache.hadoop.yarn.util.ProtoUtils;
public class RegisterApplicationMasterResponsePBImpl
extends ProtoBase<RegisterApplicationMasterResponseProto>
implements RegisterApplicationMasterResponse {
public class RegisterApplicationMasterResponsePBImpl extends
RegisterApplicationMasterResponse {
RegisterApplicationMasterResponseProto proto =
RegisterApplicationMasterResponseProto.getDefaultInstance();
RegisterApplicationMasterResponseProto.Builder builder = null;
@ -64,6 +62,26 @@ implements RegisterApplicationMasterResponse {
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() {
if (viaProto)
maybeInitBuilder();

View File

@ -21,12 +21,10 @@ import org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenReque
import org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRequestProtoOrBuilder;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
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.impl.pb.TokenPBImpl;
public class RenewDelegationTokenRequestPBImpl extends
ProtoBase<RenewDelegationTokenRequestProto> implements
RenewDelegationTokenRequest {
RenewDelegationTokenRequestProto proto =
RenewDelegationTokenRequestProto.getDefaultInstance();
@ -63,7 +61,6 @@ public class RenewDelegationTokenRequestPBImpl extends
this.token = token;
}
@Override
public RenewDelegationTokenRequestProto getProto() {
mergeLocalToProto();
proto = viaProto ? proto : builder.build();
@ -71,6 +68,25 @@ public class RenewDelegationTokenRequestPBImpl extends
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() {
if (token != null) {

View File

@ -22,8 +22,7 @@ import org.apache.hadoop.security.proto.SecurityProtos.RenewDelegationTokenRespo
import org.apache.hadoop.yarn.api.protocolrecords.RenewDelegationTokenResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
public class RenewDelegationTokenResponsePBImpl extends
ProtoBase<RenewDelegationTokenResponseProto> implements
public class RenewDelegationTokenResponsePBImpl extends
RenewDelegationTokenResponse {
RenewDelegationTokenResponseProto proto =
@ -41,13 +40,32 @@ public class RenewDelegationTokenResponsePBImpl extends
this.viaProto = true;
}
@Override
public RenewDelegationTokenResponseProto getProto() {
proto = viaProto ? proto : builder.build();
viaProto = true;
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() {
if (viaProto || builder == null) {
builder = RenewDelegationTokenResponseProto.newBuilder(proto);

View File

@ -22,7 +22,6 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
import org.apache.hadoop.yarn.api.protocolrecords.StartContainerRequest;
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.impl.pb.ContainerLaunchContextPBImpl;
import org.apache.hadoop.yarn.api.records.impl.pb.TokenPBImpl;
@ -32,7 +31,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.StartContainerRequestProto
public class StartContainerRequestPBImpl extends ProtoBase<StartContainerRequestProto> implements StartContainerRequest {
public class StartContainerRequestPBImpl extends StartContainerRequest {
StartContainerRequestProto proto = StartContainerRequestProto.getDefaultInstance();
StartContainerRequestProto.Builder builder = null;
boolean viaProto = false;
@ -57,6 +56,26 @@ public class StartContainerRequestPBImpl extends ProtoBase<StartContainerRequest
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() {
if (this.containerLaunchContext != null) {
builder.setContainerLaunchContext(convertToProtoFormat(this.containerLaunchContext));

View File

@ -22,17 +22,18 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.List;
import java.util.Map;
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.StartContainerResponseProtoOrBuilder;
import org.apache.hadoop.yarn.proto.YarnProtos.StringBytesMapProto;
import org.apache.hadoop.yarn.util.ProtoUtils;
import com.google.protobuf.ByteString;
public class StartContainerResponsePBImpl extends ProtoBase<StartContainerResponseProto> implements StartContainerResponse {
public class StartContainerResponsePBImpl extends StartContainerResponse {
StartContainerResponseProto proto = StartContainerResponseProto.getDefaultInstance();
StartContainerResponseProto.Builder builder = null;
boolean viaProto = false;
@ -55,12 +56,40 @@ public class StartContainerResponsePBImpl extends ProtoBase<StartContainerRespon
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() {
if (this.serviceResponse != null) {
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() {
if (viaProto) {
maybeInitBuilder();

View File

@ -21,7 +21,6 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.StopContainerRequest;
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.proto.YarnProtos.ContainerIdProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.StopContainerRequestProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.StopContainerRequestProtoO
public class StopContainerRequestPBImpl extends ProtoBase<StopContainerRequestProto> implements StopContainerRequest {
public class StopContainerRequestPBImpl extends StopContainerRequest {
StopContainerRequestProto proto = StopContainerRequestProto.getDefaultInstance();
StopContainerRequestProto.Builder builder = null;
boolean viaProto = false;
@ -53,6 +52,26 @@ public class StopContainerRequestPBImpl extends ProtoBase<StopContainerRequestPr
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() {
if (this.containerId != null) {
builder.setContainerId(convertToProtoFormat(this.containerId));

View File

@ -20,12 +20,11 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.StopContainerResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
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.Builder builder = null;
boolean viaProto = false;
@ -44,16 +43,24 @@ public class StopContainerResponsePBImpl extends ProtoBase<StopContainerResponse
viaProto = true;
return proto;
}
private void maybeInitBuilder() {
if (viaProto || builder == null) {
builder = StopContainerResponseProto.newBuilder(proto);
}
viaProto = false;
}
@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 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest;
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.proto.YarnProtos.ApplicationSubmissionContextProto;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.SubmitApplicationRequestProto;
@ -29,7 +28,7 @@ import org.apache.hadoop.yarn.proto.YarnServiceProtos.SubmitApplicationRequestPr
public class SubmitApplicationRequestPBImpl extends ProtoBase<SubmitApplicationRequestProto> implements SubmitApplicationRequest {
public class SubmitApplicationRequestPBImpl extends SubmitApplicationRequest {
SubmitApplicationRequestProto proto = SubmitApplicationRequestProto.getDefaultInstance();
SubmitApplicationRequestProto.Builder builder = null;
boolean viaProto = false;
@ -52,6 +51,26 @@ public class SubmitApplicationRequestPBImpl extends ProtoBase<SubmitApplicationR
viaProto = true;
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() {
if (this.applicationSubmissionContext != null) {

View File

@ -20,12 +20,11 @@ package org.apache.hadoop.yarn.api.protocolrecords.impl.pb;
import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationResponse;
import org.apache.hadoop.yarn.api.records.ProtoBase;
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.Builder builder = null;
boolean viaProto = false;
@ -45,15 +44,23 @@ public class SubmitApplicationResponsePBImpl extends ProtoBase<SubmitApplication
return proto;
}
private void maybeInitBuilder() {
if (viaProto || builder == null) {
builder = SubmitApplicationResponseProto.newBuilder(proto);
}
viaProto = false;
@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,13 +22,21 @@ import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.classification.InterfaceStability.Unstable;
import org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest;
import org.apache.hadoop.yarn.util.Records;
/**
* Description of resources requested back by the cluster.
* @see PreemptionContract
* @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
@ -36,10 +44,9 @@ public interface PreemptionResourceRequest {
*/
@Public
@Evolving
public ResourceRequest getResourceRequest();
public abstract ResourceRequest getResourceRequest();
@Private
@Unstable
public void setResourceRequest(ResourceRequest req);
public abstract void setResourceRequest(ResourceRequest req);
}

View File

@ -48,6 +48,26 @@ public class PreemptionContainerPBImpl extends PreemptionContainer {
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() {
if (viaProto)
maybeInitBuilder();

View File

@ -56,6 +56,26 @@ public class PreemptionContractPBImpl extends PreemptionContract {
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() {
if (viaProto)
maybeInitBuilder();

View File

@ -50,6 +50,26 @@ public class PreemptionMessagePBImpl extends PreemptionMessage {
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() {
if (viaProto)
maybeInitBuilder();

View File

@ -23,7 +23,7 @@ import org.apache.hadoop.yarn.proto.YarnProtos.PreemptionResourceRequestProto;
import org.apache.hadoop.yarn.proto.YarnProtos.PreemptionResourceRequestProtoOrBuilder;
import org.apache.hadoop.yarn.proto.YarnProtos.ResourceRequestProto;
public class PreemptionResourceRequestPBImpl implements PreemptionResourceRequest {
public class PreemptionResourceRequestPBImpl extends PreemptionResourceRequest {
PreemptionResourceRequestProto proto =
PreemptionResourceRequestProto.getDefaultInstance();
@ -48,6 +48,26 @@ public class PreemptionResourceRequestPBImpl implements PreemptionResourceReques
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() {
if (viaProto)
maybeInitBuilder();

View File

@ -53,6 +53,26 @@ public class StrictPreemptionContractPBImpl extends StrictPreemptionContract {
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() {
if (viaProto)
maybeInitBuilder();