Modify the FindPrimary implementation so that it works correctly with a configuration
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ConfigurationImpl.java
index 1b8bf3e160e75c9c47cfd20dfe8e0dc9cdbb8388..9a9ac2c725dafee3426c08235d0a5a45eabc94ac 100644 (file)
@@ -85,6 +85,18 @@ public class ConfigurationImpl implements Configuration {
         return Collections.EMPTY_LIST;
     }
 
+    @Override public List<String> getMembersFromShardName(String shardName) {
+        List<String> shards = new ArrayList();
+        for(ModuleShard ms : moduleShards){
+            for(Shard s : ms.getShards()) {
+                if(s.getName().equals(shardName)){
+                    return s.getReplicas();
+                }
+            }
+        }
+        return Collections.EMPTY_LIST;
+    }
+
 
 
     private void readModules(Config modulesConfig) {