adding log command
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CommandHandler.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CommandHandler.java
index 7fc3884..91a7ee5 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CommandHandler.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/CommandHandler.java
@@ -52,6 +52,9 @@
case CONFIGURE:
cmd = new ConfigureCommand();
break;
+ case LOG:
+ cmd = new LogCommand();
+ break;
case SHUTDOWN:
cmd = new ShutdownCommand();
break;
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ICommand.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ICommand.java
index 979c414..0b29850 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ICommand.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/command/ICommand.java
@@ -27,6 +27,7 @@
ALTER,
VALIDATE,
CONFIGURE,
+ LOG,
SHUTDOWN,
HELP
}
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 08249ee..4e114f4 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
@@ -135,6 +135,8 @@
buffer.append("describe " + ":" + " Describes an existing asterix instance" + "\n");
buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
buffer.append("configure" + ":" + " Configure the Asterix installer" + "\n");
+ buffer.append("log " + ":"
+ + " Produce a tar archive contianing log files from the master and worker nodes" + "\n");
buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
buffer.append("help " + ":" + " Provides usage description of a command" + "\n");
buffer.append("\nTo get more information about a command, use managix help -cmd <command>");
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
index 0f382f9..c2d6c04 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/events/PatternCreator.java
@@ -479,4 +479,21 @@
return new Pattern(null, 1, null, event);
}
+ public Patterns getTransferLogPattern(String asterixInstanceName, Cluster cluster, String outputDir) {
+ List<Pattern> patternList = new ArrayList<Pattern>();
+ String username = cluster.getUsername() == null ? System.getProperty("user.name") : cluster.getUsername();
+ String destHost = cluster.getMasterNode().getClusterIp();
+ for (Node node : cluster.getNode()) {
+ Nodeid nodeid = new Nodeid(new Value(null, node.getId()));
+ String srcDir = node.getLogDir();
+ String destDir = outputDir + File.separator + node.getId();
+ String pargs = username + " " + srcDir + " " + destHost + " " + destDir;
+ Event event = new Event("directory_transfer", nodeid, pargs);
+ Pattern p = new Pattern(null, 1, null, event);
+ patternList.add(p);
+ }
+ Patterns patterns = new Patterns(patternList);
+ return patterns;
+ }
+
}