*/
package org.opendaylight.controller.cluster.datastore.config;
+import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
this.name = name;
}
+ public ModuleConfig(ModuleConfig moduleConfig) {
+ this.name = moduleConfig.getName();
+ this.nameSpace = moduleConfig.getNameSpace();
+ this.shardStrategy = moduleConfig.getShardStrategy();
+ for (ShardConfig shardConfig : moduleConfig.getShardConfigs()) {
+ shardConfigs.put(shardConfig.getName(), new ShardConfig(shardConfig.getName(),
+ ImmutableSet.copyOf(shardConfig.getReplicas())));
+ }
+ }
+
public String getName() {
return name;
}
public void setShardStrategy(ShardStrategy shardStrategy) {
this.shardStrategy = shardStrategy;
}
-}
\ No newline at end of file
+
+ public ShardConfig removeShardConfig(String name) {
+ return shardConfigs.remove(name);
+ }
+}