- super(new ModuleShardConfigProvider() {
- @Override
- public Map<String, ModuleConfig> retrieveModuleConfigs(Configuration configuration) {
- Map<String, ModuleConfig> retMap = new HashMap<String, ModuleConfig>();
- for(Map.Entry<String, List<String>> e : shardMembers.entrySet()) {
- String shardName = e.getKey();
- ModuleConfig mc = new ModuleConfig(shardName);
- mc.addShardConfig(shardName, Sets.newHashSet(e.getValue()));
- retMap.put(mc.getName(), mc);
- }
-
- return retMap;
+ super(configuration -> {
+ Map<String, ModuleConfig.Builder> retMap = new HashMap<>();
+ for(Map.Entry<String, List<String>> e : shardMembers.entrySet()) {
+ String shardName = e.getKey();
+ retMap.put(shardName,
+ ModuleConfig.builder(shardName).shardConfig(
+ shardName, e.getValue().stream().map(MemberName::forName).collect(Collectors.toList())));