- final String modulesConfigPath){
-
- Preconditions.checkNotNull(moduleShardsConfigPath, "moduleShardsConfigPath should not be null");
- Preconditions.checkNotNull(modulesConfigPath, "modulesConfigPath should not be null");
-
-
- File moduleShardsFile = new File("./configuration/initial/" + moduleShardsConfigPath);
- File modulesFile = new File("./configuration/initial/" + modulesConfigPath);
-
- Config moduleShardsConfig = null;
- if(moduleShardsFile.exists()) {
- LOG.info("module shards config file exists - reading config from it");
- moduleShardsConfig = ConfigFactory.parseFile(moduleShardsFile);
- } else {
- LOG.warn("module shards configuration read from resource");
- moduleShardsConfig = ConfigFactory.load(moduleShardsConfigPath);
- }
-
- Config modulesConfig = null;
- if(modulesFile.exists()) {
- LOG.info("modules config file exists - reading config from it");
- modulesConfig = ConfigFactory.parseFile(modulesFile);
- } else {
- LOG.warn("modules configuration read from resource");
- modulesConfig = ConfigFactory.load(modulesConfigPath);
- }
-
- this.moduleShards = readModuleShards(moduleShardsConfig);
- this.modules = readModules(modulesConfig);
-
- this.allShardNames = createAllShardNames(moduleShards);
- this.moduleNameToShardName = createModuleNameToShardName(moduleShards);
- this.moduleNameToStrategy = createModuleNameToStrategy(modules);
- this.namespaceToModuleName = createNamespaceToModuleName(modules);