// Fix the catalog!
// populateCatalog(args.catalog_db, type);
// Populate host information
Catalog new_catalog = args.catalog;
if (args.hasIntParam(ArgumentsParser.PARAM_CATALOG_NUM_HOSTS)) {
String host_format = args.getParam(ArgumentsParser.PARAM_CATALOG_HOSTS);
int num_hosts = args.getIntParam(ArgumentsParser.PARAM_CATALOG_NUM_HOSTS);
int num_sites_per_host = (args.hasIntParam(ArgumentsParser.PARAM_CATALOG_SITES_PER_HOST) ? args.getIntParam(ArgumentsParser.PARAM_CATALOG_SITES_PER_HOST) : 2);
int num_partitions_per_site = (args.hasIntParam(ArgumentsParser.PARAM_CATALOG_PARTITIONS_PER_SITE) ? args.getIntParam(ArgumentsParser.PARAM_CATALOG_PARTITIONS_PER_SITE) : 2);
if (host_format == null) {
FixCatalog.updateCatalog(new_catalog, num_hosts, num_sites_per_host, num_partitions_per_site);
} else {
FixCatalog.updateCatalog(new_catalog, host_format, num_hosts, num_sites_per_host, num_partitions_per_site);
}
// Use host list
} else {
String hostsInfo = args.getParam(ArgumentsParser.PARAM_CATALOG_HOSTS);
ClusterConfiguration cc = new ClusterConfiguration(hostsInfo);
FixCatalog.updateCatalog(new_catalog, cc);
}
// Now construct the new Dtxn.Coordinator configuration
// String new_dtxn = HStoreDtxnConf.toHStoreDtxnConf(new_catalog);
// We need to write this things somewhere now...
FileUtil.writeStringToFile(new File(catalogOutputPath), new_catalog.serialize());
LOG.debug("Wrote updated catalog specification to '" + catalogOutputPath + "'");
// FileUtil.writeStringToFile(new File(dtxnOutputPath), new_dtxn);
// LOG.info("Wrote updated Dtxn.Coordinator configuration to '" +
// dtxnOutputPath + "'");