Esempio n. 1
0
 @Override
 public List<? extends Config> getConfigList(String path) {
   List<ConfigObject> objects = getObjectList(path);
   List<Config> l = new ArrayList<Config>();
   for (ConfigObject o : objects) {
     l.add(o.toConfig());
   }
   return l;
 }
Esempio n. 2
0
  private void readModuleShards(Config moduleShardsConfig) {
    List<? extends ConfigObject> moduleShardsConfigObjectList =
        moduleShardsConfig.getObjectList("module-shards");

    for (ConfigObject moduleShardConfigObject : moduleShardsConfigObjectList) {

      String moduleName = moduleShardConfigObject.get("name").unwrapped().toString();

      List<? extends ConfigObject> shardsConfigObjectList =
          moduleShardConfigObject.toConfig().getObjectList("shards");

      List<Shard> shards = new ArrayList<>();

      for (ConfigObject shard : shardsConfigObjectList) {
        String shardName = shard.get("name").unwrapped().toString();
        List<String> replicas = shard.toConfig().getStringList("replicas");
        shards.add(new Shard(shardName, replicas));
      }

      this.moduleShards.add(new ModuleShard(moduleName, shards));
    }
  }
Esempio n. 3
0
 public String stringValue(String name) {
   return configObject.get(name).unwrapped().toString();
 }