You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2017/03/23 18:41:17 UTC
[1/2] tinkerpop git commit: TINKERPOP-1303 Adds help option to
:remote config command
Repository: tinkerpop
Updated Branches:
refs/heads/tp32 b853a9a18 -> 027433f22
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/tp32
Commit: cf8b6b97eb6fcd5a4f1a11f92da89ef24f8bca81
Parents: 3821792
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Mar 16 11:51:23 2017 -0400
Committer: Stephen Mallette <sp...@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));
[2/2] tinkerpop git commit: Merge branch 'TINKERPOP-1303' into tp32
Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1303' into tp32
Conflicts:
CHANGELOG.asciidoc
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/027433f2
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/027433f2
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/027433f2
Branch: refs/heads/tp32
Commit: 027433f222a3ef716144dca3725a28ca71f86064
Parents: b853a9a cf8b6b9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Mar 23 14:29:19 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Mar 23 14:29:19 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/027433f2/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 8ba4477,dca6f06..b5cba15
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -26,7 -26,7 +26,8 @@@ image::https://raw.githubusercontent.co
TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* De-registered metrics on Gremlin Server shutdown.
+ * 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.