asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Blow (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: IGNORE IGNORE IGNORE
Date Tue, 17 May 2016 04:30:32 GMT
Michael Blow has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/855

Change subject: IGNORE IGNORE IGNORE
......................................................................

IGNORE IGNORE IGNORE

Do not review.

Change-Id: Ibb07d9cafe0976fd987cb5da61b7d904d795fc7d
---
M hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeControllersInfoWork.java
1 file changed, 9 insertions(+), 6 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/55/855/1

diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeControllersInfoWork.java
b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeControllersInfoWork.java
index 785a202..2125ca0 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeControllersInfoWork.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/work/GetNodeControllersInfoWork.java
@@ -29,6 +29,7 @@
 import org.apache.hyracks.control.common.work.IResultCallback;
 
 public class GetNodeControllersInfoWork extends AbstractWork {
+    private final Integer mutex = new Integer(-1);
     private final ClusterControllerService ccs;
     private IResultCallback<Map<String, NodeControllerInfo>> callback;
 
@@ -40,12 +41,14 @@
 
     @Override
     public void run() {
-        Map<String, NodeControllerInfo> result = new LinkedHashMap<String, NodeControllerInfo>();
-        Map<String, NodeControllerState> nodeMap = ccs.getNodeMap();
-        for (Map.Entry<String, NodeControllerState> e : nodeMap.entrySet()) {
-            result.put(e.getKey(), new NodeControllerInfo(e.getKey(), NodeStatus.ALIVE, e.getValue().getDataPort(),
e
-                    .getValue().getDatasetPort()));
+        synchronized(mutex) {
+            Map<String, NodeControllerInfo> result = new LinkedHashMap<String, NodeControllerInfo>();
+            Map<String, NodeControllerState> nodeMap = ccs.getNodeMap();
+            for (Map.Entry<String, NodeControllerState> e : nodeMap.entrySet()) {
+                result.put(e.getKey(), new NodeControllerInfo(e.getKey(), NodeStatus.ALIVE,
e.getValue().getDataPort(), e
+                        .getValue().getDatasetPort()));
+            }
+            callback.setValue(result);
         }
-        callback.setValue(result);
     }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/855
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb07d9cafe0976fd987cb5da61b7d904d795fc7d
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <michael.blow@couchbase.com>

Mime
View raw message