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 2015/05/04 15:46:35 UTC

incubator-tinkerpop git commit: Add an example for how to register a strategy in Gremlin Server.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 6b93fab6a -> 1f2a6ad10


Add an example for how to register a strategy in Gremlin Server.


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

Branch: refs/heads/master
Commit: 1f2a6ad10ae7c924aaf068e82a84856b98d814ca
Parents: 6b93fab
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon May 4 09:46:14 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon May 4 09:46:14 2015 -0400

----------------------------------------------------------------------
 .../conf/gremlin-server-modern-readonly.yaml    | 44 ++++++++++++++++++++
 .../scripts/generate-modern-readonly.groovy     | 24 +++++++++++
 .../server/op/AbstractEvalOpProcessor.java      |  1 +
 3 files changed, 69 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1f2a6ad1/gremlin-server/conf/gremlin-server-modern-readonly.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
new file mode 100644
index 0000000..0797799
--- /dev/null
+++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+host: localhost
+port: 8182
+threadPoolWorker: 1
+gremlinPool: 8
+scriptEvaluationTimeout: 30000
+serializedResponseTimeout: 30000
+graphs: {
+  graph: conf/tinkergraph-empty.properties}
+plugins:
+  - tinkerpop.tinkergraph
+scriptEngines: {
+  gremlin-groovy: {
+    imports: [java.lang.Math],
+    staticImports: [java.lang.Math.PI],
+    scripts: [scripts/generate-modern-readonly.groovy]}}
+serializers:
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0 }
+  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
+metrics: {
+  slf4jReporter: {enabled: true, interval: 180000}}
+threadPoolBoss: 1
+maxInitialLineLength: 4096
+maxHeaderSize: 8192
+maxChunkSize: 8192
+maxContentLength: 65536
+maxAccumulationBufferComponents: 1024
+resultIterationBatchSize: 64

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1f2a6ad1/gremlin-server/scripts/generate-modern-readonly.groovy
----------------------------------------------------------------------
diff --git a/gremlin-server/scripts/generate-modern-readonly.groovy b/gremlin-server/scripts/generate-modern-readonly.groovy
new file mode 100644
index 0000000..3028217
--- /dev/null
+++ b/gremlin-server/scripts/generate-modern-readonly.groovy
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Generates the modern graph into an "empty" TinkerGraph
+TinkerFactory.generateModern(graph)
+
+// define the default TraversalSource to bind queries to.
+g = graph.traversal(GraphTraversalSource.build().with(ReadOnlyStrategy.instance()))
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1f2a6ad1/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
index e9c5039..1a826bf 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractEvalOpProcessor.java
@@ -159,6 +159,7 @@ public abstract class AbstractEvalOpProcessor implements OpProcessor {
             try {
                 handleIterator(context, itty);
             } catch (Exception te) {
+                // todo: throwing here dumps to handeAsync below but no message is returned to the client!!
                 throw new RuntimeException(te);
             }
         }, executor);