commit | 91b555eb42f3d8dc7879842ef470f8bd420f1188 | [log] [tgz] |
---|---|---|
author | Murtadha Hubail <murtadha.hubail@couchbase.com> | Mon Aug 09 02:28:55 2021 +0300 |
committer | Murtadha Hubail <mhubail@apache.org> | Mon Aug 09 19:27:17 2021 +0000 |
tree | bd8ac72511da9fca4fcf16e39df4acef363b1c8a | |
parent | 0d97846619b0cb8630ac5b8b9d8ec406297cabed [diff] |
[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 <mhubail@apache.org> Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com> Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
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 @@ * @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 @@ 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());