You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ta...@apache.org on 2021/12/06 05:46:30 UTC

[hadoop] branch branch-3.3 updated: YARN-10820. Make GetClusterNodesRequestPBImpl thread safe. Contributed by Swathi Chandrashekar.

This is an automated email from the ASF dual-hosted git repository.

tasanuma pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new edfd68e  YARN-10820. Make GetClusterNodesRequestPBImpl thread safe. Contributed by Swathi Chandrashekar.
edfd68e is described below

commit edfd68e248201e7c7a7ee5d73cece6fe43c7d49b
Author: Prabhu Joseph <pr...@gmail.com>
AuthorDate: Thu Jun 17 11:35:41 2021 +0530

    YARN-10820. Make GetClusterNodesRequestPBImpl thread safe. Contributed by Swathi Chandrashekar.
    
    (cherry picked from commit 6b4987f09cbc53e00e85cb82ad97505858cada11)
---
 .../api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java
index c817f05..c25fbdf 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/protocolrecords/impl/pb/GetClusterNodesRequestPBImpl.java
@@ -52,7 +52,7 @@ public class GetClusterNodesRequestPBImpl extends GetClusterNodesRequest {
     viaProto = true;
   }
   
-  public GetClusterNodesRequestProto getProto() {
+  public synchronized GetClusterNodesRequestProto getProto() {
     mergeLocalToProto();
     proto = viaProto ? proto : builder.build();
     viaProto = true;
@@ -60,13 +60,13 @@ public class GetClusterNodesRequestPBImpl extends GetClusterNodesRequest {
   }
   
   @Override
-  public EnumSet<NodeState> getNodeStates() {
+  public synchronized EnumSet<NodeState> getNodeStates() {
     initNodeStates();
     return this.states;
   }
   
   @Override
-  public void setNodeStates(final EnumSet<NodeState> states) {
+  public synchronized void setNodeStates(final EnumSet<NodeState> states) {
     initNodeStates();
     this.states.clear();
     if (states == null) {

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