tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [01/21] tinkerpop git commit: TINKERPOP-1303 Adds help option to :remote config command [Forced Update!]
Date Thu, 23 Mar 2017 22:01:04 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1642 f1f656377 -> f02e4be8a (forced update)


TINKERPOP-1303 Adds help option to :remote config command


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

Branch: refs/heads/TINKERPOP-1642
Commit: cf8b6b97eb6fcd5a4f1a11f92da89ef24f8bca81
Parents: 3821792
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Thu Mar 16 11:51:23 2017 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Mar 16 11:51:23 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                            | 1 +
 .../gremlin/console/jsr223/GephiRemoteAcceptor.groovy         | 5 ++++-
 .../gremlin/console/plugin/GephiRemoteAcceptor.groovy         | 5 ++++-
 .../gremlin/console/groovy/plugin/DriverRemoteAcceptor.java   | 7 +++++--
 .../gremlin/console/jsr223/DriverRemoteAcceptor.java          | 7 +++++--
 .../gremlin/hadoop/groovy/plugin/HadoopRemoteAcceptor.java    | 4 ++++
 .../tinkerpop/gremlin/hadoop/jsr223/HadoopRemoteAcceptor.java | 4 ++++
 7 files changed, 27 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf8b6b97/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a77991e..dca6f06 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added "help" command option on `:remote config` for plugins that support that feature in
the Gremlin Console.
 * Added various metrics to the `GremlinGroovyScriptEngine` around script compilation and
exposed them in Gremlin Server.
 * Moved the `caffeine` dependency down to `gremlin-groovy` and out of `gremlin-server`.
 * Improved script compilation in `GremlinGroovyScriptEngine to use better caching, log long
compile times and prevent failed compilations from recompiling on future requests.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf8b6b97/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
index 4d023dd..28cd85f 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiRemoteAcceptor.groovy
@@ -99,9 +99,12 @@ class GephiRemoteAcceptor implements RemoteAcceptor {
 
     @Override
     Object configure(final List<String> args) throws RemoteException {
-        if (args.size() < 2)
+        if (args.size() < 2 && args[0] != "help")
             throw new RemoteException("Invalid config arguments - check syntax")
 
+        if (args[0] == "help")
+            return ":remote config [host <host>|port <port>|workspace <name>|stepDelay
<ms>|startRGBColor <0.0,0.0,0.0>|colorToFade [r|g|b]|colorFadeRate <0.0>|sizeDecrementRate
<0.0>|startSize <0.0>|visualTraversal <graph>|help]"
+
         if (args[0] == "host")
             host = args[1]
         else if (args[0] == "port") {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf8b6b97/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiRemoteAcceptor.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiRemoteAcceptor.groovy
b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiRemoteAcceptor.groovy
index 902a479..37a7604 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiRemoteAcceptor.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiRemoteAcceptor.groovy
@@ -104,9 +104,12 @@ class GephiRemoteAcceptor implements RemoteAcceptor {
 
     @Override
     Object configure(final List<String> args) throws RemoteException {
-        if (args.size() < 2)
+        if (args.size() < 2 && args[0] != "help")
             throw new RemoteException("Invalid config arguments - check syntax")
 
+        if (args[0] == "help")
+            return ":remote config [host <host>|port <port>|workspace <name>|stepDelay
<ms>|startRGBColor <0.0,0.0,0.0>|colorToFade [r|g|b]|colorFadeRate <0.0>|sizeDecrementRate
<0.0>|startSize <0.0>|visualTraversal <graph>|help]"
+
         if (args[0] == "host")
             host = args[1]
         else if (args[0] == "port") {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf8b6b97/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
index 80e8194..a6a2ffc 100644
--- a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
+++ b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/groovy/plugin/DriverRemoteAcceptor.java
@@ -75,7 +75,8 @@ public class DriverRemoteAcceptor implements RemoteAcceptor {
     private static final String TOKEN_ALIAS = "alias";
     private static final String TOKEN_SESSION = "session";
     private static final String TOKEN_SESSION_MANAGED = "session-managed";
-    private static final List<String> POSSIBLE_TOKENS = Arrays.asList(TOKEN_TIMEOUT,
TOKEN_ALIAS);
+    private static final String TOKEN_HELP = "help";
+    private static final List<String> POSSIBLE_TOKENS = Arrays.asList(TOKEN_TIMEOUT,
TOKEN_ALIAS, TOKEN_HELP);
 
     private final Groovysh shell;
 
@@ -117,7 +118,9 @@ public class DriverRemoteAcceptor implements RemoteAcceptor {
 
         final List<String> arguments = args.subList(1, args.size());
 
-        if (option.equals(TOKEN_TIMEOUT)) {
+        if (option.equals(TOKEN_HELP)) {
+            return ":remote config [timeout [<ms>|none]|alias [reset|show|<alias>
<actual>]|help]";
+        } else if (option.equals(TOKEN_TIMEOUT)) {
             final String errorMessage = "The timeout option expects a positive integer representing
milliseconds or 'none' as an argument";
             if (arguments.size() != 1) throw new RemoteException(errorMessage);
             try {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf8b6b97/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java
b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java
index aa02606..51272ba 100644
--- a/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java
+++ b/gremlin-console/src/main/java/org/apache/tinkerpop/gremlin/console/jsr223/DriverRemoteAcceptor.java
@@ -73,7 +73,8 @@ public class DriverRemoteAcceptor implements RemoteAcceptor {
     private static final String TOKEN_ALIAS = "alias";
     private static final String TOKEN_SESSION = "session";
     private static final String TOKEN_SESSION_MANAGED = "session-managed";
-    private static final List<String> POSSIBLE_TOKENS = Arrays.asList(TOKEN_TIMEOUT,
TOKEN_ALIAS);
+    private static final String TOKEN_HELP = "help";
+    private static final List<String> POSSIBLE_TOKENS = Arrays.asList(TOKEN_TIMEOUT,
TOKEN_ALIAS, TOKEN_HELP);
 
     private final GremlinShellEnvironment shellEnvironment;
 
@@ -115,7 +116,9 @@ public class DriverRemoteAcceptor implements RemoteAcceptor {
 
         final List<String> arguments = args.subList(1, args.size());
 
-        if (option.equals(TOKEN_TIMEOUT)) {
+        if (option.equals(TOKEN_HELP)) {
+            return ":remote config [timeout [<ms>|none]|alias [reset|show|<alias>
<actual>]|help]";
+        } else if (option.equals(TOKEN_TIMEOUT)) {
             final String errorMessage = "The timeout option expects a positive integer representing
milliseconds or 'none' as an argument";
             if (arguments.size() != 1) throw new RemoteException(errorMessage);
             try {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf8b6b97/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopRemoteAcceptor.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopRemoteAcceptor.java
b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopRemoteAcceptor.java
index acae442..1d28a48 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopRemoteAcceptor.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopRemoteAcceptor.java
@@ -46,6 +46,7 @@ public final class HadoopRemoteAcceptor implements RemoteAcceptor {
 
     private static final String USE_SUGAR = "useSugar";
     private static final String USE_TRAVERSAL_SOURCE = "useTraversalSource";
+    private static final String HELP = "help";
     private static final String SPACE = " ";
 
     private HadoopGraph hadoopGraph;
@@ -76,6 +77,9 @@ public final class HadoopRemoteAcceptor implements RemoteAcceptor {
 
     @Override
     public Object configure(final List<String> args) throws RemoteException {
+        if (args.size() == 1 && args.get(0).equals(HELP))
+            return ":remote config [useSugar [true|false]|useTraversalSource <traversalSourceName>|help]";
+
         for (int i = 0; i < args.size(); i = i + 2) {
             if (args.get(i).equals(USE_SUGAR))
                 this.useSugar = Boolean.valueOf(args.get(i + 1));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cf8b6b97/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/jsr223/HadoopRemoteAcceptor.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/jsr223/HadoopRemoteAcceptor.java
b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/jsr223/HadoopRemoteAcceptor.java
index 1fcdab1..9b0abf2 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/jsr223/HadoopRemoteAcceptor.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/jsr223/HadoopRemoteAcceptor.java
@@ -44,6 +44,7 @@ public final class HadoopRemoteAcceptor implements RemoteAcceptor {
 
     private static final String USE_SUGAR = "useSugar";
     private static final String USE_TRAVERSAL_SOURCE = "useTraversalSource";
+    private static final String HELP = "help";
     private static final String SPACE = " ";
 
     private HadoopGraph hadoopGraph;
@@ -74,6 +75,9 @@ public final class HadoopRemoteAcceptor implements RemoteAcceptor {
 
     @Override
     public Object configure(final List<String> args) throws RemoteException {
+        if (args.size() == 1 && args.get(0).equals(HELP))
+            return ":remote config [useSugar [true|false]|useTraversalSource <traversalSourceName>|help]";
+
         for (int i = 0; i < args.size(); i = i + 2) {
             if (args.get(i).equals(USE_SUGAR))
                 this.useSugar = Boolean.valueOf(args.get(i + 1));


Mime
View raw message