You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mh...@apache.org on 2021/08/09 19:27:52 UTC

[asterixdb] branch master updated: [NO ISSUE][CLUS] Add getter to the cluster partitions map

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

mhubail 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 91b555e  [NO ISSUE][CLUS] Add getter to the cluster partitions map
91b555e is described below

commit 91b555eb42f3d8dc7879842ef470f8bd420f1188
Author: Murtadha Hubail <mu...@couchbase.com>
AuthorDate: Mon Aug 9 02:28:55 2021 +0300

    [NO ISSUE][CLUS] Add getter to the cluster partitions map
    
    - user model changes: no
    - storage format changes: no
    - interface changes: yes
    
    Change-Id: Idd1872e3cbf3a95a6f4b51ed5d2135db041ebc31
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/12723
    Reviewed-by: Murtadha Hubail <mh...@apache.org>
    Reviewed-by: Ali Alsuliman <al...@gmail.com>
    Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
---
 .../org/apache/asterix/common/cluster/IClusterStateManager.java    | 7 +++++++
 .../java/org/apache/asterix/runtime/utils/ClusterStateManager.java | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/IClusterStateManager.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/IClusterStateManager.java
index 2ee9435..41f786a 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/IClusterStateManager.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/cluster/IClusterStateManager.java
@@ -265,4 +265,11 @@ public interface IClusterStateManager {
      * @param rebalanceRequired
      */
     void setRebalanceRequired(boolean rebalanceRequired) throws HyracksDataException;
+
+    /**
+     * Gets a map of the cluster partitions
+     *
+     * @return the cluster partitions map
+     */
+    Map<Integer, ClusterPartition> getClusterPartitions();
 }
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
index 7e50102..c5398e1 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/ClusterStateManager.java
@@ -473,6 +473,11 @@ public class ClusterStateManager implements IClusterStateManager {
         refreshState();
     }
 
+    @Override
+    public Map<Integer, ClusterPartition> getClusterPartitions() {
+        return Collections.unmodifiableMap(clusterPartitions);
+    }
+
     private void updateClusterCounters(String nodeId, NcLocalCounters localCounters) {
         final IResourceIdManager resourceIdManager = appCtx.getResourceIdManager();
         resourceIdManager.report(nodeId, localCounters.getMaxResourceId());