Author: dkuppitz
Date: Mon Mar 20 18:29:47 2017
New Revision: 1787825
URL: http://svn.apache.org/viewvc?rev=1787825=rev
Log:
Deploy TinkerPop homepage
Modified:
tinkerpop/site/providers.html
Modified: tinkerpop/site/providers.html
URL:
http://svn.apache.org/viewvc/tinkerpop/site/providers.html?rev=1787825=1787824=1787825=diff
==
--- tinkerpop/site/providers.html (original)
+++ tinkerpop/site/providers.html Mon Mar 20 18:29:47 2017
@@ -279,7 +279,7 @@ limitations under the License.
https://grakn.ai/;>
-https://grakn.ai/;>Grakn is a distributed
knowledge graph that brings knowledge ontologies and transactional data
together to enable intelligent querying of data. Querying is performed through
the language: Graql, a declarative, knowledge-oriented graph query language for
retrieving explicitly stored and implicitly derived information, as well as to
perform graph analytics and automated reasoning.
+https://grakn.ai/;>GRAKN.AI is a distributed
knowledge graph that brings knowledge ontologies and transactional data
together to enable intelligent querying of data. Querying is performed through
the language: Graql, a declarative, knowledge-oriented graph query language for
retrieving explicitly stored and implicitly derived information, as well as to
perform graph analytics and automated reasoning.
http://www.ibm.com/analytics/us/en/technology/cloud-data-services/graph/;>
@@ -502,7 +502,8 @@ WHERE(Created.by(Friends.of("gremlin")))
});
-
+
+
Apache TinkerPop, TinkerPop, Apache,
Apache feather logo, and Apache TinkerPop project logo are either registered
trademarks or trademarks of http://www.apache.org/;>The Apache
Software Foundation in the United States and other countries.
Added ScopingStrategy which does a single TraversalHelper.getLabels() call and
recurssively tells where() and select() steps the path labels accessed by the
Traversal.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d130cc81
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d130cc81
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d130cc81
Branch: refs/heads/TINKERPOP-1642
Commit: d130cc81678d258256a50eb65696c7846e0c02a4
Parents: d3bb05b
Author: Marko A. Rodriguez
Authored: Fri Mar 3 09:27:58 2017 -0700
Committer: Stephen Mallette
Committed: Mon Mar 20 14:08:31 2017 -0400
--
CHANGELOG.asciidoc | 1 +
.../process/traversal/TraversalStrategies.java | 2 +
.../gremlin/process/traversal/step/Scoping.java | 10
.../step/filter/WherePredicateStep.java | 11 +++-
.../step/filter/WhereTraversalStep.java | 16 --
.../traversal/step/map/SelectOneStep.java | 21 ++--
.../process/traversal/step/map/SelectStep.java | 15 --
.../strategy/finalization/ScopingStrategy.java | 57
8 files changed, 121 insertions(+), 12 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d130cc81/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a77991e..86f30f7 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -34,6 +34,7 @@ TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
* Failed scripts will not be recompiled.
* Scripts that take over 5 seconds to compile are logged as a warning.
* Fixed an `NullPointerException` in `GraphMLReader` that occurred when an
`` didn't have an ID field and the base graph supported ID assignment.
+* Added `ScopingStrategy` which will computer and provide all `Scoping` steps
with the path labels of the global `Traversal`.
* Split `ComputerVerificationStrategy` into two strategies:
`ComputerVerificationStrategy` and `ComputerFinalizationStrategy`.
* Removed `HasTest.g_V_hasId_compilationEquality` from process test suite as
it makes too many assumptions about provider compilation.
* Deprecated `CustomizerProvider` infrastructure.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d130cc81/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index 63ae23f..0ddae91 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -24,6 +24,7 @@ import
org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimiza
import
org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization.MessagePassingReductionStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy;
+import
org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ScopingStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy;
@@ -214,6 +215,7 @@ public interface TraversalStrategies extends Serializable,
Cloneable {
RangeByIsCountStrategy.instance(),
PathRetractionStrategy.instance(),
LazyBarrierStrategy.instance(),
+ScopingStrategy.instance(),
ProfileStrategy.instance(),
StandardVerificationStrategy.instance());
GRAPH_CACHE.put(Graph.class, graphStrategies);
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d130cc81/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
index 8c27405..68655e4 100644
---
TINKERPOP-1644 Added metrics to GremlinGroovyScriptEngine
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8ffa5af6
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8ffa5af6
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8ffa5af6
Branch: refs/heads/TINKERPOP-1642
Commit: 8ffa5af6ff56933c1955e88e8aa42c06cb69162b
Parents: a06072b
Author: Stephen Mallette
Authored: Thu Mar 9 10:30:17 2017 -0500
Committer: Stephen Mallette
Committed: Fri Mar 10 11:13:03 2017 -0500
--
CHANGELOG.asciidoc | 2 +
.../jsr223/GremlinGroovyScriptEngine.java | 122 ++-
...roovyScriptEngineCompilationOptionsTest.java | 8 +-
.../jsr223/GremlinGroovyScriptEngineTest.java | 70 ++-
4 files changed, 193 insertions(+), 9 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ffa5af6/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 9c3313e..3729271 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,7 +26,9 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
~~~
+* Added various metrics to the `GremlinGroovyScriptEngine` around script
compilation.
* 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.
* Script compilation is synchronised.
* Script compilation times are placed in to logs.
* Failed scripts will not be recompiled.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ffa5af6/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
--
diff --git
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
index 3bcb06c..0ed8d84 100644
---
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
+++
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
@@ -164,7 +164,10 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
/**
* Script to generated Class map.
*/
-private final LoadingCache classMap =
Caffeine.newBuilder().softValues().build(new CacheLoader() {
+private final LoadingCache classMap =
Caffeine.newBuilder().
+softValues().
+recordStats().
+build(new CacheLoader() {
@Override
public Future load(final String script) throws Exception {
final long start = System.currentTimeMillis();
@@ -175,6 +178,7 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
} catch (CompilationFailedException e) {
final long finish = System.currentTimeMillis();
log.error("Script compilation FAILED {} took {}ms {}",
script, finish - start, e);
+failedCompilationCount.incrementAndGet();
throw e;
} finally {
final long time = System.currentTimeMillis() - start;
@@ -208,6 +212,13 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
private final AtomicLong longRunCompilationCount = new AtomicLong(0L);
/**
+ * A counter for the instance that tracks the number of failed
compilations. Note that the failures need to be
+ * tracked outside of cache failure load stats because the loading
mechanism will always successfully return
+ * a future and won't trigger a failure.
+ */
+private final AtomicLong failedCompilationCount = new AtomicLong(0L);
+
+/**
* The list of loaded plugins for the console.
*/
private final Set loadedPlugins = new HashSet<>();
@@ -589,10 +600,117 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
/**
* Gets the number of compilations that extended beyond the {@link
#expectedCompilationTime}.
*/
-public long getLongRunCompilationCount() {
+public long getClassCacheLongRunCompilationCount() {
return longRunCompilationCount.longValue();
}
+/**
+ * Gets
TINKERPOP-1644 Improve script compilation syncronisation
Script compilation is synchronised.
Script compilation times are placed in to logs.
Failed scripts will not be recompiled.
Scripts that take over 5 seconds to compile are logged as a warning.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/13c93cab
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/13c93cab
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/13c93cab
Branch: refs/heads/TINKERPOP-1642
Commit: 13c93cabac51112a73f592e0fba12e515f643522
Parents: 60a3fb3
Author: BrynCooke
Authored: Thu Mar 2 19:07:28 2017 +
Committer: Stephen Mallette
Committed: Fri Mar 10 11:12:36 2017 -0500
--
CHANGELOG.asciidoc | 4 ++
.../jsr223/GremlinGroovyScriptEngine.java | 57 ++--
2 files changed, 56 insertions(+), 5 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/13c93cab/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 6861d57..24e5e9c 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,10 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
~~~
+* Script compilation is synchronised.
+* Script compilation times are placed in to logs.
+* Failed scripts will not be recompiled.
+* Scripts that take over 5 seconds to compile are logged as a warning.
* Fixed an `NullPointerException` in `GraphMLReader` that occurred when an
`` didn't have an ID field and the base graph supported ID assignment.
* Split `ComputerVerificationStrategy` into two strategies:
`ComputerVerificationStrategy` and `ComputerFinalizationStrategy`.
* Removed `HasTest.g_V_hasId_compilationEquality` from process test suite as
it makes too many assumptions about provider compilation.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/13c93cab/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
--
diff --git
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
index 1fb2efc..a8365a2 100644
---
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
+++
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
@@ -56,6 +56,8 @@ import org.codehaus.groovy.runtime.InvokerHelper;
import org.codehaus.groovy.runtime.MetaClassHelper;
import org.codehaus.groovy.runtime.MethodClosure;
import org.codehaus.groovy.util.ReferenceBundle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.script.Bindings;
import javax.script.CompiledScript;
@@ -93,6 +95,7 @@ import java.util.stream.Collectors;
public class GremlinGroovyScriptEngine extends GroovyScriptEngineImpl
implements DependencyManager, AutoCloseable, GremlinScriptEngine {
+private static final Logger log =
LoggerFactory.getLogger(GremlinGroovyScriptEngine.class);
/**
* An "internal" key for sandboxing the script engine - technically not
for public use.
*/
@@ -153,6 +156,7 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
* Script to generated Class map.
*/
private ManagedConcurrentValueMap classMap = new
ManagedConcurrentValueMap<>(ReferenceBundle.getSoftBundle());
+private ManagedConcurrentValueMap
failedClassMap = new
ManagedConcurrentValueMap<>(ReferenceBundle.getSoftBundle());
/**
* Global closures map - this is used to simulate a single global
functions namespace
@@ -529,13 +533,56 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
return makeInterface(thiz, clazz);
}
+private Class getScriptClassFromMap(String script) throws
CompilationFailedException {
+CompilationFailedException exception = failedClassMap.get(script);
+if(exception != null) {
+throw exception;
+}
+return classMap.get(script);
+
+}
+
Class getScriptClass(final String script) throws
CompilationFailedException {
-Class clazz = classMap.get(script);
-if (clazz != null) return clazz;
+Class clazz = getScriptClassFromMap(script);
+if (clazz != null) {
+return clazz;
+}
+
TINKERPOP-1644 Docs for new metrics in Gremlin Server
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/37976526
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/37976526
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/37976526
Branch: refs/heads/TINKERPOP-1642
Commit: 37976526f1eac9fd06858f962f979aa98d3e5346
Parents: 9eb248e
Author: Stephen Mallette
Authored: Thu Mar 9 13:35:44 2017 -0500
Committer: Stephen Mallette
Committed: Fri Mar 10 11:13:03 2017 -0500
--
docs/src/reference/gremlin-applications.asciidoc | 5 +
docs/src/upgrade/release-3.2.x-incubating.asciidoc | 10 ++
2 files changed, 15 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/37976526/docs/src/reference/gremlin-applications.asciidoc
--
diff --git a/docs/src/reference/gremlin-applications.asciidoc
b/docs/src/reference/gremlin-applications.asciidoc
index 8e0edc2..37244e0 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1560,6 +1560,11 @@ and standard deviation evaluation times, as well as the
75th, 95th, 98th, 99th a
* `op.traversal` - the number of `Traveral` executions, mean rate, 1, 5, and
15 minute rates, minimum, maximum, median,
mean, and standard deviation evaluation times, as well as the 75th, 95th,
98th, 99th and 99.9th percentile evaluation
times.
+* `engine-name.session.session-id.*` - metrics related to different
`GremlinScriptEngine` instanc configured for
+session-based requests where "engine-name" will be the actual name of the
engine, such as "gremlin-groovy" and
+"session-id" will be the identifier for the session itself.
+* `engine-name.sessionless.*` - metrics related to different
`GremlinScriptEngine` instanc configured for sessionless
+requests where "engine-name" will be the actual name of the engine, such as
"gremlin-groovy".
Best Practices
~~
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/37976526/docs/src/upgrade/release-3.2.x-incubating.asciidoc
--
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 78c276b..d01f58f 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -32,6 +32,16 @@ Please see the
link:https://github.com/apache/tinkerpop/blob/3.2.5/CHANGELOG.asc
Upgrading for Users
~~~
+GremlinScriptEngine Metrics
+^^^
+
+The `GremlinScriptEngine` has a number of new metrics about its cache size and
script compilation times which should
+be helpful in understanding usage problems. As `GremlinScriptEngine` instances
are used in Gremlin Server these metrics
+are naturally exposed as part of the standard
link:http://tinkerpop.apache.org/docs/current/reference/#_metrics[metrics]
+set. Note that metrics are captured for both sessionless requests as well as
for each individual session that is opened.
+
+See: https://issues.apache.org/jira/browse/TINKERPOP-1644[TINKERPOP-1644]
+
Gremlin-Python Driver
^
Gremlin-Python now offers a more complete driver implementation that uses
connection pooling and
TINKERPOP-1504 Added the property key to events for new properties.
Newly added properties triggered "changed" events when using EventStrategy but
the specific key that was newly added was not available in the mutation
listener. The listener would simply report the new value only. After this
change the listener now gets a DetachedVertexPropery/Property with the newly
added key and a null value set.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/06bf620c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/06bf620c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/06bf620c
Branch: refs/heads/TINKERPOP-1642
Commit: 06bf620caf6fda6325512fde704e4b92329fa8fd
Parents: cde8b31
Author: Stephen Mallette
Authored: Wed Mar 15 10:40:09 2017 -0400
Committer: Stephen Mallette
Committed: Wed Mar 15 10:40:09 2017 -0400
--
CHANGELOG.asciidoc | 1 +
.../step/sideEffect/AddPropertyStep.java| 17 +-
.../decoration/EventStrategyProcessTest.java| 474 ++-
3 files changed, 488 insertions(+), 4 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/06bf620c/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index f4eaaa8..90b9f00 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
TinkerPop 3.1.7 (Release Date: NOT OFFICIALLY RELEASED YET)
~~~
+* Fixed `EventStrategy` so that newly added properties trigger events with the
name of the key that was added.
* Drop use of jitpack for the jbcrypt artifact - using the official one in
Maven Central.
[[release-3-1-6]]
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/06bf620c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java
index 7c12c0e..3ccff52 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStep.java
@@ -36,6 +36,8 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
+import
org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexProperty;
import java.util.List;
import java.util.Set;
@@ -91,11 +93,20 @@ public final class AddPropertyStep
extends SideEffectStep
final boolean newProperty = element instanceof Vertex ?
currentProperty == VertexProperty.empty() : currentProperty == Property.empty();
final Event.ElementPropertyChangedEvent evt;
if (element instanceof Vertex)
-evt = new
Event.VertexPropertyChangedEvent(DetachedFactory.detach((Vertex) element,
true), newProperty ? null : DetachedFactory.detach((VertexProperty)
currentProperty, true), value, vertexPropertyKeyValues);
+evt = new
Event.VertexPropertyChangedEvent(DetachedFactory.detach((Vertex) element, true),
+newProperty ?
+new DetachedVertexProperty(null, key, null,
null) :
+DetachedFactory.detach((VertexProperty)
currentProperty, true), value, vertexPropertyKeyValues);
else if (element instanceof Edge)
-evt = new
Event.EdgePropertyChangedEvent(DetachedFactory.detach((Edge) element, true),
newProperty ? null : DetachedFactory.detach(currentProperty), value);
+evt = new
Event.EdgePropertyChangedEvent(DetachedFactory.detach((Edge) element, true),
+newProperty ?
+new DetachedProperty(key, null) :
+DetachedFactory.detach(currentProperty),
value);
else if (element instanceof VertexProperty)
-evt = new
Event.VertexPropertyPropertyChangedEvent(DetachedFactory.detach((VertexProperty)
element, true), newProperty ? null :
TINKERPOP-1642 Cached the Traversal list in Parameters
This leads to a pretty good boost in performance from the prior commit
especially for long chained mutating traversals that add vertices and edges as
there is a 3X improvement in those cases.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/cb4e5024
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/cb4e5024
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/cb4e5024
Branch: refs/heads/TINKERPOP-1642
Commit: cb4e5024400acf64927b299a15e841167cbe2004
Parents: 8621401
Author: Stephen Mallette
Authored: Fri Mar 3 06:47:56 2017 -0500
Committer: Stephen Mallette
Committed: Mon Mar 20 14:07:22 2017 -0400
--
.../process/traversal/step/util/Parameters.java | 59
.../traversal/step/util/ParametersTest.java | 50 +
2 files changed, 87 insertions(+), 22 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/cb4e5024/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
index 67cb2f9..3f0cb7c 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
@@ -26,6 +26,7 @@ import
org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalUtil;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import java.io.Serializable;
import java.util.ArrayList;
@@ -49,9 +50,11 @@ public final class Parameters implements Cloneable,
Serializable {
private Map
TINKERPOP-1644 Updated changelog
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b29ba121
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b29ba121
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b29ba121
Branch: refs/heads/TINKERPOP-1642
Commit: b29ba12109e7e88bc3465d08f6177e5ded17ca59
Parents: 4bdeac4
Author: Stephen Mallette
Authored: Wed Mar 8 16:15:27 2017 -0500
Committer: Stephen Mallette
Committed: Fri Mar 10 11:12:36 2017 -0500
--
CHANGELOG.asciidoc | 1 +
1 file changed, 1 insertion(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b29ba121/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 24e5e9c..9c3313e 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)
~~~
+* Moved the `caffeine` dependency down to `gremlin-groovy` and out of
`gremlin-server`.
* Script compilation is synchronised.
* Script compilation times are placed in to logs.
* Failed scripts will not be recompiled.
Added some additional notes on local() vs flatMap()
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7b234b46
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7b234b46
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7b234b46
Branch: refs/heads/TINKERPOP-1642
Commit: 7b234b468149d729ad9367029499fdf155cd5d46
Parents: 99ad76d
Author: Stephen Mallette
Authored: Wed Mar 15 13:54:09 2017 -0400
Committer: Stephen Mallette
Committed: Wed Mar 15 13:54:09 2017 -0400
--
docs/src/reference/the-traversal.asciidoc | 11 +++
1 file changed, 11 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7b234b46/docs/src/reference/the-traversal.asciidoc
--
diff --git a/docs/src/reference/the-traversal.asciidoc
b/docs/src/reference/the-traversal.asciidoc
index eb93950..84887bc 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -949,6 +949,17 @@ The two traversals above look nearly identical save the
inclusion of `local()` w
in a object-local traversal. As such, the `order().by()` and the `limit()`
refer to a particular object, not to the
stream as a whole.
+Local Step is quite similar in functionality to <> where it can often be confused.
+`local()` propagates the traverser through the internal traversal as is
without splitting/cloning it. Thus, its
+a âglobal traversalâ with local processing. Its use is subtle and
primarily finds application in compilation
+optimizations (i.e. when writing `TraversalStrategy` implementations. As
another example consider:
+
+[gremlin-groovy,modern]
+
+g.V().both().barrier().flatMap(groupCount().by("name"))
+g.V().both().barrier().local(groupCount().by("name"))
+
+
WARNING: The anonymous traversal of `local()` processes the current object
"locally." In OLAP, where the atomic unit
of computing is the vertex and its local "star graph," it is important that
the anonymous traversal does not leave
the confines of the vertex's star graph. In other words, it can not traverse
to an adjacent vertex's properties or edges.
TINKERPOP-1644 Added some docs for CompilationOptionsCustomizerProvider
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d7c2a221
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d7c2a221
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d7c2a221
Branch: refs/heads/TINKERPOP-1642
Commit: d7c2a221ecb56442a01ca2e5cf539b011ac05f94
Parents: 33416dd
Author: Stephen Mallette
Authored: Tue Mar 14 15:26:46 2017 -0400
Committer: Stephen Mallette
Committed: Tue Mar 14 15:26:46 2017 -0400
--
docs/src/reference/gremlin-applications.asciidoc | 2 ++
1 file changed, 2 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d7c2a221/docs/src/reference/gremlin-applications.asciidoc
--
diff --git a/docs/src/reference/gremlin-applications.asciidoc
b/docs/src/reference/gremlin-applications.asciidoc
index 884ce04..3a2c446 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1336,6 +1336,7 @@ There are a number of pre-packaged `CustomizerProvider`
implementations:
|=
|Customizer |Description
|`CompileStaticCustomizerProvider` |Applies `CompileStatic` annotations to
incoming scripts thus removing dynamic dispatch. More information about static
compilation can be found in the
link:http://docs.groovy-lang.org/latest/html/documentation/#_static_compilation[Groovy
Documentation]. It is possible to configure this `CustomizerProvider` by
specifying a comma separated list of
link:http://docs.groovy-lang.org/latest/html/documentation/#Typecheckingextensions-Workingwithextensions[type
checking extensions] that can have the effect of securing calls to various
methods.
+|`CompilationOptionsCustomizerProvider` |The amount of time a script is
allowed to compile before a warning message is sent to the logs.
|`ConfigurationCustomizerProvider` |Allows configuration of the Groovy
`CompilerConfiguration` object by taking a `Map` of key/value pairs where the
"key" is a property to set on the `CompilerConfiguration`.
|`ThreadInterruptCustomizerProvider` |Injects checks for thread interruption,
thus allowing the thread to potentially respect calls to `Thread.interrupt()`
|`TimedInterruptCustomizerProvider` |Injects checks into loops to interrupt
them if they exceed the configured timeout in milliseconds.
@@ -1354,6 +1355,7 @@ scriptEngines: {
compilerCustomizerProviders: {
"org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ThreadInterruptCustomizerProvider":[],
"org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.TimedInterruptCustomizerProvider":[1],
+
"org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompilationOptionsCustomizerProvider":[8000],
"org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompileStaticCustomizerProvider":["org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension"]
NOTE: The above configuration could also use the
`TypeCheckedCustomizerProvider` in place of the
CTR: ExecutorServices in TinkerGraphComputer and SparkGraphComputer can only be
used, but
they were not shut down after being used. This prevented applications from
shutting down
properly as there were still threads lingering. I'm not sure about
GiraphGraphComputer as
it uses a slightly different model.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/df285d38
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/df285d38
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/df285d38
Branch: refs/heads/TINKERPOP-1642
Commit: df285d38027d46f5dcabf4ce5831b6028624bc9f
Parents: 258dccb
Author: Daniel Kuppitz
Authored: Wed Mar 8 22:20:33 2017 +0100
Committer: Daniel Kuppitz
Committed: Wed Mar 8 22:20:33 2017 +0100
--
.../gremlin/spark/process/computer/SparkGraphComputer.java | 4 +++-
.../tinkergraph/process/computer/TinkerGraphComputer.java| 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/df285d38/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
--
diff --git
a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
index 6d2742b..00a2e46 100644
---
a/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
+++
b/spark-gremlin/src/main/java/org/apache/tinkerpop/gremlin/spark/process/computer/SparkGraphComputer.java
@@ -131,7 +131,7 @@ public final class SparkGraphComputer extends
AbstractHadoopGraphComputer {
private Future submitWithExecutor(Executor exec) {
// create the completable future
-return computerService.submit(() -> {
+final Future result = computerService.submit(() -> {
final long startTime = System.currentTimeMillis();
// apache and hadoop configurations that are used throughout the
graph computer computation
final org.apache.commons.configuration.Configuration
graphComputerConfiguration = new HadoopConfiguration(this.sparkConfiguration);
@@ -378,6 +378,8 @@ public final class SparkGraphComputer extends
AbstractHadoopGraphComputer {
Spark.close();
}
});
+computerService.shutdown();
+return result;
}
/
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/df285d38/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
--
diff --git
a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
index 2abce9a..bf6f594 100644
---
a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
+++
b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/computer/TinkerGraphComputer.java
@@ -154,7 +154,7 @@ public final class TinkerGraphComputer implements
GraphComputer {
// initialize the memory
this.memory = new TinkerMemory(this.vertexProgram, this.mapReducers);
-return computerService.submit(() -> {
+final Future result = computerService.submit(() -> {
final long time = System.currentTimeMillis();
final TinkerGraphComputerView view =
TinkerHelper.createGraphComputerView(this.graph, this.graphFilter, null !=
this.vertexProgram ? this.vertexProgram.getVertexComputeKeys() :
Collections.emptySet());
final TinkerWorkerPool workers = new TinkerWorkerPool(this.graph,
this.memory, this.workers);
@@ -246,6 +246,8 @@ public final class TinkerGraphComputer implements
GraphComputer {
workers.close();
}
});
+this.computerService.shutdown();
+return result;
}
@Override
TINKERPOP-1644 Fixed spelling errors
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/85c53305
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/85c53305
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/85c53305
Branch: refs/heads/TINKERPOP-1642
Commit: 85c53305f83b9915538289bcb7de596620b76d6c
Parents: 33db1a3
Author: Stephen Mallette
Authored: Tue Mar 14 12:30:14 2017 -0400
Committer: Stephen Mallette
Committed: Tue Mar 14 12:30:14 2017 -0400
--
docs/src/reference/gremlin-applications.asciidoc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/85c53305/docs/src/reference/gremlin-applications.asciidoc
--
diff --git a/docs/src/reference/gremlin-applications.asciidoc
b/docs/src/reference/gremlin-applications.asciidoc
index 37244e0..884ce04 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1560,10 +1560,10 @@ and standard deviation evaluation times, as well as the
75th, 95th, 98th, 99th a
* `op.traversal` - the number of `Traveral` executions, mean rate, 1, 5, and
15 minute rates, minimum, maximum, median,
mean, and standard deviation evaluation times, as well as the 75th, 95th,
98th, 99th and 99.9th percentile evaluation
times.
-* `engine-name.session.session-id.*` - metrics related to different
`GremlinScriptEngine` instanc configured for
+* `engine-name.session.session-id.*` - metrics related to different
`GremlinScriptEngine` instances configured for
session-based requests where "engine-name" will be the actual name of the
engine, such as "gremlin-groovy" and
"session-id" will be the identifier for the session itself.
-* `engine-name.sessionless.*` - metrics related to different
`GremlinScriptEngine` instanc configured for sessionless
+* `engine-name.sessionless.*` - metrics related to different
`GremlinScriptEngine` instances configured for sessionless
requests where "engine-name" will be the actual name of the engine, such as
"gremlin-groovy".
Best Practices
TINKERPOP-1642 Removed some extra iteration in Parameters.getTraversals()
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/149a6f8b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/149a6f8b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/149a6f8b
Branch: refs/heads/TINKERPOP-1642
Commit: 149a6f8bbb98360357d6099f8324ec4c53ba622a
Parents: 5061c47
Author: Stephen Mallette
Authored: Fri Mar 10 12:31:38 2017 -0500
Committer: Stephen Mallette
Committed: Mon Mar 20 14:09:02 2017 -0400
--
.../gremlin/process/traversal/step/util/Parameters.java | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/149a6f8b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
index 6640e87..93cf1f8 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
@@ -54,7 +54,7 @@ public final class Parameters implements Cloneable,
Serializable {
* {@link #set(Object...)} because when the parameter map is large the
cost of iterating it repeatedly on the
* high number of calls to {@link #getTraversals()} and {@link
#integrateTraversals(TraversalParent)} is great.
*/
-private List traversals = new ArrayList<>();
+private List traversals = new ArrayList<>();
/**
* Checks for existence of key in parameter set.
@@ -203,11 +203,7 @@ public final class Parameters implements Cloneable,
Serializable {
*/
public List> getTraversals() {
// stupid generics - just need to return "traversals"
-final List> result = new ArrayList<>();
-for (Traversal.Admin t : traversals) {
-result.add(t);
-}
-return result;
+return (List>) (Object) traversals;
}
public Parameters clone() {
TINKERPOP-1644 Made the "counter" in GremlinGroovyScriptEngine static
It seems that this field should be static and shared across all instances as
the script name seems to share space with other GroovyClassLoaders. Not sure
what would happen in the case of collision, but there doesn't seem to be much
harm in ensuring better uniqueness. This counter wasn't used for tracking the
number of scripts actually processed or anything so it should be ok to make
this change without fear of breaking anything.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a06072b0
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a06072b0
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a06072b0
Branch: refs/heads/TINKERPOP-1642
Commit: a06072b0502f9b42fee4c68dba554b4991406c36
Parents: b29ba12
Author: Stephen Mallette
Authored: Wed Mar 8 16:17:40 2017 -0500
Committer: Stephen Mallette
Committed: Fri Mar 10 11:12:37 2017 -0500
--
.../groovy/jsr223/GremlinGroovyScriptEngine.java| 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a06072b0/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
--
diff --git
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
index 5168130..3bcb06c 100644
---
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
+++
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
@@ -196,7 +196,15 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
*/
private final ManagedConcurrentValueMap globalClosures =
new ManagedConcurrentValueMap<>(ReferenceBundle.getHardBundle());
-private final AtomicLong counter = new AtomicLong(0L);
+/**
+ * Ensures unique script names across all instances.
+ */
+private final static AtomicLong scriptNameCounter = new AtomicLong(0L);
+
+/**
+ * A counter for the instance that tracks the number of warnings issued
during script compilations that exceeded
+ * the {@link #expectedCompilationTime}.
+ */
private final AtomicLong longRunCompilationCount = new AtomicLong(0L);
/**
@@ -799,7 +807,7 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
}
private synchronized String generateScriptName() {
-return SCRIPT + counter.incrementAndGet() + DOT_GROOVY;
+return SCRIPT + scriptNameCounter.incrementAndGet() + DOT_GROOVY;
}
@SuppressWarnings("unchecked")
Removed references to gremlin-groovy-test as it is deprecated
There really isn't any point to continuing to encourage providers to implement
gremlin-groovy-test on the 3.2.x line as it is deprecated. It has already been
removed in 3.3.x. CTR
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/591a65a3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/591a65a3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/591a65a3
Branch: refs/heads/TINKERPOP-1642
Commit: 591a65a3ce3a06ac0919f77117622fa44a0456b7
Parents: a8acd67
Author: Stephen Mallette
Authored: Tue Mar 7 07:00:26 2017 -0500
Committer: Stephen Mallette
Committed: Tue Mar 7 07:00:26 2017 -0500
--
docs/src/dev/provider/index.asciidoc | 33 +++
1 file changed, 7 insertions(+), 26 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/591a65a3/docs/src/dev/provider/index.asciidoc
--
diff --git a/docs/src/dev/provider/index.asciidoc
b/docs/src/dev/provider/index.asciidoc
index 71d071f..3988ee9 100644
--- a/docs/src/dev/provider/index.asciidoc
+++ b/docs/src/dev/provider/index.asciidoc
@@ -458,20 +458,16 @@ Validating with Gremlin-Test
image:gremlin-edumacated.png[width=225]
[source,xml]
+
org.apache.tinkerpop
gremlin-test
x.y.z
-
- org.apache.tinkerpop
- gremlin-groovy-test
- x.y.z
-
+
-The operational semantics of any OLTP or OLAP implementation are validated by
`gremlin-test` and functional
-interoperability with the Groovy environment is ensured by
`gremlin-groovy-test`. To implement these tests, provide
-test case implementations as shown below, where `XXX` below denotes the name
of the graph implementation (e.g.
+The operational semantics of any OLTP or OLAP implementation are validated by
`gremlin-test`. To implement these tests,
+provide test case implementations as shown below, where `XXX` below denotes
the name of the graph implementation (e.g.
TinkerGraph, Neo4jGraph, HadoopGraph, etc.).
[source,java]
@@ -489,22 +485,11 @@ public class XXXProcessComputerTest {}
@RunWith(ProcessStandardSuite.class)
@GraphProviderClass(provider = XXXGraphProvider.class, graph = XXXGraph.class)
public class XXXProcessStandardTest {}
-
-@RunWith(GroovyEnvironmentSuite.class)
-@GraphProviderClass(provider = XXXProvider.class, graph = TinkerGraph.class)
-public class XXXGroovyEnvironmentTest {}
-
-@RunWith(GroovyProcessStandardSuite.class)
-@GraphProviderClass(provider = XXXGraphProvider.class, graph =
TinkerGraph.class)
-public class XXXGroovyProcessStandardTest {}
-
-@RunWith(GroovyProcessComputerSuite.class)
-@GraphProviderClass(provider = XXXGraphComputerProvider.class, graph =
TinkerGraph.class)
-public class XXXGroovyProcessComputerTest {}
The above set of tests represent the minimum test suite set to implement.
There are other "integration" and
-"performance" tests that should be considered optional. Implementing those
tests requires the same pattern as shown above.
+"performance" tests that should be considered optional. Implementing those
tests requires the same pattern as shown
+above.
IMPORTANT: It is as important to look at "ignored" tests as it is to look at
ones that fail. The `gremlin-test`
suite utilizes the `Feature` implementation exposed by the `Graph` to
determine which tests to execute. If a test
@@ -526,9 +511,6 @@ annotation. See the `TinkerGraph` implementation below as
an example:
@Graph.OptIn(Graph.OptIn.SUITE_STRUCTURE_STANDARD)
@Graph.OptIn(Graph.OptIn.SUITE_PROCESS_STANDARD)
@Graph.OptIn(Graph.OptIn.SUITE_PROCESS_COMPUTER)
-@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_STANDARD)
-@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_COMPUTER)
-@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT)
public class TinkerGraph implements Graph {
@@ -567,8 +549,7 @@ public class HadoopGraph implements Graph {
The above examples show how to ignore individual tests. It is also possible
to:
* Ignore an entire test case (i.e. all the methods within the test) by setting
the `method` to "*".
-* Ignore a "base" test class such that test that extend from those classes
will all be ignored. This style of
-ignoring is useful for Gremlin "process" tests that have bases classes that
are extended by various Gremlin flavors (e.g. groovy).
+* Ignore a "base" test class such that test that extend from those classes
will all be ignored.
* Ignore a `GraphComputer` test based on the type of `GraphComputer` being
used. Specify the "computer" attribute on
the `OptOut` (which is an array specification) which should have a value of
the `GraphComputer` implementation class
that should ignore that
added MARKER model to PathRetractionStrategy to reduce recurssive lookups of
invalidating steps. Again, we really need Traversal.metdata to make this more
'pure'.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f1f65637
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f1f65637
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f1f65637
Branch: refs/heads/TINKERPOP-1642
Commit: f1f656377a1cf30792c389f9f670196017686eb6
Parents: b88b264
Author: Marko A. Rodriguez
Authored: Fri Mar 17 13:04:58 2017 -0600
Committer: Stephen Mallette
Committed: Mon Mar 20 14:09:03 2017 -0400
--
CHANGELOG.asciidoc| 3 ++-
.../strategy/optimization/PathRetractionStrategy.java | 10 +-
2 files changed, 11 insertions(+), 2 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1f65637/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 1d89305..59158cb 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,7 +26,8 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
~~~
-* `ProfileStrategy` now uses the marker-model to reduce recrussive lookups of
`ProfileSideEffectStep`.
+* `PathRetractionStrategy` now uses the marker-model to reduce recursive
lookups of invalidating steps.
+* `ProfileStrategy` now uses the marker-model to reduce recursive lookups of
`ProfileSideEffectStep`.
* `Mutating` steps now implement `Scoping` interface.
* `LABELED_PATH` requirement is now set if any step in the traversal is
labeled.
* Added various metrics to the `GremlinGroovyScriptEngine` around script
compilation and exposed them in Gremlin Server.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1f65637/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
index bd27a3e..d19954b 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategy.java
@@ -18,6 +18,7 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization;
+import
org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.VertexProgramStep;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -36,6 +37,7 @@ import
org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversal
import
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
import org.apache.tinkerpop.gremlin.process.traversal.util.PathUtil;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
+import org.apache.tinkerpop.gremlin.structure.Graph;
import org.javatuples.Pair;
import java.util.ArrayList;
@@ -57,6 +59,7 @@ public final class PathRetractionStrategy extends
AbstractTraversalStrategy> PRIORS =
new HashSet<>(Arrays.asList(
RepeatUnrollStrategy.class, MatchPredicateStrategy.class,
PathProcessorStrategy.class));
+private static final String MARKER =
Graph.Hidden.hide("gremlin.pathRetraction");
private final int standardBarrierSize;
@@ -72,8 +75,13 @@ public final class PathRetractionStrategy extends
AbstractTraversalStrategy traversal) {
// do not apply this strategy if there are lambdas as you can't
introspect to know what path information the lambdas are using
// do not apply this strategy if a PATH requirement step is being used
(in the future, we can do PATH requirement lookhead to be more intelligent
about its usage)
-if (TraversalHelper.anyStepRecursively(step -> step instanceof
LambdaHolder || step.getRequirements().contains(TraverserRequirement.PATH),
TraversalHelper.getRootTraversal(traversal)))
+if ((traversal.getParent() instanceof EmptyStep ||
traversal.getParent() instanceof VertexProgramStep) &&
+TraversalHelper.anyStepRecursively(step -> step instanceof
Fixed an NPE in GraphMLReader where if the doesn't have an ID field and
the base graph supports ids, then an NPE happens. Added a test case to verifiy
working behavior. Super simple fix. CTR.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/61a3d125
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/61a3d125
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/61a3d125
Branch: refs/heads/TINKERPOP-1642
Commit: 61a3d125c48869c8e5fdaf195abbb46fbaaf0c30
Parents: 9ea319d
Author: Marko A. Rodriguez
Authored: Thu Mar 9 14:49:36 2017 -0700
Committer: Marko A. Rodriguez
Committed: Thu Mar 9 14:49:36 2017 -0700
--
.../structure/io/graphml/GraphMLReader.java | 19 +++--
.../tinkerpop/gremlin/structure/io/IoTest.java | 25 ++--
.../structure/io/graphml/graph-no-edge-ids.xml | 30
3 files changed, 62 insertions(+), 12 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/61a3d125/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
index e161ba7..3289166 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphml/GraphMLReader.java
@@ -19,10 +19,10 @@
package org.apache.tinkerpop.gremlin.structure.io.graphml;
import org.apache.tinkerpop.gremlin.structure.Direction;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.io.GraphReader;
@@ -72,7 +72,7 @@ public final class GraphMLReader implements GraphReader {
@Override
public void readGraph(final InputStream graphInputStream, final Graph
graphToWriteTo) throws IOException {
-final Map cache = new HashMap<>();
+final Map cache = new HashMap<>();
final AtomicLong counter = new AtomicLong(0);
final boolean supportsTx =
graphToWriteTo.features().graph().supportsTransactions();
final Graph.Features.EdgeFeatures edgeFeatures =
graphToWriteTo.features().edge();
@@ -186,9 +186,9 @@ public final class GraphMLReader implements GraphReader {
isInVertex = false;
} else if (elementName.equals(GraphMLTokens.EDGE)) {
final Object[] propsAsArray =
edgeProps.entrySet().stream().flatMap(e -> Stream.of(e.getKey(),
e.getValue())).toArray();
-final Object[] propsReady =
edgeFeatures.willAllowId(edgeId) ? ElementHelper.upsert(propsAsArray, T.id,
edgeId) : propsAsArray;
-
- edgeOutVertex.addEdge(null == edgeLabel ?
Edge.DEFAULT_LABEL : edgeLabel, edgeInVertex, propsReady);
+final Object[] propsReady = null != edgeId &&
edgeFeatures.willAllowId(edgeId) ? ElementHelper.upsert(propsAsArray, T.id,
edgeId) : propsAsArray;
+
+edgeOutVertex.addEdge(null == edgeLabel ?
Edge.DEFAULT_LABEL : edgeLabel, edgeInVertex, propsReady);
if (supportsTx && counter.incrementAndGet() %
batchSize == 0)
graphToWriteTo.tx().commit();
@@ -292,7 +292,7 @@ public final class GraphMLReader implements GraphReader {
private static Vertex findOrCreate(final Object id, final Graph
graphToWriteTo,
final Graph.Features.VertexFeatures
features,
- final Map cache, final
boolean asVertex, final Object... args) {
+ final Map cache, final
boolean asVertex, final Object... args) {
if (cache.containsKey(id)) {
// if the request to findOrCreate come from a vertex then AND the
vertex was already created, that means
// that the vertex was created by an edge that arrived first in
the stream (allowable via GraphML
@@ -306,7 +306,7 @@ public final class GraphMLReader implements GraphReader {
Add a slight optimization to ScopingStrategy that will not compute step labels
if no Scoping steps are defined. Also added JavaDoc and comments accordingly.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2aecff5f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2aecff5f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2aecff5f
Branch: refs/heads/TINKERPOP-1642
Commit: 2aecff5feb0e74bc4efdfd8af3382b0fc6e11d66
Parents: d130cc8
Author: Marko A. Rodriguez
Authored: Mon Mar 6 08:07:39 2017 -0700
Committer: Stephen Mallette
Committed: Mon Mar 20 14:08:31 2017 -0400
--
.../gremlin/process/traversal/step/Scoping.java | 5 +
.../strategy/finalization/ScopingStrategy.java | 12 ++--
2 files changed, 15 insertions(+), 2 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2aecff5f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
index 68655e4..fae52d7 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
@@ -69,6 +69,11 @@ public interface Scoping {
return null;
}
+/**
+ * Get the labels that this scoping step will access during the traversal
+ *
+ * @return the accessed labels of the scoping step
+ */
public Set getScopeKeys();
/**
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2aecff5f/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ScopingStrategy.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ScopingStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ScopingStrategy.java
index ce66da4..073f45e 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ScopingStrategy.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ScopingStrategy.java
@@ -19,6 +19,7 @@
package org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization;
+import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.step.Scoping;
@@ -29,6 +30,10 @@ import
org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import java.util.Set;
/**
+ * ScopingStrategy will analyze the traversal for step labels (e.g. as()) and
provide {@link Scoping} steps that information.
+ * This enables Scoping steps to avoid having to generate step label data at
{@link Step#getRequirements()} and thus,
+ * may significantly reduce compilation times.
+ *
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public final class ScopingStrategy extends
AbstractTraversalStrategy implements
TraversalStrategy.FinalizationStrategy {
@@ -41,11 +46,14 @@ public final class ScopingStrategy extends
AbstractTraversalStrategy traversal) {
-// only operate on the root traversal and apply global step labels
recursively
-if (!(traversal.getParent() instanceof EmptyStep))
+// only operate on the root traversal and only if it contains scoping
steps
+if (!(traversal.getParent() instanceof EmptyStep) ||
+
!TraversalHelper.hasStepOfAssignableClassRecursively(Scoping.class, traversal))
return;
+// get the labels associated with the traveral
final Set labels = TraversalHelper.getLabels(traversal);
+// tell all scoping steps what those labels are
for (final Scoping scoping :
TraversalHelper.getStepsOfAssignableClassRecursively(Scoping.class, traversal))
{
scoping.setPathLabels(labels);
}
Updated changelog CTR
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/60a3fb33
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/60a3fb33
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/60a3fb33
Branch: refs/heads/TINKERPOP-1642
Commit: 60a3fb33e33245f2ad9f3b1494d349c7ccf482b5
Parents: 61a3d12
Author: Stephen Mallette
Authored: Fri Mar 10 06:30:27 2017 -0500
Committer: Stephen Mallette
Committed: Fri Mar 10 06:30:27 2017 -0500
--
CHANGELOG.asciidoc | 1 +
1 file changed, 1 insertion(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/60a3fb33/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 04541d6..6861d57 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)
~~~
+* Fixed an `NullPointerException` in `GraphMLReader` that occurred when an
`` didn't have an ID field and the base graph supported ID assignment.
* Split `ComputerVerificationStrategy` into two strategies:
`ComputerVerificationStrategy` and `ComputerFinalizationStrategy`.
* Removed `HasTest.g_V_hasId_compilationEquality` from process test suite as
it makes too many assumptions about provider compilation.
* Deprecated `CustomizerProvider` infrastructure.
TINKERPOP-1642 Improved performance of addV() and chained mutating statements
Added more tests for Parameters. Performance improved by about 2.5x given the
benchmarks. Also long chained mutating traversals are now inserting roughly on
par with single insert traversals (prior to this change they were about 25%
slower).
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8621401b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8621401b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8621401b
Branch: refs/heads/TINKERPOP-1642
Commit: 8621401b9a7a7a1b622fed3daefdabd0469cc0b0
Parents: 2138c8e
Author: Stephen Mallette
Authored: Thu Mar 2 10:44:58 2017 -0500
Committer: Stephen Mallette
Committed: Mon Mar 20 14:07:22 2017 -0400
--
.../traversal/dsl/graph/GraphTraversal.java | 9 +-
.../process/traversal/step/util/Parameters.java | 33 -
.../traversal/step/util/ParametersTest.java | 119 ++-
3 files changed, 146 insertions(+), 15 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8621401b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 8070538..c89c7be 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -1010,7 +1010,6 @@ public interface GraphTraversal extends
Traversal {
for (int i = 0; i < propertyKeyValues.length; i = i + 2) {
this.property(propertyKeyValues[i], propertyKeyValues[i + 1]);
}
-//((AddVertexStep)
this.asAdmin().getEndStep()).addPropertyMutations(propertyKeyValues);
return (GraphTraversal) this;
}
@@ -2058,11 +2057,13 @@ public interface GraphTraversal extends
Traversal {
this.asAdmin().getBytecode().addStep(Symbols.property, key, value,
keyValues);
else
this.asAdmin().getBytecode().addStep(Symbols.property,
cardinality, key, value, keyValues);
+
// if it can be detected that this call to property() is related to an
addV/E() then we can attempt to fold
// the properties into that step to gain an optimization for those
graphs that support such capabilities.
-if ((this.asAdmin().getEndStep() instanceof AddVertexStep ||
this.asAdmin().getEndStep() instanceof AddEdgeStep
-|| this.asAdmin().getEndStep() instanceof AddVertexStartStep)
&& keyValues.length == 0 && null == cardinality) {
-((Mutating) this.asAdmin().getEndStep()).addPropertyMutations(key,
value);
+final Step endStep = this.asAdmin().getEndStep();
+if ((endStep instanceof AddVertexStep || endStep instanceof
AddEdgeStep || endStep instanceof AddVertexStartStep) &&
+keyValues.length == 0 && null == cardinality) {
+((Mutating) endStep).addPropertyMutations(key, value);
} else {
this.asAdmin().addStep(new AddPropertyStep(this.asAdmin(),
cardinality, key, value));
((AddPropertyStep)
this.asAdmin().getEndStep()).addPropertyMutations(keyValues);
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8621401b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
index 3584c87..67cb2f9 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
@@ -49,6 +49,11 @@ public final class Parameters implements Cloneable,
Serializable {
private Map parameters = new HashMap<>();
/**
+ * Determines if there are traversals present in the parameters {@code
Map}.
+ */
+private boolean traversalsPresent = false;
+
+/**
* Checks for existence of key in parameter set.
*
* @param key the key to check
@@ -138,6 +143,11 @@ public final class Parameters implements Cloneable,
Serializable {
Quick fix to logging and to init script execution
Init scripts weren't working right for scriptengines because they weren't
getting the bindings set to the engine scope (which was happening under the old
model of initialization). Without that setting, the types couldn't be
identified and type checking features of Groovy wouldn't work if configured. CTR
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/38217929
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/38217929
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/38217929
Branch: refs/heads/TINKERPOP-1642
Commit: 38217929138ffe9e5ff391d33a42b92d8ca5700e
Parents: 7b234b4
Author: Stephen Mallette
Authored: Wed Mar 15 17:18:07 2017 -0400
Committer: Stephen Mallette
Committed: Wed Mar 15 17:18:07 2017 -0400
--
.../gremlin/jsr223/DefaultGremlinScriptEngineManager.java | 7 ++-
.../gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java | 2 --
.../tinkerpop/gremlin/server/util/ServerGremlinExecutor.java | 5 +++--
3 files changed, 9 insertions(+), 5 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38217929/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/DefaultGremlinScriptEngineManager.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/DefaultGremlinScriptEngineManager.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/DefaultGremlinScriptEngineManager.java
index b3025ec..c8b77e6 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/DefaultGremlinScriptEngineManager.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/DefaultGremlinScriptEngineManager.java
@@ -474,7 +474,12 @@ public class DefaultGremlinScriptEngineManager implements
GremlinScriptEngineMan
scriptCustomizers.stream().flatMap(sc -> sc.getScripts().stream()).
map(l -> String.join(System.lineSeparator(),
l)).forEach(initScript -> {
try {
-final Object initializedBindings = engine.eval(initScript);
+// need to apply global bindings here as part of the engine or
else they don't get their binding types
+// registered by certain GremlinScriptEngine instances (pretty
much talking about gremlin-groovy here)
+// where type checking is made important. this may not be a
good generic way to handled this in the
+// long run, but for now we only have two GremlinScriptEngines
to be concerned about so thus far it
+// presents no real pains
+final Object initializedBindings = engine.eval(initScript,
getBindings());
if (initializedBindings != null && initializedBindings
instanceof Map)
((Map) initializedBindings).forEach((k,v)
-> put(k,v));
} catch (Exception ex) {
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38217929/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
--
diff --git
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
index 4b27180..7a39f43 100644
---
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
+++
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
@@ -720,8 +720,6 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
//This should never happen as the future should completed before
it is returned to the us.
throw new AssertionError();
}
-
-
}
boolean isCached(final String script) {
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/38217929/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
--
diff --git
a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
index e3c0cae..56e78fb 100644
---
a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
+++
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/util/ServerGremlinExecutor.java
@@ -149,7 +149,7 @@ public class ServerGremlinExecutor {
Added some notes on sampling to recommendation recipe CTR
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3fe223bd
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3fe223bd
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3fe223bd
Branch: refs/heads/TINKERPOP-1642
Commit: 3fe223bdcbf0695529aa9f5fd58b3bff573845b6
Parents: df285d3
Author: Stephen Mallette
Authored: Thu Mar 9 07:34:23 2017 -0500
Committer: Stephen Mallette
Committed: Thu Mar 9 07:34:23 2017 -0500
--
docs/src/recipes/recommendation.asciidoc | 45 ++-
1 file changed, 44 insertions(+), 1 deletion(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3fe223bd/docs/src/recipes/recommendation.asciidoc
--
diff --git a/docs/src/recipes/recommendation.asciidoc
b/docs/src/recipes/recommendation.asciidoc
index 8d5f1ec..0aaa7e4 100644
--- a/docs/src/recipes/recommendation.asciidoc
+++ b/docs/src/recipes/recommendation.asciidoc
@@ -245,4 +245,47 @@ g.V().has("person","name","alice").as("alice").
by(values, decr).
by(select(keys).values("name")).
unfold().select(keys).values("name")
-
\ No newline at end of file
+
+
+In considering the practical applications of this recipe, it is worth
revisiting the earlier "basic" version of the
+reccomendation algorithm:
+
+[gremlin-groovy,existing]
+
+g.V().has('person','name','alice').as('her').
+ out('bought').aggregate('self').
+ in('bought').where(neq('her')).
+ out('bought').where(without('self')).
+ groupCount().
+ order(local).
+by(values, decr)
+
+
+The above traversal performs a full ranking of items based on all the
connected data. That could be a time consuming
+operation depending on the number of paths being traversed. As it turns out,
recommendations don't need to have perfect
+knowledge of all data to provide a "pretty good" approximation of a
recommendation. It can therefore make sense to
+place additional limits on the traversal to have it better return more quickly
at the expense of examining less data.
+
+
+Gremlin provides a number of steps that can help with these limits like:
+link:http://tinkerpop.apache.org/docs/x.y.z/reference/#coin-step[coin()],
+link:http://tinkerpop.apache.org/docs/x.y.z/reference/#sample-step[sample()],
and
+link:http://tinkerpop.apache.org/docs/current/reference/#timelimit-step[timeLimit()].
For example, to have the
+traversal sample the data for no longer than one second, the previous "basic"
recommendation could be changed to:
+
+[gremlin-groovy,existing]
+
+g.V().has('person','name','alice').as('her').
+ out('bought').aggregate('self').
+ in('bought').where(neq('her')).
+ out('bought').where(without('self')).timeLimit(1000).
+ groupCount().
+ order(local).
+by(values, decr)
+
+
+In using sampling methods, it is important to consider that the natural
ordering of edges in the graph may not produce
+an ideal sample for the recommendation. For example, if the edges end up being
returned oldest first, then the
+recommendation will be based on the oldest data, which would not be ideal. As
with any traversal, it is important to
+understand the nature of the graph being traversed and the behavior of the
underlying graph database to properly
+achieve the desired outcome.
\ No newline at end of file
TINKERPOP-1642 Minor fixes
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d3bb05bb
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d3bb05bb
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d3bb05bb
Branch: refs/heads/TINKERPOP-1642
Commit: d3bb05bb5ba90062ce8d393906680647d23b4d12
Parents: cb4e502
Author: Stephen Mallette
Authored: Fri Mar 3 08:45:24 2017 -0500
Committer: Stephen Mallette
Committed: Mon Mar 20 14:07:22 2017 -0400
--
.../gremlin/process/traversal/step/util/Parameters.java| 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d3bb05bb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
index 3f0cb7c..6640e87 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
@@ -50,7 +50,7 @@ public final class Parameters implements Cloneable,
Serializable {
private Map parameters = new HashMap<>();
/**
- * A cached list of traversals that server as parameter values. The list
is cached on calls to
+ * A cached list of traversals that serve as parameter values. The list is
cached on calls to
* {@link #set(Object...)} because when the parameter map is large the
cost of iterating it repeatedly on the
* high number of calls to {@link #getTraversals()} and {@link
#integrateTraversals(TraversalParent)} is great.
*/
@@ -129,10 +129,10 @@ public final class Parameters implements Cloneable,
Serializable {
/**
* Gets the array of keys/values of the parameters while resolving
parameter values that contain
- * {@link Traversal} instances
+ * {@link Traversal} instances.
*/
public Object[] getKeyValues(final Traverser.Admin traverser, final
Object... exceptKeys) {
-if (this.parameters.size() == 0) return EMPTY_ARRAY;
+if (this.parameters.isEmpty()) return EMPTY_ARRAY;
final List keyValues = new ArrayList<>();
for (final Map.Entry entry :
this.parameters.entrySet()) {
if (!ArrayUtils.contains(exceptKeys, entry.getKey())) {
TINKERPOP-1644
Fix exception handling.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/17a72e0e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/17a72e0e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/17a72e0e
Branch: refs/heads/TINKERPOP-1642
Commit: 17a72e0e1db6fe52d3a0821ef2bfae1eb39be856
Parents: 18778e4
Author: BrynCooke
Authored: Wed Mar 8 13:23:30 2017 +
Committer: Stephen Mallette
Committed: Fri Mar 10 11:12:36 2017 -0500
--
.../jsr223/GremlinGroovyScriptEngine.java | 33 ++--
1 file changed, 16 insertions(+), 17 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17a72e0e/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
--
diff --git
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
index 51850ad..2151a82 100644
---
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
+++
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
@@ -168,26 +168,25 @@ public class GremlinGroovyScriptEngine extends
GroovyScriptEngineImpl
@Override
public Future load(String script) throws Exception {
long start = System.currentTimeMillis();
-try {
-return CompletableFuture.supplyAsync(() ->
loader.parseClass(script, generateScriptName()), command -> command.run());
-} catch (Exception e) {
-if (e.getCause() instanceof CompilationFailedException) {
+
+return CompletableFuture.supplyAsync(() -> {
+try {
+return loader.parseClass(script, generateScriptName());
+} catch (CompilationFailedException e) {
long finish = System.currentTimeMillis();
log.error("Script compilation FAILED {} took {}ms {}",
script, finish - start, e.getCause());
-throw (CompilationFailedException) e.getCause();
-} else {
-throw new AssertionError("Unexpected exception when
compiling script", e);
-}
-} finally {
-long time = System.currentTimeMillis() - start;
-if (time > 5000) {
-//We warn if a script took longer than a few seconds.
Repeatedly seeing these warnings is a sign that something is wrong.
-//Scripts with a large numbers of parameters often trigger
this and should be avoided.
-log.warn("Script compilation {} took {}ms", script, time);
-} else {
-log.debug("Script compilation {} took {}ms", script, time);
+throw e;
+} finally {
+long time = System.currentTimeMillis() - start;
+if (time > 5000) {
+//We warn if a script took longer than a few seconds.
Repeatedly seeing these warnings is a sign that something is wrong.
+//Scripts with a large numbers of parameters often
trigger this and should be avoided.
+log.warn("Script compilation {} took {}ms", script,
time);
+} else {
+log.debug("Script compilation {} took {}ms", script,
time);
+}
}
-}
+}, command -> command.run());
}
});
TINKERPOP-1642 Made Mutating steps implement Scoping.
This simplified PathUtil.getReferencedLabels() and reduced iterations over
Parameter traversals.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/61c1f815
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/61c1f815
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/61c1f815
Branch: refs/heads/TINKERPOP-1642
Commit: 61c1f8154100b50debe9f4c95b803767d0026791
Parents: 8a1c328
Author: Stephen Mallette
Authored: Fri Mar 10 15:11:52 2017 -0500
Committer: Stephen Mallette
Committed: Mon Mar 20 14:09:02 2017 -0400
--
CHANGELOG.asciidoc | 1 +
.../process/traversal/Parameterizing.java | 8 +
.../gremlin/process/traversal/step/Scoping.java | 14 +---
.../process/traversal/step/map/AddEdgeStep.java | 10 +-
.../traversal/step/map/AddVertexStartStep.java | 9 -
.../traversal/step/map/AddVertexStep.java | 9 -
.../step/sideEffect/AddPropertyStep.java| 9 -
.../process/traversal/step/util/Parameters.java | 37 +---
.../process/traversal/util/PathUtil.java| 17 +
9 files changed, 84 insertions(+), 30 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/61c1f815/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 3fc3da2..dd80275 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)
~~~
+* `Mutating` steps now implement `Scoping` interface.
* `LABELED_PATH` requirement is now set if any step in the traversal is
labeled.
* 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`.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/61c1f815/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Parameterizing.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Parameterizing.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Parameterizing.java
index 8af80b3..9b7e088 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Parameterizing.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Parameterizing.java
@@ -21,9 +21,17 @@ package org.apache.tinkerpop.gremlin.process.traversal;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
/**
+ * An interface for {@link Step} implementations that hold a {@link
Parameters} object, which fold in arguments from
+ * other steps. It is typically used on mutating steps, such as {@code
addV()}, where calls to {@code property(k,v)}
+ * are folded in as parameters to that add vertex step.
+ *
* @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
*/
public interface Parameterizing {
+/**
+ * Gets the parameters on the step.
+ */
public Parameters getParameters();
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/61c1f815/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
index 22109bf..683e661 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
@@ -20,23 +20,27 @@ package org.apache.tinkerpop.gremlin.process.traversal.step;
import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.Pop;
+import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import
org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
/**
+ * This interface is implemented by {@link Step} implementations that access
labeled path steps, side-effects or
+ * {@code
Wow. Can't believe we didn't do this from the start. LABELED_PATH is set if a
Step is labeled. Dar. So much simpler than all the recurssion in
TraversalHelper.getLabels() and having a ScopingStrategy @spmallette -- can
you verify that your Mutating traversal profiling is faster now.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5061c47b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5061c47b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5061c47b
Branch: refs/heads/TINKERPOP-1642
Commit: 5061c47be4c9beff6c12728b424febb829277958
Parents: 2aecff5
Author: Marko A. Rodriguez
Authored: Wed Mar 8 07:37:07 2017 -0700
Committer: Stephen Mallette
Committed: Mon Mar 20 14:09:02 2017 -0400
--
CHANGELOG.asciidoc | 1 +
.../process/traversal/TraversalStrategies.java | 2 -
.../gremlin/process/traversal/step/Scoping.java | 15 -
.../step/filter/WherePredicateStep.java | 15 +
.../step/filter/WhereTraversalStep.java | 14 +
.../traversal/step/map/SelectOneStep.java | 13 +---
.../process/traversal/step/map/SelectStep.java | 13 +---
.../strategy/finalization/ScopingStrategy.java | 65
.../traversal/util/DefaultTraversal.java| 2 +
.../process/traversal/util/TraversalHelper.java | 18 ++
.../traversal/step/filter/WhereStepTest.java| 4 +-
.../process/computer/GraphComputerTest.java | 2 +
12 files changed, 29 insertions(+), 135 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5061c47b/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 86f30f7..3fc3da2 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)
~~~
+* `LABELED_PATH` requirement is now set if any step in the traversal is
labeled.
* 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/5061c47b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
index 0ddae91..63ae23f 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategies.java
@@ -24,7 +24,6 @@ import
org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimiza
import
org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization.MessagePassingReductionStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ConnectiveStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy;
-import
org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ScopingStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.AdjacentToIncidentStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.FilterRankingStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.IncidentToAdjacentStrategy;
@@ -215,7 +214,6 @@ public interface TraversalStrategies extends Serializable,
Cloneable {
RangeByIsCountStrategy.instance(),
PathRetractionStrategy.instance(),
LazyBarrierStrategy.instance(),
-ScopingStrategy.instance(),
ProfileStrategy.instance(),
StandardVerificationStrategy.instance());
GRAPH_CACHE.put(Graph.class, graphStrategies);
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5061c47b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Scoping.java
--
diff --git
I made it so ProfileStrategy uses the MARKER model developed by @dkuppitz and
myself to reduce recurssive lookups in strategies. Moving forward, we really
need to move to a Traversal.metadata model as using labeled steps is a bit
hackish.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b88b264e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b88b264e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b88b264e
Branch: refs/heads/TINKERPOP-1642
Commit: b88b264ee418246a6b9585be635435614f573f31
Parents: 0b9f9a5
Author: Marko A. Rodriguez
Authored: Fri Mar 17 11:57:52 2017 -0600
Committer: Stephen Mallette
Committed: Mon Mar 20 14:09:03 2017 -0400
--
CHANGELOG.asciidoc | 1 +
.../strategy/finalization/ProfileStrategy.java | 39 +---
2 files changed, 19 insertions(+), 21 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b88b264e/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index dd80275..1d89305 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)
~~~
+* `ProfileStrategy` now uses the marker-model to reduce recrussive lookups of
`ProfileSideEffectStep`.
* `Mutating` steps now implement `Scoping` interface.
* `LABELED_PATH` requirement is now set if any step in the traversal is
labeled.
* Added various metrics to the `GremlinGroovyScriptEngine` around script
compilation and exposed them in Gremlin Server.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b88b264e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
index 6d08652..b5f0b86 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/ProfileStrategy.java
@@ -18,13 +18,16 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization;
+import
org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.VertexProgramStep;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
import
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ProfileSideEffectStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.ProfileStep;
import
org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
+import org.apache.tinkerpop.gremlin.structure.Graph;
import java.util.List;
@@ -34,34 +37,28 @@ import java.util.List;
public final class ProfileStrategy extends
AbstractTraversalStrategy implements
TraversalStrategy.FinalizationStrategy {
private static final ProfileStrategy INSTANCE = new ProfileStrategy();
+private static final String MARKER = Graph.Hidden.hide("gremlin.profile");
private ProfileStrategy() {
}
@Override
public void apply(final Traversal.Admin traversal) {
-if
(TraversalHelper.hasStepOfAssignableClassRecursively(ProfileSideEffectStep.class,
TraversalHelper.getRootTraversal(traversal).asAdmin())) {
-prepTraversalForProfiling(traversal);
-}
-}
-
-// Iterate the traversal steps and inject the .profile()-steps.
-private void prepTraversalForProfiling(Traversal.Admin traversal) {
-// Add .profile() step after every pre-existing step.
-final List steps = traversal.getSteps();
-final int numSteps = steps.size();
-for (int ii = 0; ii < numSteps; ii++) {
-// Get the original step
-final Step step = steps.get(ii * 2);
-
-// Do not inject profiling after ProfileSideEffectStep as this
will be the last step on the root traversal.
-if (step instanceof ProfileSideEffectStep) {
-break;
+
TINKERPOP-1642 Minor refactoring to get rid of duplicate code
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8a1c328e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8a1c328e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8a1c328e
Branch: refs/heads/TINKERPOP-1642
Commit: 8a1c328e701aada723519e2db63f74d0034076e9
Parents: 149a6f8
Author: Stephen Mallette
Authored: Fri Mar 10 13:27:01 2017 -0500
Committer: Stephen Mallette
Committed: Mon Mar 20 14:09:02 2017 -0400
--
.../process/traversal/util/TraversalHelper.java | 19 ++-
1 file changed, 10 insertions(+), 9 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8a1c328e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalHelper.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalHelper.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalHelper.java
index 5163824..95862d0 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalHelper.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalHelper.java
@@ -417,7 +417,7 @@ public final class TraversalHelper {
* Determine if any step in {@link Traversal} or its children match the
step given the provided {@link Predicate}.
*
* @param predicate the match function
- * @param traversal th traversal to perform the action on
+ * @param traversal the traversal to perform the action on
* @return {@code true} if there is a match and {@code false} otherwise
*/
public static boolean anyStepRecursively(final Predicate predicate,
final Traversal.Admin traversal) {
@@ -425,18 +425,19 @@ public final class TraversalHelper {
if (predicate.test(step)) {
return true;
}
-if (step instanceof TraversalParent) {
-for (final Traversal.Admin localChild :
((TraversalParent) step).getLocalChildren()) {
-if (anyStepRecursively(predicate, localChild)) return true;
-}
-for (final Traversal.Admin globalChild :
((TraversalParent) step).getGlobalChildren()) {
-if (anyStepRecursively(predicate, globalChild)) return
true;
-}
-}
+
+if (step instanceof TraversalParent) anyStepRecursively(predicate,
((TraversalParent) step));
}
return false;
}
+/**
+ * Determine if any child step of a {@link TraversalParent} match the step
given the provided {@link Predicate}.
+ *
+ * @param predicate the match function
+ * @param step the step to perform the action on
+ * @return {@code true} if there is a match and {@code false} otherwise
+ */
public static boolean anyStepRecursively(final Predicate predicate,
final TraversalParent step) {
for (final Traversal.Admin localChild : step.getLocalChildren())
{
if (anyStepRecursively(predicate, localChild)) return true;
Improve an error message in Gremlin Server around large scripts. CTR
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/258dccb9
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/258dccb9
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/258dccb9
Branch: refs/heads/TINKERPOP-1642
Commit: 258dccb9c1dbe89c9cb439cc9c7fdbde73209b42
Parents: 591a65a
Author: Stephen Mallette
Authored: Tue Mar 7 16:06:34 2017 -0500
Committer: Stephen Mallette
Committed: Tue Mar 7 16:06:34 2017 -0500
--
CHANGELOG.asciidoc | 1 +
.../server/op/AbstractEvalOpProcessor.java | 20 +--
.../server/GremlinServerIntegrateTest.java | 35 ++--
3 files changed, 51 insertions(+), 5 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/258dccb9/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 8cc2adc..04541d6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -36,6 +36,7 @@ TinkerPop 3.2.5 (Release Date: NOT OFFICIALLY RELEASED YET)
* Fixed an optimization bug in `LazyBarrierStrategy` around appending barriers
to the end of a `Traversal`.
* Fixed an optimization bug in `PathRetractionStrategy` around appending
barriers to the end of a `Traversal`.
* `TraverserIterator` in GremlinServer is smart to try and bulk traversers
prior to network I/O.
+* Improved error handling of compilation failures for very large or highly
parameterized script sent to Gremlin Server.
* Fixed a bug in `RangeByIsCountStrategy` that changed the meaning of inner
traversals.
* Improved Gremlin-Python Driver implementation by adding a threaded client
with basic connection pooling and support for pluggable websocket clients.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/258dccb9/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 48de830..1ba6e36 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
@@ -41,10 +41,13 @@ import
org.apache.tinkerpop.gremlin.server.util.MetricManager;
import org.apache.tinkerpop.gremlin.util.function.ThrowingConsumer;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import io.netty.channel.ChannelHandlerContext;
+import org.codehaus.groovy.control.ErrorCollector;
+import org.codehaus.groovy.control.MultipleCompilationErrorsException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.script.Bindings;
+import javax.script.ScriptException;
import javax.script.SimpleBindings;
import java.util.Arrays;
import java.util.HashSet;
@@ -292,8 +295,21 @@ public abstract class AbstractEvalOpProcessor extends
AbstractOpProcessor {
logger.warn(errorMessage, t);
ctx.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_TIMEOUT).statusMessage(t.getMessage()).create());
} else {
-logger.warn(String.format("Exception processing a script
on request [%s].", msg), t);
-
ctx.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_SCRIPT_EVALUATION).statusMessage(t.getMessage()).create());
+// try to trap the specific jvm error of "Method code too
large!" to re-write it as something nicer,
+// but only re-write if it's the only error because
otherwise we might lose some other important
+// information related to the failure. at this point,
there hasn't been a scenario that has
+// presented itself where the "Method code too large!"
comes with other compilation errors so
+// it seems that this message trumps other compilation
errors to some reasonable degree that ends
+// up being favorable for this problem
+if (t instanceof MultipleCompilationErrorsException &&
t.getMessage().contains("Method code too large!") &&
+((MultipleCompilationErrorsException)
t).getErrorCollector().getErrorCount() == 1) {
+final String errorMessage = String.format("The Gremlin
statement that was submitted exceed the maximum
TINKERPOP-1644 Provided configuration options for GremlinGroovyScriptEngine
Introduced new customizers to pass in configuration options to the
GremlinGroovyScriptEngine.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4bdeac4b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4bdeac4b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4bdeac4b
Branch: refs/heads/TINKERPOP-1642
Commit: 4bdeac4b796b38fb14d1be763e03cc837b57d3d7
Parents: de1d58a
Author: Stephen Mallette
Authored: Wed Mar 8 16:13:06 2017 -0500
Committer: Stephen Mallette
Committed: Fri Mar 10 11:12:36 2017 -0500
--
.../jsr223/CompilationOptionsCustomizer.java| 39 ++
.../jsr223/GremlinGroovyScriptEngine.java | 36 +++--
.../jsr223/GroovyCompilerGremlinPlugin.java | 13
.../CompilationOptionsCustomizerProvider.java | 48
...roovyScriptEngineCompilationOptionsTest.java | 80
.../jsr223/GroovyCompilerGremlinPluginTest.java | 24 --
6 files changed, 225 insertions(+), 15 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4bdeac4b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/CompilationOptionsCustomizer.java
--
diff --git
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/CompilationOptionsCustomizer.java
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/CompilationOptionsCustomizer.java
new file mode 100644
index 000..2a22eb3
--- /dev/null
+++
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/CompilationOptionsCustomizer.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+package org.apache.tinkerpop.gremlin.groovy.jsr223;
+
+import org.apache.tinkerpop.gremlin.jsr223.Customizer;
+
+/**
+ * Provides some custom compilation options to the {@link
GremlinGroovyScriptEngine}.
+ *
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+class CompilationOptionsCustomizer implements Customizer {
+
+private final int expectedCompilationTime;
+
+public CompilationOptionsCustomizer(final int expectedCompilationTime) {
+this.expectedCompilationTime = expectedCompilationTime;
+}
+
+public int getExpectedCompilationTime() {
+return expectedCompilationTime;
+}
+}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4bdeac4b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
--
diff --git
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
index 42d954a..5168130 100644
---
a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
+++
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java
@@ -35,6 +35,7 @@ import
org.apache.tinkerpop.gremlin.groovy.DefaultImportCustomizerProvider;
import org.apache.tinkerpop.gremlin.groovy.EmptyImportCustomizerProvider;
import org.apache.tinkerpop.gremlin.groovy.ImportCustomizerProvider;
import org.apache.tinkerpop.gremlin.groovy.NoImportCustomizerProvider;
+import
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompilationOptionsCustomizerProvider;
import
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider;
import
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.InterpreterModeCustomizerProvider;
import org.apache.tinkerpop.gremlin.groovy.loaders.GremlinLoader;
@@ -80,11 +81,11 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import
Repository: tinkerpop
Updated Branches:
refs/heads/master 195b819db -> c446be25f
updated Grakn name.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c446be25
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c446be25
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c446be25
Branch: refs/heads/master
Commit: c446be25f7b7660e48c7bee6ac6b7a96c61b89bb
Parents: 195b819
Author: Marko A. Rodriguez
Authored: Mon Mar 20 10:52:41 2017 -0600
Committer: Marko A. Rodriguez
Committed: Mon Mar 20 10:52:41 2017 -0600
--
docs/site/home/providers.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c446be25/docs/site/home/providers.html
--
diff --git a/docs/site/home/providers.html b/docs/site/home/providers.html
index 56dd50e..6df96bc 100644
--- a/docs/site/home/providers.html
+++ b/docs/site/home/providers.html
@@ -140,7 +140,7 @@ limitations under the License.
https://grakn.ai/;>
-https://grakn.ai/;>Grakn is a distributed
knowledge graph that brings knowledge ontologies and transactional data
together to enable intelligent querying of data. Querying is performed through
the language: Graql, a declarative, knowledge-oriented graph query language for
retrieving explicitly stored and implicitly derived information, as well as to
perform graph analytics and automated reasoning.
+https://grakn.ai/;>GRAKN.AI is a distributed
knowledge graph that brings knowledge ontologies and transactional data
together to enable intelligent querying of data. Querying is performed through
the language: Graql, a declarative, knowledge-oriented graph query language for
retrieving explicitly stored and implicitly derived information, as well as to
perform graph analytics and automated reasoning.
http://www.ibm.com/analytics/us/en/technology/cloud-data-services/graph/;>
@@ -363,4 +363,4 @@ WHERE(Created.by(Friends.of("gremlin")))
});
-
\ No newline at end of file
+
Repository: tinkerpop
Updated Branches:
refs/heads/master 71af16049 -> 195b819db
CTR: Added AWK script that helps to publish the homepage. The script
used by publish-docs.sh is not reusable in this case.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/195b819d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/195b819d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/195b819d
Branch: refs/heads/master
Commit: 195b819db4842fc822a953a6f4b47d33f88e2e11
Parents: 71af160
Author: Daniel Kuppitz
Authored: Mon Mar 20 17:43:29 2017 +0100
Committer: Daniel Kuppitz
Committed: Mon Mar 20 17:43:29 2017 +0100
--
bin/publish-home.awk | 31 +++
bin/publish-home.sh | 2 +-
2 files changed, 32 insertions(+), 1 deletion(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/195b819d/bin/publish-home.awk
--
diff --git a/bin/publish-home.awk b/bin/publish-home.awk
new file mode 100644
index 000..3876938
--- /dev/null
+++ b/bin/publish-home.awk
@@ -0,0 +1,31 @@
+# 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.
+
+#
+# @author Daniel Kuppitz (http://gremlin.guru)
+#
+/^Files / {
+ print "U " gensub("^[^/]*/", "", "g", $2)
+}
+
+/^Only in (images|css|js)/ {
+ print "D " gensub(/:$/, "", "g", gensub("^[^/]*/", "", "g", $3)) "/" $4
+}
+
+/^Only in \.\./ {
+ print "A " gensub(/:$/, "", "g", gensub("^[^/]*/[^/]*/", "", "g", $3)) "/" $4
+}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/195b819d/bin/publish-home.sh
--
diff --git a/bin/publish-home.sh b/bin/publish-home.sh
index 1543c42..377e740 100755
--- a/bin/publish-home.sh
+++ b/bin/publish-home.sh
@@ -48,7 +48,7 @@ cd target/svn
find ../site/home -mindepth 1 -maxdepth 1 -type d | xargs -n1 basename | xargs
-r ${SVN_CMD} update
-diff -rq ./ ../site/home/ | awk -f ../../bin/publish-docs.awk | sed 's/^\(.\)
\//\1 /g' > ../publish-home.files
+diff -rq ./ ../site/home/ | awk -f ../../bin/publish-home.awk | sed 's/^\(.\)
\//\1 /g' > ../publish-home.files
for file in $(cat ../publish-home.files | awk '/^[AU]/ {print $2}')
do