hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject [33/50] [abbrv] hadoop git commit: YARN-3732. Change NodeHeartbeatResponse.java and RegisterNodeManagerResponse.java as abstract classes. Contributed by Devaraj K.
Date Wed, 02 Nov 2016 17:39:12 GMT
YARN-3732. Change NodeHeartbeatResponse.java and RegisterNodeManagerResponse.java as abstract
classes. Contributed by Devaraj K.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9d0c2ad5
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9d0c2ad5
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9d0c2ad5

Branch: refs/heads/HDFS-10285
Commit: 9d0c2ad5a5e3a93c8c48f66ab9b21756d42b645a
Parents: 7d2d8d2
Author: Rohith Sharma K S <rohithsharmaks@apache.org>
Authored: Fri Oct 28 12:11:43 2016 +0530
Committer: Rohith Sharma K S <rohithsharmaks@apache.org>
Committed: Tue Nov 1 16:25:45 2016 +0530

----------------------------------------------------------------------
 .../protocolrecords/NodeHeartbeatResponse.java  | 95 ++++++++++++--------
 .../RegisterNodeManagerResponse.java            | 40 +++++----
 .../impl/pb/NodeHeartbeatResponsePBImpl.java    | 15 ++--
 .../pb/RegisterNodeManagerResponsePBImpl.java   | 15 ++--
 4 files changed, 99 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9d0c2ad5/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/NodeHeartbeatResponse.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/NodeHeartbeatResponse.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/NodeHeartbeatResponse.java
index 09cafaf..7568bbb 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/NodeHeartbeatResponse.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/NodeHeartbeatResponse.java
@@ -32,62 +32,85 @@ import org.apache.hadoop.yarn.server.api.records.ContainerQueuingLimit;
 import org.apache.hadoop.yarn.server.api.records.MasterKey;
 import org.apache.hadoop.yarn.server.api.records.NodeAction;
 
-public interface NodeHeartbeatResponse {
-  int getResponseId();
-  NodeAction getNodeAction();
+/**
+ * Node Manager's heartbeat response.
+ */
+public abstract class NodeHeartbeatResponse {
+  public abstract int getResponseId();
+
+  public abstract NodeAction getNodeAction();
 
-  List<ContainerId> getContainersToCleanup();
-  List<ContainerId> getContainersToBeRemovedFromNM();
+  public abstract List<ContainerId> getContainersToCleanup();
 
-  List<ApplicationId> getApplicationsToCleanup();
+  public abstract List<ContainerId> getContainersToBeRemovedFromNM();
+
+  public abstract List<ApplicationId> getApplicationsToCleanup();
 
   // This tells NM the collectors' address info of related apps
-  Map<ApplicationId, String> getAppCollectorsMap();
-  void setAppCollectorsMap(Map<ApplicationId, String> appCollectorsMap);
+  public abstract Map<ApplicationId, String> getAppCollectorsMap();
 
-  void setResponseId(int responseId);
-  void setNodeAction(NodeAction action);
+  public abstract void setAppCollectorsMap(
+      Map<ApplicationId, String> appCollectorsMap);
 
-  MasterKey getContainerTokenMasterKey();
-  void setContainerTokenMasterKey(MasterKey secretKey);
-  
-  MasterKey getNMTokenMasterKey();
-  void setNMTokenMasterKey(MasterKey secretKey);
+  public abstract void setResponseId(int responseId);
+
+  public abstract void setNodeAction(NodeAction action);
 
-  void addAllContainersToCleanup(List<ContainerId> containers);
+  public abstract MasterKey getContainerTokenMasterKey();
+
+  public abstract void setContainerTokenMasterKey(MasterKey secretKey);
+
+  public abstract MasterKey getNMTokenMasterKey();
+
+  public abstract void setNMTokenMasterKey(MasterKey secretKey);
+
+  public abstract void addAllContainersToCleanup(List<ContainerId> containers);
 
   // This tells NM to remove finished containers from its context. Currently, NM
   // will remove finished containers from its context only after AM has actually
   // received the finished containers in a previous allocate response
-  void addContainersToBeRemovedFromNM(List<ContainerId> containers);
-  
-  void addAllApplicationsToCleanup(List<ApplicationId> applications);
+  public abstract void addContainersToBeRemovedFromNM(
+      List<ContainerId> containers);
 
-  List<SignalContainerRequest> getContainersToSignalList();
-  void addAllContainersToSignal(List<SignalContainerRequest> containers);
-  long getNextHeartBeatInterval();
-  void setNextHeartBeatInterval(long nextHeartBeatInterval);
-  
-  String getDiagnosticsMessage();
+  public abstract void addAllApplicationsToCleanup(
+      List<ApplicationId> applications);
+
+  public abstract List<SignalContainerRequest> getContainersToSignalList();
+
+  public abstract void addAllContainersToSignal(
+      List<SignalContainerRequest> containers);
+
+  public abstract long getNextHeartBeatInterval();
+
+  public abstract void setNextHeartBeatInterval(long nextHeartBeatInterval);
 
-  void setDiagnosticsMessage(String diagnosticsMessage);
+  public abstract String getDiagnosticsMessage();
+
+  public abstract void setDiagnosticsMessage(String diagnosticsMessage);
 
   // Credentials (i.e. hdfs tokens) needed by NodeManagers for application
   // localizations and logAggreations.
-  Map<ApplicationId, ByteBuffer> getSystemCredentialsForApps();
+  public abstract Map<ApplicationId, ByteBuffer> getSystemCredentialsForApps();
 
-  void setSystemCredentialsForApps(
+  public abstract void setSystemCredentialsForApps(
       Map<ApplicationId, ByteBuffer> systemCredentials);
   
-  boolean getAreNodeLabelsAcceptedByRM();
-  void setAreNodeLabelsAcceptedByRM(boolean areNodeLabelsAcceptedByRM);
+  public abstract boolean getAreNodeLabelsAcceptedByRM();
+
+  public abstract void setAreNodeLabelsAcceptedByRM(
+      boolean areNodeLabelsAcceptedByRM);
+
+  public abstract Resource getResource();
+
+  public abstract void setResource(Resource resource);
+
+  public abstract List<Container> getContainersToDecrease();
 
-  Resource getResource();
-  void setResource(Resource resource);
+  public abstract void addAllContainersToDecrease(
+      Collection<Container> containersToDecrease);
 
-  List<Container> getContainersToDecrease();
-  void addAllContainersToDecrease(Collection<Container> containersToDecrease);
+  public abstract ContainerQueuingLimit getContainerQueuingLimit();
 
-  ContainerQueuingLimit getContainerQueuingLimit();
-  void setContainerQueuingLimit(ContainerQueuingLimit containerQueuingLimit);
+  public abstract void setContainerQueuingLimit(
+      ContainerQueuingLimit containerQueuingLimit);
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9d0c2ad5/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerResponse.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerResponse.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerResponse.java
index fb1da4c..675b375 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerResponse.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/RegisterNodeManagerResponse.java
@@ -22,34 +22,40 @@ import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.hadoop.yarn.server.api.records.MasterKey;
 import org.apache.hadoop.yarn.server.api.records.NodeAction;
 
-public interface RegisterNodeManagerResponse {
-  MasterKey getContainerTokenMasterKey();
+/**
+ * Node Manager's register response.
+ */
+public abstract class RegisterNodeManagerResponse {
+  public abstract MasterKey getContainerTokenMasterKey();
+
+  public abstract void setContainerTokenMasterKey(MasterKey secretKey);
+
+  public abstract MasterKey getNMTokenMasterKey();
 
-  void setContainerTokenMasterKey(MasterKey secretKey);
+  public abstract void setNMTokenMasterKey(MasterKey secretKey);
 
-  MasterKey getNMTokenMasterKey();
+  public abstract NodeAction getNodeAction();
 
-  void setNMTokenMasterKey(MasterKey secretKey);
+  public abstract void setNodeAction(NodeAction nodeAction);
 
-  NodeAction getNodeAction();
+  public abstract long getRMIdentifier();
 
-  void setNodeAction(NodeAction nodeAction);
+  public abstract void setRMIdentifier(long rmIdentifier);
 
-  long getRMIdentifier();
+  public abstract String getDiagnosticsMessage();
 
-  void setRMIdentifier(long rmIdentifier);
+  public abstract void setDiagnosticsMessage(String diagnosticsMessage);
 
-  String getDiagnosticsMessage();
+  public abstract void setRMVersion(String version);
 
-  void setDiagnosticsMessage(String diagnosticsMessage);
+  public abstract String getRMVersion();
 
-  void setRMVersion(String version);
+  public abstract Resource getResource();
 
-  String getRMVersion();
+  public abstract void setResource(Resource resource);
 
-  Resource getResource();
-  void setResource(Resource resource);
+  public abstract boolean getAreNodeLabelsAcceptedByRM();
 
-  boolean getAreNodeLabelsAcceptedByRM();
-  void setAreNodeLabelsAcceptedByRM(boolean areNodeLabelsAcceptedByRM);
+  public abstract void setAreNodeLabelsAcceptedByRM(
+      boolean areNodeLabelsAcceptedByRM);
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9d0c2ad5/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/NodeHeartbeatResponsePBImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/NodeHeartbeatResponsePBImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/NodeHeartbeatResponsePBImpl.java
index cd85241..37bf570 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/NodeHeartbeatResponsePBImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/NodeHeartbeatResponsePBImpl.java
@@ -35,7 +35,6 @@ 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.ContainerIdPBImpl;
 import org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl;
-import org.apache.hadoop.yarn.api.records.impl.pb.ProtoBase;
 import org.apache.hadoop.yarn.api.records.impl.pb.ProtoUtils;
 import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl;
 import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto;
@@ -57,12 +56,14 @@ import org.apache.hadoop.yarn.server.api.records.NodeAction;
 import org.apache.hadoop.yarn.server.api.records.impl.pb.ContainerQueuingLimitPBImpl;
 import org.apache.hadoop.yarn.server.api.records.impl.pb.MasterKeyPBImpl;
 
-
-public class NodeHeartbeatResponsePBImpl extends
-    ProtoBase<NodeHeartbeatResponseProto> implements NodeHeartbeatResponse {
-  NodeHeartbeatResponseProto proto = NodeHeartbeatResponseProto.getDefaultInstance();
-  NodeHeartbeatResponseProto.Builder builder = null;
-  boolean viaProto = false;
+/**
+ * PBImpl class for NodeHeartbeatResponse.
+ */
+public class NodeHeartbeatResponsePBImpl extends NodeHeartbeatResponse {
+  private NodeHeartbeatResponseProto proto = NodeHeartbeatResponseProto
+      .getDefaultInstance();
+  private NodeHeartbeatResponseProto.Builder builder = null;
+  private boolean viaProto = false;
 
   private List<ContainerId> containersToCleanup = null;
   private List<ContainerId> containersToBeRemovedFromNM = null;

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9d0c2ad5/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerResponsePBImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerResponsePBImpl.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerResponsePBImpl.java
index 56b675b..2121fd1 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerResponsePBImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/api/protocolrecords/impl/pb/RegisterNodeManagerResponsePBImpl.java
@@ -20,7 +20,6 @@ package org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb;
 
 
 import org.apache.hadoop.yarn.api.records.Resource;
-import org.apache.hadoop.yarn.api.records.impl.pb.ProtoBase;
 import org.apache.hadoop.yarn.api.records.impl.pb.ResourcePBImpl;
 import org.apache.hadoop.yarn.proto.YarnProtos.ResourceProto;
 import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.MasterKeyProto;
@@ -32,11 +31,15 @@ import org.apache.hadoop.yarn.server.api.records.MasterKey;
 import org.apache.hadoop.yarn.server.api.records.NodeAction;
 import org.apache.hadoop.yarn.server.api.records.impl.pb.MasterKeyPBImpl;
 
-
-public class RegisterNodeManagerResponsePBImpl extends ProtoBase<RegisterNodeManagerResponseProto>
implements RegisterNodeManagerResponse {
-  RegisterNodeManagerResponseProto proto = RegisterNodeManagerResponseProto.getDefaultInstance();
-  RegisterNodeManagerResponseProto.Builder builder = null;
-  boolean viaProto = false;
+/**
+ * PBImpl class for RegisterNodeManagerResponse.
+ */
+public class RegisterNodeManagerResponsePBImpl
+    extends RegisterNodeManagerResponse {
+  private RegisterNodeManagerResponseProto proto =
+      RegisterNodeManagerResponseProto.getDefaultInstance();
+  private RegisterNodeManagerResponseProto.Builder builder = null;
+  private boolean viaProto = false;
   private Resource resource = null;
 
   private MasterKey containerTokenMasterKey = null;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message