falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject falcon git commit: FALCON-1963 Falcon CLI should provide detailed hints if the user's command is invalid
Date Mon, 23 May 2016 19:19:38 GMT
Repository: falcon
Updated Branches:
  refs/heads/master b53cc7090 -> d59ff0d1b


FALCON-1963 Falcon CLI should provide detailed hints if the user's command is invalid

Author: yzheng-hortonworks <yzheng@hortonworks.com>

Reviewers: "Balu Vellanki <balu@apache.org>"

Closes #147 from yzheng-hortonworks/FALCON-1963


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

Branch: refs/heads/master
Commit: d59ff0d1bb5954ba438958fd3fc4343dcedc29a7
Parents: b53cc70
Author: yzheng-hortonworks <yzheng@hortonworks.com>
Authored: Mon May 23 12:19:31 2016 -0700
Committer: bvellanki <bvellanki@hortonworks.com>
Committed: Mon May 23 12:19:31 2016 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/falcon/cli/FalconAdminCLI.java   | 10 ++++++----
 cli/src/main/java/org/apache/falcon/cli/FalconCLI.java    |  3 ++-
 .../main/java/org/apache/falcon/cli/FalconEntityCLI.java  |  4 +++-
 .../java/org/apache/falcon/cli/FalconExtensionCLI.java    |  5 ++++-
 .../java/org/apache/falcon/cli/FalconInstanceCLI.java     |  4 +++-
 .../java/org/apache/falcon/cli/FalconMetadataCLI.java     |  4 +++-
 6 files changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/d59ff0d1/cli/src/main/java/org/apache/falcon/cli/FalconAdminCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconAdminCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconAdminCLI.java
index 84439b9..e8ea06b 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconAdminCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconAdminCLI.java
@@ -83,13 +83,11 @@ public class FalconAdminCLI extends FalconCLI {
 
         String doAsUser = commandLine.getOptionValue(FalconCLIConstants.DO_AS_OPT);
 
+        int exitValue = 0;
         if (optionsList.contains(STACK_OPTION)) {
             result = client.getThreadDump(doAsUser);
             OUT.get().println(result);
-        }
-
-        int exitValue = 0;
-        if (optionsList.contains(FalconCLIConstants.STATUS_OPT)) {
+        } else if (optionsList.contains(FalconCLIConstants.STATUS_OPT)) {
             try {
                 int status = client.getStatus(doAsUser);
                 if (status != 200) {
@@ -118,6 +116,10 @@ public class FalconAdminCLI extends FalconCLI {
             }
         } else if (optionsList.contains(FalconCLIConstants.HELP_CMD)) {
             OUT.get().println("Falcon Help");
+        } else {
+            throw new FalconCLIException("Invalid/missing admin command. Supported commands
include "
+                    + "status, version, setsafemode, help. "
+                    + "Please refer to Falcon CLI twiki for more details.");
         }
         return exitValue;
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/d59ff0d1/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java
index b6f4290..2977e72 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java
@@ -103,7 +103,8 @@ public class FalconCLI {
         parser.addCommand(FalconCLIConstants.METADATA_CMD, "", "Metadata operations like
list, relations",
                 metadataCLI.createMetadataOptions(), true);
         parser.addCommand(FalconCLIConstants.EXTENSION_CMD, "",
-                "Extension operations like enumerate, definition, describe",
+                "Extension operations like enumerate, definition, describe, list, instances,
"
+                        + "submit, submitAndSchedule, schedule, suspend, resume, delete,
update, validate",
                 extensionCLI.createExtensionOptions(), true);
         parser.addCommand(FalconCLIConstants.VERSION_OPT, "", "show client version", new
Options(), false);
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/d59ff0d1/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java
index 78b2225..11aa2b4 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java
@@ -322,7 +322,9 @@ public class FalconEntityCLI extends FalconCLI {
         } else if (optionsList.contains(FalconCLIConstants.HELP_CMD)) {
             OUT.get().println("Falcon Help");
         } else {
-            throw new FalconCLIException("Invalid command");
+            throw new FalconCLIException("Invalid/missing entity command. Supported commands
include "
+                    + "submit, suspend, resume, delete, status, definition, submitAndSchedule.
"
+                    + "Please refer to Falcon CLI twiki for more details.");
         }
         OUT.get().println(result);
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/d59ff0d1/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
index ecab5f7..393603e 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconExtensionCLI.java
@@ -128,7 +128,10 @@ public class FalconExtensionCLI {
                     commandLine.getOptionValue(FalconCLIConstants.NUM_RESULTS_OPT));
             result = instances != null ? instances.toString() : "No instance (" + jobName
+ ") found.";
         } else {
-            throw new FalconCLIException("Invalid extension command");
+            throw new FalconCLIException("Invalid/missing extension command. Supported commands
include "
+                    + "enumerate, definition, describe, list, instances, submit, submitAndSchedule,
"
+                    + "schedule, suspend, resume, delete, update, validate. "
+                    + "Please refer to Falcon CLI twiki for more details.");
         }
         OUT.get().println(result);
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/d59ff0d1/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java
index 43482b3..3b5d7ca 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java
@@ -297,7 +297,9 @@ public class FalconInstanceCLI extends FalconCLI {
             result = ResponseHelper.getString(client.searchInstances(
                     type, nameSubsequence, tagKeywords, start, end, status, orderBy, offset,
numResults));
         } else {
-            throw new FalconCLIException("Invalid command");
+            throw new FalconCLIException("Invalid/missing instance command. Supported commands
include "
+                    + "running, status, kill, suspend, resume, rerun, logs, search. "
+                    + "Please refer to Falcon CLI twiki for more details.");
         }
 
         OUT.get().println(result);

http://git-wip-us.apache.org/repos/asf/falcon/blob/d59ff0d1/cli/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java
index b3e138f..d8cd124 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconMetadataCLI.java
@@ -188,7 +188,9 @@ public class FalconMetadataCLI extends FalconCLI {
             validateId(id);
             result = client.getEdge(id, doAsUser);
         } else {
-            throw new FalconCLIException("Invalid metadata command");
+            throw new FalconCLIException("Invalid/missing metadata command. Supported commands
include "
+                    + "list, relations, lineage, vertex, vertices, edge, edges. "
+                    + "Please refer to Falcon CLI twiki for more details.");
         }
 
         OUT.get().println(result);


Mime
View raw message