You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by dl...@apache.org on 2020/10/14 03:09:36 UTC

[asterixdb] branch master updated: [NO ISSUE][MTD] Return Nodegroup nodes in a sorted ordered

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

dlych pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 7f80418  [NO ISSUE][MTD] Return Nodegroup nodes in a sorted ordered
7f80418 is described below

commit 7f8041832f169a393f60ab2794158a79dff86de7
Author: Murtadha Hubail <mh...@apache.org>
AuthorDate: Mon Oct 12 10:26:40 2020 +0300

    [NO ISSUE][MTD] Return Nodegroup nodes in a sorted ordered
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    
    - Return nodegroups list of nodes in a sorted order. This
      ensures that datasets created on the same set of nodes
      will have the same location constraints order.
    - Improve logging when an index is not found.
    
    Change-Id: I9878aac19d64e57c473428f86e8858c06104712c
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/8364
    Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Murtadha Hubail <mh...@apache.org>
    Reviewed-by: Dmitry Lychagin <dm...@couchbase.com>
    Tested-by: Murtadha Hubail <mh...@apache.org>
    Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
---
 .../org/apache/asterix/metadata/entities/NodeGroup.java  | 16 ++++++++++++----
 .../storage/am/common/dataflow/IndexDataflowHelper.java  |  1 +
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/NodeGroup.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/NodeGroup.java
index 8a7d5ec..1c4ec64 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/NodeGroup.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/entities/NodeGroup.java
@@ -19,7 +19,11 @@
 
 package org.apache.asterix.metadata.entities;
 
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
 
 import org.apache.asterix.metadata.MetadataCache;
 import org.apache.asterix.metadata.api.IMetadataEntity;
@@ -29,15 +33,19 @@ import org.apache.asterix.metadata.api.IMetadataEntity;
  */
 public class NodeGroup implements IMetadataEntity<NodeGroup> {
 
-    private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 2L;
 
     // Enforced to be unique within an Asterix cluster.
     private final String groupName;
-    private final List<String> nodeNames;
+    private final Set<String> nodeNames;
 
     public NodeGroup(String groupName, List<String> nodeNames) {
         this.groupName = groupName;
-        this.nodeNames = nodeNames;
+        if (nodeNames != null) {
+            this.nodeNames = new TreeSet<>(nodeNames);
+        } else {
+            this.nodeNames = Collections.emptySet();
+        }
     }
 
     public String getNodeGroupName() {
@@ -45,7 +53,7 @@ public class NodeGroup implements IMetadataEntity<NodeGroup> {
     }
 
     public List<String> getNodeNames() {
-        return this.nodeNames;
+        return Collections.unmodifiableList(new ArrayList<>(nodeNames));
     }
 
     @Override
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexDataflowHelper.java b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexDataflowHelper.java
index 520dbc0..16461de 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexDataflowHelper.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-am-common/src/main/java/org/apache/hyracks/storage/am/common/dataflow/IndexDataflowHelper.java
@@ -73,6 +73,7 @@ public class IndexDataflowHelper implements IIndexDataflowHelper {
         // Get local resource
         LocalResource lr = getResource();
         if (lr == null) {
+            LOGGER.error("index {} does not exist", resourceRef.getRelativePath());
             throw HyracksDataException.create(ErrorCode.INDEX_DOES_NOT_EXIST);
         }
         IResource resource = lr.getResource();