asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mhub...@apache.org
Subject incubator-asterixdb git commit: ASTERIXDB-1340: fix node group nodes order
Date Fri, 11 Mar 2016 23:36:52 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master f02e1be3e -> 230b5a5e2


ASTERIXDB-1340: fix node group nodes order

Change-Id: I6e93aedb6cdc57d98f83991ab910476b82bacb15
Reviewed-on: https://asterix-gerrit.ics.uci.edu/708
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/230b5a5e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/230b5a5e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/230b5a5e

Branch: refs/heads/master
Commit: 230b5a5e228aadf92df1f32b9c6ab3dc34159307
Parents: f02e1be
Author: Murtadha Hubail <mhubail@uci.edu>
Authored: Fri Mar 11 10:02:15 2016 -0800
Committer: Murtadha Hubail <hubailmor@gmail.com>
Committed: Fri Mar 11 15:31:44 2016 -0800

----------------------------------------------------------------------
 .../asterix/api/common/AsterixHyracksIntegrationUtil.java |  4 ++--
 .../apache/asterix/aql/translator/QueryTranslator.java    | 10 +++-------
 .../asterix/common/config/AsterixMetadataProperties.java  |  4 ++--
 .../asterix/common/config/AsterixPropertiesAccessor.java  |  9 ++++-----
 .../asterix/metadata/bootstrap/MetadataBootstrap.java     |  2 +-
 5 files changed, 12 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/230b5a5e/asterix-app/src/main/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
----------------------------------------------------------------------
diff --git a/asterix-app/src/main/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
b/asterix-app/src/main/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
index be9452b..a568464 100644
--- a/asterix-app/src/main/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ b/asterix-app/src/main/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -20,7 +20,7 @@ package org.apache.asterix.api.common;
 
 import java.io.File;
 import java.util.EnumSet;
-import java.util.Set;
+import java.util.List;
 
 import org.apache.asterix.common.config.AsterixPropertiesAccessor;
 import org.apache.asterix.common.config.GlobalConfig;
@@ -72,7 +72,7 @@ public class AsterixHyracksIntegrationUtil {
 
         // Starts ncs.
         int n = 0;
-        Set<String> nodes = propertiesAccessor.getNodeNames();
+        List<String> nodes = propertiesAccessor.getNodeNames();
         for (String ncName : nodes) {
             NCConfig ncConfig1 = new NCConfig();
             ncConfig1.ccHost = "localhost";

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/230b5a5e/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
----------------------------------------------------------------------
diff --git a/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
b/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
index 00bc254..362be2e 100644
--- a/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
+++ b/asterix-app/src/main/java/org/apache/asterix/aql/translator/QueryTranslator.java
@@ -26,16 +26,15 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.rmi.RemoteException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Random;
-import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -771,11 +770,8 @@ public class QueryTranslator extends AbstractLangTranslator {
             } else {
                 nodegroupCardinality = Integer.parseInt(dd.getHints().get(DatasetNodegroupCardinalityHint.NAME));
             }
-            Set<String> nodeNames = AsterixAppContextInfo.getInstance().getMetadataProperties().getNodeNames();
-            Set<String> nodeNamesClone = new HashSet<String>();
-            for (String node : nodeNames) {
-                nodeNamesClone.add(node);
-            }
+            List<String> nodeNames = AsterixAppContextInfo.getInstance().getMetadataProperties().getNodeNames();
+            List<String> nodeNamesClone = new ArrayList<String>(nodeNames);
             String metadataNodeName = AsterixAppContextInfo.getInstance().getMetadataProperties().getMetadataNodeName();
             List<String> selectedNodes = new ArrayList<String>();
             selectedNodes.add(metadataNodeName);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/230b5a5e/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixMetadataProperties.java
----------------------------------------------------------------------
diff --git a/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixMetadataProperties.java
b/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixMetadataProperties.java
index 473a163..9a8fba4 100644
--- a/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixMetadataProperties.java
+++ b/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixMetadataProperties.java
@@ -18,8 +18,8 @@
  */
 package org.apache.asterix.common.config;
 
+import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.SortedMap;
 
 import org.apache.asterix.common.cluster.ClusterPartition;
@@ -46,7 +46,7 @@ public class AsterixMetadataProperties extends AbstractAsterixProperties
{
         return accessor.getStores();
     }
 
-    public Set<String> getNodeNames() {
+    public List<String> getNodeNames() {
         return accessor.getNodeNames();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/230b5a5e/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixPropertiesAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixPropertiesAccessor.java
b/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixPropertiesAccessor.java
index 13ce403..77a290d 100644
--- a/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixPropertiesAccessor.java
+++ b/asterix-common/src/main/java/org/apache/asterix/common/config/AsterixPropertiesAccessor.java
@@ -22,12 +22,11 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.logging.Level;
@@ -50,7 +49,7 @@ public class AsterixPropertiesAccessor {
 
     private final String instanceName;
     private final String metadataNodeName;
-    private final Set<String> nodeNames;
+    private final List<String> nodeNames;
     private final Map<String, String[]> stores;
     private final Map<String, String> coredumpConfig;
     private final Map<String, Property> asterixConfigurationParams;
@@ -87,7 +86,7 @@ public class AsterixPropertiesAccessor {
         metadataNodeName = asterixConfiguration.getMetadataNode();
         stores = new HashMap<String, String[]>();
         List<Store> configuredStores = asterixConfiguration.getStore();
-        nodeNames = new HashSet<String>();
+        nodeNames = new ArrayList<String>();
         nodePartitionsMap = new HashMap<>();
         clusterPartitions = new TreeMap<>();
         int uniquePartitionId = 0;
@@ -137,7 +136,7 @@ public class AsterixPropertiesAccessor {
         return stores;
     }
 
-    public Set<String> getNodeNames() {
+    public List<String> getNodeNames() {
         return nodeNames;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/230b5a5e/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java
----------------------------------------------------------------------
diff --git a/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java
b/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java
index ec0d21f..b83f2f3 100644
--- a/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java
+++ b/asterix-metadata/src/main/java/org/apache/asterix/metadata/bootstrap/MetadataBootstrap.java
@@ -115,7 +115,7 @@ public class MetadataBootstrap {
     private static IIOManager ioManager;
 
     private static String metadataNodeName;
-    private static Set<String> nodeNames;
+    private static List<String> nodeNames;
     private static String outputDir;
 
     private static IMetadataIndex[] primaryIndexes;


Mime
View raw message