tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [2/3] tajo git commit: TAJO-967: tajoCli doesn't remeber the last '\q' command. (Jaewoong Jung via jihoon)
Date Mon, 05 Jan 2015 05:30:41 GMT
TAJO-967: tajoCli doesn't remeber the last '\q' command. (Jaewoong Jung via jihoon)

Closes #325


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/c420ced1
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/c420ced1
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/c420ced1

Branch: refs/heads/index_support
Commit: c420ced1b8a9e777fd0d5558236050a4515d8a45
Parents: 14e7529
Author: Jihoon Son <jihoonson@apache.org>
Authored: Mon Jan 5 14:10:05 2015 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Mon Jan 5 14:10:05 2015 +0900

----------------------------------------------------------------------
 CHANGES                                                        | 3 +++
 .../main/java/org/apache/tajo/cli/tsql/TajoFileHistory.java    | 6 +++++-
 .../java/org/apache/tajo/cli/tsql/commands/ExitCommand.java    | 5 ++++-
 3 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/c420ced1/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a025270..cbd2f8b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -243,6 +243,9 @@ Release 0.9.1 - unreleased
 
   TASKS
 
+    TAJO-967: tajoCli doesn't remeber the last '\q' command.
+    (Jaewoong Jung via jihoon)
+
     TAJO-1272: Change snapshot version from 0.9.1 to 0.10. (hyunsik)
 
     TAJO-1267: Remove LazyTaskScheduler. (DaeMyung Kang via jihoon)

http://git-wip-us.apache.org/repos/asf/tajo/blob/c420ced1/tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoFileHistory.java
----------------------------------------------------------------------
diff --git a/tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoFileHistory.java b/tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoFileHistory.java
index 9b1a5b8..c780a77 100644
--- a/tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoFileHistory.java
+++ b/tajo-client/src/main/java/org/apache/tajo/cli/tsql/TajoFileHistory.java
@@ -19,6 +19,7 @@
 package org.apache.tajo.cli.tsql;
 
 import jline.console.history.FileHistory;
+import org.apache.tajo.cli.tsql.commands.ExitCommand;
 
 import java.io.File;
 import java.io.IOException;
@@ -31,7 +32,10 @@ public class TajoFileHistory extends FileHistory {
 
   @Override
   public void add(CharSequence item) {
-    // TODO: Filter out the quit command. Users wouldn't want it in the history.
+    // Don't store an exit command. Most users wouldn't want it.
+    if (item.equals(ExitCommand.COMMAND_STRING)) {
+      return;
+    }
     super.add(item);
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/c420ced1/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/ExitCommand.java
----------------------------------------------------------------------
diff --git a/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/ExitCommand.java
b/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/ExitCommand.java
index 499e92a..d882b2f 100644
--- a/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/ExitCommand.java
+++ b/tajo-client/src/main/java/org/apache/tajo/cli/tsql/commands/ExitCommand.java
@@ -22,13 +22,16 @@ import org.apache.tajo.cli.tsql.TajoCli;
 
 public class ExitCommand extends TajoShellCommand {
 
+  // Sharing the exit command string publicly to filter it out from the command history.
+  public static final String COMMAND_STRING = "\\q";
+
   public ExitCommand(TajoCli.TajoCliContext context) {
     super(context);
   }
 
   @Override
   public String getCommand() {
-    return "\\q";
+    return COMMAND_STRING;
   }
 
   @Override


Mime
View raw message