removing duplicacy in command listing
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
index 8083427..3596032 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
@@ -30,133 +30,108 @@
public class InstallerDriver {
- public static final String MANAGIX_INTERNAL_DIR = ".installer";
- public static final String MANAGIX_EVENT_DIR = MANAGIX_INTERNAL_DIR
- + File.separator + "eventrix";
- public static final String MANAGIX_EVENT_SCRIPTS_DIR = MANAGIX_INTERNAL_DIR
- + File.separator + "eventrix" + File.separator + "scripts";
- public static final String ASTERIX_DIR = "asterix";
- public static final String EVENTS_DIR = "events";
+ public static final String MANAGIX_INTERNAL_DIR = ".installer";
+ public static final String MANAGIX_EVENT_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix";
+ public static final String MANAGIX_EVENT_SCRIPTS_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix"
+ + File.separator + "scripts";
+ public static final String ASTERIX_DIR = "asterix";
+ public static final String EVENTS_DIR = "events";
- private static final Logger LOGGER = Logger.getLogger(InstallerDriver.class
- .getName());
- public static final String ENV_MANAGIX_HOME = "MANAGIX_HOME";
- public static final String MANAGIX_CONF_XML = "conf" + File.separator
- + "managix-conf.xml";
+ private static final Logger LOGGER = Logger.getLogger(InstallerDriver.class.getName());
+ public static final String ENV_MANAGIX_HOME = "MANAGIX_HOME";
+ public static final String MANAGIX_CONF_XML = "conf" + File.separator + "managix-conf.xml";
- private static Configuration conf;
- private static String managixHome;
- private static String asterixZip;
+ private static Configuration conf;
+ private static String managixHome;
+ private static String asterixZip;
- public static String getAsterixZip() {
- return asterixZip;
- }
+ public static String getAsterixZip() {
+ return asterixZip;
+ }
- public static Configuration getConfiguration() {
- return conf;
- }
+ public static Configuration getConfiguration() {
+ return conf;
+ }
- public static void initConfig() throws Exception {
- File configFile = new File(managixHome + File.separator
- + MANAGIX_CONF_XML);
- JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
- Unmarshaller unmarshaller = configCtx.createUnmarshaller();
- conf = (Configuration) unmarshaller.unmarshal(configFile);
- asterixZip = initBinary("asterix-server");
+ public static void initConfig() throws Exception {
+ File configFile = new File(managixHome + File.separator + MANAGIX_CONF_XML);
+ JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
+ Unmarshaller unmarshaller = configCtx.createUnmarshaller();
+ conf = (Configuration) unmarshaller.unmarshal(configFile);
+ asterixZip = initBinary("asterix-server");
- ILookupService lookupService = ServiceProvider.INSTANCE
- .getLookupService();
- if (!lookupService.isRunning(conf)) {
- lookupService.startService(conf);
- }
- }
+ ILookupService lookupService = ServiceProvider.INSTANCE.getLookupService();
+ if (!lookupService.isRunning(conf)) {
+ lookupService.startService(conf);
+ }
+ }
- private static String initBinary(final String fileNamePattern) {
- String asterixDir = InstallerDriver.getAsterixDir();
- File file = new File(asterixDir);
- File[] zipFiles = file.listFiles(new FileFilter() {
- public boolean accept(File arg0) {
- return arg0.getAbsolutePath().contains(fileNamePattern)
- && arg0.isFile();
- }
- });
- if (zipFiles.length == 0) {
- String msg = " Binary not found at " + asterixDir;
- LOGGER.log(Level.FATAL, msg);
- throw new IllegalStateException(msg);
- }
- if (zipFiles.length > 1) {
- String msg = " Multiple binaries found at " + asterixDir;
- LOGGER.log(Level.FATAL, msg);
- throw new IllegalStateException(msg);
- }
+ private static String initBinary(final String fileNamePattern) {
+ String asterixDir = InstallerDriver.getAsterixDir();
+ File file = new File(asterixDir);
+ File[] zipFiles = file.listFiles(new FileFilter() {
+ public boolean accept(File arg0) {
+ return arg0.getAbsolutePath().contains(fileNamePattern) && arg0.isFile();
+ }
+ });
+ if (zipFiles.length == 0) {
+ String msg = " Binary not found at " + asterixDir;
+ LOGGER.log(Level.FATAL, msg);
+ throw new IllegalStateException(msg);
+ }
+ if (zipFiles.length > 1) {
+ String msg = " Multiple binaries found at " + asterixDir;
+ LOGGER.log(Level.FATAL, msg);
+ throw new IllegalStateException(msg);
+ }
- return zipFiles[0].getAbsolutePath();
- }
+ return zipFiles[0].getAbsolutePath();
+ }
- public static String getManagixHome() {
- return managixHome;
- }
+ public static String getManagixHome() {
+ return managixHome;
+ }
- public static String getAsterixDir() {
- return managixHome + File.separator + ASTERIX_DIR;
- }
+ public static String getAsterixDir() {
+ return managixHome + File.separator + ASTERIX_DIR;
+ }
- public static void main(String args[]) {
- try {
- if (args.length != 0) {
- managixHome = System.getenv(ENV_MANAGIX_HOME);
- CommandHandler cmdHandler = new CommandHandler();
- cmdHandler.processCommand(args);
- } else {
- printUsage();
- }
- } catch (IllegalArgumentException iae) {
- LOGGER.error("Unknown command");
- printUsage();
- } catch (Exception e) {
- LOGGER.error(e.getMessage());
- if (e.getMessage() == null || e.getMessage().length() == 0) {
- e.printStackTrace();
- }
- }
- }
+ public static void main(String args[]) {
+ try {
+ if (args.length != 0) {
+ managixHome = System.getenv(ENV_MANAGIX_HOME);
+ CommandHandler cmdHandler = new CommandHandler();
+ cmdHandler.processCommand(args);
+ } else {
+ printUsage();
+ }
+ } catch (IllegalArgumentException iae) {
+ LOGGER.error("Unknown command");
+ printUsage();
+ } catch (Exception e) {
+ LOGGER.error(e.getMessage());
+ if (e.getMessage() == null || e.getMessage().length() == 0) {
+ e.printStackTrace();
+ }
+ }
+ }
- private static void printUsage() {
- StringBuffer buffer = new StringBuffer("managix <command> <options>"
- + "\n");
- buffer.append("Commands" + "\n");
- buffer.append("create " + ":" + " Creates a new asterix instance"
- + "\n");
- buffer.append("delete " + ":" + " Deletes an asterix instance" + "\n");
- buffer.append("start " + ":" + " Starts an asterix instance" + "\n");
- buffer.append("stop " + ":"
- + " Stops an asterix instance that is in ACTIVE state" + "\n");
- buffer.append("backup " + ":"
- + " Creates a back up for an existing asterix instance" + "\n");
- buffer.append("restore " + ":" + " Restores an asterix instance"
- + "\n");
- buffer.append("describe " + ":"
- + " Describes an existing asterix instance" + "\n");
- buffer.append("validate " + ":"
- + " Validates the installer/cluster configuration" + "\n");
- buffer.append("configure"
- + ":"
- + " Auto-generate configuration for local psedu-distributed Asterix instance"
- + "\n");
- buffer.append("shutdown " + ":" + " Shutdown the installer service"
- + "\n");
- buffer.append("validate " + ":"
- + " Validates the installer/cluster configuration" + "\n");
- buffer.append("configure"
- + ":"
- + " Auto-generate configuration for local psedu-distributed Asterix instance"
- + "\n");
- buffer.append("shutdown " + ":" + " Shutdown the installer service"
- + "\n");
- buffer.append("help " + ":"
- + " Provides usage description of a command" + "\n");
+ private static void printUsage() {
+ StringBuffer buffer = new StringBuffer("managix <command> <options>" + "\n");
+ buffer.append("Commands" + "\n");
+ buffer.append("create " + ":" + " Creates a new asterix instance" + "\n");
+ buffer.append("delete " + ":" + " Deletes an asterix instance" + "\n");
+ buffer.append("start " + ":" + " Starts an asterix instance" + "\n");
+ buffer.append("stop " + ":" + " Stops an asterix instance that is in ACTIVE state" + "\n");
+ buffer.append("backup " + ":" + " Creates a back up for an existing asterix instance" + "\n");
+ buffer.append("restore " + ":" + " Restores an asterix instance" + "\n");
+ buffer.append("describe " + ":" + " Describes an existing asterix instance" + "\n");
+ buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
+ buffer.append("configure" + ":" + " Auto-generate configuration for local psedu-distributed Asterix instance"
+ + "\n");
+ buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
+ buffer.append("help " + ":" + " Provides usage description of a command" + "\n");
- LOGGER.info(buffer.toString());
- }
+ LOGGER.info(buffer.toString());
+ }
}