deploymentOptions.setHeapSize(defaultHeapSize);
deploymentOptions.setHeapNewSize(defaultHeapNewSize);
deploymentOptions.load();
Deployer deployer = new Deployer();
deployer.setDeploymentOptions(deploymentOptions);
storageBasedir.mkdirs();
deployer.unzipDistro();
deployer.applyConfigChanges();
deployer.updateFilePerms();
ConfigEditor oldYamlEditor = new ConfigEditor(oldYamlFile);
oldYamlEditor.load();
ConfigEditor newYamlEditor = new ConfigEditor(newYamlFile);
newYamlEditor.load();
installerInfo.hostname = oldYamlEditor.getListenAddress();
newYamlEditor.setListenAddress(installerInfo.hostname);
newYamlEditor.setRpcAddress(installerInfo.hostname);
installerInfo.cqlPort = oldYamlEditor.getNativeTransportPort();
newYamlEditor.setNativeTransportPort(installerInfo.cqlPort);
installerInfo.gossipPort = oldYamlEditor.getStoragePort();
newYamlEditor.setStoragePort(installerInfo.gossipPort);
newYamlEditor.setCommitLogDirectory(oldYamlEditor.getCommitLogDirectory());
newYamlEditor.setSavedCachesDirectory(oldYamlEditor.getSavedCachesDirectory());
newYamlEditor.setDataFileDirectories(oldYamlEditor.getDataFileDirectories());
newYamlEditor.setSeeds(installerInfo.hostname);
newYamlEditor.save();
if (isRHQ48Install) {
Properties jvmProps = new Properties();
jvmProps.load(new FileInputStream(cassandraJvmPropsFile));
PropertiesFileUpdate propertiesUpdater = new PropertiesFileUpdate(
cassandraJvmPropsFile.getAbsolutePath());
jvmProps.setProperty("jmx_port", Integer.toString(installerInfo.jmxPort));
propertiesUpdater.update(jvmProps);
deployer.updateStorageAuthConf(asSet(installerInfo.hostname));
} else {
File oldStorageAuthConfFile = new File(oldConfDir, "rhq-storage-auth.conf");
File newStorageAuthConfFile = new File(newConfDir, "rhq-storage-auth.conf");
StreamUtil.copy(new FileInputStream(oldStorageAuthConfFile), new FileOutputStream(
newStorageAuthConfFile));