Skip to content
Permalink
Browse files
[NO ISSUE][REP] Add Replicas Getter
- user model changes: no
- storage format changes: no
- interface changes: yes

Details:

- Add getter in ReplicaManager for the current replicas.
- Add getter for the replica identifier.

Change-Id: I9394739ec7d591fbdf56127e9493c13005c6e38e
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/12863
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
  • Loading branch information
mhubail committed Aug 16, 2021
1 parent 3e4bf05 commit 5444615fcbb7ccf937e8ee38a2b9cf82a4c56fd9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
@@ -18,6 +18,7 @@
*/
package org.apache.asterix.app.nc;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -141,6 +142,11 @@ public Object getReplicaSyncLock() {
return replicaSyncLock;
}

@Override
public synchronized List<IPartitionReplica> getReplicas() {
return new ArrayList<>(replicas.values());
}

public void closePartitionResources(int partition) throws HyracksDataException {
final IDatasetLifecycleManager datasetLifecycleManager = appCtx.getDatasetLifecycleManager();
//TODO(mhubail) we can flush only datasets of the requested partition
@@ -86,4 +86,11 @@ public interface IReplicaManager {
* @return The partition replica if found. Otherwise, null.
*/
IPartitionReplica getReplica(ReplicaIdentifier id);

/**
* Gets the list of replicas
*
* @return the list of replicas
*/
List<IPartitionReplica> getReplicas();
}
@@ -75,6 +75,10 @@ public int hashCode() {
return id.hashCode();
}

public String getId() {
return id;
}

@Override
public String toString() {
return id;

0 comments on commit 5444615

Please sign in to comment.