private boolean matches(String filename) { return dataHub.buildPatternForDatabasesToUpdateIndexesFor().matcher(filename).matches(); } }
/** * Note that this differs from how "mlUpdateIndexes" works in ml-gradle. This is not stripping out any "non-index" * properties from each payload - it's just updating every database. * * This does however disable forest creation which speeds up the process so that the only calls made are to * update the databases. */ @Override public void updateIndexes() { SimpleAppDeployer deployer = new SimpleAppDeployer(getManageClient(), getAdminManager()); deployer.setCommands(buildCommandMap().get("mlDatabaseCommands")); AppConfig appConfig = hubConfig.getAppConfig(); final boolean originalCreateForests = appConfig.isCreateForests(); final Pattern originalIncludePattern = appConfig.getResourceFilenamesIncludePattern(); try { appConfig.setCreateForests(false); if (hubConfig.getIsProvisionedEnvironment()) { appConfig.setResourceFilenamesIncludePattern(buildPatternForDatabasesToUpdateIndexesFor()); } deployer.deploy(hubConfig.getAppConfig()); } finally { appConfig.setCreateForests(originalCreateForests); appConfig.setResourceFilenamesIncludePattern(originalIncludePattern); } }