You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/09/08 21:13:49 UTC
[01/50] incubator-tinkerpop git commit: tweaked BLVP configuration
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/TINKERPOP3-333 c3de6f8c2 -> d86b28560
tweaked BLVP configuration
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/b1191e74
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/b1191e74
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/b1191e74
Branch: refs/heads/TINKERPOP3-333
Commit: b1191e743a2b574a7bcc990ad27d99ab9df21f8f
Parents: e5d5192
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Aug 31 20:38:27 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Aug 31 20:38:27 2015 +0200
----------------------------------------------------------------------
.../gremlin/process/computer/VertexProgram.java | 4 +
.../bulkloading/BulkLoaderVertexProgram.java | 83 +++++++++++++++++---
.../bulkloading/IncrementalBulkLoader.java | 11 +--
.../util/AbstractVertexProgramBuilder.java | 5 +-
.../BulkLoaderVertexProgramTest.java | 17 +---
5 files changed, 90 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1191e74/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java
index 4fd9e82..37ff8e7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/VertexProgram.java
@@ -223,6 +223,10 @@ public interface VertexProgram<M> extends Cloneable {
public interface Builder {
+ /**
+ * This method should only be used by the underlying compute engine. For VertexProgram configurations, please
+ * use specific fluent methods off the builder.
+ */
public Builder configure(final Object... keyValues);
public <P extends VertexProgram> P create(final Graph graph);
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1191e74/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
index 9ab21c2..eaebd53 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
@@ -20,7 +20,9 @@ package org.apache.tinkerpop.gremlin.process.computer.bulkloading;
import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.ConfigurationUtils;
+import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
import org.apache.tinkerpop.gremlin.process.computer.Memory;
import org.apache.tinkerpop.gremlin.process.computer.MessageScope;
@@ -58,6 +60,8 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
public static final String BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX = "gremlin.bulkLoaderVertexProgram";
public static final String GRAPH_CFG_KEY = "graph";
public static final String BULK_LOADER_CFG_KEY = "loader";
+ public final static String USER_SUPPLIED_IDS_CFG_KEY = "userSuppliedIds";
+ public final static String KEEP_ORIGINAL_IDS_CFG_KEY = "keepOriginalIds";
public static final String INTERMEDIATE_BATCH_SIZE_CFG_KEY = "intermediateBatchSize";
public static final String BULK_LOADER_VERTEX_ID_CFG_KEY = "vertexIdProperty";
public static final String DEFAULT_BULK_LOADER_VERTEX_ID = "bulkLoader.vertex.id";
@@ -81,13 +85,6 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
elementComputeKeys = new HashSet<>();
}
- private Configuration getGraphConfiguration() {
- final Configuration config = configuration.subset(GRAPH_CFG_KEY);
- config.setProperty(Graph.GRAPH, config.getString("class"));
- config.clearProperty("class");
- return config;
- }
-
private BulkLoader createBulkLoader() {
final BulkLoader loader;
final Configuration config = configuration.subset(BULK_LOADER_CFG_KEY);
@@ -118,7 +115,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
* @param close Whether to close the current graph instance after calling commit() or not.
*/
private void commit(final boolean close) {
- if (!close && (counter.get().incrementAndGet() % intermediateBatchSize != 0 || intermediateBatchSize == 0L))
+ if (!close && (intermediateBatchSize == 0L || counter.get().incrementAndGet() % intermediateBatchSize != 0))
return;
if (null != graph) {
if (graph.features().graph().supportsTransactions()) {
@@ -176,7 +173,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
@Override
public void workerIterationStart(final Memory memory) {
if (null == graph) {
- graph = GraphFactory.open(getGraphConfiguration());
+ graph = GraphFactory.open(configuration.subset(GRAPH_CFG_KEY));
LOGGER.info("Opened Graph instance: {}", graph);
try {
if (!graph.features().graph().supportsConcurrentAccess()) {
@@ -321,5 +318,73 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
ConfigurationUtils.append(graph.configuration().subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX), configuration);
return (BulkLoaderVertexProgram) VertexProgram.createVertexProgram(graph, this.configuration);
}
+
+ private void setLoaderConfigurationProperty(final String key, final Object value) {
+ configuration.setProperty(String.join(".", BULK_LOADER_CFG_KEY, key), value);
+ }
+
+ private void setGraphConfigurationProperty(final String key, final Object value) {
+ configuration.setProperty(String.join(".", GRAPH_CFG_KEY, key), value);
+ }
+
+ /**
+ * Sets the class name of the BulkLoader implementation to be used.
+ */
+ public Builder bulkLoader(final String className) {
+ setLoaderConfigurationProperty(Graph.GRAPH, className);
+ return this;
+ }
+
+ /**
+ * Sets the class of the BulkLoader implementation to be used.
+ */
+ public Builder bulkLoader(final Class<? extends BulkLoader> clazz) {
+ return bulkLoader(clazz.getCanonicalName());
+ }
+
+ /**
+ * Sets the name of the property that is used to store the original vertex identifiers in the target graph.
+ */
+ public Builder vertexIdProperty(final String name) {
+ setLoaderConfigurationProperty(BULK_LOADER_VERTEX_ID_CFG_KEY, name);
+ return this;
+ }
+
+ /**
+ * Specifies whether user supplied identifiers should be used when the bulk loader creates vertices in the
+ * target graph.
+ */
+ public Builder userSuppliedIds(final boolean useUserSuppliedIds) {
+ setLoaderConfigurationProperty(USER_SUPPLIED_IDS_CFG_KEY, useUserSuppliedIds);
+ return this;
+ }
+
+ /**
+ * Specifies whether the original vertex identifiers should be kept in the target graph or not. In case of false
+ * BulkLoaderVertexProgram will add another iteration to remove the properties and it won't be possible to use
+ * the data for further incremental bulk loads.
+ */
+ public Builder keepOriginalIds(final boolean keepOriginalIds) {
+ setLoaderConfigurationProperty(KEEP_ORIGINAL_IDS_CFG_KEY, keepOriginalIds);
+ return this;
+ }
+
+ /**
+ * The batch size for a single transaction (number of vertices in the vertex loading stage; number of edges in
+ * the edge loading stage).
+ */
+ public Builder intermediateBatchSize(final int batchSize) {
+ configuration.setProperty(INTERMEDIATE_BATCH_SIZE_CFG_KEY, batchSize);
+ return this;
+ }
+
+ /**
+ * A configuration for the target graph that can be passed to GraphFactory.open().
+ */
+ public Builder writeGraph(final String configurationFile) throws ConfigurationException {
+ final Configuration conf = new PropertiesConfiguration(configurationFile);
+ conf.getKeys().forEachRemaining(key -> setGraphConfigurationProperty(key, conf.getProperty(key)));
+ return this;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1191e74/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/IncrementalBulkLoader.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/IncrementalBulkLoader.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/IncrementalBulkLoader.java
index 2177d0b..f03cd18 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/IncrementalBulkLoader.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/IncrementalBulkLoader.java
@@ -36,9 +36,6 @@ import java.util.Iterator;
*/
public class IncrementalBulkLoader implements BulkLoader {
- public final static String USER_SUPPLIED_IDS_CFG_KEY = "userSuppliedIds";
- public final static String KEEP_ORIGINAL_IDS_CFG_KEY = "keepOriginalIds";
-
private String bulkLoaderVertexId = BulkLoaderVertexProgram.DEFAULT_BULK_LOADER_VERTEX_ID;
private boolean keepOriginalIds = true;
private boolean userSuppliedIds = false;
@@ -143,11 +140,11 @@ public class IncrementalBulkLoader implements BulkLoader {
if (configuration.containsKey(BulkLoaderVertexProgram.BULK_LOADER_VERTEX_ID_CFG_KEY)) {
bulkLoaderVertexId = configuration.getString(BulkLoaderVertexProgram.BULK_LOADER_VERTEX_ID_CFG_KEY);
}
- if (configuration.containsKey(USER_SUPPLIED_IDS_CFG_KEY)) {
- userSuppliedIds = configuration.getBoolean(USER_SUPPLIED_IDS_CFG_KEY);
+ if (configuration.containsKey(BulkLoaderVertexProgram.USER_SUPPLIED_IDS_CFG_KEY)) {
+ userSuppliedIds = configuration.getBoolean(BulkLoaderVertexProgram.USER_SUPPLIED_IDS_CFG_KEY);
}
- if (configuration.containsKey(KEEP_ORIGINAL_IDS_CFG_KEY)) {
- keepOriginalIds = configuration.getBoolean(KEEP_ORIGINAL_IDS_CFG_KEY);
+ if (configuration.containsKey(BulkLoaderVertexProgram.KEEP_ORIGINAL_IDS_CFG_KEY)) {
+ keepOriginalIds = configuration.getBoolean(BulkLoaderVertexProgram.KEEP_ORIGINAL_IDS_CFG_KEY);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1191e74/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/AbstractVertexProgramBuilder.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/AbstractVertexProgramBuilder.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/AbstractVertexProgramBuilder.java
index 035b685..50e5157 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/AbstractVertexProgramBuilder.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/AbstractVertexProgramBuilder.java
@@ -18,8 +18,8 @@
*/
package org.apache.tinkerpop.gremlin.process.computer.util;
-import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
import org.apache.commons.configuration.BaseConfiguration;
+import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
import org.apache.tinkerpop.gremlin.structure.Graph;
/**
@@ -44,6 +44,9 @@ public abstract class AbstractVertexProgramBuilder<B extends VertexProgram.Build
return (B) this;
}*/
+ /**
+ * {@inheritDoc}
+ */
@Override
public B configure(final Object... keyValues) {
VertexProgramHelper.legalConfigurationKeyValueArray(keyValues);
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b1191e74/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java
index 3584c00..d3e42f7 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java
@@ -22,7 +22,6 @@ import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
-import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.util.GraphFactory;
import org.junit.Test;
@@ -38,11 +37,7 @@ import static org.junit.Assert.assertTrue;
*/
public class BulkLoaderVertexProgramTest extends AbstractGremlinProcessTest {
- private BulkLoader getBulkLoader(final Configuration configuration) throws Exception {
- final VertexProgram.Builder builder = BulkLoaderVertexProgram.build();
- if (configuration != null)
- configuration.getKeys().forEachRemaining(key -> builder.configure(key, configuration.getProperty(key)));
- BulkLoaderVertexProgram blvp = builder.create(graph);
+ private BulkLoader getBulkLoader(final BulkLoaderVertexProgram blvp) throws Exception {
final Field field = BulkLoaderVertexProgram.class.getDeclaredField("bulkLoader");
field.setAccessible(true);
return (BulkLoader) field.get(blvp);
@@ -56,7 +51,7 @@ public class BulkLoaderVertexProgramTest extends AbstractGremlinProcessTest {
@Test
public void shouldUseIncrementalBulkLoaderByDefault() throws Exception {
- final BulkLoader loader = getBulkLoader(null);
+ final BulkLoader loader = getBulkLoader(BulkLoaderVertexProgram.build().create(graph));
assertTrue(loader instanceof IncrementalBulkLoader);
assertTrue(loader.keepOriginalIds());
assertFalse(loader.useUserSuppliedIds());
@@ -65,9 +60,7 @@ public class BulkLoaderVertexProgramTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void shouldStoreOriginalIds() throws Exception {
- final Configuration configuration = new BaseConfiguration();
- configuration.setProperty("loader.userSuppliedIds", false);
- final BulkLoader loader = getBulkLoader(configuration);
+ final BulkLoader loader = getBulkLoader(BulkLoaderVertexProgram.build().userSuppliedIds(false).create(graph));
assertFalse(loader.useUserSuppliedIds());
final Graph target = getTargetGraph();
graph.vertices().forEachRemaining(v -> loader.getOrCreateVertex(v, target, target.traversal()));
@@ -77,9 +70,7 @@ public class BulkLoaderVertexProgramTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void shouldNotStoreOriginalIds() throws Exception {
- final Configuration configuration = new BaseConfiguration();
- configuration.setProperty("loader.userSuppliedIds", true);
- final BulkLoader loader = getBulkLoader(configuration);
+ final BulkLoader loader = getBulkLoader(BulkLoaderVertexProgram.build().userSuppliedIds(true).create(graph));
assertTrue(loader.useUserSuppliedIds());
final Graph target = getTargetGraph();
graph.vertices().forEachRemaining(v -> loader.getOrCreateVertex(v, target, target.traversal()));
[18/50] incubator-tinkerpop git commit: added tinkergraph-gremlin
dependency (scope: test) to hadoop-gremlin in order to be able to execute
BLVP tests properly
Posted by sp...@apache.org.
added tinkergraph-gremlin dependency (scope: test) to hadoop-gremlin in order to be able to execute BLVP tests properly
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/18adacd4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/18adacd4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/18adacd4
Branch: refs/heads/TINKERPOP3-333
Commit: 18adacd4ae37747bba4611e55c99fa0f988095e4
Parents: f0992f2
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue Sep 1 19:41:46 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue Sep 1 19:41:46 2015 +0200
----------------------------------------------------------------------
.../computer/bulkloading/BulkLoaderVertexProgramTest.java | 1 +
hadoop-gremlin/pom.xml | 6 ++++++
2 files changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/18adacd4/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java
index d3e42f7..9905da9 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgramTest.java
@@ -78,4 +78,5 @@ public class BulkLoaderVertexProgramTest extends AbstractGremlinProcessTest {
}
// TODO: once Neo4j supports concurrent connections, write a real integration test that leverages BLVP
+ // TODO: also, once Neo4j can be used, remove the tinkergraph-gremlin dependency from hadoop-gremlin and clean up the existing tests
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/18adacd4/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index ff094c4..f0651d9 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -200,6 +200,12 @@ limitations under the License.
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.tinkerpop</groupId>
+ <artifactId>tinkergraph-gremlin</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<repositories>
<repository>
[25/50] incubator-tinkerpop git commit: Update release process a bit
and cover release candidates.
Posted by sp...@apache.org.
Update release process a bit and cover release candidates.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/64a6436b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/64a6436b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/64a6436b
Branch: refs/heads/TINKERPOP3-333
Commit: 64a6436bb3948b50be97fee5b6ce36196aefba4a
Parents: 167e419
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Sep 2 07:42:07 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Sep 2 07:42:07 2015 -0400
----------------------------------------------------------------------
RELEASE.asciidoc | 46 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/64a6436b/RELEASE.asciidoc
----------------------------------------------------------------------
diff --git a/RELEASE.asciidoc b/RELEASE.asciidoc
index c3d8d78..abd282e 100644
--- a/RELEASE.asciidoc
+++ b/RELEASE.asciidoc
@@ -17,7 +17,36 @@ limitations under the License.
Release Process
---------------
-The following instructions represent the steps required to release TinkerPop:
+This document describes the steps required to release a version of TinkerPop. The process is multi-phased and can therefore take several weeks to complete given the time needed for Apache voting and community feedback. Once a release point has been identified, the following phases represent the flow of "release":
+
+* Optionally, produce a release candidate for community feedback.
+* Submit the official release for PMC vote.
+* Submit the official release for Incubator vote.
+* Release and promote.
+
+Release Candidate
+~~~~~~~~~~~~~~~~~
+
+A release candidate is an unofficial release that is represented by a tagged version in the Git repository. It is offered in cases where there is significant change in a particular version and the potential for upgrades and problems might be high.
+
+. `mvn clean install -DincludeNeo4j`
+.. `mvn verify -DskipIntegrationTests=false -DincludeNeo4j`
+.. `mvn verify -DskipPerformanceTests=false`
+. `bin/publish-docs.sh <username>` - note that under a release candidate the documentation is published as SNAPSHOT
+. `bin/bump.sh "version"` to update the project files to reference a non-SNAPSHOT `rc` version (e.g. `x.y.z-incubating-rc1)
+. `git diff` and review the updated files (expect all `pom.xml` files and this README)
+. `git commit -a -m "TinkerPop x.y.z release"` and `git push`
+. `git tag -a -m "TinkerPop x.y.z release" x.y.z` and `git push --tags`
+. `mvn clean install -Dmaven.test.skip=true`
+. `bin/bump.sh "version"` to go back to SNAPSHOT
+. `git commit -a -m "Returned to x.y.z-SNAPSHOT"` and `git push`
+. Announce the release candidate to `dev` mailing list and await feedback
+. Repeat as required or proceed to the next phase
+
+PMC Vote
+~~~~~~~~
+
+A positive vote for a particular release from the TinkerPop PMC is required to move to the following phase.
. `mvn clean install`
.. `mvn verify -DskipIntegrationTests=false -DincludeNeo4j`
@@ -43,8 +72,21 @@ The following instructions represent the steps required to release TinkerPop:
.. `cp ~/.m2/repository/org/apache/tinkerpop/tinkerpop/x.y.z/tinkerpop-x.y.z-source-release.zip* dev/x.y.z`
.. `cd dev/x.y.z` and `for f in *.zip*; do mv "$f" "apache-$f"; done`
.. `cd ..; svn add x.y.z/; svn ci -m "TinkerPop x.y.z release"`
+. Submit for `[VOTE]` at `dev@tinkerpop.incubator.apache.org` (see email template below).
+. *Wait for vote acceptance* (72 hours).
+
+Incubator Vote
+~~~~~~~~~~~~~~
+
+A positive vote for a particular release from the Apache Incubator is required to move to the following phase.
+
. Submit for `[VOTE]` at `general@incubator.apache.org` (see email template below).
+.. Include the vote tally: "Apache TinkerPop (http://tinkerpop.incubator.apache.org/) would like to release TinkerPop x.y.z. We had a dev@ VOTE which resulted in a tally of +1 (3), 0 (0), and -1 (0). We now present our artifacts for vote by Incubator."
. *Wait for vote acceptance* (72 hours).
+
+Release & Promote
+~~~~~~~~~~~~~~~~~
+
. `mvn clean install -Dmaven.test.skip=true; bin/process-docs.sh` - rebuild source and docs of tagged release
. `mvn deploy -Papache-release -DcreateChecksum=true -Dmaven.test.skip=true`- deploy signed artifacts with checksums to Apache Nexus
. Review and close the staging repository (Apache Nexus at link:https://repository.apache.org/[https://repository.apache.org/])
@@ -90,4 +132,4 @@ My vote is +1.
Thank you very much,
<TinkerPop Committer Name>
-```
+```
\ No newline at end of file
[11/50] incubator-tinkerpop git commit: fix for RepeatTest. Sorry,
I got my branches all mixed up. This is basically me fixing things.
Posted by sp...@apache.org.
fix for RepeatTest. Sorry, I got my branches all mixed up. This is basically me fixing things.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/12de5151
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/12de5151
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/12de5151
Branch: refs/heads/TINKERPOP3-333
Commit: 12de51516c30efd750987504b73dd42af78157ab
Parents: d730fe6 19923ff
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 15:07:27 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 15:07:27 2015 -0600
----------------------------------------------------------------------
.../gremlin/process/traversal/step/branch/RepeatTest.java | 8 --------
1 file changed, 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/12de5151/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
----------------------------------------------------------------------
diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
index f5ecbf8,1da33d9..3d07ffd
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
@@@ -220,28 -216,12 +220,20 @@@ public abstract class RepeatTest extend
@Test
@LoadGraphWith(MODERN)
- public void g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name() {
- final Traversal<Vertex, String> traversal = get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(convertToVertexId("marko"));
+ public void g_V_repeatXbothX_timesX10X_asXaX_out_asXbX_selectXa_bX() {
+ final Traversal<Vertex, Map<String, Vertex>> traversal = get_g_V_repeatXbothX_timesX10X_asXaX_out_asXbX_selectXa_bX();
printTraversalForm(traversal);
- checkResults(Arrays.asList("lop", "lop", "ripple", "vadas"), traversal);
+ int counter = 0;
+ while (traversal.hasNext()) {
+ final Map<String, Vertex> map = traversal.next();
+ assertEquals(2, map.size());
+ assertTrue(map.get("a") instanceof Vertex);
+ assertTrue(map.get("b") instanceof Vertex);
+ counter++;
+ }
+ assertTrue(counter > 0);
}
- @Test
- @LoadGraphWith(MODERN)
- public void g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name() {
- final Traversal<Vertex, String> traversal = get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(convertToVertexId("marko"));
- printTraversalForm(traversal);
- checkResults(Arrays.asList("lop", "lop", "ripple", "vadas"), traversal);
- }
-
public static class Traversals extends RepeatTest {
@Override
[16/50] incubator-tinkerpop git commit: Merge branch 'blvp' into tp30
Posted by sp...@apache.org.
Merge branch 'blvp' into tp30
Resolved Conflicts:
CHANGELOG.asciidoc
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/f0992f22
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/f0992f22
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/f0992f22
Branch: refs/heads/TINKERPOP3-333
Commit: f0992f2257ec356eac3135197f1bb3ed81db8da1
Parents: 0c826bb f9ac298
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue Sep 1 16:25:10 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue Sep 1 16:25:10 2015 +0200
----------------------------------------------------------------------
CHANGELOG.asciidoc | 4 +-
.../gremlin/process/computer/VertexProgram.java | 4 +
.../computer/bulkloading/BulkLoader.java | 115 ++++++
.../bulkloading/BulkLoaderVertexProgram.java | 407 +++++++++++++++++++
.../bulkloading/IncrementalBulkLoader.java | 150 +++++++
.../util/AbstractVertexProgramBuilder.java | 5 +-
.../tinkerpop/gremlin/structure/Graph.java | 13 +
.../gremlin/structure/io/gryo/GryoMapper.java | 19 +-
.../structure/io/gryo/PairSerializer.java | 42 ++
.../process/GroovyProcessComputerSuite.java | 23 +-
.../AbstractImportCustomizerProvider.java | 2 +
.../gremlin/process/ProcessComputerSuite.java | 2 +
.../BulkLoaderVertexProgramTest.java | 81 ++++
.../gremlin/neo4j/structure/Neo4jGraph.java | 5 +
.../tinkergraph/structure/TinkerGraph.java | 5 +
15 files changed, 865 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f0992f22/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index d20c2fc,234d431..e7da592
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -25,9 -25,7 +25,11 @@@ image::http://www.tinkerpop.com/docs/cu
TinkerPop 3.0.1 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++* Added `BulkLoaderVertexProgram` and a default bulk loader implementation: `IncrementalBulkLoader`
+* `Compare` now uses `BigDecimal` internally to ensure that precision is not lost on standard number comparisons.
+* Renamed `ComputerVerificationStrategy` to `VerificationStrategy` so all the verification strategies can use it.
+* Added `StandardVerificationStrategy` that throws exceptions for illegal traversal patterns on the standard engine (which extends to `GraphComputer`).
+ * Added `GraphFeatures.supportsConcurrentAccess()` to allows `Graph` implementations to signify if multiple instances can access the same data.
* Clarified semantics of `Transaction.close()` in unit tests - now refers only to closing the current transaction in the current thread.
* `Neo4jGraph` no longer uses `OptOut` on `TransactionTest.shouldRollbackOnCloseWhenConfigured` (formerly `shouldRollbackOnShutdownWhenConfigured`)
* Gremlin Server initialization scripts can now return a `Map` of values that will become global bindings for the server.
@@@ -722,4 -720,4 +724,4 @@@ TinkerPop 3.0.0.M2 (Release Date: Septe
TinkerPop 3.0.0.M1 (Release Date: August 12, 2014)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--* First official release of TinkerPop3 and thus, no changes.
++* First official release of TinkerPop3 and thus, no changes.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f0992f22/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
----------------------------------------------------------------------
[14/50] incubator-tinkerpop git commit: extended
BulkLoaderVertexProgram's toString() output;
included all configuration properties except the writeGraph
Posted by sp...@apache.org.
extended BulkLoaderVertexProgram's toString() output; included all configuration properties except the writeGraph
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/f9ac298a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/f9ac298a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/f9ac298a
Branch: refs/heads/TINKERPOP3-333
Commit: f9ac298a9de569dcbff5e76f2c8de5f40081314b
Parents: 9546e44
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue Sep 1 02:58:47 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue Sep 1 02:58:47 2015 +0200
----------------------------------------------------------------------
.../computer/bulkloading/BulkLoaderVertexProgram.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f9ac298a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
index 962edd0..d5eb835 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
@@ -295,7 +295,17 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
@Override
public String toString() {
- return StringFactory.vertexProgramString(this, bulkLoader != null ? bulkLoader.getClass().getSimpleName() : null);
+ final StringBuilder sb = new StringBuilder();
+ if (bulkLoader != null) {
+ sb.append("bulkLoader=").append(bulkLoader.getClass().getSimpleName()).append(",");
+ sb.append("vertexIdProperty=").append(bulkLoader.getVertexIdProperty()).append(",");
+ sb.append("userSuppliedIds=").append(bulkLoader.useUserSuppliedIds()).append(",");
+ sb.append("keepOriginalIds=").append(bulkLoader.keepOriginalIds()).append(",");
+ } else {
+ sb.append("bulkLoader=").append(bulkLoader).append(",");
+ }
+ sb.append("batchSize=").append(intermediateBatchSize);
+ return StringFactory.vertexProgramString(this, sb.toString());
}
public static Builder build() {
[15/50] incubator-tinkerpop git commit: Removed an "optimization"
that caused TINKERPOP3-822
Posted by sp...@apache.org.
Removed an "optimization" that caused TINKERPOP3-822
When calling g.V(v).has(), the has() portion would get ignored.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/0c826bb1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/0c826bb1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/0c826bb1
Branch: refs/heads/TINKERPOP3-333
Commit: 0c826bb15b13addba29af34165198a08023780bc
Parents: 19923ff
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 1 08:10:11 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 1 08:10:11 2015 -0400
----------------------------------------------------------------------
.../traversal/step/filter/GroovyHasTest.groovy | 5 +++++
.../process/traversal/step/filter/HasTest.java | 20 ++++++++++++++------
.../step/sideEffect/Neo4jGraphStep.java | 4 +---
.../step/sideEffect/TinkerGraphStep.java | 4 +---
4 files changed, 21 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0c826bb1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy
index 3d71644..73e6b79 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyHasTest.groovy
@@ -70,6 +70,11 @@ public abstract class GroovyHasTest {
}
@Override
+ public Traversal<Vertex, Vertex> get_g_VXv1X_hasXage_gt_30X(final Object v1Id) {
+ TraversalScriptHelper.compute("g.V(g.V(v1Id).next()).has('age', gt(30))", g, "v1Id", v1Id);
+ }
+
+ @Override
public Traversal<Vertex, Vertex> get_g_VX1X_out_hasIdX2X(final Object v1Id, final Object v2Id) {
TraversalScriptHelper.compute(" g.V(v1Id).out.hasId(v2Id)", g, "v1Id", v1Id, "v2Id", v2Id);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0c826bb1/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
index f7aac61..29c00f7 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
@@ -63,6 +63,8 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Vertex> get_g_VX1X_hasXage_gt_30X(final Object v1Id);
+ public abstract Traversal<Vertex, Vertex> get_g_VXv1X_hasXage_gt_30X(final Object v1Id);
+
public abstract Traversal<Vertex, Vertex> get_g_VX1X_out_hasXid_lt_3X(final Object v1Id, final Object v3Id);
public abstract Traversal<Vertex, Vertex> get_g_VX1X_out_hasIdX2X(final Object v1Id, final Object v2Id);
@@ -155,12 +157,13 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void g_VX1X_hasXage_gt_30X() {
- Traversal<Vertex, Vertex> traversal = get_g_VX1X_hasXage_gt_30X(convertToVertexId("marko"));
- printTraversalForm(traversal);
- assertFalse(traversal.hasNext());
- traversal = get_g_VX1X_hasXage_gt_30X(convertToVertexId("josh"));
- printTraversalForm(traversal);
- assertTrue(traversal.hasNext());
+ Arrays.asList(get_g_VX1X_hasXage_gt_30X(convertToVertexId("marko")), get_g_VXv1X_hasXage_gt_30X(convertToVertexId("marko"))).forEach(traversal -> {
+ printTraversalForm(traversal);
+ assertFalse(traversal.hasNext());
+ traversal = get_g_VX1X_hasXage_gt_30X(convertToVertexId("josh"));
+ printTraversalForm(traversal);
+ assertTrue(traversal.hasNext());
+ });
}
@Test
@@ -386,6 +389,11 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
}
@Override
+ public Traversal<Vertex, Vertex> get_g_VXv1X_hasXage_gt_30X(final Object v1Id) {
+ return g.V(g.V(v1Id).next()).has("age", P.gt(30));
+ }
+
+ @Override
public Traversal<Vertex, Vertex> get_g_VX1X_out_hasXid_lt_3X(final Object v1Id, final Object v3Id) {
return g.V(v1Id).out().has(T.id, P.lt(v3Id));
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0c826bb1/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
index b2bfbb6..488f0d2 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
@@ -46,9 +46,7 @@ public final class Neo4jGraphStep<S extends Element> extends GraphStep<S> implem
public Neo4jGraphStep(final GraphStep<S> originalGraphStep) {
super(originalGraphStep.getTraversal(), originalGraphStep.getReturnClass(), originalGraphStep.getIds());
originalGraphStep.getLabels().forEach(this::addLabel);
- //No need to do anything if the first element is an Element, all elements are guaranteed to be an element and will be return as is
- if ((this.ids.length == 0 || !(this.ids[0] instanceof Element)))
- this.setIteratorSupplier(() -> (Iterator<S>) (Vertex.class.isAssignableFrom(this.returnClass) ? this.vertices() : this.edges()));
+ this.setIteratorSupplier(() -> (Iterator<S>) (Vertex.class.isAssignableFrom(this.returnClass) ? this.vertices() : this.edges()));
}
private Iterator<? extends Edge> edges() {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0c826bb1/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java
index 56bac20..052120c 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java
@@ -48,9 +48,7 @@ public final class TinkerGraphStep<S extends Element> extends GraphStep<S> imple
public TinkerGraphStep(final GraphStep<S> originalGraphStep) {
super(originalGraphStep.getTraversal(), originalGraphStep.getReturnClass(), originalGraphStep.getIds());
originalGraphStep.getLabels().forEach(this::addLabel);
- //No need to do anything if the first element is an Element, all elements are guaranteed to be an element and will be return as is
- if ((this.ids.length == 0 || !(this.ids[0] instanceof Element)))
- this.setIteratorSupplier(() -> (Iterator<S>) (Vertex.class.isAssignableFrom(this.returnClass) ? this.vertices() : this.edges()));
+ this.setIteratorSupplier(() -> (Iterator<S>) (Vertex.class.isAssignableFrom(this.returnClass) ? this.vertices() : this.edges()));
}
private Iterator<? extends Edge> edges() {
[02/50] incubator-tinkerpop git commit: TINKERPOP3-750: Test large
number comparison
Posted by sp...@apache.org.
TINKERPOP3-750: Test large number comparison
Repro for comparisons that are sensitive to loss of precision when converting Number to double.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/e1917173
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/e1917173
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/e1917173
Branch: refs/heads/TINKERPOP3-333
Commit: e1917173d8a44b97799ecffb405948e0549af6d6
Parents: a20d060
Author: mhfrantz <mf...@redsealnetworks.com>
Authored: Mon Aug 31 11:42:35 2015 -0700
Committer: mhfrantz <mf...@redsealnetworks.com>
Committed: Mon Aug 31 13:26:05 2015 -0700
----------------------------------------------------------------------
.../gremlin/process/traversal/CompareTest.java | 49 ++++++++++++++++----
1 file changed, 40 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e1917173/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/CompareTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/CompareTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/CompareTest.java
index 6184c94..a7d8e1b 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/CompareTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/CompareTest.java
@@ -32,13 +32,13 @@ import static org.junit.Assert.assertEquals;
/**
* @author Stephen Mallette (http://stephen.genoprime.com)
+ * @author Matt Frantz (http://github.com/mhfrantz)
*/
@RunWith(Parameterized.class)
public class CompareTest {
@Parameterized.Parameters(name = "{0}.test({1},{2}) = {3}")
public static Iterable<Object[]> data() {
- final List<Object> one = Arrays.asList(1, 1l, 1d, 1f, BigDecimal.ONE, BigInteger.ONE);
final List<Object[]> testCases = new ArrayList<>(Arrays.asList(new Object[][]{
{Compare.eq, null, null, true},
{Compare.eq, null, 1, false},
@@ -89,16 +89,47 @@ public class CompareTest {
{Compare.lte, "z", "a", false},
{Compare.lte, "a", "z", true}
}));
- for (int i = 0; i < one.size(); i++) {
- for (int j = 0; j < one.size(); j++) {
- testCases.add(new Object[]{Compare.eq, one.get(i), one.get(j), true});
- testCases.add(new Object[]{Compare.neq, one.get(i), one.get(j), false});
- testCases.add(new Object[]{Compare.gt, one.get(i), one.get(j), false});
- testCases.add(new Object[]{Compare.lt, one.get(i), one.get(j), false});
- testCases.add(new Object[]{Compare.gte, one.get(i), one.get(j), true});
- testCases.add(new Object[]{Compare.lte, one.get(i), one.get(j), true});
+ // Compare Numbers of mixed types.
+ final List<Object> one = Arrays.asList(1, 1l, 1d, 1f, BigDecimal.ONE, BigInteger.ONE);
+ for (Object i : one) {
+ for (Object j : one) {
+ testCases.addAll(Arrays.asList(new Object[][]{
+ {Compare.eq, i, j, true},
+ {Compare.neq, i, j, false},
+ {Compare.gt, i, j, false},
+ {Compare.lt, i, j, false},
+ {Compare.gte, i, j, true},
+ {Compare.lte, i, j, true},
+ }));
}
}
+ // Compare large numbers of different types that cannot convert to doubles losslessly.
+ final BigInteger big1 = new BigInteger("123456789012345678901234567890");
+ final BigDecimal big1d = new BigDecimal("123456789012345678901234567890");
+ final BigDecimal big2 = new BigDecimal(big1.add(BigInteger.ONE));
+ testCases.addAll(Arrays.asList(new Object[][]{
+ // big1 == big1d
+ {Compare.eq, big1, big1d, true},
+ {Compare.neq, big1, big1d, false},
+ {Compare.gt, big1, big1d, false},
+ {Compare.lt, big1, big1d, false},
+ {Compare.gte, big1, big1d, true},
+ {Compare.lte, big1, big1d, true},
+ // big1 < big2
+ {Compare.eq, big1, big2, false},
+ {Compare.neq, big1, big2, true},
+ {Compare.gt, big1, big2, false},
+ {Compare.lt, big1, big2, true},
+ {Compare.gte, big1, big2, false},
+ {Compare.lte, big1, big2, true},
+ // Reverse the operands for symmetric test coverage (big2 > big1)
+ {Compare.eq, big2, big1, false},
+ {Compare.neq, big2, big1, true},
+ {Compare.gt, big2, big1, true},
+ {Compare.lt, big2, big1, false},
+ {Compare.gte, big2, big1, true},
+ {Compare.lte, big2, big1, false},
+ }));
return testCases;
}
[43/50] incubator-tinkerpop git commit: Update javadoc.
Posted by sp...@apache.org.
Update javadoc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/27322aba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/27322aba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/27322aba
Branch: refs/heads/TINKERPOP3-333
Commit: 27322aba7d78f76547a42c740b2c75f931183d0c
Parents: 847642e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Sep 4 10:14:45 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Sep 4 10:14:45 2015 -0400
----------------------------------------------------------------------
.../gremlin/driver/AuthProperties.java | 34 ++++++++++++++++++--
.../tinkerpop/gremlin/driver/Handler.java | 2 +-
2 files changed, 32 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/27322aba/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/AuthProperties.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/AuthProperties.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/AuthProperties.java
index 3fd464a..2c1b4d4 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/AuthProperties.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/AuthProperties.java
@@ -21,22 +21,50 @@ package org.apache.tinkerpop.gremlin.driver;
import java.util.HashMap;
import java.util.Map;
+/**
+ * Properties to supply to the {@link Cluster} for authentication purposes.
+ */
public class AuthProperties {
+
+ /**
+ * An enum of the available authorization properties.
+ */
public enum Property {
+ /**
+ * The username.
+ */
USERNAME,
+
+ /**
+ * The password.
+ */
PASSWORD,
+
+ /**
+ * The protocol for which the authentication is being performed (e.g., "ldap").
+ */
PROTOCOL,
+
+ /**
+ * The name used as the index into the configuration for the {@code LoginContext}.
+ */
JAAS_ENTRY
}
- private Map<Property, String> properties = new HashMap<>();
+ private final Map<Property, String> properties = new HashMap<>();
- public AuthProperties with(Property key, String value) {
+ /**
+ * Adds a {@link Property} with value to the authorization property set.
+ */
+ public AuthProperties with(final Property key, final String value) {
properties.put(key, value);
return this;
}
- public String get(Property key) {
+ /**
+ * Gets a property given the key.
+ */
+ public String get(final Property key) {
return properties.get(key);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/27322aba/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Handler.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Handler.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Handler.java
index 73df542..8871f13 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Handler.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Handler.java
@@ -129,7 +129,7 @@ final class Handler {
private Subject login() throws LoginException {
// Login if the user provided us with an entry into the JAAS config file
if (authProps.get(AuthProperties.Property.JAAS_ENTRY) != null) {
- LoginContext login = new LoginContext(authProps.get(AuthProperties.Property.JAAS_ENTRY));
+ final LoginContext login = new LoginContext(authProps.get(AuthProperties.Property.JAAS_ENTRY));
login.login();
return login.getSubject();
}
[33/50] incubator-tinkerpop git commit: Merge remote-tracking branch
'origin/tp30'
Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/tp30'
Conflicts:
gremlin-console/pom.xml
gremlin-core/pom.xml
gremlin-driver/pom.xml
gremlin-groovy-test/pom.xml
gremlin-groovy/pom.xml
gremlin-server/pom.xml
gremlin-shaded/pom.xml
gremlin-test/pom.xml
hadoop-gremlin/pom.xml
neo4j-gremlin/pom.xml
neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/process/traversal/step/sideEffect/Neo4jGraphStep.java
pom.xml
tinkergraph-gremlin/pom.xml
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/9fd51293
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/9fd51293
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/9fd51293
Branch: refs/heads/TINKERPOP3-333
Commit: 9fd5129369927d15d25860e7b992044b912609ba
Parents: 2253c67 5a38139
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Sep 3 11:20:24 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Sep 3 11:20:24 2015 -0400
----------------------------------------------------------------------
CHANGELOG.asciidoc | 35 +-
RELEASE.asciidoc | 46 ++-
gremlin-console/src/main/LICENSE | 36 +-
gremlin-console/src/main/NOTICE | 59 +--
.../gremlin/process/computer/VertexProgram.java | 4 +
.../computer/bulkloading/BulkLoader.java | 115 ++++++
.../bulkloading/BulkLoaderVertexProgram.java | 407 +++++++++++++++++++
.../bulkloading/IncrementalBulkLoader.java | 150 +++++++
.../util/AbstractVertexProgramBuilder.java | 5 +-
.../ComputerVerificationStrategy.java | 7 +
.../tinkerpop/gremlin/structure/Graph.java | 13 +
.../gremlin/structure/io/gryo/GryoMapper.java | 3 +-
.../structure/io/gryo/PairSerializer.java | 42 ++
.../traversal/step/filter/GroovyHasTest.groovy | 5 +
.../traversal/step/map/GroovyOrderTest.groovy | 4 +-
.../process/GroovyProcessComputerSuite.java | 24 +-
.../AbstractImportCustomizerProvider.java | 2 +
gremlin-server/src/main/LICENSE | 33 +-
gremlin-server/src/main/NOTICE | 90 +---
.../gremlin/process/ProcessComputerSuite.java | 2 +
.../BulkLoaderVertexProgramTest.java | 82 ++++
.../process/traversal/step/filter/HasTest.java | 20 +-
.../process/traversal/step/map/OrderTest.java | 22 +-
hadoop-gremlin/pom.xml | 6 +
.../step/sideEffect/Neo4jGraphStep.java | 4 +-
.../gremlin/neo4j/structure/Neo4jGraph.java | 5 +
.../step/sideEffect/TinkerGraphStep.java | 4 +-
.../tinkergraph/structure/TinkerGraph.java | 5 +
28 files changed, 1042 insertions(+), 188 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/CHANGELOG.asciidoc
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
----------------------------------------------------------------------
diff --cc gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
index dfde060,47301e7..6382ced
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/process/GroovyProcessComputerSuite.java
@@@ -42,7 -43,26 +43,27 @@@ import org.apache.tinkerpop.gremlin.pro
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.GroovySimplePathTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.GroovyTailTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.GroovyWhereTest;
- import org.apache.tinkerpop.gremlin.process.traversal.step.map.*;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyAddEdgeTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyCoalesceTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyConstantTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyCountTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyFoldTest;
++import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyLoopsTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyMapKeysTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyMapTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyMapValuesTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyMatchTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyMaxTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyMeanTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyMinTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyOrderTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyPathTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyPropertiesTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovySelectTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovySumTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyUnfoldTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyValueMapTest;
+ import org.apache.tinkerpop.gremlin.process.traversal.step.map.GroovyVertexTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovyAggregateTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovyGroupCountTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroovyGroupTest;
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9fd51293/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java
----------------------------------------------------------------------
[10/50] incubator-tinkerpop git commit: added RepeatTests around
until(barrier).
Posted by sp...@apache.org.
added RepeatTests around until(barrier).
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/19923ffb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/19923ffb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/19923ffb
Branch: refs/heads/TINKERPOP3-333
Commit: 19923ffb265f538eecf91ffc85eee6680ea0acbb
Parents: 2ffde6c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 15:05:53 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 15:05:53 2015 -0600
----------------------------------------------------------------------
.../traversal/step/branch/GroovyRepeatTest.groovy | 5 +++++
.../process/traversal/step/branch/RepeatTest.java | 15 +++++++++++++++
2 files changed, 20 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/19923ffb/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
index 024ed6c..42b7a77 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
@@ -74,5 +74,10 @@ public abstract class GroovyRepeatTest {
public Traversal<Vertex, Map<String, Long>> get_g_V_repeatXgroupCountXmX_byXnameX_outX_timesX2X_capXmX() {
TraversalScriptHelper.compute("g.V.repeat(groupCount('m').by('name').out).times(2).cap('m')", g)
}
+
+ @Override
+ public Traversal<Vertex, String> get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(final Object v1Id) {
+ TraversalScriptHelper.compute("g.V(${v1Id}).repeat(out()).until(__.outE.count.is(0)).name", g, "v1Id", v1Id)
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/19923ffb/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
index 550c7d2..1da33d9 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
@@ -70,6 +70,8 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Map<String, Long>> get_g_V_repeatXgroupCountXmX_byXnameX_outX_timesX2X_capXmX();
+ public abstract Traversal<Vertex, String> get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(final Object v1Id);
+
@Test
@LoadGraphWith(MODERN)
public void g_V_repeatXoutX_timesX2X_emit_path() {
@@ -212,6 +214,14 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
});
}
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name() {
+ final Traversal<Vertex, String> traversal = get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(convertToVertexId("marko"));
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList("lop", "lop", "ripple", "vadas"), traversal);
+ }
+
public static class Traversals extends RepeatTest {
@Override
@@ -258,5 +268,10 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
public Traversal<Vertex, Map<String, Long>> get_g_V_repeatXgroupCountXmX_byXnameX_outX_timesX2X_capXmX() {
return g.V().repeat(groupCount("m").by("name").out()).times(2).cap("m");
}
+
+ @Override
+ public Traversal<Vertex, String> get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(final Object v1Id) {
+ return g.V(v1Id).repeat(out()).until(outE().count().is(0)).values("name");
+ }
}
}
\ No newline at end of file
[49/50] incubator-tinkerpop git commit: Merge remote-tracking branch
'origin/master' into TINKERPOP3-333
Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/master' into TINKERPOP3-333
Conflicts:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/781a4667
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/781a4667
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/781a4667
Branch: refs/heads/TINKERPOP3-333
Commit: 781a4667e84be2141c961923d088612557ec2301
Parents: c3de6f8 e643006
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 8 15:09:25 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 8 15:09:25 2015 -0400
----------------------------------------------------------------------
CHANGELOG.asciidoc | 45 +-
RELEASE.asciidoc | 48 ++-
bin/bump.sh | 47 ---
docs/preprocessor/preprocess.sh | 8 +
gremlin-console/src/main/LICENSE | 36 +-
gremlin-console/src/main/NOTICE | 59 +--
.../GephiTraversalVisualizationStrategy.groovy | 6 -
.../gremlin/process/computer/VertexProgram.java | 4 +
.../computer/bulkloading/BulkLoader.java | 115 ++++++
.../bulkloading/BulkLoaderVertexProgram.java | 407 +++++++++++++++++++
.../bulkloading/IncrementalBulkLoader.java | 150 +++++++
.../traversal/TraversalVertexProgram.java | 1 -
.../traversal/VertexTraversalSideEffects.java | 12 +-
.../util/AbstractVertexProgramBuilder.java | 5 +-
.../gremlin/process/traversal/Compare.java | 47 ++-
.../tinkerpop/gremlin/process/traversal/P.java | 31 +-
.../process/traversal/Parameterizing.java | 31 +-
.../gremlin/process/traversal/Pop.java | 31 +-
.../process/traversal/SackFunctions.java | 49 +++
.../gremlin/process/traversal/Traversal.java | 2 +-
.../process/traversal/TraversalSideEffects.java | 28 +-
.../process/traversal/TraversalStrategies.java | 4 +-
.../traversal/dsl/graph/GraphTraversal.java | 12 +-
.../dsl/graph/GraphTraversalSource.java | 64 ++-
.../gremlin/process/traversal/dsl/graph/__.java | 5 +
.../traversal/lambda/FunctionTraverser.java | 31 +-
.../process/traversal/lambda/LoopTraversal.java | 31 +-
.../traversal/lambda/PredicateTraverser.java | 31 +-
.../process/traversal/step/Bypassing.java | 31 +-
.../process/traversal/step/PathProcessor.java | 31 +-
.../gremlin/process/traversal/step/Scoping.java | 31 +-
.../process/traversal/step/filter/NotStep.java | 31 +-
.../step/filter/TraversalFilterStep.java | 31 +-
.../step/filter/WherePredicateStep.java | 31 +-
.../step/filter/WhereTraversalStep.java | 31 +-
.../process/traversal/step/map/AddEdgeStep.java | 6 +-
.../process/traversal/step/map/HasNextStep.java | 31 +-
.../process/traversal/step/map/MapKeysStep.java | 31 +-
.../traversal/step/map/MapValuesStep.java | 31 +-
.../process/traversal/step/map/MatchStep.java | 31 +-
.../step/map/TraversalFlatMapStep.java | 31 +-
.../traversal/step/map/TraversalMapStep.java | 31 +-
.../step/sideEffect/AddPropertyStep.java | 9 +-
.../sideEffect/TraversalSideEffectStep.java | 31 +-
.../step/util/CollectingBarrierStep.java | 2 +-
.../step/util/LambdaCollectingBarrierStep.java | 59 +++
.../traversal/step/util/NoOpBarrierStep.java | 44 --
.../process/traversal/step/util/Parameters.java | 102 +++--
.../strategy/decoration/PartitionStrategy.java | 18 +-
.../finalization/LazyBarrierStrategy.java | 38 +-
.../finalization/MatchAlgorithmStrategy.java | 31 +-
.../ComputerVerificationException.java | 36 --
.../ComputerVerificationStrategy.java | 20 +-
.../verification/LambdaRestrictionStrategy.java | 6 +-
.../strategy/verification/ReadOnlyStrategy.java | 15 +-
.../StandardVerificationStrategy.java | 48 +++
.../verification/VerificationException.java | 36 ++
.../traverser/B_LP_O_P_S_SE_SL_Traverser.java | 4 +-
.../traverser/B_LP_O_S_SE_SL_Traverser.java | 37 +-
.../B_LP_O_S_SE_SL_TraverserGenerator.java | 31 +-
.../traverser/B_O_S_SE_SL_Traverser.java | 21 +-
.../gremlin/process/traversal/util/AndP.java | 31 +-
.../process/traversal/util/ConjunctionP.java | 31 +-
.../util/DefaultTraversalSideEffects.java | 20 +-
.../util/EmptyTraversalSideEffects.java | 20 +-
.../gremlin/process/traversal/util/OrP.java | 31 +-
.../traversal/util/TraversalClassFunction.java | 31 +-
.../tinkerpop/gremlin/structure/Graph.java | 13 +
.../gremlin/structure/io/gryo/GryoMapper.java | 5 +-
.../structure/io/gryo/PairSerializer.java | 42 ++
.../structure/util/reference/ReferenceEdge.java | 31 +-
.../util/reference/ReferenceElement.java | 31 +-
.../util/reference/ReferenceFactory.java | 31 +-
.../structure/util/reference/ReferencePath.java | 31 +-
.../util/reference/ReferenceProperty.java | 31 +-
.../util/reference/ReferenceVertex.java | 31 +-
.../util/reference/ReferenceVertexProperty.java | 31 +-
.../gremlin/structure/util/star/StarGraph.java | 31 +-
.../util/star/StarGraphGryoSerializer.java | 31 +-
.../gremlin/process/traversal/CompareTest.java | 49 ++-
.../gremlin/process/traversal/PathTest.java | 31 +-
.../traversal/dsl/graph/GraphTraversalTest.java | 31 +-
.../process/traversal/step/StepTest.java | 31 +-
.../traversal/step/branch/BranchStepTest.java | 31 +-
.../traversal/step/branch/ChooseStepTest.java | 31 +-
.../traversal/step/branch/LocalStepTest.java | 31 +-
.../traversal/step/branch/RepeatStepTest.java | 31 +-
.../traversal/step/branch/UnionStepTest.java | 31 +-
.../traversal/step/filter/AndStepTest.java | 31 +-
.../traversal/step/filter/CoinStepTest.java | 31 +-
.../step/filter/CyclicPathStepTest.java | 31 +-
.../step/filter/DedupGlobalStepTest.java | 31 +-
.../traversal/step/filter/DropStepTest.java | 31 +-
.../traversal/step/filter/HasStepTest.java | 31 +-
.../traversal/step/filter/IsStepTest.java | 31 +-
.../step/filter/LambdaFilterStepTest.java | 31 +-
.../traversal/step/filter/OrStepTest.java | 31 +-
.../step/filter/RangeGlobalStepTest.java | 31 +-
.../step/filter/SampleGlobalStepTest.java | 31 +-
.../step/filter/SimplePathStepTest.java | 31 +-
.../step/filter/TailGlobalStepTest.java | 31 +-
.../step/filter/TimeLimitStepTest.java | 31 +-
.../traversal/step/filter/WhereStepTest.java | 31 +-
.../traversal/step/map/AddEdgeStepTest.java | 31 +-
.../traversal/step/map/CoalesceStepTest.java | 31 +-
.../traversal/step/map/CountGlobalStepTest.java | 31 +-
.../traversal/step/map/CountLocalStepTest.java | 31 +-
.../traversal/step/map/DedupLocalStepTest.java | 31 +-
.../step/map/EdgeOtherVertexStepTest.java | 31 +-
.../traversal/step/map/EdgeVertexStepTest.java | 31 +-
.../traversal/step/map/FoldStepTest.java | 31 +-
.../traversal/step/map/GroupCountStepTest.java | 31 +-
.../traversal/step/map/GroupStepTest.java | 31 +-
.../process/traversal/step/map/IdStepTest.java | 31 +-
.../traversal/step/map/LabelStepTest.java | 31 +-
.../step/map/LambdaFlatMapStepTest.java | 31 +-
.../traversal/step/map/LambdaMapStepTest.java | 31 +-
.../traversal/step/map/LoopsStepTest.java | 31 +-
.../traversal/step/map/MapKeysStepTest.java | 31 +-
.../traversal/step/map/MapValuesStepTest.java | 31 +-
.../traversal/step/map/MatchStepTest.java | 35 +-
.../traversal/step/map/MaxGlobalStepTest.java | 31 +-
.../traversal/step/map/MaxLocalStepTest.java | 31 +-
.../traversal/step/map/MeanGlobalStepTest.java | 31 +-
.../traversal/step/map/MeanLocalStepTest.java | 31 +-
.../traversal/step/map/MinGlobalStepTest.java | 31 +-
.../traversal/step/map/MinLocalStepTest.java | 31 +-
.../traversal/step/map/OrderGlobalStepTest.java | 31 +-
.../traversal/step/map/OrderLocalStepTest.java | 31 +-
.../traversal/step/map/PathStepTest.java | 31 +-
.../traversal/step/map/PropertiesStepTest.java | 31 +-
.../traversal/step/map/PropertyKeyStepTest.java | 31 +-
.../traversal/step/map/PropertyMapStepTest.java | 31 +-
.../step/map/PropertyValueStepTest.java | 31 +-
.../traversal/step/map/RangeLocalStepTest.java | 31 +-
.../traversal/step/map/SackStepTest.java | 31 +-
.../traversal/step/map/SampleLocalStepTest.java | 31 +-
.../traversal/step/map/SelectOneStepTest.java | 31 +-
.../traversal/step/map/SelectStepTest.java | 31 +-
.../traversal/step/map/SumGlobalStepTest.java | 31 +-
.../traversal/step/map/SumLocalStepTest.java | 31 +-
.../traversal/step/map/TailLocalStepTest.java | 31 +-
.../traversal/step/map/TreeStepTest.java | 31 +-
.../traversal/step/map/UnfoldStepTest.java | 31 +-
.../traversal/step/map/VertexStepTest.java | 31 +-
.../step/sideEffect/AddPropertyStepTest.java | 35 +-
.../step/sideEffect/AggregateStepTest.java | 31 +-
.../GroupCountSideEffectStepTest.java | 31 +-
.../sideEffect/GroupSideEffectStepTest.java | 31 +-
.../step/sideEffect/IdentityStepTest.java | 31 +-
.../step/sideEffect/InjectStepTest.java | 31 +-
.../sideEffect/LambdaSideEffectStepTest.java | 31 +-
.../step/sideEffect/ProfileStepTest.java | 31 +-
.../step/sideEffect/SackValueStepTest.java | 31 +-
.../step/sideEffect/SideEffectCapStepTest.java | 31 +-
.../step/sideEffect/StoreStepTest.java | 31 +-
.../step/sideEffect/SubgraphStepTest.java | 31 +-
.../step/sideEffect/TreeSideEffectStepTest.java | 31 +-
.../step/util/NoOpBarrierStepTest.java | 31 +-
.../traversal/step/util/ParametersTest.java | 45 +-
.../decoration/ConjunctionStrategyTest.java | 31 +-
.../PartitionStrategyTraverseTest.java | 8 +-
.../finalization/LazyBarrierStrategyTest.java | 31 +-
.../optimization/FilterRankingStrategyTest.java | 31 +-
.../IdentityRemovalStrategyTest.java | 31 +-
.../MatchPredicateStrategyTest.java | 31 +-
.../ComputerVerificationStrategyTest.java | 35 +-
.../LambdaRestrictionStrategyTest.java | 4 +-
.../verification/ReadOnlyStrategyTest.java | 8 +-
.../StandardVerificationStrategyTest.java | 79 ++++
.../util/DefaultTraversalStrategiesTest.java | 31 +-
.../gremlin/driver/AuthProperties.java | 34 +-
.../tinkerpop/gremlin/driver/Cluster.java | 46 +++
.../tinkerpop/gremlin/driver/Handler.java | 2 +-
.../step/branch/GroovyRepeatTest.groovy | 5 +
.../traversal/step/filter/GroovyHasTest.groovy | 5 +
.../step/map/GroovyAddVertexTest.groovy | 10 +
.../traversal/step/map/GroovyOrderTest.groovy | 4 +-
.../step/sideEffect/GroovySackTest.groovy | 6 +
.../step/sideEffect/GroovyStoreTest.groovy | 2 +-
.../util/TestableConsolePluginAcceptor.java | 31 +-
.../process/GroovyProcessComputerSuite.java | 24 +-
.../gremlin/groovy/loaders/StepLoader.groovy | 23 +-
.../AbstractImportCustomizerProvider.java | 6 +-
.../groovy/function/GBinaryOperator.java | 55 +++
gremlin-server/src/main/LICENSE | 33 +-
gremlin-server/src/main/NOTICE | 90 +---
.../server/GremlinDriverIntegrateTest.java | 11 +-
.../gremlin/process/GremlinProcessRunner.java | 4 +-
.../gremlin/process/ProcessComputerSuite.java | 2 +
.../BulkLoaderVertexProgramTest.java | 82 ++++
.../traversal/step/branch/RepeatTest.java | 16 +
.../process/traversal/step/filter/HasTest.java | 20 +-
.../traversal/step/map/AddVertexTest.java | 72 +++-
.../process/traversal/step/map/OrderTest.java | 22 +-
.../traversal/step/sideEffect/SackTest.java | 17 +
.../PartitionStrategyProcessTest.java | 4 +
.../util/detached/DetachedGraphTest.java | 31 +-
.../util/reference/ReferenceEdgeTest.java | 31 +-
.../util/reference/ReferenceGraphTest.java | 31 +-
.../reference/ReferenceVertexPropertyTest.java | 31 +-
.../util/reference/ReferenceVertexTest.java | 31 +-
hadoop-gremlin/pom.xml | 6 +
.../computer/AbstractHadoopGraphComputer.java | 31 +-
.../computer/PersistResultGraphAware.java | 31 +-
.../computer/spark/io/InputFormatRDD.java | 31 +-
.../process/computer/spark/io/InputRDD.java | 31 +-
.../computer/spark/io/OutputFormatRDD.java | 31 +-
.../process/computer/spark/io/OutputRDD.java | 31 +-
.../computer/spark/payload/MessagePayload.java | 31 +-
.../process/computer/spark/payload/Payload.java | 31 +-
.../spark/payload/ViewIncomingPayload.java | 31 +-
.../spark/payload/ViewOutgoingPayload.java | 31 +-
.../computer/spark/payload/ViewPayload.java | 31 +-
.../structure/io/HadoopPoolsConfigurable.java | 31 +-
.../structure/io/VertexWritableIterator.java | 31 +-
.../groovy/plugin/HadoopGremlinPluginTest.java | 31 +-
.../hadoop/groovy/plugin/HadoopPluginSuite.java | 31 +-
.../GiraphHadoopGremlinPluginIntegrateTest.java | 31 +-
.../groovy/SparkHadoopGremlinPluginTest.java | 31 +-
.../computer/spark/io/ExampleInputRDD.java | 31 +-
.../computer/spark/io/ExampleOutputRDD.java | 31 +-
.../computer/spark/io/InputOutputRDDTest.java | 31 +-
.../process/computer/spark/io/InputRDDTest.java | 31 +-
.../computer/spark/io/OutputRDDTest.java | 31 +-
.../hadoop/structure/io/VertexWritableTest.java | 31 +-
.../gremlin/neo4j/process/traversal/LabelP.java | 31 +-
.../step/sideEffect/CypherStartStep.java | 31 +-
.../step/sideEffect/Neo4jGraphStep.java | 4 +-
.../gremlin/neo4j/structure/Neo4jGraph.java | 5 +
.../structure/trait/MultiMetaNeo4jTrait.java | 31 +-
.../neo4j/structure/trait/Neo4jTrait.java | 31 +-
.../trait/NoMultiNoMetaNeo4jTrait.java | 31 +-
.../gremlin/neo4j/AbstractNeo4jGremlinTest.java | 31 +-
.../MultiMetaNeo4jGraphNativeNeo4jTest.java | 31 +-
.../gremlin/neo4j/NativeNeo4jSuite.java | 31 +-
.../NoMultiNoMetaNeo4jGraphNativeNeo4jTest.java | 31 +-
.../neo4j/NoMultiNoMetaNeo4jGraphProvider.java | 31 +-
...ultiNoMetaNeo4jGraphProcessStandardTest.java | 31 +-
...MetaNeo4jGraphGroovyProcessStandardTest.java | 31 +-
.../neo4j/structure/NativeNeo4jIndexTest.java | 31 +-
.../structure/NativeNeo4jStructureTest.java | 31 +-
...tiNoMetaNeo4jGraphStructureStandardTest.java | 31 +-
.../step/sideEffect/TinkerGraphStep.java | 5 +-
.../tinkergraph/structure/TinkerGraph.java | 5 +
.../TinkerGraphNoStrategyComputerProvider.java | 31 +-
...hNoStrategyProcessComputerIntegrateTest.java | 31 +-
.../TinkerGraphStepStrategyTest.java | 31 +-
.../tinkergraph/structure/TinkerGraphTest.java | 33 +-
249 files changed, 4369 insertions(+), 3452 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/781a4667/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java
index 10d3637,3f03b59..3e46768
--- 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
@@@ -1,24 -1,21 +1,22 @@@
/*
+ * 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
*
- * 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.
+ * 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.process.traversal.step.util;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
@@@ -56,20 -50,22 +54,26 @@@ public final class Parameters implement
this.set(newKey, this.parameters.remove(oldKey));
}
- public <S, E> E get(final Traverser.Admin<S> traverser, final Object key, final Supplier<E> defaultValue) {
- final Object object = parameters.get(key);
- return null == object ? defaultValue.get() : object instanceof Traversal.Admin ? TraversalUtil.apply(traverser, (Traversal.Admin<S, E>) object) : (E) object;
+ public <S, E> List<E> get(final Traverser.Admin<S> traverser, final Object key, final Supplier<E> defaultValue) {
+ final List<E> values = (List<E>) this.parameters.get(key);
+ if (null == values) return Collections.singletonList(defaultValue.get());
+ final List<E> result = new ArrayList<>();
+ for (final Object value : values) {
+ result.add(value instanceof Traversal.Admin ? TraversalUtil.apply(traverser, (Traversal.Admin<S, E>) value) : (E) value);
+ }
+ return result;
}
- public <E> E get(final Object key, final Supplier<E> defaultValue) {
- final Object object = parameters.get(key);
- return null == object ? defaultValue.get() : (E) object;
+ public <E> List<E> get(final Object key, final Supplier<E> defaultValue) {
+ final List<E> list = (List<E>) this.parameters.get(key);
+ return (null == list) ? Collections.singletonList(defaultValue.get()) : list;
+
}
+ public Object remove(final Object key) {
+ return parameters.remove(key);
+ }
+
public <S> Object[] getKeyValues(final Traverser.Admin<S> traverser, final Object... exceptKeys) {
if (this.parameters.size() == 0) return EMPTY_ARRAY;
final List<Object> exceptions = Arrays.asList(exceptKeys);
@@@ -83,23 -81,6 +89,23 @@@
return keyValues.toArray(new Object[keyValues.size()]);
}
+ /**
+ * Gets an immutable set of the parameters without evaluating them in the context of a {@link Traverser} as
+ * is done in {@link #getKeyValues(Traverser.Admin, Object...)}.
+ *
+ * @param exceptKeys keys to not include in the returned {@link Map}
+ */
- public Map<Object,Object> getRaw(final Object... exceptKeys) {
++ public Map<Object,List<Object>> getRaw(final Object... exceptKeys) {
+ if (parameters.isEmpty()) return Collections.emptyMap();
+ final List<Object> exceptions = Arrays.asList(exceptKeys);
- final Map<Object,Object> raw = new HashMap<>();
- for (Map.Entry entry : parameters.entrySet()) {
++ final Map<Object,List<Object>> raw = new HashMap<>();
++ for (Map.Entry<Object, List<Object>> entry : parameters.entrySet()) {
+ if (!exceptions.contains(entry.getKey())) raw.put(entry.getKey(), entry.getValue());
+ }
+
+ return Collections.unmodifiableMap(raw);
+ }
+
public void set(final Object... keyValues) {
for (int i = 0; i < keyValues.length; i = i + 2) {
if (keyValues[i + 1] != null) {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/781a4667/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
index fc344ab,943380c..4ba0b95
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
@@@ -122,100 -83,13 +122,102 @@@ public final class PartitionStrategy ex
stepsToInsertHasAfter.addAll(TraversalHelper.getStepsOfAssignableClass(EdgeOtherVertexStep.class, traversal));
stepsToInsertHasAfter.addAll(TraversalHelper.getStepsOfAssignableClass(EdgeVertexStep.class, traversal));
- // all steps that return a vertex need to have has(paritionKey,within,partitionValues) injected after it
+ // all steps that return a vertex need to have has(partitionKey,within,partitionValues) injected after it
stepsToInsertHasAfter.forEach(step -> TraversalHelper.insertAfterStep(
- new HasStep(traversal, new HasContainer(this.partitionKey, P.within(new ArrayList<>(this.readPartitions)))), step, traversal));
+ new HasStep(traversal, new HasContainer(partitionKey, P.within(new ArrayList<>(readPartitions)))), step, traversal));
+
+ if (includeMetaProperties) {
+ final List<PropertiesStep> propertiesSteps = TraversalHelper.getStepsOfAssignableClass(PropertiesStep.class, traversal);
+ propertiesSteps.forEach(step -> {
+ // check length first because keyExists will return true otherwise
+ if (step.getPropertyKeys().length > 0 && ElementHelper.keyExists(partitionKey, step.getPropertyKeys()))
+ throw new IllegalStateException("Cannot explicitly request the partitionKey in the traversal");
+
+ if (step.getReturnType() == PropertyType.PROPERTY) {
+ // check the following step to see if it is a has(partitionKey, *) - if so then this strategy was
+ // already applied down below via g.V().values() which injects a properties() step
+ final Step next = step.getNextStep();
+ if (!(next instanceof HasStep) || !((HasContainer) ((HasStep) next).getHasContainers().get(0)).getKey().equals(partitionKey)) {
+ // use choose() to determine if the properties() step is called on a Vertex to get a VertexProperty
+ // if not, pass it through.
+ final Traversal choose = __.choose(
+ __.filter(new TypeChecker<>(VertexProperty.class)),
+ __.has(partitionKey, P.within(new ArrayList<>(readPartitions))),
+ __.__()).filter(new PartitionKeyHider());
+ TraversalHelper.insertTraversal(step, choose.asAdmin(), traversal);
+ }
+ } else if (step.getReturnType() == PropertyType.VALUE) {
+ // use choose() to determine if the values() step is called on a Vertex to get a VertexProperty
+ // if not, pass it through otherwise explode g.V().values() to g.V().properties().has().value()
+ final Traversal choose = __.choose(
+ __.filter(new TypeChecker<>(Vertex.class)),
+ __.properties(step.getPropertyKeys()).has(partitionKey, P.within(new ArrayList<>(readPartitions))).filter(new PartitionKeyHider()).value(),
+ __.__().filter(new PartitionKeyHider()));
+ TraversalHelper.insertTraversal(step, choose.asAdmin(), traversal);
+ traversal.removeStep(step);
+ } else {
+ throw new IllegalStateException(String.format("%s is not accounting for a particular %s %s",
+ PartitionStrategy.class.getSimpleName(), PropertyType.class.toString(), step.getReturnType()));
+ }
+ });
+
+ final List<PropertyMapStep> propertyMapSteps = TraversalHelper.getStepsOfAssignableClass(PropertyMapStep.class, traversal);
+ propertyMapSteps.forEach(step -> {
+ // check length first because keyExists will return true otherwise
+ if (step.getPropertyKeys().length > 0 && ElementHelper.keyExists(partitionKey, step.getPropertyKeys()))
+ throw new IllegalStateException("Cannot explicitly request the partitionKey in the traversal");
+
+ if (step.getReturnType() == PropertyType.PROPERTY) {
+ // via map() filter out properties that aren't in the partition if it is a PropertyVertex,
+ // otherwise just let them pass through
+ TraversalHelper.insertAfterStep(new LambdaMapStep<>(traversal, new MapPropertiesFilter()), step, traversal);
+ } else if (step.getReturnType() == PropertyType.VALUE) {
+ // as this is a value map, replace that step with propertiesMap() that returns PropertyType.VALUE.
+ // from there, add the filter as shown above and then unwrap the properties as they would have
+ // been done under valueMap()
+ final PropertyMapStep propertyMapStep = new PropertyMapStep(traversal, step.isIncludeTokens(), PropertyType.PROPERTY, step.getPropertyKeys());
+ TraversalHelper.replaceStep(step, propertyMapStep, traversal);
+
+ final LambdaMapStep mapPropertiesFilterStep = new LambdaMapStep<>(traversal, new MapPropertiesFilter());
+ TraversalHelper.insertAfterStep(mapPropertiesFilterStep, propertyMapStep, traversal);
+ TraversalHelper.insertAfterStep(new LambdaMapStep<>(traversal, new MapPropertiesConverter()), mapPropertiesFilterStep, traversal);
+ } else {
+ throw new IllegalStateException(String.format("%s is not accounting for a particular %s %s",
+ PartitionStrategy.class.getSimpleName(), PropertyType.class.toString(), step.getReturnType()));
+ }
+ });
+ }
+
+ final List<Step> stepsToInsertPropertyMutations = traversal.getSteps().stream().filter(step ->
+ step instanceof AddEdgeStep || step instanceof AddVertexStep ||
+ step instanceof AddVertexStartStep || (includeMetaProperties && step instanceof AddPropertyStep)
+ ).collect(Collectors.toList());
- traversal.getSteps().forEach(step -> {
- if (step instanceof AddEdgeStep || step instanceof AddVertexStep || step instanceof AddVertexStartStep) {
- ((Mutating) step).addPropertyMutations(this.partitionKey, this.writePartition);
+ stepsToInsertPropertyMutations.forEach(step -> {
+ // note that with AddPropertyStep we just add the partition key/value regardless of whether this
+ // ends up being a Vertex or not. AddPropertyStep currently chooses to simply not bother
+ // to use the additional "property mutations" if the Element being mutated is a Edge or
+ // VertexProperty
+ ((Mutating) step).addPropertyMutations(partitionKey, writePartition);
+
+ if (includeMetaProperties) {
+ // GraphTraversal folds g.addV().property('k','v') to just AddVertexStep/AddVertexStartStep so this
+ // has to be exploded back to g.addV().property('k','v','partition','A')
+ if (step instanceof AddVertexStartStep || step instanceof AddVertexStep) {
+ final Parameters parameters = ((Parameterizing) step).getParameters();
- final Map<Object, Object> params = parameters.getRaw();
++ final Map<Object, List<Object>> params = parameters.getRaw();
+ params.forEach((k, v) -> {
- final AddPropertyStep addPropertyStep = new AddPropertyStep(traversal, null, k, v);
- addPropertyStep.addPropertyMutations(partitionKey, writePartition);
- TraversalHelper.insertAfterStep(addPropertyStep, step, traversal);
-
- // need to remove the parameter from the AddVertex/StartStep because it's now being added
- // via the AddPropertyStep
- parameters.remove(k);
++ v.forEach(o -> {
++ final AddPropertyStep addPropertyStep = new AddPropertyStep(traversal, null, k, o);
++ addPropertyStep.addPropertyMutations(partitionKey, writePartition);
++ TraversalHelper.insertAfterStep(addPropertyStep, step, traversal);
++
++ // need to remove the parameter from the AddVertex/StartStep because it's now being added
++ // via the AddPropertyStep
++ parameters.remove(k);
++ });
+ });
+ }
}
});
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/781a4667/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ParametersTest.java
----------------------------------------------------------------------
diff --cc gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ParametersTest.java
index c77e0c7,0000000..fcdac02
mode 100644,000000..100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ParametersTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/ParametersTest.java
@@@ -1,80 -1,0 +1,95 @@@
+/*
+ * 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.process.traversal.step.util;
+
+import org.junit.Test;
+
+import java.util.Collections;
++import java.util.List;
+import java.util.Map;
+
++import static org.hamcrest.MatcherAssert.assertThat;
++import static org.hamcrest.Matchers.contains;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class ParametersTest {
+ @Test
+ public void shouldGetRaw() {
+ final Parameters parameters = new Parameters();
+ parameters.set("a", "axe", "b", "bat", "c", "cat");
+
- final Map<Object,Object> params = parameters.getRaw();
++ final Map<Object,List<Object>> params = parameters.getRaw();
+ assertEquals(3, params.size());
- assertEquals("axe", params.get("a"));
- assertEquals("bat", params.get("b"));
- assertEquals("cat", params.get("c"));
++ assertEquals("axe", params.get("a").get(0));
++ assertEquals("bat", params.get("b").get(0));
++ assertEquals("cat", params.get("c").get(0));
++ }
++
++ @Test
++ public void shouldGetRawWithMulti() {
++ final Parameters parameters = new Parameters();
++ parameters.set("a", "axe", "b", "bat", "a", "ant", "c", "cat");
++
++ final Map<Object,List<Object>> params = parameters.getRaw();
++ assertEquals(3, params.size());
++ assertThat(params.get("a"), contains("axe", "ant"));
++ assertEquals("bat", params.get("b").get(0));
++ assertEquals("cat", params.get("c").get(0));
+ }
+
+ @Test
+ public void shouldGetRawEmptyAndUnmodifiable() {
+ final Parameters parameters = new Parameters();
- final Map<Object,Object> params = parameters.getRaw();
++ final Map<Object,List<Object>> params = parameters.getRaw();
+ assertEquals(Collections.emptyMap(), params);
+ }
+
+ @Test
+ public void shouldGetRawExcept() {
+ final Parameters parameters = new Parameters();
+ parameters.set("a", "axe", "b", "bat", "c", "cat");
+
- final Map<Object,Object> params = parameters.getRaw("b");
++ final Map<Object,List<Object>> params = parameters.getRaw("b");
+ assertEquals(2, params.size());
- assertEquals("axe", params.get("a"));
- assertEquals("cat", params.get("c"));
++ assertEquals("axe", params.get("a").get(0));
++ assertEquals("cat", params.get("c").get(0));
+ }
+
+ @Test
+ public void shouldRemove() {
+ final Parameters parameters = new Parameters();
+ parameters.set("a", "axe", "b", "bat", "c", "cat");
+
- final Map<Object,Object> before = parameters.getRaw();
++ final Map<Object,List<Object>> before = parameters.getRaw();
+ assertEquals(3, before.size());
- assertEquals("axe", before.get("a"));
- assertEquals("bat", before.get("b"));
- assertEquals("cat", before.get("c"));
++ assertEquals("axe", before.get("a").get(0));
++ assertEquals("bat", before.get("b").get(0));
++ assertEquals("cat", before.get("c").get(0));
+
+ parameters.remove("b");
+
- final Map<Object,Object> after = parameters.getRaw("b");
++ final Map<Object,List<Object>> after = parameters.getRaw("b");
+ assertEquals(2, after.size());
- assertEquals("axe", after.get("a"));
- assertEquals("cat", after.get("c"));
++ assertEquals("axe", after.get("a").get(0));
++ assertEquals("cat", after.get("c").get(0));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/781a4667/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
----------------------------------------------------------------------
diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
index e8300dd,0debdae..3f4459d
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
@@@ -54,199 -48,6 +54,203 @@@ public class PartitionStrategyProcessTe
}
@Test
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldAppendPartitionToVertexProperty() {
+ final PartitionStrategy partitionStrategy = PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create();
++ Traversal t = create(partitionStrategy).addV().property("any", "thing");
++ System.out.println(t);
++ t.asAdmin().applyStrategies();
++ System.out.println(t);
+ final Vertex v = create(partitionStrategy).addV().property("any", "thing").next();
+
+ assertNotNull(v);
+ assertEquals("thing", v.property("any").value());
+ assertEquals("A", v.property(partition).value());
+ assertEquals("A", v.property("any").value(partition));
+ }
+
+ @Test
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldNotAppendPartitionToVertexProperty() {
+ final PartitionStrategy partitionStrategy = PartitionStrategy.build()
+ .includeMetaProperties(false)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create();
+ final Vertex v = create(partitionStrategy).addV().property("any", "thing").next();
+
+ assertNotNull(v);
+ assertEquals("thing", v.property("any").value());
+ assertEquals("A", v.property(partition).value());
+ assertThat(v.property("any").properties().hasNext(), is(false));
+
+ }
+
+ @Test
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldAppendPartitionToAllVertexProperties() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+
+ final GraphTraversalSource gOverB = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("B").addReadPartition("B").create());
+
+ final GraphTraversalSource gOverAB = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("B").addReadPartition("B").addReadPartition("A").create());
+
+ final Vertex v = gOverA.addV().property("any", "thing").property("some","thing").next();
+
+ assertNotNull(v);
+ assertEquals("thing", v.property("any").value());
+ assertEquals("A", v.property(partition).value());
+ assertEquals("A", v.property("any").value(partition));
+ assertEquals("thing", v.property("some").value());
+ assertEquals("A", v.property("some").value(partition));
+
+ gOverAB.V(v).property("that", "thing").iterate();
+ assertEquals("thing", v.property("that").value());
+ assertEquals("B", v.property("that").value(partition));
+
+ assertThat(gOverAB.V(v).properties("any").hasNext(), is(true));
+ assertThat(gOverAB.V(v).properties("that").hasNext(), is(true));
+ assertThat(gOverA.V(v).properties("that").hasNext(), is(false));
+ assertThat(gOverA.V(v).properties("any").hasNext(), is(true));
+ assertThat(gOverB.V(v).properties("any").hasNext(), is(false));
+ assertThat(gOverB.V(v).properties("that").hasNext(), is(false));
+ assertThat(gOverAB.V(v).properties("partitionKey").hasNext(), is(false));
+
+ assertThat(gOverAB.V(v).values("any").hasNext(), is(true));
+ assertThat(gOverAB.V(v).values("that").hasNext(), is(true));
+ assertThat(gOverA.V(v).values("that").hasNext(), is(false));
+ assertThat(gOverA.V(v).values("any").hasNext(), is(true));
+ assertThat(gOverB.V(v).values("any").hasNext(), is(false));
+ assertThat(gOverB.V(v).values("that").hasNext(), is(false));
+ assertThat(gOverAB.V(v).values("partitionKey").hasNext(), is(false));
+
+ assertThat(gOverAB.V(v).propertyMap().next().containsKey("any"), is(true));
+ assertThat(gOverAB.V(v).propertyMap().next().containsKey("that"), is(true));
+ assertThat(gOverA.V(v).propertyMap().next().containsKey("that"), is(false));
+ assertThat(gOverA.V(v).propertyMap().next().containsKey("any"), is(true));
+ assertThat(gOverB.V(v).propertyMap().hasNext(), is(false));
+ assertThat(gOverB.V(v).propertyMap().hasNext(), is(false));
+ assertThat(gOverAB.V(v).propertyMap().next().containsKey(partition), is(false));
+
+ assertThat(gOverAB.V(v).valueMap().next().containsKey("any"), is(true));
+ assertThat(gOverAB.V(v).valueMap().next().containsKey("that"), is(true));
+ assertThat(gOverA.V(v).valueMap().next().containsKey("that"), is(false));
+ assertThat(gOverA.V(v).valueMap().next().containsKey("any"), is(true));
+ assertThat(gOverB.V(v).valueMap().hasNext(), is(false));
+ assertThat(gOverB.V(v).valueMap().hasNext(), is(false));
+ assertThat(gOverAB.V(v).valueMap().next().containsKey(partition), is(false));
+ }
+
+ @Test(expected = IllegalStateException.class)
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldHidePartitionKeyForValues() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+ final Vertex v = gOverA.addV().property("any", "thing").next();
+
+ gOverA.V(v).values(partition).next();
+ }
+
+ @Test
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldHidePartitionKeyForValuesWithEmptyKeys() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+ final Vertex v = gOverA.addV().property("any", "thing").next();
+
+ assertEquals(1l, (long) gOverA.V(v).values().count().next());
+ assertEquals("thing", gOverA.V(v).values().next());
+ }
+
+ @Test(expected = IllegalStateException.class)
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldHidePartitionKeyForProperties() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+ final Vertex v = gOverA.addV().property("any", "thing").next();
+
+ gOverA.V(v).properties(partition).next();
+ }
+
+ @Test
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldHidePartitionKeyForPropertiesWithEmptyKeys() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+ final Vertex v = gOverA.addV().property("any", "thing").next();
+
+ assertEquals(1l, (long) gOverA.V(v).properties().count().next());
+ assertEquals("thing", gOverA.V(v).properties().value().next());
+ }
+
+ @Test(expected = IllegalStateException.class)
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldHidePartitionKeyForPropertyMap() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+ final Vertex v = gOverA.addV().property("any", "thing").next();
+
+ gOverA.V(v).propertyMap(partition).next();
+ }
+
+ @Test
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldHidePartitionKeyForPropertyMapWithEmptyKeys() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+ final Vertex v = gOverA.addV().property("any", "thing").next();
+
+ assertEquals(1l, (long) gOverA.V(v).propertyMap().count().next());
+ assertEquals("thing", ((List<VertexProperty>) gOverA.V(v).propertyMap().next().get("any")).get(0).value());
+ }
+
+ @Test(expected = IllegalStateException.class)
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldHidePartitionKeyForValueMap() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+ final Vertex v = gOverA.addV().property("any", "thing").next();
+
+ gOverA.V(v).valueMap(partition).next();
+ }
+
+ @Test
+ @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
+ public void shouldHidePartitionKeyForValueMapWithEmptyKeys() {
+ final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+ .includeMetaProperties(true)
+ .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+ final Vertex v = gOverA.addV().property("any", "thing").next();
+
+ assertEquals(1l, (long) gOverA.V(v).valueMap().count().next());
+ assertEquals("thing", ((List) gOverA.V(v).valueMap().next().get("any")).get(0));
+ }
+
+ @Test
@FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
public void shouldAppendPartitionToEdge() {
final PartitionStrategy partitionStrategy = PartitionStrategy.build()
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/781a4667/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphStep.java
----------------------------------------------------------------------
[07/50] incubator-tinkerpop git commit: Merge branch
'TINKERPOP3-750-Compare-Number-as-BigDecimal' of
https://github.com/RedSeal-co/incubator-tinkerpop into tp30
Posted by sp...@apache.org.
Merge branch 'TINKERPOP3-750-Compare-Number-as-BigDecimal' of https://github.com/RedSeal-co/incubator-tinkerpop into tp30
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/0a11ae1c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/0a11ae1c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/0a11ae1c
Branch: refs/heads/TINKERPOP3-333
Commit: 0a11ae1c288f875f9330ad0083ea0ee4e7507344
Parents: 0ee8364 378dd6c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 14:38:58 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 14:38:58 2015 -0600
----------------------------------------------------------------------
.../gremlin/process/traversal/Compare.java | 47 +++++++++++--------
.../gremlin/process/traversal/CompareTest.java | 49 ++++++++++++++++----
2 files changed, 68 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
[29/50] incubator-tinkerpop git commit: fixed hashCode calculation
for AddPropertyStep
Posted by sp...@apache.org.
fixed hashCode calculation for AddPropertyStep
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/bb78a643
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/bb78a643
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/bb78a643
Branch: refs/heads/TINKERPOP3-333
Commit: bb78a643e8855d33aabe947a3065ea0b9c54a923
Parents: 97fbdfa
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Sep 2 15:47:07 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Sep 2 15:47:07 2015 +0200
----------------------------------------------------------------------
.../process/traversal/step/sideEffect/AddPropertyStep.java | 3 ++-
.../gremlin/process/traversal/step/util/Parameters.java | 2 +-
.../process/traversal/step/sideEffect/AddPropertyStepTest.java | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb78a643/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 9ea7785..7c12c0e 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
@@ -123,7 +123,8 @@ public final class AddPropertyStep<S extends Element> extends SideEffectStep<S>
@Override
public int hashCode() {
- return super.hashCode() ^ this.parameters.hashCode() ^ ((null == this.cardinality) ? "null".hashCode() : this.cardinality.hashCode());
+ final int hash = super.hashCode() ^ this.parameters.hashCode();
+ return (null != this.cardinality) ? (hash ^ cardinality.hashCode()) : hash;
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb78a643/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 01206d9..3f03b59 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
@@ -132,7 +132,7 @@ public final class Parameters implements Cloneable, Serializable {
for (final Map.Entry<Object, List<Object>> entry : this.parameters.entrySet()) {
result ^= entry.getKey().hashCode();
for (final Object value : entry.getValue()) {
- result ^= value.hashCode();
+ result ^= Integer.rotateLeft(value.hashCode(), entry.getKey().hashCode());
}
}
return result;
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bb78a643/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java
index 4ecf311..6d141bc 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java
@@ -34,8 +34,8 @@ public class AddPropertyStepTest extends StepTest {
protected List<Traversal> getTraversals() {
return Arrays.asList(
__.property("x", 0),
- __.property("x", 1)
- //__.property("y", 0) // TODO: when this is 0 is breaks?! I think this is because of ^ and y being 1 away from x and 0 being one away from x.
+ __.property("x", 1),
+ __.property("y", 0)
);
}
}
[05/50] incubator-tinkerpop git commit: fixed a bug in
StandardVerificationStrategy.
Posted by sp...@apache.org.
fixed a bug in StandardVerificationStrategy.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/0ee83647
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/0ee83647
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/0ee83647
Branch: refs/heads/TINKERPOP3-333
Commit: 0ee83647fffe97c0a67ec0aa42c7fd33ba1a025d
Parents: a20d060
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 14:30:23 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 14:30:23 2015 -0600
----------------------------------------------------------------------
.../strategy/verification/StandardVerificationStrategy.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/0ee83647/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
index 6ba5216..d9ba6ba 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
@@ -40,7 +40,7 @@ public final class StandardVerificationStrategy extends AbstractTraversalStrateg
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
traversal.getSteps().forEach(step -> {
- if (step instanceof ReducingBarrierStep && step.getTraversal().getParent() instanceof RepeatStep)
+ if (step instanceof ReducingBarrierStep && step.getTraversal().getParent() instanceof RepeatStep && step.getTraversal().getParent().getGlobalChildren().get(0).getSteps().contains(step))
throw new VerificationException("The direct parent of a ReducingBarrierStep can not be a RepeatStep: " + step, traversal);
});
}
[27/50] incubator-tinkerpop git commit: Fix broken image in changelog.
Posted by sp...@apache.org.
Fix broken image in changelog.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/65d60f9f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/65d60f9f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/65d60f9f
Branch: refs/heads/TINKERPOP3-333
Commit: 65d60f9f5a45a2989cdc1d2cc057480a613b9dba
Parents: 8e71d2e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Sep 2 07:55:04 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Sep 2 07:55:04 2015 -0400
----------------------------------------------------------------------
CHANGELOG.asciidoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/65d60f9f/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 11bd6df..c051d87 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -20,7 +20,7 @@ TinkerPop3 CHANGELOG
TinkerPop 3.0.0 (A Gremlin Rāga in 7/16 Time)
---------------------------------------------
-image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
+image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/static/images/gremlin-hindu.png[width=225]
TinkerPop 3.0.1 (Release Date: September 2, 2015)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[13/50] incubator-tinkerpop git commit: again some BLVP configuration
tweaking as requested by @okram
Posted by sp...@apache.org.
again some BLVP configuration tweaking as requested by @okram
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/9546e449
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/9546e449
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/9546e449
Branch: refs/heads/TINKERPOP3-333
Commit: 9546e4493320e194e40e812c88e3710bca0fa157
Parents: b1191e7
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Aug 31 23:14:25 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Mon Aug 31 23:14:25 2015 +0200
----------------------------------------------------------------------
.../bulkloading/BulkLoaderVertexProgram.java | 59 +++++++++++---------
1 file changed, 33 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9546e449/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
index eaebd53..962edd0 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/bulkloading/BulkLoaderVertexProgram.java
@@ -58,12 +58,12 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
private static final Logger LOGGER = LoggerFactory.getLogger(BulkLoaderVertexProgram.class);
public static final String BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX = "gremlin.bulkLoaderVertexProgram";
- public static final String GRAPH_CFG_KEY = "graph";
- public static final String BULK_LOADER_CFG_KEY = "loader";
- public final static String USER_SUPPLIED_IDS_CFG_KEY = "userSuppliedIds";
- public final static String KEEP_ORIGINAL_IDS_CFG_KEY = "keepOriginalIds";
- public static final String INTERMEDIATE_BATCH_SIZE_CFG_KEY = "intermediateBatchSize";
- public static final String BULK_LOADER_VERTEX_ID_CFG_KEY = "vertexIdProperty";
+ public static final String BULK_LOADER_CLASS_CFG_KEY = String.join(".", BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX, "class");
+ public static final String BULK_LOADER_VERTEX_ID_CFG_KEY = String.join(".", BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX, "vertexIdProperty");
+ public static final String INTERMEDIATE_BATCH_SIZE_CFG_KEY = String.join(".", BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX, "intermediateBatchSize");
+ public static final String KEEP_ORIGINAL_IDS_CFG_KEY = String.join(".", BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX, "keepOriginalIds");
+ public static final String USER_SUPPLIED_IDS_CFG_KEY = String.join(".", BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX, "userSuppliedIds");
+ public static final String WRITE_GRAPH_CFG_KEY = String.join(".", BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX, "writeGraph");
public static final String DEFAULT_BULK_LOADER_VERTEX_ID = "bulkLoader.vertex.id";
private final MessageScope messageScope;
@@ -73,7 +73,8 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
private Graph graph;
private GraphTraversalSource g;
private long intermediateBatchSize;
- private static ThreadLocal<AtomicLong> counter = new ThreadLocal<AtomicLong>() {
+
+ private static final ThreadLocal<AtomicLong> counter = new ThreadLocal<AtomicLong>() {
@Override
protected AtomicLong initialValue() {
return new AtomicLong();
@@ -87,7 +88,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
private BulkLoader createBulkLoader() {
final BulkLoader loader;
- final Configuration config = configuration.subset(BULK_LOADER_CFG_KEY);
+ final Configuration config = configuration.subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX);
if (config.containsKey("class")) {
final String className = config.getString("class");
config.clearProperty("class");
@@ -104,7 +105,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
} else {
loader = new IncrementalBulkLoader();
}
- loader.configure(config);
+ loader.configure(configuration);
return loader;
}
@@ -152,13 +153,8 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
if (config != null) {
ConfigurationUtils.copy(config, configuration);
}
- if (!configuration.subset(BULK_LOADER_CFG_KEY).containsKey(BULK_LOADER_VERTEX_ID_CFG_KEY)) {
- configuration.addProperty(
- String.join(".", BULK_LOADER_CFG_KEY, BULK_LOADER_VERTEX_ID_CFG_KEY),
- DEFAULT_BULK_LOADER_VERTEX_ID);
- }
intermediateBatchSize = configuration.getLong(INTERMEDIATE_BATCH_SIZE_CFG_KEY, 0L);
- elementComputeKeys.add(configuration.subset(BULK_LOADER_CFG_KEY).getString(BULK_LOADER_VERTEX_ID_CFG_KEY));
+ elementComputeKeys.add(configuration.getString(BULK_LOADER_VERTEX_ID_CFG_KEY, DEFAULT_BULK_LOADER_VERTEX_ID));
bulkLoader = createBulkLoader();
}
@@ -173,7 +169,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
@Override
public void workerIterationStart(final Memory memory) {
if (null == graph) {
- graph = GraphFactory.open(configuration.subset(GRAPH_CFG_KEY));
+ graph = GraphFactory.open(configuration.subset(WRITE_GRAPH_CFG_KEY));
LOGGER.info("Opened Graph instance: {}", graph);
try {
if (!graph.features().graph().supportsConcurrentAccess()) {
@@ -316,22 +312,18 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
@Override
public BulkLoaderVertexProgram create(final Graph graph) {
ConfigurationUtils.append(graph.configuration().subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX), configuration);
- return (BulkLoaderVertexProgram) VertexProgram.createVertexProgram(graph, this.configuration);
- }
-
- private void setLoaderConfigurationProperty(final String key, final Object value) {
- configuration.setProperty(String.join(".", BULK_LOADER_CFG_KEY, key), value);
+ return (BulkLoaderVertexProgram) VertexProgram.createVertexProgram(graph, configuration);
}
private void setGraphConfigurationProperty(final String key, final Object value) {
- configuration.setProperty(String.join(".", GRAPH_CFG_KEY, key), value);
+ configuration.setProperty(String.join(".", WRITE_GRAPH_CFG_KEY, key), value);
}
/**
* Sets the class name of the BulkLoader implementation to be used.
*/
public Builder bulkLoader(final String className) {
- setLoaderConfigurationProperty(Graph.GRAPH, className);
+ configuration.setProperty(BULK_LOADER_CLASS_CFG_KEY, className);
return this;
}
@@ -346,7 +338,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
* Sets the name of the property that is used to store the original vertex identifiers in the target graph.
*/
public Builder vertexIdProperty(final String name) {
- setLoaderConfigurationProperty(BULK_LOADER_VERTEX_ID_CFG_KEY, name);
+ configuration.setProperty(BULK_LOADER_VERTEX_ID_CFG_KEY, name);
return this;
}
@@ -355,7 +347,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
* target graph.
*/
public Builder userSuppliedIds(final boolean useUserSuppliedIds) {
- setLoaderConfigurationProperty(USER_SUPPLIED_IDS_CFG_KEY, useUserSuppliedIds);
+ configuration.setProperty(USER_SUPPLIED_IDS_CFG_KEY, useUserSuppliedIds);
return this;
}
@@ -365,7 +357,7 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
* the data for further incremental bulk loads.
*/
public Builder keepOriginalIds(final boolean keepOriginalIds) {
- setLoaderConfigurationProperty(KEEP_ORIGINAL_IDS_CFG_KEY, keepOriginalIds);
+ configuration.setProperty(KEEP_ORIGINAL_IDS_CFG_KEY, keepOriginalIds);
return this;
}
@@ -387,4 +379,19 @@ public class BulkLoaderVertexProgram implements VertexProgram<Tuple> {
return this;
}
}
+
+ @Override
+ public Features getFeatures() {
+ return new Features() {
+ @Override
+ public boolean requiresLocalMessageScopes() {
+ return true;
+ }
+
+ @Override
+ public boolean requiresVertexPropertyAddition() {
+ return true;
+ }
+ };
+ }
}
[06/50] incubator-tinkerpop git commit: Merge branch 'tp30'
Posted by sp...@apache.org.
Merge branch 'tp30'
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/03be9f21
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/03be9f21
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/03be9f21
Branch: refs/heads/TINKERPOP3-333
Commit: 03be9f214eaca28cb54311a0973bef5addf28b4a
Parents: 969045e 0ee8364
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 14:31:10 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 14:31:10 2015 -0600
----------------------------------------------------------------------
----------------------------------------------------------------------
[47/50] incubator-tinkerpop git commit: Changed groovy tests which
were using string concatenation instead of bindings.
Posted by sp...@apache.org.
Changed groovy tests which were using string concatenation instead of bindings.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/187ea93f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/187ea93f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/187ea93f
Branch: refs/heads/TINKERPOP3-333
Commit: 187ea93f61158ef56139a2a0efa1446fef0a48a3
Parents: b6784d9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 8 09:34:04 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 8 09:34:04 2015 -0400
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy | 2 +-
.../process/traversal/step/sideEffect/GroovyStoreTest.groovy | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/187ea93f/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 3669d6c..60c555d 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.0.2 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Fixed id parameter used in tests for `GroovyStoreTest` and `GroovyRepeatTest` to not be treated as an embedded string.
* `GraphStep` will convert any `Vertex` or `Edge` ids to their id `Object` prior to submission to `GraphComputer` (OLAP).
TinkerPop 3.0.1 (Release Date: September 2, 2015)
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/187ea93f/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
index 42b7a77..8bdf020 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
@@ -77,7 +77,7 @@ public abstract class GroovyRepeatTest {
@Override
public Traversal<Vertex, String> get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(final Object v1Id) {
- TraversalScriptHelper.compute("g.V(${v1Id}).repeat(out()).until(__.outE.count.is(0)).name", g, "v1Id", v1Id)
+ TraversalScriptHelper.compute("g.V(v1Id).repeat(out()).until(__.outE.count.is(0)).name", g, "v1Id", v1Id)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/187ea93f/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyStoreTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyStoreTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyStoreTest.groovy
index 808593b..0a9270a 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyStoreTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyStoreTest.groovy
@@ -37,7 +37,7 @@ public abstract class GroovyStoreTest {
@Override
public Traversal<Vertex, Collection> get_g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX(
final Object v1Id) {
- TraversalScriptHelper.compute("g.V(${v1Id}).store('a').by('name').out().store('a').by('name').name.cap('a')", g)
+ TraversalScriptHelper.compute("g.V(v1Id).store('a').by('name').out().store('a').by('name').name.cap('a')", g, "v1Id", v1Id)
}
@Override
[17/50] incubator-tinkerpop git commit: new merge work
Posted by sp...@apache.org.
new merge work
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/c6883f9e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/c6883f9e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/c6883f9e
Branch: refs/heads/TINKERPOP3-333
Commit: c6883f9e501f4508a815dbc01b221facef8cb78f
Parents: 2253c67
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Sep 1 09:44:53 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Sep 1 09:44:53 2015 -0600
----------------------------------------------------------------------
.../traversal/VertexTraversalSideEffects.java | 11 +++-
.../process/traversal/SackFunctions.java | 66 ++++++++++++++++++++
.../process/traversal/TraversalSideEffects.java | 25 ++++++--
.../dsl/graph/GraphTraversalSource.java | 66 +++++++++++++++-----
.../step/util/LambdaCollectingBarrierStep.java | 13 ----
.../traverser/B_LP_O_P_S_SE_SL_Traverser.java | 4 +-
.../traverser/B_LP_O_S_SE_SL_Traverser.java | 6 +-
.../traverser/B_O_S_SE_SL_Traverser.java | 17 +++--
.../util/DefaultTraversalSideEffects.java | 17 +++--
.../util/EmptyTraversalSideEffects.java | 17 +++--
.../gremlin/groovy/loaders/StepLoader.groovy | 23 ++++---
.../AbstractImportCustomizerProvider.java | 5 +-
.../gremlin/groovy/function/GBiFunction.java | 55 ++++++++++++++++
.../tinkergraph/structure/TinkerGraphTest.java | 4 +-
14 files changed, 262 insertions(+), 67 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java
index d4bb2cb..278dd10 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java
@@ -19,6 +19,7 @@
package org.apache.tinkerpop.gremlin.process.computer.traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -26,6 +27,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
+import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -58,7 +60,7 @@ public final class VertexTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <S> void setSack(final Supplier<S> initialValue, final Optional<UnaryOperator<S>> splitOperator) {
+ public <T, S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> mergeFunction) {
throw EXCEPTION;
}
@@ -68,7 +70,12 @@ public final class VertexTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <S> Optional<UnaryOperator<S>> getSackSplitOperator() {
+ public <S> UnaryOperator<S> getSackSplitter() {
+ throw EXCEPTION;
+ }
+
+ @Override
+ public <T, S> BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> getSackMerger() {
throw EXCEPTION;
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java
new file mode 100644
index 0000000..ac51212
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java
@@ -0,0 +1,66 @@
+/*
+ * 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.process.traversal;
+
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
+
+import java.util.function.BiFunction;
+import java.util.function.Consumer;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class SackFunctions {
+
+ private SackFunctions() {
+
+ }
+
+ public enum Merge implements BiFunction<Traverser.Admin<Object>, Traverser.Admin<Object>, Object> {
+ weightedSum {
+ @Override
+ public Object apply(final Traverser.Admin<Object> a, final Traverser.Admin<Object> b) {
+ final Object value = (a.bulk() * ((Number) a.sack()).doubleValue()) + (b.bulk() * ((Number) b.sack()).doubleValue());
+ a.setBulk(1l);
+ return value;
+ }
+ };
+ }
+
+ public enum Barrier implements Consumer<TraverserSet<Object>> {
+ noOp {
+ @Override
+ public void accept(final TraverserSet<Object> traverserSet) {
+
+ }
+ }, normSack {
+ @Override
+ public void accept(final TraverserSet<Object> traverserSet) {
+ double total = 0.0d;
+ for (final Traverser.Admin<Object> traverser : traverserSet) {
+ total = total + ((double) traverser.sack() * (double) traverser.bulk());
+ }
+ for (final Traverser.Admin<Object> traverser : traverserSet) {
+ traverser.sack(((double) traverser.sack() * (double) traverser.bulk()) / total);
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java
index bc348aa..8a11616 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java
@@ -24,6 +24,7 @@ import java.io.Serializable;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
+import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -106,14 +107,16 @@ public interface TraversalSideEffects extends Cloneable, Serializable {
}
/**
- * Set the initial value of each {@link Traverser} "sack" along with the operator for splitting sacks.
- * If no operator is provided, then a direct memory copy is assumed (this is typically good for primitive types and strings).
+ * Set the initial value of each {@link Traverser} "sack" along with the methods for splitting and merging sacks.
+ * If no split operator is provided, then a direct memory copy is assumed (this is typically good for primitive types and strings).
+ * If no merge function is provided, then traversers with sacks can not be merged.
*
* @param initialValue the initial value supplier of the traverser sack
* @param splitOperator the split operator for splitting traverser sacks
+ * @param <T> the traverser object type
* @param <S> the sack type
*/
- public <S> void setSack(final Supplier<S> initialValue, final Optional<UnaryOperator<S>> splitOperator);
+ public <T, S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> mergeFunction);
/**
* If sacks are enabled, get the initial value of the {@link Traverser} sack.
@@ -124,13 +127,23 @@ public interface TraversalSideEffects extends Cloneable, Serializable {
public <S> Optional<Supplier<S>> getSackInitialValue();
/**
- * If sacks are enabled and a split operator has been specified, then get it.
- * The split operator is used to split a stack when a bifurcation in a {@link Traverser} happens.
+ * If sacks are enabled and a split operator has been specified, then get it (else null).
+ * The split operator is used to split a sack when a bifurcation in a {@link Traverser} happens.
*
* @param <S> the sack type
* @return the operator for splitting a traverser sack
*/
- public <S> Optional<UnaryOperator<S>> getSackSplitOperator();
+ public <S> UnaryOperator<S> getSackSplitter();
+
+ /**
+ * If sacks are enabled and a merge function has been specified, then get it (else null).
+ * The merge function is used to merge a sack when two {@link Traverser}s converge.
+ *
+ * @param <T> the traverser object type
+ * @param <S> the sack type
+ * @return the operator for merging two traverser sacks
+ */
+ public <T, S> BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> getSackMerger();
/**
* If the sideEffect contains an object associated with the key, return it.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index ddb8076..651ffbc 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep;
@@ -30,6 +31,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.PathIdentityStep;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Transaction;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -39,6 +41,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
+import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -139,30 +142,45 @@ public class GraphTraversalSource implements TraversalSource {
return new GraphTraversalSourceStub(traversal, false);
}
- public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
- final GraphTraversal.Admin traversal = this.generateTraversal();
- traversal.getSideEffects().setSack(initialValue, Optional.of(splitOperator));
- return new GraphTraversalSourceStub(traversal, false);
+ public <A> GraphTraversalSourceStub withSack(final A initialValue) {
+ return this.withSack(initialValue, null, null);
}
public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue) {
final GraphTraversal.Admin traversal = this.generateTraversal();
- traversal.getSideEffects().setSack(initialValue, Optional.empty());
+ traversal.getSideEffects().setSack(initialValue, null, null);
return new GraphTraversalSourceStub(traversal, false);
}
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
+ return this.withSack(initialValue, splitOperator, null);
+ }
+
public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator) {
+ return this.withSack(initialValue, splitOperator, null);
+ }
+
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
+ return this.withSack(initialValue, null, mergeFunction);
+ }
+
+ public <A> GraphTraversalSourceStub withSack(final A initialValue, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
+ return this.withSack(initialValue, null, mergeFunction);
+ }
+
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
final GraphTraversal.Admin traversal = this.generateTraversal();
- traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.of(splitOperator));
+ traversal.getSideEffects().setSack(initialValue, splitOperator, mergeFunction);
return new GraphTraversalSourceStub(traversal, false);
}
- public <A> GraphTraversalSourceStub withSack(final A initialValue) {
+ public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
final GraphTraversal.Admin traversal = this.generateTraversal();
- traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.empty());
+ traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, mergeFunction);
return new GraphTraversalSourceStub(traversal, false);
}
+
public <S> GraphTraversalSourceStub withPath() {
return new GraphTraversalSourceStub(this.generateTraversal(), true);
}
@@ -295,23 +313,43 @@ public class GraphTraversalSource implements TraversalSource {
return this;
}
- public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
- this.traversal.getSideEffects().setSack(initialValue, Optional.of(splitOperator));
+ public <A> GraphTraversalSourceStub withSack(final A initialValue) {
+ this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), null, null);
return this;
}
public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue) {
- this.traversal.getSideEffects().setSack(initialValue, Optional.empty());
+ this.traversal.getSideEffects().setSack(initialValue, null, null);
+ return this;
+ }
+
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator) {
+ this.traversal.getSideEffects().setSack(initialValue, splitOperator, null);
return this;
}
public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator) {
- this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.of(splitOperator));
+ this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, null);
return this;
}
- public <A> GraphTraversalSourceStub withSack(final A initialValue) {
- this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), Optional.empty());
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
+ this.traversal.getSideEffects().setSack(initialValue, null, mergeFunction);
+ return this;
+ }
+
+ public <A> GraphTraversalSourceStub withSack(final A initialValue, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
+ this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), null, mergeFunction);
+ return this;
+ }
+
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
+ this.traversal.getSideEffects().setSack(initialValue, splitOperator, mergeFunction);
+ return this;
+ }
+
+ public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
+ this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, mergeFunction);
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
index a312dab..a3c7bef 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
@@ -20,7 +20,6 @@
package org.apache.tinkerpop.gremlin.process.traversal.step.util;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
@@ -37,21 +36,9 @@ public final class LambdaCollectingBarrierStep<S> extends CollectingBarrierStep<
public void accept(final TraverserSet<Object> traverserSet) {
}
- }, normSack {
- @Override
- public void accept(final TraverserSet<Object> traverserSet) {
- double total = 0.0d;
- for (final Traverser.Admin<Object> traverser : traverserSet) {
- total = total + ((double) traverser.sack() * (double) traverser.bulk());
- }
- for (final Traverser.Admin<Object> traverser : traverserSet) {
- traverser.sack(((double) traverser.sack() * (double) traverser.bulk()) / total);
- }
- }
}
}
-
private final Consumer<TraverserSet<S>> barrierConsumer;
public LambdaCollectingBarrierStep(final Traversal.Admin traversal, final Consumer<TraverserSet<S>> barrierConsumer, final int maxBarrierSize) {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
index c282d30..30641bb 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_P_S_SE_SL_Traverser.java
@@ -22,11 +22,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.ImmutablePath;
-import org.apache.tinkerpop.gremlin.structure.util.Attachable;
import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory;
import java.util.Set;
-import java.util.function.Function;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -92,7 +90,7 @@ public class B_LP_O_P_S_SE_SL_Traverser<T> extends B_O_S_SE_SL_Traverser<T> {
&& ((B_LP_O_P_S_SE_SL_Traverser) object).get().equals(this.t)
&& ((B_LP_O_P_S_SE_SL_Traverser) object).getStepId().equals(this.getStepId())
&& ((B_LP_O_P_S_SE_SL_Traverser) object).loops() == this.loops()
- && (null == this.sack)
+ && (null == this.sack || null != this.sideEffects.getSackMerger())
&& ((B_LP_O_P_S_SE_SL_Traverser) object).path().equals(this.path);
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_S_SE_SL_Traverser.java
index f9c2e08..b32126b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_LP_O_S_SE_SL_Traverser.java
@@ -23,11 +23,9 @@ 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.step.util.ImmutablePath;
-import org.apache.tinkerpop.gremlin.structure.util.Attachable;
import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory;
import java.util.Set;
-import java.util.function.Function;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -97,8 +95,8 @@ public class B_LP_O_S_SE_SL_Traverser<T> extends B_O_S_SE_SL_Traverser<T> {
&& ((B_LP_O_S_SE_SL_Traverser) object).get().equals(this.t)
&& ((B_LP_O_S_SE_SL_Traverser) object).getStepId().equals(this.getStepId())
&& ((B_LP_O_S_SE_SL_Traverser) object).loops() == this.loops()
- && (null == this.sack)
- && ((B_LP_O_S_SE_SL_Traverser) object).path().popEquals(Pop.last,this.path); // this should be Pop.all?
+ && (null == this.sack || null != this.sideEffects.getSackMerger())
+ && ((B_LP_O_S_SE_SL_Traverser) object).path().popEquals(Pop.last, this.path); // this should be Pop.all?
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
index f916a75..327bad3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
@@ -23,7 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import java.util.function.UnaryOperator;
+import java.util.function.BiFunction;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -89,18 +89,25 @@ public class B_O_S_SE_SL_Traverser<T> extends B_O_Traverser<T> {
@Override
public <R> Traverser.Admin<R> split(final R r, final Step<T, R> step) {
- final B_O_S_SE_SL_Traverser<R> clone = (B_O_S_SE_SL_Traverser<R>) super.split(r,step);
- clone.sack = null == clone.sack ? null : clone.sideEffects.getSackSplitOperator().orElse(UnaryOperator.identity()).apply(clone.sack);
+ final B_O_S_SE_SL_Traverser<R> clone = (B_O_S_SE_SL_Traverser<R>) super.split(r, step);
+ clone.sack = null == clone.sack ? null : null == clone.sideEffects.getSackSplitter() ? clone.sack : clone.sideEffects.getSackSplitter().apply(clone.sack);
return clone;
}
@Override
public Traverser.Admin<T> split() {
final B_O_S_SE_SL_Traverser<T> clone = (B_O_S_SE_SL_Traverser<T>) super.split();
- clone.sack = null == clone.sack ? null : clone.sideEffects.getSackSplitOperator().orElse(UnaryOperator.identity()).apply(clone.sack);
+ clone.sack = null == clone.sack ? null : null == clone.sideEffects.getSackSplitter() ? clone.sack : clone.sideEffects.getSackSplitter().apply(clone.sack);
return clone;
}
+ @Override
+ public void merge(final Traverser.Admin<?> other) {
+ super.merge(other);
+ if (this.sack != null && this.sideEffects.getSackMerger() != null)
+ this.sack = ((BiFunction)this.sideEffects.getSackMerger()).apply(this,other);
+ }
+
/////////////////
@Override
@@ -114,6 +121,6 @@ public class B_O_S_SE_SL_Traverser<T> extends B_O_Traverser<T> {
&& ((B_O_S_SE_SL_Traverser) object).get().equals(this.t)
&& ((B_O_S_SE_SL_Traverser) object).getStepId().equals(this.getStepId())
&& ((B_O_S_SE_SL_Traverser) object).loops() == this.loops()
- && (null == this.sack);
+ && (null == this.sack || null != this.sideEffects.getSackMerger());
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
index c028172..42bb04f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
@@ -19,6 +19,7 @@
package org.apache.tinkerpop.gremlin.process.traversal.util;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
@@ -30,6 +31,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
+import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -41,6 +43,7 @@ public class DefaultTraversalSideEffects implements TraversalSideEffects {
protected Map<String, Object> objectMap = new HashMap<>();
protected Map<String, Supplier> supplierMap = new HashMap<>();
protected UnaryOperator sackSplitOperator = null;
+ protected BiFunction sackMergeOperator = null;
protected Supplier sackInitialValue = null;
public DefaultTraversalSideEffects() {
@@ -75,9 +78,10 @@ public class DefaultTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <S> void setSack(final Supplier<S> initialValue, final Optional<UnaryOperator<S>> splitOperator) {
+ public <T,S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> mergeFunction) {
this.sackInitialValue = initialValue;
- this.sackSplitOperator = splitOperator.orElse(null);
+ this.sackSplitOperator = splitOperator;
+ this.sackMergeOperator = mergeFunction;
}
@Override
@@ -86,8 +90,13 @@ public class DefaultTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <S> Optional<UnaryOperator<S>> getSackSplitOperator() {
- return Optional.ofNullable(this.sackSplitOperator);
+ public <S> UnaryOperator<S> getSackSplitter() {
+ return this.sackSplitOperator;
+ }
+
+ @Override
+ public <T,S> BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> getSackMerger() {
+ return this.sackMergeOperator;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java
index 39ce9a6..b1aea21 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java
@@ -19,11 +19,13 @@
package org.apache.tinkerpop.gremlin.process.traversal.util;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import java.util.Collections;
import java.util.Optional;
import java.util.Set;
+import java.util.function.BiFunction;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -45,7 +47,7 @@ public final class EmptyTraversalSideEffects implements TraversalSideEffects {
@Override
public <V> Optional<V> get(final String key) throws IllegalArgumentException {
- return Optional.empty();
+ return Optional.empty();
}
@Override
@@ -69,7 +71,7 @@ public final class EmptyTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <S> void setSack(final Supplier<S> initialValue, final Optional<UnaryOperator<S>> splitOperator) {
+ public <T, S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> mergeFunction) {
}
@@ -79,8 +81,13 @@ public final class EmptyTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <S> Optional<UnaryOperator<S>> getSackSplitOperator() {
- return Optional.empty();
+ public <S> UnaryOperator<S> getSackSplitter() {
+ return null;
+ }
+
+ @Override
+ public <T, S> BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> getSackMerger() {
+ return null;
}
@Override
@@ -90,7 +97,7 @@ public final class EmptyTraversalSideEffects implements TraversalSideEffects {
@SuppressWarnings("CloneDoesntCallSuperClone")
@Override
- public TraversalSideEffects clone() {
+ public TraversalSideEffects clone() {
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy
index 889c118..8243e64 100644
--- a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy
+++ b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy
@@ -18,10 +18,7 @@
*/
package org.apache.tinkerpop.gremlin.groovy.loaders
-import org.apache.tinkerpop.gremlin.groovy.function.GComparator
-import org.apache.tinkerpop.gremlin.groovy.function.GFunction
-import org.apache.tinkerpop.gremlin.groovy.function.GSupplier
-import org.apache.tinkerpop.gremlin.groovy.function.GUnaryOperator
+import org.apache.tinkerpop.gremlin.groovy.function.*
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource
import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier
@@ -45,8 +42,13 @@ class StepLoader {
return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure));
}
- GraphTraversalSource.metaClass.withSack = { final Closure closure, final Closure operator ->
- return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure), new GUnaryOperator(operator));
+ GraphTraversalSource.metaClass.withSack = { final Closure closure, final Closure splitOrMerge ->
+ return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure), splitOrMerge.getMaximumNumberOfParameters() == 1 ? new GUnaryOperator(splitOrMerge) : new GBiFunction(splitOrMerge));
+ }
+
+ GraphTraversalSource.metaClass.withSack = {
+ final Closure closure, final Closure splitOperator, final Closure mergeFunction ->
+ return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure), new GUnaryOperator(splitOperator), new GBiFunction(mergeFunction));
}
///////////////////
@@ -61,8 +63,13 @@ class StepLoader {
}
GraphTraversalSource.GraphTraversalSourceStub.metaClass.withSack = {
- final Closure closure, final Closure operator ->
- return ((GraphTraversalSource.GraphTraversalSourceStub) delegate).withSack(new GSupplier(closure), new GUnaryOperator(operator));
+ final Closure closure, final Closure splitOrMerge ->
+ return ((GraphTraversalSource.GraphTraversalSourceStub) delegate).withSack(new GSupplier(closure), splitOrMerge.getMaximumNumberOfParameters() == 1 ? new GUnaryOperator(splitOrMerge) : new GBiFunction(splitOrMerge));
+ }
+
+ GraphTraversalSource.GraphTraversalSourceStub.metaClass.withSack = {
+ final Closure closure, final Closure splitOperator, Closure mergeFunction ->
+ return ((GraphTraversalSource.GraphTraversalSourceStub) delegate).withSack(new GSupplier(closure), new GUnaryOperator(splitOperator), new GBiFunction(mergeFunction));
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
index d91d049..594a3a9 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
@@ -31,6 +31,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Operator;
import org.apache.tinkerpop.gremlin.process.traversal.Order;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.Pop;
+import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
import org.apache.tinkerpop.gremlin.process.traversal.Scope;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
@@ -38,7 +39,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.LambdaCollectingBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy;
@@ -105,7 +105,8 @@ public abstract class AbstractImportCustomizerProvider implements ImportCustomiz
staticImports.add(Scope.class.getCanonicalName() + DOT_STAR);
staticImports.add(Pop.class.getCanonicalName() + DOT_STAR);
staticImports.add(__.class.getCanonicalName() + DOT_STAR);
- staticImports.add(LambdaCollectingBarrierStep.Consumers.class.getCanonicalName() + DOT_STAR);
+ staticImports.add(SackFunctions.Merge.class.getCanonicalName() + DOT_STAR);
+ staticImports.add(SackFunctions.Barrier.class.getCanonicalName() + DOT_STAR);
staticImports.add(TraversalOptionParent.Pick.class.getCanonicalName() + DOT_STAR);
staticImports.add(GraphTraversalSource.class.getCanonicalName() + DOT_STAR);
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBiFunction.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBiFunction.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBiFunction.java
new file mode 100644
index 0000000..939dffd
--- /dev/null
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBiFunction.java
@@ -0,0 +1,55 @@
+/*
+ * 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.function;
+
+import groovy.lang.Closure;
+import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder;
+
+import java.util.function.BiFunction;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class GBiFunction<A, B, C> implements BiFunction<A, B, C>, LambdaHolder {
+
+ private final Closure closure;
+
+ public GBiFunction(final Closure closure) {
+ this.closure = closure;
+ }
+
+ public static GBiFunction[] make(final Closure... closures) {
+ final GBiFunction[] functions = new GBiFunction[closures.length];
+ for (int i = 0; i < closures.length; i++) {
+ functions[i] = new GBiFunction(closures[i]);
+ }
+ return functions;
+ }
+
+ @Override
+ public String toString() {
+ return "lambda";
+ }
+
+ @Override
+ public C apply(final A a, final B b) {
+ return (C) closure.call(a, b);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c6883f9e/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index a1f6b1c..1a75b83 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.tinkergraph.structure;
import org.apache.tinkerpop.gremlin.process.traversal.Operator;
import org.apache.tinkerpop.gremlin.process.traversal.P;
+import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
@@ -40,6 +41,7 @@ import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
+import java.util.function.BiFunction;
import java.util.function.Supplier;
import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
@@ -164,7 +166,7 @@ public class TinkerGraphTest {
public void testPlay7() throws Exception {
final Graph graph = TinkerFactory.createModern();
final GraphTraversalSource g = graph.traversal();
- g.withSack(1.0).V(1).local(outE().barrier(LambdaCollectingBarrierStep.Consumers.normSack)).inV().sack().forEachRemaining(System.out::println);
+ g.withSack(1.0,(BiFunction)SackFunctions.Merge.weightedSum).V(1).local(outE("knows").barrier(SackFunctions.Barrier.normSack)).inV().in("knows").barrier().sack().forEachRemaining(System.out::println);
}
@Test
[38/50] incubator-tinkerpop git commit: Merge branch 'tp30'
Posted by sp...@apache.org.
Merge branch 'tp30'
Conflicts:
gremlin-console/pom.xml
gremlin-core/pom.xml
gremlin-driver/pom.xml
gremlin-groovy-test/pom.xml
gremlin-groovy/pom.xml
gremlin-server/pom.xml
gremlin-shaded/pom.xml
gremlin-test/pom.xml
hadoop-gremlin/pom.xml
neo4j-gremlin/pom.xml
pom.xml
tinkergraph-gremlin/pom.xml
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/a20860bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/a20860bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/a20860bb
Branch: refs/heads/TINKERPOP3-333
Commit: a20860bb8d5030363521843381f65cf4e897cf64
Parents: aca507b 51eb806
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Sep 3 11:10:22 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Sep 3 11:10:22 2015 -0600
----------------------------------------------------------------------
----------------------------------------------------------------------
[19/50] incubator-tinkerpop git commit: Parameters deals with
multi-properties -- which is really only useful for AddVertexStep. Found a
couple other problems with Parameters that didn't rear their head with the
test cases we had. Added more test cases.
Posted by sp...@apache.org.
Parameters deals with multi-properties -- which is really only useful for AddVertexStep. Found a couple other problems with Parameters that didn't rear their head with the test cases we had. Added more test cases. TINKERPOP3-823 #close.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/be8522b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/be8522b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/be8522b1
Branch: refs/heads/TINKERPOP3-333
Commit: be8522b1f23fded72783f4f0b916a2c946129adb
Parents: 2253c67
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Sep 1 13:15:58 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Sep 1 13:15:58 2015 -0600
----------------------------------------------------------------------
.../process/traversal/step/map/AddEdgeStep.java | 6 +-
.../step/sideEffect/AddPropertyStep.java | 6 +-
.../process/traversal/step/util/Parameters.java | 67 ++++++++++++------
.../PartitionStrategyTraverseTest.java | 8 +--
.../step/map/GroovyAddVertexTest.groovy | 10 +++
.../traversal/step/map/AddVertexTest.java | 71 +++++++++++++++++++-
6 files changed, 137 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be8522b1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
index 91f3c05..3f6086a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java
@@ -85,9 +85,9 @@ public final class AddEdgeStep<S> extends MapStep<S, Edge> implements Mutating<E
@Override
protected Edge map(final Traverser.Admin<S> traverser) {
- final Vertex toVertex = this.parameters.get(traverser, TO, () -> (Vertex) traverser.get());
- final Vertex fromVertex = this.parameters.get(traverser, FROM, () -> (Vertex) traverser.get());
- final String edgeLabel = this.parameters.get(traverser, T.label, () -> Edge.DEFAULT_LABEL);
+ final Vertex toVertex = this.parameters.get(traverser, TO, () -> (Vertex) traverser.get()).get(0);
+ final Vertex fromVertex = this.parameters.get(traverser, FROM, () -> (Vertex) traverser.get()).get(0);
+ final String edgeLabel = this.parameters.get(traverser, T.label, () -> Edge.DEFAULT_LABEL).get(0);
final Edge edge = fromVertex.addEdge(edgeLabel, toVertex, this.parameters.getKeyValues(traverser, TO, FROM, T.label));
if (callbackRegistry != null) {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be8522b1/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 02ac53c..9ea7785 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
@@ -75,12 +75,12 @@ public final class AddPropertyStep<S extends Element> extends SideEffectStep<S>
@Override
protected void sideEffect(final Traverser.Admin<S> traverser) {
- final String key = this.parameters.get(traverser, T.key, () -> {
+ final String key = (String) this.parameters.get(traverser, T.key, () -> {
throw new IllegalStateException("The AddPropertyStep does not have a provided key: " + this);
- });
+ }).get(0);
final Object value = this.parameters.get(traverser, T.value, () -> {
throw new IllegalStateException("The AddPropertyStep does not have a provided value: " + this);
- });
+ }).get(0);
final Object[] vertexPropertyKeyValues = this.parameters.getKeyValues(traverser, T.key, T.value);
final Element element = traverser.get();
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be8522b1/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 7acc240..01206d9 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.util.TraversalUtil;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -39,7 +40,7 @@ public final class Parameters implements Cloneable, Serializable {
private static final Object[] EMPTY_ARRAY = new Object[0];
- private Map<Object, Object> parameters = new HashMap<>();
+ private Map<Object, List<Object>> parameters = new HashMap<>();
public boolean contains(final Object key) {
return this.parameters.containsKey(key);
@@ -49,24 +50,32 @@ public final class Parameters implements Cloneable, Serializable {
this.set(newKey, this.parameters.remove(oldKey));
}
- public <S, E> E get(final Traverser.Admin<S> traverser, final Object key, final Supplier<E> defaultValue) {
- final Object object = parameters.get(key);
- return null == object ? defaultValue.get() : object instanceof Traversal.Admin ? TraversalUtil.apply(traverser, (Traversal.Admin<S, E>) object) : (E) object;
+ public <S, E> List<E> get(final Traverser.Admin<S> traverser, final Object key, final Supplier<E> defaultValue) {
+ final List<E> values = (List<E>) this.parameters.get(key);
+ if (null == values) return Collections.singletonList(defaultValue.get());
+ final List<E> result = new ArrayList<>();
+ for (final Object value : values) {
+ result.add(value instanceof Traversal.Admin ? TraversalUtil.apply(traverser, (Traversal.Admin<S, E>) value) : (E) value);
+ }
+ return result;
}
- public <E> E get(final Object key, final Supplier<E> defaultValue) {
- final Object object = parameters.get(key);
- return null == object ? defaultValue.get() : (E) object;
+ public <E> List<E> get(final Object key, final Supplier<E> defaultValue) {
+ final List<E> list = (List<E>) this.parameters.get(key);
+ return (null == list) ? Collections.singletonList(defaultValue.get()) : list;
+
}
public <S> Object[] getKeyValues(final Traverser.Admin<S> traverser, final Object... exceptKeys) {
if (this.parameters.size() == 0) return EMPTY_ARRAY;
final List<Object> exceptions = Arrays.asList(exceptKeys);
final List<Object> keyValues = new ArrayList<>();
- for (final Map.Entry<Object, Object> keyValue : this.parameters.entrySet()) {
- if (!exceptions.contains(keyValue.getKey())) {
- keyValues.add(keyValue.getKey() instanceof Traversal.Admin ? TraversalUtil.apply(traverser, (Traversal.Admin<S, ?>) keyValue.getKey()) : keyValue.getKey());
- keyValues.add(keyValue.getValue() instanceof Traversal.Admin ? TraversalUtil.apply(traverser, (Traversal.Admin<S, ?>) keyValue.getValue()) : keyValue.getValue());
+ for (final Map.Entry<Object, List<Object>> entry : this.parameters.entrySet()) {
+ if (!exceptions.contains(entry.getKey())) {
+ for (final Object value : entry.getValue()) {
+ keyValues.add(entry.getKey() instanceof Traversal.Admin ? TraversalUtil.apply(traverser, (Traversal.Admin<S, ?>) entry.getKey()) : entry.getKey());
+ keyValues.add(value instanceof Traversal.Admin ? TraversalUtil.apply(traverser, (Traversal.Admin<S, ?>) value) : value);
+ }
}
}
return keyValues.toArray(new Object[keyValues.size()]);
@@ -75,29 +84,42 @@ public final class Parameters implements Cloneable, Serializable {
public void set(final Object... keyValues) {
for (int i = 0; i < keyValues.length; i = i + 2) {
if (keyValues[i + 1] != null) {
- this.parameters.put(keyValues[i], keyValues[i + 1]);
+ List<Object> values = this.parameters.get(keyValues[i]);
+ if (null == values) {
+ values = new ArrayList<>();
+ values.add(keyValues[i + 1]);
+ this.parameters.put(keyValues[i], values);
+ } else {
+ values.add(keyValues[i + 1]);
+ }
}
}
}
public void integrateTraversals(final TraversalParent step) {
- for (final Object value : this.parameters.values()) {
- if (value instanceof Traversal.Admin) {
- step.integrateChild((Traversal.Admin) value);
+ for (final List<Object> values : this.parameters.values()) {
+ for (final Object object : values) {
+ if (object instanceof Traversal.Admin) {
+ step.integrateChild((Traversal.Admin) object);
+ }
}
}
}
public <S, E> List<Traversal.Admin<S, E>> getTraversals() {
- return (List) this.parameters.values().stream().filter(t -> t instanceof Traversal.Admin).collect(Collectors.toList());
+ return (List) this.parameters.values().stream().flatMap(List::stream).filter(t -> t instanceof Traversal.Admin).collect(Collectors.toList());
}
public Parameters clone() {
try {
final Parameters clone = (Parameters) super.clone();
clone.parameters = new HashMap<>();
- for (final Map.Entry<Object, Object> entry : this.parameters.entrySet()) {
- clone.parameters.put(entry.getKey(), entry.getValue() instanceof Traversal ? ((Traversal.Admin) entry.getValue()).clone() : entry.getValue());
+ for (final Map.Entry<Object, List<Object>> entry : this.parameters.entrySet()) {
+ final List<Object> values = new ArrayList<>();
+ for (final Object value : entry.getValue()) {
+ values.add(value instanceof Traversal.Admin ? ((Traversal.Admin) value).clone() : value);
+ }
+ clone.parameters.put(entry.getKey() instanceof Traversal.Admin ? ((Traversal.Admin) entry.getKey()).clone() : entry.getKey(), values);
}
return clone;
} catch (final CloneNotSupportedException e) {
@@ -106,7 +128,14 @@ public final class Parameters implements Cloneable, Serializable {
}
public int hashCode() {
- return this.parameters.hashCode();
+ int result = 1;
+ for (final Map.Entry<Object, List<Object>> entry : this.parameters.entrySet()) {
+ result ^= entry.getKey().hashCode();
+ for (final Object value : entry.getValue()) {
+ result ^= value.hashCode();
+ }
+ }
+ return result;
}
public String toString() {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be8522b1/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyTraverseTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyTraverseTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyTraverseTest.java
index 29d6dc0..13b6ca6 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyTraverseTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyTraverseTest.java
@@ -108,19 +108,19 @@ public class PartitionStrategyTraverseTest {
final List<AddEdgeStep> addEdgeSteps = TraversalHelper.getStepsOfAssignableClass(AddEdgeStep.class, traversal.asAdmin());
assertEquals(1, addEdgeSteps.size());
addEdgeSteps.forEach(s -> {
- assertEquals("test", s.getParameters().get(T.label, () -> Edge.DEFAULT_LABEL));
- assertEquals("a", s.getParameters().get("p", null));
+ assertEquals("test", s.getParameters().get(T.label, () -> Edge.DEFAULT_LABEL).get(0));
+ assertEquals("a", s.getParameters().get("p", null).get(0));
});
} else if (TraversalHelper.hasStepOfAssignableClass(AddVertexStep.class, traversal.asAdmin())) {
strategy.apply(traversal.asAdmin());
final List<AddVertexStep> addVertexSteps = TraversalHelper.getStepsOfAssignableClass(AddVertexStep.class, traversal.asAdmin());
assertEquals(1, addVertexSteps.size());
- addVertexSteps.forEach(s -> assertEquals("a", s.getParameters().get("p", null)));
+ addVertexSteps.forEach(s -> assertEquals("a", s.getParameters().get("p", null).get(0)));
} else if (TraversalHelper.hasStepOfAssignableClass(AddVertexStartStep.class, traversal.asAdmin())) {
strategy.apply(traversal.asAdmin());
final List<AddVertexStartStep> addVertexSteps = TraversalHelper.getStepsOfAssignableClass(AddVertexStartStep.class, traversal.asAdmin());
assertEquals(1, addVertexSteps.size());
- addVertexSteps.forEach(s -> assertEquals("a", s.getParameters().get("p", null)));
+ addVertexSteps.forEach(s -> assertEquals("a", s.getParameters().get("p", null).get(0)));
} else
fail("This test should not be marked as having a mutating step or there is something else amiss.");
} else {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be8522b1/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy
index 7ec2866..b42f4ce 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy
@@ -51,6 +51,16 @@ public abstract class GroovyAddVertexTest {
TraversalScriptHelper.compute("g.V.has('name', 'marko').property('friendWeight', outE('knows').weight.sum(), 'acl', 'private')", g)
}
+ @Override
+ public Traversal<Vertex, Vertex> get_g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X() {
+ TraversalScriptHelper.compute("g.addV('animal').property('name', 'mateo').property('name', 'gateo').property('name', 'cateo').property('age', 5)", g)
+ }
+
+ @Override
+ public Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX() {
+ TraversalScriptHelper.compute("g.V.addV('animal').property('name', values('name')).property('name', 'an animal').property(values('name'), label())", g)
+ }
+
///////// DEPRECATED BELOW
@Override
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/be8522b1/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
index 4019995..131305a 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
@@ -31,9 +31,10 @@ import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.List;
+
import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.*;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -49,6 +50,10 @@ public abstract class AddVertexTest extends AbstractGremlinTest {
public abstract Traversal<Vertex, Vertex> get_g_V_hasXname_markoX_propertyXfriendWeight_outEXknowsX_weight_sum__acl_privateX();
+ public abstract Traversal<Vertex, Vertex> get_g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X();
+
+ public abstract Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX();
+
// 3.0.0 DEPRECATIONS
@Deprecated
public abstract Traversal<Vertex, Vertex> get_g_V_addVXlabel_animal_age_0X();
@@ -123,6 +128,58 @@ public abstract class AddVertexTest extends AbstractGremlinTest {
assertEquals(1, IteratorUtils.count(marko.property("friendWeight").properties()));
}
+ @Test
+ @LoadGraphWith(MODERN)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
+ public void g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X() {
+ final Traversal<Vertex, Vertex> traversal = get_g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X();
+ printTraversalForm(traversal);
+ final Vertex mateo = traversal.next();
+ assertFalse(traversal.hasNext());
+ assertEquals("animal", mateo.label());
+ assertEquals(3, IteratorUtils.count(mateo.properties("name")));
+ mateo.values("name").forEachRemaining(name -> {
+ assertTrue(name.equals("mateo") || name.equals("cateo") || name.equals("gateo"));
+ });
+ assertEquals(5, ((Integer) mateo.value("age")).intValue());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
+ public void xxx() {
+ final Traversal<Vertex, Vertex> traversal = get_g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX();
+ printTraversalForm(traversal);
+ while (traversal.hasNext()) {
+ final Vertex vertex = traversal.next();
+ assertEquals("animal", vertex.label());
+ assertEquals(2, IteratorUtils.count(vertex.properties("name")));
+ List<String> names = IteratorUtils.asList(vertex.values("name"));
+ assertEquals(2, names.size());
+ assertTrue(names.contains("an animal"));
+ assertTrue(names.contains("marko") || names.contains("vadas") || names.contains("josh") || names.contains("lop") || names.contains("ripple") || names.contains("peter"));
+ if (names.contains("marko")) {
+ assertEquals("person", vertex.value("marko"));
+ } else if (names.contains("vadas")) {
+ assertEquals("person", vertex.value("vadas"));
+ } else if (names.contains("josh")) {
+ assertEquals("person", vertex.value("josh"));
+ } else if (names.contains("ripple")) {
+ assertEquals("software", vertex.value("ripple"));
+ } else if (names.contains("lop")) {
+ assertEquals("software", vertex.value("lop"));
+ } else if (names.contains("peter")) {
+ assertEquals("person", vertex.value("peter"));
+ } else {
+ throw new IllegalStateException("This state should not have been reached");
+ }
+ }
+ }
+
/////
@Test
@@ -183,6 +240,16 @@ public abstract class AddVertexTest extends AbstractGremlinTest {
}
@Override
+ public Traversal<Vertex, Vertex> get_g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X() {
+ return g.addV("animal").property("name", "mateo").property("name", "gateo").property("name", "cateo").property("age", 5);
+ }
+
+ @Override
+ public Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX() {
+ return g.V().addV("animal").property("name", __.values("name")).property("name", "an animal").property(__.values("name"), __.label());
+ }
+
+ @Override
public Traversal<Vertex, Vertex> get_g_V_addVXlabel_animal_age_0X() {
return g.V().addV(T.label, "animal", "age", 0);
}
[23/50] incubator-tinkerpop git commit: disallow vertices/edges for
GraphStartStep in computer mode
Posted by sp...@apache.org.
disallow vertices/edges for GraphStartStep in computer mode
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/167e419a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/167e419a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/167e419a
Branch: refs/heads/TINKERPOP3-333
Commit: 167e419a9bd16fb743ff5ef006770404951d4041
Parents: 18adacd
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue Sep 1 22:53:12 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue Sep 1 22:53:12 2015 +0200
----------------------------------------------------------------------
.../strategy/verification/ComputerVerificationStrategy.java | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/167e419a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
index a56afd4..8923372 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
@@ -46,7 +46,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierS
import org.apache.tinkerpop.gremlin.process.traversal.step.util.SupplyingBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
+import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.T;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
import java.util.Arrays;
import java.util.HashSet;
@@ -79,6 +81,11 @@ public final class ComputerVerificationStrategy extends AbstractTraversalStrateg
if (traversal.getParent() instanceof EmptyStep) {
if (!(traversal.getStartStep() instanceof GraphStep))
throw new VerificationException("GraphComputer does not support traversals starting from a non-GraphStep: " + traversal.getStartStep(), traversal);
+ for (final Object id : ((GraphStep) traversal.getStartStep()).getIds()) {
+ if (id instanceof Vertex || id instanceof Edge) {
+ throw new VerificationException("GraphComputer does not support traversals starting from a particular vertex or edge.", traversal);
+ }
+ }
///
if (endStep instanceof CollectingBarrierStep && endStep instanceof TraversalParent) {
if (((TraversalParent) endStep).getLocalChildren().stream().filter(t ->
[44/50] incubator-tinkerpop git commit: Added more javadoc.
Posted by sp...@apache.org.
Added more javadoc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/7351675f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/7351675f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/7351675f
Branch: refs/heads/TINKERPOP3-333
Commit: 7351675f39b2749f9b342b43497d3a2567de40ed
Parents: 27322ab
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Sep 4 12:18:24 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Sep 4 12:18:24 2015 -0400
----------------------------------------------------------------------
.../tinkerpop/gremlin/driver/Cluster.java | 46 ++++++++++++++++++++
1 file changed, 46 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7351675f/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
index a732ad5..9aeb9bf 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
@@ -71,6 +71,11 @@ public final class Cluster {
* Creates a {@link Client.ClusteredClient} instance to this {@code Cluster}, meaning requests will be routed to
* one or more servers (depending on the cluster configuration), where each request represents the entirety of a
* transaction. A commit or rollback (in case of error) is automatically executed at the end of the request.
+ * <p/>
+ * Note that calling this method does not imply that a connection is made to the server itself at this point.
+ * Therefore, if there is only one server specified in the {@code Cluster} and that server is not available an
+ * error will not be raised at this point. Connections get initialized in the {@link Client} when a request is
+ * submitted or can be directly initialized via {@link Client#init()}.
*/
public Client connect() {
return new Client.ClusteredClient(this);
@@ -81,6 +86,11 @@ public final class Cluster {
* a single server (randomly selected from the cluster), where the same bindings will be available on each request.
* Requests are bound to the same thread on the server and thus transactions may extend beyond the bounds of a
* single request. The transactions are managed by the user and must be committed or rolledback manually.
+ * <p/>
+ * Note that calling this method does not imply that a connection is made to the server itself at this point.
+ * Therefore, if there is only one server specified in the {@code Cluster} and that server is not available an
+ * error will not be raised at this point. Connections get initialized in the {@link Client} when a request is
+ * submitted or can be directly initialized via {@link Client#init()}.
*
* @param sessionId user supplied id for the session which should be unique (a UUID is ideal).
*/
@@ -178,6 +188,13 @@ public final class Cluster {
return manager.isClosing() && manager.close().isDone();
}
+ /**
+ * Gets the list of hosts that the {@code Cluster} was able to connect to. A {@link Host} is assumed unavailable
+ * until a connection to it is proven to be present. This will not happen until the the {@link Client} submits
+ * requests that succeed in reaching a server at the {@link Host} or {@link Client#init()} is called which
+ * initializes the {@link ConnectionPool} for the {@link Client} itself. The number of available hosts returned
+ * from this method will change as different servers come on and offline.
+ */
public List<URI> availableHosts() {
return Collections.unmodifiableList(allHosts().stream()
.filter(Host::isAvailable)
@@ -402,31 +419,52 @@ public final class Cluster {
return this;
}
+ /**
+ * Specifies the load balancing strategy to use on the client side.
+ */
public Builder loadBalancingStrategy(final LoadBalancingStrategy loadBalancingStrategy) {
this.loadBalancingStrategy = loadBalancingStrategy;
return this;
}
+ /**
+ * Specifies parameters for authentication to Gremlin Server.
+ */
public Builder authProperties(final AuthProperties authProps) {
this.authProps = authProps;
return this;
}
+ /**
+ * Sets the {@link AuthProperties.Property#USERNAME} and {@link AuthProperties.Property#PASSWORD} properties
+ * for authentication to Gremlin Server.
+ */
public Builder credentials(final String username, final String password) {
authProps = authProps.with(AuthProperties.Property.USERNAME, username).with(AuthProperties.Property.PASSWORD, password);
return this;
}
+ /**
+ * Sets the {@link AuthProperties.Property#PROTOCOL} properties for authentication to Gremlin Server.
+ */
public Builder protocol(final String protocol) {
this.authProps = authProps.with(AuthProperties.Property.PROTOCOL, protocol);
return this;
}
+ /**
+ * Sets the {@link AuthProperties.Property#JAAS_ENTRY} properties for authentication to Gremlin Server.
+ */
public Builder jaasEntry(final String jaasEntry) {
this.authProps = authProps.with(AuthProperties.Property.JAAS_ENTRY, jaasEntry);
return this;
}
+ /**
+ * Adds the address of a Gremlin Server to the list of servers a {@link Client} will try to contact to send
+ * requests to. The address should be parseable by {@link InetAddress#getByName(String)}. That's the only
+ * validation performed at this point. No connection to the host is attempted.
+ */
public Builder addContactPoint(final String address) {
try {
this.addresses.add(InetAddress.getByName(address));
@@ -436,12 +474,20 @@ public final class Cluster {
}
}
+ /**
+ * Add one or more the addresses of a Gremlin Servers to the list of servers a {@link Client} will try to
+ * contact to send requests to. The address should be parseable by {@link InetAddress#getByName(String)}.
+ * That's the only validation performed at this point. No connection to the host is attempted.
+ */
public Builder addContactPoints(final String... addresses) {
for (String address : addresses)
addContactPoint(address);
return this;
}
+ /**
+ * Sets the port that the Gremlin Servers will be listening on.
+ */
public Builder port(final int port) {
this.port = port;
return this;
[45/50] incubator-tinkerpop git commit: Improve gremlin driver tests.
Posted by sp...@apache.org.
Improve gremlin driver tests.
Ensure that availableHosts is tested before init() of the Client, after init() of the client and after the server goes down.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/8881caff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/8881caff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/8881caff
Branch: refs/heads/TINKERPOP3-333
Commit: 8881caffe1cc6bab2682b4876047a3a85d83f209
Parents: 7351675
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Sep 4 12:18:31 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Sep 4 12:18:31 2015 -0400
----------------------------------------------------------------------
.../gremlin/server/GremlinDriverIntegrateTest.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8881caff/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index 407436c..326d746 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -332,7 +332,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldCloseWithServerDown() throws Exception {
final Cluster cluster = Cluster.open();
- cluster.connect();
+ cluster.connect().init();
stopServer();
@@ -341,11 +341,14 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
@Test
public void shouldMarkHostDeadSinceServerIsDown() throws Exception {
- stopServer();
-
final Cluster cluster = Cluster.open();
- cluster.connect();
+ assertEquals(0, cluster.availableHosts().size());
+ cluster.connect().init();
+ assertEquals(1, cluster.availableHosts().size());
+
+ stopServer();
+ cluster.connect().init();
assertEquals(0, cluster.availableHosts().size());
cluster.close();
[26/50] incubator-tinkerpop git commit: Update changelog with JIRA
tickets for 3.0.1.
Posted by sp...@apache.org.
Update changelog with JIRA tickets for 3.0.1.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/8e71d2ec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/8e71d2ec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/8e71d2ec
Branch: refs/heads/TINKERPOP3-333
Commit: 8e71d2ec9f663a11cfb2870f632bdcdcf15674cb
Parents: 64a6436
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Sep 2 07:52:45 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Sep 2 07:52:45 2015 -0400
----------------------------------------------------------------------
CHANGELOG.asciidoc | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8e71d2ec/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index e7da592..11bd6df 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -22,8 +22,8 @@ TinkerPop 3.0.0 (A Gremlin Rāga in 7/16 Time)
image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
-TinkerPop 3.0.1 (NOT OFFICIALLY RELEASED YET)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+TinkerPop 3.0.1 (Release Date: September 2, 2015)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Added `BulkLoaderVertexProgram` and a default bulk loader implementation: `IncrementalBulkLoader`
* `Compare` now uses `BigDecimal` internally to ensure that precision is not lost on standard number comparisons.
@@ -52,6 +52,37 @@ TinkerPop 3.0.1 (NOT OFFICIALLY RELEASED YET)
* Removed `SecurityCustomizerProvider` class and the "sandbox" configuration on the `ScriptEngines` class - this was an experimental feature and not meant for public use.
* Removed dependency on `groovy-sandbox` from the `gremlin-groovy` module.
+Bugs
+^^^^
+
+* [TINKERPOP3-770] - Exception while AddPropertyStep tries to detach vertex property
+* [TINKERPOP3-780] - Use of fold() in repeat()
+* [TINKERPOP3-782] - map(Traversal) should declare requirements of child
+* [TINKERPOP3-785] - Gremlin Server Not Properly Reporting Port Conflict
+* [TINKERPOP3-792] - select at start of match traversal on Map can fail
+* [TINKERPOP3-794] - IncidentToAdjecentStrategy malfunction
+* [TINKERPOP3-804] - Failed installing neo4j-gremlin extension on Windows 7
+* [TINKERPOP3-822] - Neo4j GraphStep with element arguments ignores has *(breaking)*
+
+Improvements
+^^^^^^^^^^^^
+
+* [TINKERPOP3-319] - BulkLoaderVertexProgram for generalized batch loading across graphs
+* [TINKERPOP3-576] - Gremlin Server Authentication
+* [TINKERPOP3-582] - Remove Groovy Sandbox Dependency
+* [TINKERPOP3-610] - General graph concept names in test schema
+* [TINKERPOP3-656] - IoRegistry Chaining
+* [TINKERPOP3-690] - Be able to OPT_OUT for Standard, but not Computer *(breaking)*
+* [TINKERPOP3-699] - GraphSON writeGraph not producing valid json object
+* [TINKERPOP3-750] - Compare should not have special case for Number
+* [TINKERPOP3-752] - Make Gremlin Server Better Respect ACCEPT
+* [TINKERPOP3-764] - Unify semantics of Transaction.close() in tests and documentation *(breaking)*
+* [TINKERPOP3-771] - IoRegistry Instantiation With GryoPool
+* [TINKERPOP3-778] - Support GraphFactory location via annotation.
+* [TINKERPOP3-791] - Document rules for committers
+* [TINKERPOP3-797] - order() seems to only like List? *(breaking)*
+* [TINKERPOP3-808] - TraversalComparator.comparator needs a getter
+
TinkerPop 3.0.0 (Release Date: July 9, 2015)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[46/50] incubator-tinkerpop git commit: Merge remote-tracking branch
'origin/tp30' into tp30
Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/tp30' into tp30
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/b6784d9c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/b6784d9c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/b6784d9c
Branch: refs/heads/TINKERPOP3-333
Commit: b6784d9ccdc57fe41ea3b23542299b50241381c1
Parents: 8881caf 93bc0a8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Sep 4 12:19:48 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Sep 4 12:19:48 2015 -0400
----------------------------------------------------------------------
docs/preprocessor/preprocess.sh | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
[32/50] incubator-tinkerpop git commit: Updates to binary
LICENSE/NOTICE.
Posted by sp...@apache.org.
Updates to binary LICENSE/NOTICE.
Not sure why there were so many reference to libs that weren't actually bundled. Also did some alphabetizing according to how file name in the binary distribution /lib directory.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/5a381391
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/5a381391
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/5a381391
Branch: refs/heads/TINKERPOP3-333
Commit: 5a381391031c2756bf0927f4246e20e220306f8d
Parents: bce3e8b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Sep 3 06:50:26 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Sep 3 06:50:26 2015 -0400
----------------------------------------------------------------------
gremlin-console/src/main/LICENSE | 36 ++++++--------
gremlin-console/src/main/NOTICE | 59 +++++++----------------
gremlin-server/src/main/LICENSE | 33 +++++--------
gremlin-server/src/main/NOTICE | 90 ++++++++---------------------------
4 files changed, 62 insertions(+), 156 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5a381391/gremlin-console/src/main/LICENSE
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/LICENSE b/gremlin-console/src/main/LICENSE
index 7b7a146..e124a3a 100644
--- a/gremlin-console/src/main/LICENSE
+++ b/gremlin-console/src/main/LICENSE
@@ -207,35 +207,30 @@ Apache 2.0 Licenses
The Apache TinkerPop project bundles the following components under the Apache 2.0 License:
- HPPC Collections (com.carrotsearch:hppc - http://labs.carrotsearch.com/hppc.html/hppc)
- JUnitBenchmarks (com.carrotsearch:junit-benchmarks - http://labs.carrotsearch.com/junit-benchmarks.html)
- Metrics Core (com.codahale.metrics:metrics-core - http://metrics.codahale.com/metrics-core/)
- Ganglia Integration for Metrics (com.codahale.metrics:metrics-ganglia - http://metrics.codahale.com/metrics-ganglia/)
- Graphite Integration for Metrics (com.codahale.metrics:metrics-graphite - http://metrics.codahale.com/metrics-graphite/)
- Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations - http://wiki.fasterxml.com/JacksonHome)
- Jackson-core (com.fasterxml.jackson.core:jackson-core - http://wiki.fasterxml.com/JacksonHome)
- jackson-databind (com.fasterxml.jackson.core:jackson-databind - http://wiki.fasterxml.com/JacksonHome)
Commons BeanUtils (commons-beanutils:commons-beanutils - http://commons.apache.org/beanutils/)
Commons Codec (commons-codec:commons-codec - http://commons.apache.org/codec/)
Commons Collections (commons-collections:commons-collections - http://commons.apache.org/collections/)
Apache Commons Configuration (commons-configuration:commons-configuration - http://commons.apache.org/configuration/)
- Commons IO (commons-io:commons-io - http://commons.apache.org/io/)
Commons Lang (commons-lang:commons-lang - http://commons.apache.org/lang/)
+ Apache Commons Lang (org.apache.commons:commons-lang3 - http://commons.apache.org/proper/commons-lang/)
Commons Logging (commons-logging:commons-logging - http://commons.apache.org/logging)
- Netty/All-in-One (io.netty:netty-all - http://netty.io/netty-all/)
- Apache Log4j (log4j:log4j - http://logging.apache.org/log4j/1.2/)
ezmorph (net.sf.ezmorph:ezmorph - http://ezmorph.sourceforge.net)
- json-lib (net.sf.json-lib:json-lib - http://json-lib.sourceforge.net)
- Neko HTML (net.sourceforge.nekohtml:nekohtml - http://nekohtml.sourceforge.net/)
- Apache Commons Lang (org.apache.commons:commons-lang3 - http://commons.apache.org/proper/commons-lang/)
+ GBench (org.gperfutils:gbench - https://github.com/gperfutils/gbench)
+ GProf (org.gperfutils:gprof - https://github.com/gperfutils/gprof)
+ Groovy (org.codehaus.groovy:groovy-all - http://groovy.codehaus.org/)
+ HPPC Collections (com.carrotsearch:hppc - http://labs.carrotsearch.com/hppc.html/hppc)
HttpClient (org.apache.httpcomponents:httpclient - http://hc.apache.org/httpcomponents-client)
HttpCore (org.apache.httpcomponents:httpcore - http://hc.apache.org/httpcomponents-core-ga)
- Apache Ivy (org.apache.ivy:ivy - http://ant.apache.org/ivy/)
- Groovy (org.codehaus.groovy:groovy-all - http://groovy.codehaus.org/)
HTTP client framework for Groovy (org.codehaus.groovy.modules.http-builder:http-builder - http://groovy.codehaus.org/modules/http-builder/)
- GBench (org.gperfutils:gbench - https://github.com/gperfutils/gbench)
- GProf (org.gperfutils:gprof - https://github.com/gperfutils/gprof)
+ Apache Ivy (org.apache.ivy:ivy - http://ant.apache.org/ivy/)
+ Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations - http://wiki.fasterxml.com/JacksonHome)
+ Jackson-core (com.fasterxml.jackson.core:jackson-core - http://wiki.fasterxml.com/JacksonHome)
+ jackson-databind (com.fasterxml.jackson.core:jackson-databind - http://wiki.fasterxml.com/JacksonHome)
javatuples (org.javatuples:javatuples - http://www.javatuples.org)
+ json-lib (net.sf.json-lib:json-lib - http://json-lib.sourceforge.net)
+ Apache Log4j (log4j:log4j - http://logging.apache.org/log4j/1.2/)
+ Neko HTML (net.sourceforge.nekohtml:nekohtml - http://nekohtml.sourceforge.net/)
+ Netty/All-in-One (io.netty:netty-all - http://netty.io/netty-all/)
SnakeYAML (org.yaml:snakeyaml - http://www.snakeyaml.org)
Xerces2 Java Parser (xerces:xercesImpl - http://xerces.apache.org/xerces2-j)
XML Commons External Components XML APIs (xml-apis:xml-apis - http://xml.apache.org/commons/components/external/)
@@ -247,8 +242,7 @@ BSD-style Licenses
The Apache TinkerPop project bundles the following components under the BSD License:
- Hamcrest All (org.hamcrest:hamcrest-all - https://github.com/hamcrest/JavaHamcrest/hamcrest-all)
- Hamcrest Core (org.hamcrest:hamcrest-core - https://github.com/hamcrest/JavaHamcrest/hamcrest-core)
+ jBCrypt (org.mindrot:jbcrypt - https://github.com/jeremyh/jBCrypt)
jcabi-log (com.jcabi:jcabi-log - http://www.jcabi.com/jcabi-log)
jcabi-manifests (com.jcabi:jcabi-manifests - http://www.jcabi.com/jcabi-manifests)
JLine (jline:jline - http://nexus.sonatype.org/oss-repository-hosting.html/jline)
@@ -286,11 +280,9 @@ MIT Licenses
The Apache TinkerPop project bundles the following components under the MIT License:
- Mockito (org.mockito:mockito-all - http://www.mockito.org)
JCL 1.1.1 implemented over SLF4J (org.slf4j:jcl-over-slf4j - http://www.slf4j.org)
SLF4J API Module (org.slf4j:slf4j-api - http://www.slf4j.org)
SLF4J LOG4J-12 Binding (org.slf4j:slf4j-log4j12 - http://www.slf4j.org)
- gmetric4j (info.ganglia.gmetric4j:gmetric4j - http://github.com/ganglia/gmetric4j)
All rights reserved.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5a381391/gremlin-console/src/main/NOTICE
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/NOTICE b/gremlin-console/src/main/NOTICE
index c9a45e7..9900dd7 100644
--- a/gremlin-console/src/main/NOTICE
+++ b/gremlin-console/src/main/NOTICE
@@ -67,15 +67,6 @@ This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
------------------------------------------------------------------------
-Commons IO
-------------------------------------------------------------------------
-Apache Commons IO
-Copyright 2002-2014 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-------------------------------------------------------------------------
Commons Lang
------------------------------------------------------------------------
Apache Commons Lang
@@ -97,6 +88,17 @@ This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
------------------------------------------------------------------------
+Groovy
+------------------------------------------------------------------------
+Groovy Language
+Copyright 2003-2015 The respective authors and developers
+Developers and Contributors are listed in the project POM file
+and Gradle build file
+
+This product includes software developed by
+The Groovy community (http://groovy.codehaus.org/).
+
+------------------------------------------------------------------------
Http Components Client
------------------------------------------------------------------------
Apache HttpComponents Client
@@ -118,17 +120,6 @@ This project contains annotations derived from JCIP-ANNOTATIONS
Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
------------------------------------------------------------------------
-Groovy
-------------------------------------------------------------------------
-Groovy Language
-Copyright 2003-2015 The respective authors and developers
-Developers and Contributors are listed in the project POM file
-and Gradle build file
-
-This product includes software developed by
-The Groovy community (http://groovy.codehaus.org/).
-
-------------------------------------------------------------------------
Java Tuples
------------------------------------------------------------------------
Copyright (c) 2010, The JAVATUPLES team (http://www.javatuples.org)
@@ -146,12 +137,6 @@ See the License for the specific language governing permissions and
limitations under the License.
------------------------------------------------------------------------
-Hamcrest
-------------------------------------------------------------------------
-Copyright (c) 2000-2015 www.hamcrest.org
-All rights reserved.
-
-------------------------------------------------------------------------
Log4j
------------------------------------------------------------------------
This product includes software developed by
@@ -195,23 +180,17 @@ Copyright (c) 2002-2012, the original author or authors.
All rights reserved.
------------------------------------------------------------------------
-Mockito
-------------------------------------------------------------------------
-Copyright (c) 2007 Mockito contributors
-
-------------------------------------------------------------------------
-gmetric4j
-------------------------------------------------------------------------
-Copyright (C) 2010-2015 Daniel Pocock <da...@pocock.com.au>
-Copyright (c) 2008-2011 Jasper Humphrey <ja...@gmail.com>
-
-------------------------------------------------------------------------
SLF4j
------------------------------------------------------------------------
Copyright (c) 2004-2007 QOS.ch
All rights reserved.
------------------------------------------------------------------------
+jBCrypt
+------------------------------------------------------------------------
+Copyright (c) 2006 Damien Miller <dj...@mindrot.org>
+
+------------------------------------------------------------------------
Xerces
------------------------------------------------------------------------
Apache Xerces Java
@@ -435,8 +414,4 @@ Netty/All-in-One (io.netty:netty-all - http://netty.io/netty-all/)
* LICENSE:
* license/LICENSE.aalto-xml.txt (Apache License 2.0)
* HOMEPAGE:
- * http://wiki.fasterxml.com/AaltoHome
-
-
-
-
+ * http://wiki.fasterxml.com/AaltoHome
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5a381391/gremlin-server/src/main/LICENSE
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/LICENSE b/gremlin-server/src/main/LICENSE
index 1d41e61..e4e5bca 100644
--- a/gremlin-server/src/main/LICENSE
+++ b/gremlin-server/src/main/LICENSE
@@ -207,28 +207,22 @@ Apache 2.0 Licenses
The Apache TinkerPop project bundles the following components under the Apache 2.0 License:
- HPPC Collections (com.carrotsearch:hppc - http://labs.carrotsearch.com/hppc.html/hppc)
- JUnitBenchmarks (com.carrotsearch:junit-benchmarks - http://labs.carrotsearch.com/junit-benchmarks.html)
- Metrics Core (com.codahale.metrics:metrics-core - http://metrics.codahale.com/metrics-core/)
- Ganglia Integration for Metrics (com.codahale.metrics:metrics-ganglia - http://metrics.codahale.com/metrics-ganglia/)
- Graphite Integration for Metrics (com.codahale.metrics:metrics-graphite - http://metrics.codahale.com/metrics-graphite/)
- Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations - http://wiki.fasterxml.com/JacksonHome)
- Jackson-core (com.fasterxml.jackson.core:jackson-core - http://wiki.fasterxml.com/JacksonHome)
- jackson-databind (com.fasterxml.jackson.core:jackson-databind - http://wiki.fasterxml.com/JacksonHome)
- Commons Codec (commons-codec:commons-codec - http://commons.apache.org/codec/)
Commons Collections (commons-collections:commons-collections - http://commons.apache.org/collections/)
Apache Commons Configuration (commons-configuration:commons-configuration - http://commons.apache.org/configuration/)
- Commons IO (commons-io:commons-io - http://commons.apache.org/io/)
Commons Lang (commons-lang:commons-lang - http://commons.apache.org/lang/)
- Commons Logging (commons-logging:commons-logging - http://commons.apache.org/logging)
- Netty/All-in-One (io.netty:netty-all - http://netty.io/netty-all/)
- Apache Log4j (log4j:log4j - http://logging.apache.org/log4j/1.2/)
Apache Commons Lang (org.apache.commons:commons-lang3 - http://commons.apache.org/proper/commons-lang/)
- HttpClient (org.apache.httpcomponents:httpclient - http://hc.apache.org/httpcomponents-client)
- HttpCore (org.apache.httpcomponents:httpcore - http://hc.apache.org/httpcomponents-core-ga)
- Apache Ivy (org.apache.ivy:ivy - http://ant.apache.org/ivy/)
Groovy (org.codehaus.groovy:groovy-all - http://groovy.codehaus.org/)
+ HPPC Collections (com.carrotsearch:hppc - http://labs.carrotsearch.com/hppc.html/hppc)
+ Apache Ivy (org.apache.ivy:ivy - http://ant.apache.org/ivy/)
+ Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations - http://wiki.fasterxml.com/JacksonHome)
+ Jackson-core (com.fasterxml.jackson.core:jackson-core - http://wiki.fasterxml.com/JacksonHome)
+ jackson-databind (com.fasterxml.jackson.core:jackson-databind - http://wiki.fasterxml.com/JacksonHome)
javatuples (org.javatuples:javatuples - http://www.javatuples.org)
+ Apache Log4j (log4j:log4j - http://logging.apache.org/log4j/1.2/)
+ Metrics Core (com.codahale.metrics:metrics-core - http://metrics.codahale.com/metrics-core/)
+ Ganglia Integration for Metrics (com.codahale.metrics:metrics-ganglia - http://metrics.codahale.com/metrics-ganglia/)
+ Graphite Integration for Metrics (com.codahale.metrics:metrics-graphite - http://metrics.codahale.com/metrics-graphite/)
+ Netty/All-in-One (io.netty:netty-all - http://netty.io/netty-all/)
SnakeYAML (org.yaml:snakeyaml - http://www.snakeyaml.org)
========================================================================
@@ -237,12 +231,10 @@ BSD-style Licenses
The Apache TinkerPop project bundles the following components under the BSD License:
- Hamcrest All (org.hamcrest:hamcrest-all - https://github.com/hamcrest/JavaHamcrest/hamcrest-all)
- Hamcrest Core (org.hamcrest:hamcrest-core - https://github.com/hamcrest/JavaHamcrest/hamcrest-core)
+ jBCrypt (org.mindrot:jbcrypt - https://github.com/jeremyh/jBCrypt)
jcabi-log (com.jcabi:jcabi-log - http://www.jcabi.com/jcabi-log)
jcabi-manifests (com.jcabi:jcabi-manifests - http://www.jcabi.com/jcabi-manifests)
JLine (jline:jline - http://nexus.sonatype.org/oss-repository-hosting.html/jline)
- jBCrypt (org.mindrot:jbcrypt - https://github.com/jeremyh/jBCrypt)
All rights reserved.
@@ -277,11 +269,10 @@ MIT Licenses
The Apache TinkerPop project bundles the following components under the MIT License:
- Mockito (org.mockito:mockito-all - http://www.mockito.org)
+ gmetric4j (info.ganglia.gmetric4j:gmetric4j - http://github.com/ganglia/gmetric4j)
JCL 1.1.1 implemented over SLF4J (org.slf4j:jcl-over-slf4j - http://www.slf4j.org)
SLF4J API Module (org.slf4j:slf4j-api - http://www.slf4j.org)
SLF4J LOG4J-12 Binding (org.slf4j:slf4j-log4j12 - http://www.slf4j.org)
- gmetric4j (info.ganglia.gmetric4j:gmetric4j - http://github.com/ganglia/gmetric4j)
All rights reserved.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/5a381391/gremlin-server/src/main/NOTICE
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/NOTICE b/gremlin-server/src/main/NOTICE
index cb533dd..4ad5e46 100644
--- a/gremlin-server/src/main/NOTICE
+++ b/gremlin-server/src/main/NOTICE
@@ -19,36 +19,6 @@ their respective licenses.
========================================================================
------------------------------------------------------------------------
-commons-beanutils
-------------------------------------------------------------------------
-Apache Commons BeanUtils
-Copyright 2000-2014 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-------------------------------------------------------------------------
-commons-codec
-------------------------------------------------------------------------
-Apache Commons Codec
-Copyright 2002-2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java
-contains test data from http://aspell.net/test/orig/batch0.tab.
-Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org)
-
-===============================================================================
-
-The content of package org.apache.commons.codec.language.bm has been translated
-from the original php source code available at http://stevemorse.org/phoneticinfo.htm
-with permission from the original authors.
-Original source copyright:
-Copyright (c) 2008 Alexander Beider & Stephen P. Morse.
-
-------------------------------------------------------------------------
Commons Collections
------------------------------------------------------------------------
Apache Commons Collections
@@ -67,15 +37,6 @@ This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
------------------------------------------------------------------------
-Commons IO
-------------------------------------------------------------------------
-Apache Commons IO
-Copyright 2002-2014 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-------------------------------------------------------------------------
Commons Lang
------------------------------------------------------------------------
Apache Commons Lang
@@ -97,27 +58,6 @@ This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
------------------------------------------------------------------------
-Http Components Client
-------------------------------------------------------------------------
-Apache HttpComponents Client
-Copyright 1999-2015 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-------------------------------------------------------------------------
-Http Components Core
-------------------------------------------------------------------------
-Apache HttpComponents Core
-Copyright 2005-2014 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-This project contains annotations derived from JCIP-ANNOTATIONS
-Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
-
-------------------------------------------------------------------------
Groovy
------------------------------------------------------------------------
Groovy Language
@@ -146,12 +86,6 @@ See the License for the specific language governing permissions and
limitations under the License.
------------------------------------------------------------------------
-Hamcrest
-------------------------------------------------------------------------
-Copyright (c) 2000-2015 www.hamcrest.org
-All rights reserved.
-
-------------------------------------------------------------------------
Log4j
------------------------------------------------------------------------
This product includes software developed by
@@ -163,6 +97,25 @@ Programmer's Guide and Specification" and freely available
to the public at http://java.sun.com/docs/books/jni.
------------------------------------------------------------------------
+Metrics
+------------------------------------------------------------------------
+Copyright 2010-2013 Coda Hale and Yammer, Inc., 2014-2015 Dropwizard Team
+
+This product includes software developed by Coda Hale and Yammer, Inc.
+
+This product includes code derived from the JSR-166 project (ThreadLocalRandom, Striped64,
+LongAdder), which was released with the following comments:
+
+ Written by Doug Lea with assistance from members of JCP JSR-166
+ Expert Group and released to the public domain, as explained at
+ http://creativecommons.org/publicdomain/zero/1.0/
+
+------------------------------------------------------------------------
+jBCrypt
+------------------------------------------------------------------------
+Copyright (c) 2006 Damien Miller <dj...@mindrot.org>
+
+------------------------------------------------------------------------
jcabi-log
------------------------------------------------------------------------
Copyright (c) 2012-2014, jcabi.com
@@ -181,11 +134,6 @@ Copyright (c) 2002-2012, the original author or authors.
All rights reserved.
------------------------------------------------------------------------
-Mockito
-------------------------------------------------------------------------
-Copyright (c) 2007 Mockito contributors
-
-------------------------------------------------------------------------
gmetric4j
------------------------------------------------------------------------
Copyright (C) 2010-2015 Daniel Pocock <da...@pocock.com.au>
[37/50] incubator-tinkerpop git commit: bumped to 3.0.2-SNAPSHOT.
Posted by sp...@apache.org.
bumped to 3.0.2-SNAPSHOT.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/51eb8069
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/51eb8069
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/51eb8069
Branch: refs/heads/TINKERPOP3-333
Commit: 51eb806930e569ac7aa74805434929a639819eed
Parents: 7642fcb
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Sep 3 11:02:19 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Sep 3 11:02:19 2015 -0600
----------------------------------------------------------------------
gremlin-console/pom.xml | 2 +-
gremlin-core/pom.xml | 2 +-
gremlin-driver/pom.xml | 2 +-
gremlin-groovy-test/pom.xml | 2 +-
gremlin-groovy/pom.xml | 2 +-
gremlin-server/pom.xml | 2 +-
gremlin-shaded/pom.xml | 2 +-
gremlin-test/pom.xml | 2 +-
hadoop-gremlin/pom.xml | 2 +-
neo4j-gremlin/pom.xml | 2 +-
pom.xml | 2 +-
tinkergraph-gremlin/pom.xml | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index d7bca3d..5144e10 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<artifactId>tinkerpop</artifactId>
<groupId>org.apache.tinkerpop</groupId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>gremlin-console</artifactId>
<name>Apache TinkerPop :: Gremlin Console</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/gremlin-core/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index 7660f63..8cdb02b 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>gremlin-core</artifactId>
<name>Apache TinkerPop :: Gremlin Core</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/gremlin-driver/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index b7c5744..31f5621 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>gremlin-driver</artifactId>
<name>Apache TinkerPop :: Gremlin Driver</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/gremlin-groovy-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/pom.xml b/gremlin-groovy-test/pom.xml
index 1ec7af8..ba08fab 100644
--- a/gremlin-groovy-test/pom.xml
+++ b/gremlin-groovy-test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>gremlin-groovy-test</artifactId>
<name>Apache TinkerPop :: Gremlin Groovy Test</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/gremlin-groovy/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy/pom.xml b/gremlin-groovy/pom.xml
index 0b53252..8e4bf1a 100644
--- a/gremlin-groovy/pom.xml
+++ b/gremlin-groovy/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>gremlin-groovy</artifactId>
<name>Apache TinkerPop :: Gremlin Groovy</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/gremlin-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index 40ab863..f9c6fa0 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>gremlin-server</artifactId>
<name>Apache TinkerPop :: Gremlin Server</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/gremlin-shaded/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-shaded/pom.xml b/gremlin-shaded/pom.xml
index d6b8dc5..e25d506 100644
--- a/gremlin-shaded/pom.xml
+++ b/gremlin-shaded/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>gremlin-shaded</artifactId>
<name>Apache TinkerPop :: Gremlin Shaded</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/gremlin-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml
index a35bdb1..71aff05 100644
--- a/gremlin-test/pom.xml
+++ b/gremlin-test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>gremlin-test</artifactId>
<name>Apache TinkerPop :: Gremlin Test</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index e527f79..ee62f5d 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>hadoop-gremlin</artifactId>
<name>Apache TinkerPop :: Hadoop Gremlin</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/neo4j-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
index fd17cbe..3c1840a 100644
--- a/neo4j-gremlin/pom.xml
+++ b/neo4j-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>neo4j-gremlin</artifactId>
<name>Apache TinkerPop :: Neo4j Gremlin</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d82bc68..d21e815 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ limitations under the License.
</parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Apache TinkerPop</name>
<description>A Graph Computing Framework</description>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/51eb8069/tinkergraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml
index b4353d3..e0a002c 100644
--- a/tinkergraph-gremlin/pom.xml
+++ b/tinkergraph-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-incubating</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<artifactId>tinkergraph-gremlin</artifactId>
<name>Apache TinkerPop :: TinkerGraph Gremlin</name>
[39/50] incubator-tinkerpop git commit: removed bump.sh and updated
RELEASE asciidoc. @dalaro provided new model based mvn:version. Thanks.
Posted by sp...@apache.org.
removed bump.sh and updated RELEASE asciidoc. @dalaro provided new model based mvn:version. Thanks.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/847642e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/847642e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/847642e8
Branch: refs/heads/TINKERPOP3-333
Commit: 847642e8efc7aa404cbd3b4803979334322f799a
Parents: 51eb806
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Sep 3 11:17:00 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Sep 3 11:17:00 2015 -0600
----------------------------------------------------------------------
RELEASE.asciidoc | 6 +++---
bin/bump.sh | 47 -----------------------------------------------
2 files changed, 3 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/847642e8/RELEASE.asciidoc
----------------------------------------------------------------------
diff --git a/RELEASE.asciidoc b/RELEASE.asciidoc
index abd282e..af342b3 100644
--- a/RELEASE.asciidoc
+++ b/RELEASE.asciidoc
@@ -33,12 +33,12 @@ A release candidate is an unofficial release that is represented by a tagged ver
.. `mvn verify -DskipIntegrationTests=false -DincludeNeo4j`
.. `mvn verify -DskipPerformanceTests=false`
. `bin/publish-docs.sh <username>` - note that under a release candidate the documentation is published as SNAPSHOT
-. `bin/bump.sh "version"` to update the project files to reference a non-SNAPSHOT `rc` version (e.g. `x.y.z-incubating-rc1)
+. `mvn versions:set -DnewVersion=x.y.z -DgenerateBackupPoms=false` to update the project files to reference a non-SNAPSHOT version.
. `git diff` and review the updated files (expect all `pom.xml` files and this README)
. `git commit -a -m "TinkerPop x.y.z release"` and `git push`
. `git tag -a -m "TinkerPop x.y.z release" x.y.z` and `git push --tags`
. `mvn clean install -Dmaven.test.skip=true`
-. `bin/bump.sh "version"` to go back to SNAPSHOT
+. `mvn versions:set -DnewVersion=x.y.z-SNAPSHOT -DgenerateBackupPoms=false` to go back to SNAPSHOT
. `git commit -a -m "Returned to x.y.z-SNAPSHOT"` and `git push`
. Announce the release candidate to `dev` mailing list and await feedback
. Repeat as required or proceed to the next phase
@@ -58,7 +58,7 @@ A positive vote for a particular release from the TinkerPop PMC is required to m
.. Update the release date
.. Generate the JIRA release notes report for the current version and append them to the `CHANGELOG.asciidoc`
.. Organize "breaking" changes to be clearly marked (use JIRA and the "breaking" label to identify those)
-. `bin/bump.sh "version"` to update project files to reference the non-SNAPSHOT version
+. `mvn versions:set -DnewVersion=x.y.z -DgenerateBackupPoms=false` to update project files to reference the non-SNAPSHOT version
. `git diff` and review the updated files (expect all `pom.xml` files and this README)
. `git commit -a -m "TinkerPop x.y.z release"` and `git push`
. `git tag -a -m "TinkerPop x.y.z release" x.y.z` and `git push --tags`
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/847642e8/bin/bump.sh
----------------------------------------------------------------------
diff --git a/bin/bump.sh b/bin/bump.sh
deleted file mode 100755
index 2d9614c..0000000
--- a/bin/bump.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/bash
-#
-#
-# 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.
-#
-
-# This script bumps version in the various files that reference the current TinkerPop version files (e.g. pom.xml)
-# in preparation for release. Usage:
-#
-# bin/bump.sh "version"
-
-VERSION="$1"
-SCRIPT_PATH="$0"
-SCRIPT_DIR=`dirname "${SCRIPT_PATH}"`
-PROJECT_DIR="${SCRIPT_DIR}/.."
-
-# switch to project directory (allows us to call bump.sh from everywhere and still use relative paths within the script)
-pushd "$PROJECT_DIR" > /dev/null
-
-# update pom.xml
-for pom in $(find . -name pom.xml); do
- cat "$pom" | grep -n -A2 -B2 '<groupId>org.apache.tinkerpop</groupId>' \
- | grep -A2 -B2 '<artifactId>tinkerpop</artifactId>' \
- | grep '<version>' | cut -f1 -d '-' | xargs -n1 -I{} sed -i.bak "{}s@>.*<@>${VERSION}<@" "$pom" && rm -f "${pom}.bak"
-done
-
-# README
-INPUT="README.asciidoc"
-sed -i.bak 's/\(http:\/\/tinkerpop.com\/.*docs\/\)[A-Za-z0-9.-]*\/\(.*\)/\1'"${VERSION}"'\/\2/' "${INPUT}" && rm -f "${INPUT}.bak"
-
-# switch back to initial directory
-popd > /dev/null
\ No newline at end of file
[50/50] incubator-tinkerpop git commit: Delete some debugging code
from PartitionStrategy tests.
Posted by sp...@apache.org.
Delete some debugging code from PartitionStrategy tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/d86b2856
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/d86b2856
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/d86b2856
Branch: refs/heads/TINKERPOP3-333
Commit: d86b285603ff57422942cb8d248ca4d76b3d42fe
Parents: 781a466
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 8 15:13:21 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 8 15:13:21 2015 -0400
----------------------------------------------------------------------
.../strategy/decoration/PartitionStrategyProcessTest.java | 4 ----
1 file changed, 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d86b2856/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
index 3f4459d..e8300dd 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
@@ -60,10 +60,6 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
final PartitionStrategy partitionStrategy = PartitionStrategy.build()
.includeMetaProperties(true)
.partitionKey(partition).writePartition("A").addReadPartition("A").create();
- Traversal t = create(partitionStrategy).addV().property("any", "thing");
- System.out.println(t);
- t.asAdmin().applyStrategies();
- System.out.println(t);
final Vertex v = create(partitionStrategy).addV().property("any", "thing").next();
assertNotNull(v);
[09/50] incubator-tinkerpop git commit: merge tp30.
Posted by sp...@apache.org.
merge tp30.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/d730fe6e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/d730fe6e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/d730fe6e
Branch: refs/heads/TINKERPOP3-333
Commit: d730fe6ea59e38341233d1147c88469715de5dc9
Parents: 03be9f2 2ffde6c
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 14:47:47 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 14:47:47 2015 -0600
----------------------------------------------------------------------
CHANGELOG.asciidoc | 3 +-
.../gremlin/process/traversal/Compare.java | 47 +++++++++++--------
.../gremlin/process/traversal/CompareTest.java | 49 ++++++++++++++++----
3 files changed, 70 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d730fe6e/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --cc CHANGELOG.asciidoc
index 062a8c0,d20c2fc..33ad8a5
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@@ -17,38 -17,6 +17,39 @@@ limitations under the License
TinkerPop3 CHANGELOG
=====================
+
+TinkerPop 3.1.0 (A 187 On The Undercover Gremlinz)
+--------------------------------------------------
+
+image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/static/images/gremlin-gangster.png[width=185]
+
+TinkerPop 3.1.0 (NOT OFFICIALLY RELEASED YET)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+* Added `LambdaCollectingBarrierStep` which generalizes `NoOpBarrierStep` and allows for `barrier(normSack)`-type operations.
+* Fixed bugs in the Gremlin Server's NIO protocol both on the server and driver side.
+* Added `Path.popEquals(Pop,Object)` to check for path equality based on `Pop` (useful for `TraverserRequirement.LABELED_PATH`).
+* Added `Operator.assign` to allow setting a direct value.
+* `Operator` is now a `BinaryOperator<Object>` with appropriate typecasting for respective number operators.
+* Simplified `SackValueStep` so it now supports both `sack(function)` and sack(function).by()`. Deprecated `sack(function,string)`.
+* Added `Parameters` object to allow for the parameters of a step to be retrieved at runtime via a traversal.
+* Redesigned (though backwards compatible) `AddEdgeStep`, `AddVertexStep`, and `AddPropertyStep` (and respective `GraphTraversal` API).
+* Added `GraphTraversalSource.inject()` so users can spawn a traverser with non-graph objects.
+* `GraphStep` can now take a single argument `Collection` which is either elements or element ids (i.e. `g.V([1,2,3])` is supported now).
+* Added `LoopsStep` to make the loop counter accessible within `repeat()`, `until()` and `emit()`.
+* Gephi Plugin no longer requires manual insert of `store` steps to visualize a traversal.
+* Gephi Plugin visualizes `Path` objects.
+* Added a `TinkerIoRegistry` that registers a custom serializer for Gryo that will serialize an entire `TinkerGraph` instance.
+* Added configuration options to Gephi Plugin for setting the size of nodes visualized.
+* Replaced `DedupBijectionStrategy` with the more effective `FilterRankingStrategy`.
+* `ComputerAwareSteps` must not only handle step ids, but also step labels.
+* Renamed `B_O_P_SE_SL_Traverser` to `B_LP_O_P_SE_SL_Traverser` as it now supports `TraverserRequirement.LABELED_PATH`.
+* Added `B_LP_O_S_SE_SL_Traverser` in support of `TraverserRequirement.LABELED_PATH`.
+* Added `TraverserRequirement.LABELED_PATH` which only generates path data for steps that are labeled (greatly increases the likelihood of bulking).
+* Fixed a bug in `Path` usage that required an API update: `Path.addLabel()` is now `Path.extend(Set<String>)` and `Traverser.addLabels(Set<String>)`.
+* Made `Path` iterable, so that it can be `unfold()`'ed and used by local steps like `min(local)`, `max(local)`, etc.
++* `WhereTraversalStep` and `WherePredicateStep` are now the only "special" `Scoping` steps after `MatchStartStep` in `match()`.
+
TinkerPop 3.0.0 (A Gremlin Rāga in 7/16 Time)
---------------------------------------------
[31/50] incubator-tinkerpop git commit: OrderTest updated to not do
an iffy situation where there is no solid defined contract on the behavior of
in Map serialized vertices.
Posted by sp...@apache.org.
OrderTest updated to not do an iffy situation where there is no solid defined contract on the behavior of in Map serialized vertices.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/bce3e8bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/bce3e8bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/bce3e8bd
Branch: refs/heads/TINKERPOP3-333
Commit: bce3e8bd54cb7b7f27a2cfe11a4878d5bbcb473e
Parents: 04ba481
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Sep 2 15:49:40 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Sep 2 15:49:40 2015 -0600
----------------------------------------------------------------------
.../traversal/step/map/GroovyOrderTest.groovy | 4 ++--
.../process/traversal/step/map/OrderTest.java | 22 ++++++++++----------
2 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bce3e8bd/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
index 69e354d..50eef57 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy
@@ -83,8 +83,8 @@ public abstract class GroovyOrderTest {
}
@Override
- public Traversal<Vertex, Map<String, List<Vertex>>> get_g_V_group_byXlabelX_by_byXorderXlocalX_byXname_decrXX() {
- TraversalScriptHelper.compute("g.V.group.by(label).by.by(order(local).by('name', decr))", g)
+ public Traversal<Vertex, Map<String, List<Vertex>>> get_g_V_group_byXlabelX_byXnameX_byXorderXlocalX_byXdecrXX() {
+ TraversalScriptHelper.compute("g.V.group.by(label).by('name').by(order(local).by(decr))", g)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bce3e8bd/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
index cd893fc..1da9969 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
@@ -68,7 +68,7 @@ public abstract class OrderTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Vertex> get_g_V_order_byXoutE_count__decrX();
- public abstract Traversal<Vertex, Map<String, List<Vertex>>> get_g_V_group_byXlabelX_by_byXorderXlocalX_byXname_decrXX();
+ public abstract Traversal<Vertex, Map<String, List<Vertex>>> get_g_V_group_byXlabelX_byXnameX_byXorderXlocalX_byXdecrXX();
@Test
@LoadGraphWith(MODERN)
@@ -224,22 +224,22 @@ public abstract class OrderTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_V_group_byXlabelX_by_byXorderXlocalX_byXname_decrXX() {
- final Traversal<Vertex, Map<String, List<Vertex>>> traversal = get_g_V_group_byXlabelX_by_byXorderXlocalX_byXname_decrXX();
+ public void g_V_group_byXlabelX_byXnameX_byXorderXlocalX_byXdecrXX() {
+ final Traversal<Vertex, Map<String, List<Vertex>>> traversal = get_g_V_group_byXlabelX_byXnameX_byXorderXlocalX_byXdecrXX();
printTraversalForm(traversal);
final Map<String, List<Vertex>> map = traversal.next();
assertFalse(traversal.hasNext());
assertEquals(2, map.size());
List list = map.get("software");
assertEquals(2, list.size());
- assertEquals(convertToVertex(graph, "lop"), list.get(1));
- assertEquals(convertToVertex(graph, "ripple"), list.get(0));
+ assertEquals("lop", list.get(1));
+ assertEquals("ripple", list.get(0));
list = map.get("person");
assertEquals(4, list.size());
- assertEquals(convertToVertex(graph, "josh"), list.get(3));
- assertEquals(convertToVertex(graph, "marko"), list.get(2));
- assertEquals(convertToVertex(graph, "peter"), list.get(1));
- assertEquals(convertToVertex(graph, "vadas"), list.get(0));
+ assertEquals("josh", list.get(3));
+ assertEquals("marko", list.get(2));
+ assertEquals("peter", list.get(1));
+ assertEquals("vadas", list.get(0));
}
public static class Traversals extends OrderTest {
@@ -299,8 +299,8 @@ public abstract class OrderTest extends AbstractGremlinProcessTest {
}
@Override
- public Traversal<Vertex, Map<String, List<Vertex>>> get_g_V_group_byXlabelX_by_byXorderXlocalX_byXname_decrXX() {
- return g.V().<String, List<Vertex>>group().by(T.label).by().by(__.order(Scope.local).by("name", Order.decr));
+ public Traversal<Vertex, Map<String, List<Vertex>>> get_g_V_group_byXlabelX_byXnameX_byXorderXlocalX_byXdecrXX() {
+ return g.V().<String, List<Vertex>>group().by(T.label).by("name").by(__.order(Scope.local).by(Order.decr));
}
}
[28/50] incubator-tinkerpop git commit: TinkerPop 3.0.1-incubating
release
Posted by sp...@apache.org.
TinkerPop 3.0.1-incubating release
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/688ebc6b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/688ebc6b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/688ebc6b
Branch: refs/heads/TINKERPOP3-333
Commit: 688ebc6bdf179f549bcc030e7b907c2fb49944b0
Parents: 65d60f9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Sep 2 08:04:12 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Sep 2 08:04:12 2015 -0400
----------------------------------------------------------------------
gremlin-console/pom.xml | 2 +-
gremlin-core/pom.xml | 2 +-
gremlin-driver/pom.xml | 2 +-
gremlin-groovy-test/pom.xml | 2 +-
gremlin-groovy/pom.xml | 2 +-
gremlin-server/pom.xml | 2 +-
gremlin-shaded/pom.xml | 2 +-
gremlin-test/pom.xml | 2 +-
hadoop-gremlin/pom.xml | 2 +-
neo4j-gremlin/pom.xml | 2 +-
pom.xml | 2 +-
tinkergraph-gremlin/pom.xml | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index 5e3210a..d7bca3d 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<artifactId>tinkerpop</artifactId>
<groupId>org.apache.tinkerpop</groupId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>gremlin-console</artifactId>
<name>Apache TinkerPop :: Gremlin Console</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/gremlin-core/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index f60f15a..7660f63 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>gremlin-core</artifactId>
<name>Apache TinkerPop :: Gremlin Core</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/gremlin-driver/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-driver/pom.xml b/gremlin-driver/pom.xml
index c158ce5..b7c5744 100644
--- a/gremlin-driver/pom.xml
+++ b/gremlin-driver/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>gremlin-driver</artifactId>
<name>Apache TinkerPop :: Gremlin Driver</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/gremlin-groovy-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/pom.xml b/gremlin-groovy-test/pom.xml
index 7230e10..1ec7af8 100644
--- a/gremlin-groovy-test/pom.xml
+++ b/gremlin-groovy-test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>gremlin-groovy-test</artifactId>
<name>Apache TinkerPop :: Gremlin Groovy Test</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/gremlin-groovy/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-groovy/pom.xml b/gremlin-groovy/pom.xml
index 69b5e0c..0b53252 100644
--- a/gremlin-groovy/pom.xml
+++ b/gremlin-groovy/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>gremlin-groovy</artifactId>
<name>Apache TinkerPop :: Gremlin Groovy</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/gremlin-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index 9a9a110..40ab863 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>gremlin-server</artifactId>
<name>Apache TinkerPop :: Gremlin Server</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/gremlin-shaded/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-shaded/pom.xml b/gremlin-shaded/pom.xml
index 056f694..d6b8dc5 100644
--- a/gremlin-shaded/pom.xml
+++ b/gremlin-shaded/pom.xml
@@ -20,7 +20,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>gremlin-shaded</artifactId>
<name>Apache TinkerPop :: Gremlin Shaded</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/gremlin-test/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-test/pom.xml b/gremlin-test/pom.xml
index 1a412a1..a35bdb1 100644
--- a/gremlin-test/pom.xml
+++ b/gremlin-test/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>gremlin-test</artifactId>
<name>Apache TinkerPop :: Gremlin Test</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/hadoop-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/pom.xml b/hadoop-gremlin/pom.xml
index f0651d9..e527f79 100644
--- a/hadoop-gremlin/pom.xml
+++ b/hadoop-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>hadoop-gremlin</artifactId>
<name>Apache TinkerPop :: Hadoop Gremlin</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/neo4j-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml
index c6349b4..fd17cbe 100644
--- a/neo4j-gremlin/pom.xml
+++ b/neo4j-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>neo4j-gremlin</artifactId>
<name>Apache TinkerPop :: Neo4j Gremlin</name>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a9b34e5..d82bc68 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ limitations under the License.
</parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
<packaging>pom</packaging>
<name>Apache TinkerPop</name>
<description>A Graph Computing Framework</description>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/688ebc6b/tinkergraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml
index 4f271bc..b4353d3 100644
--- a/tinkergraph-gremlin/pom.xml
+++ b/tinkergraph-gremlin/pom.xml
@@ -21,7 +21,7 @@ limitations under the License.
<parent>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkerpop</artifactId>
- <version>3.0.1-SNAPSHOT</version>
+ <version>3.0.1-incubating</version>
</parent>
<artifactId>tinkergraph-gremlin</artifactId>
<name>Apache TinkerPop :: TinkerGraph Gremlin</name>
[30/50] incubator-tinkerpop git commit: Removed blvp reference from
changelog.
Posted by sp...@apache.org.
Removed blvp reference from changelog.
It is not yet documented for public promotion.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/04ba481f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/04ba481f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/04ba481f
Branch: refs/heads/TINKERPOP3-333
Commit: 04ba481facf9234669092467b73c05eb9b4c0301
Parents: 688ebc6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Sep 2 10:41:49 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Sep 2 10:41:49 2015 -0400
----------------------------------------------------------------------
CHANGELOG.asciidoc | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/04ba481f/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index c051d87..87360e3 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,7 +25,6 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.0.1 (Release Date: September 2, 2015)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* Added `BulkLoaderVertexProgram` and a default bulk loader implementation: `IncrementalBulkLoader`
* `Compare` now uses `BigDecimal` internally to ensure that precision is not lost on standard number comparisons.
* Renamed `ComputerVerificationStrategy` to `VerificationStrategy` so all the verification strategies can use it.
* Added `StandardVerificationStrategy` that throws exceptions for illegal traversal patterns on the standard engine (which extends to `GraphComputer`).
@@ -67,7 +66,6 @@ Bugs
Improvements
^^^^^^^^^^^^
-* [TINKERPOP3-319] - BulkLoaderVertexProgram for generalized batch loading across graphs
* [TINKERPOP3-576] - Gremlin Server Authentication
* [TINKERPOP3-582] - Remove Groovy Sandbox Dependency
* [TINKERPOP3-610] - General graph concept names in test schema
[20/50] incubator-tinkerpop git commit: Merge branch 'master' into
new_merge
Posted by sp...@apache.org.
Merge branch 'master' into new_merge
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/b3d7098d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/b3d7098d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/b3d7098d
Branch: refs/heads/TINKERPOP3-333
Commit: b3d7098d8c367efcf4aebff42badc1bf3e4d93c9
Parents: c6883f9 be8522b
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Sep 1 13:40:31 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Sep 1 13:40:31 2015 -0600
----------------------------------------------------------------------
.../process/traversal/step/map/AddEdgeStep.java | 6 +-
.../step/sideEffect/AddPropertyStep.java | 6 +-
.../process/traversal/step/util/Parameters.java | 67 ++++++++++++------
.../PartitionStrategyTraverseTest.java | 8 +--
.../step/map/GroovyAddVertexTest.groovy | 10 +++
.../traversal/step/map/AddVertexTest.java | 71 +++++++++++++++++++-
6 files changed, 137 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
[22/50] incubator-tinkerpop git commit: added a note for @dkuppitz
about this weird hashCode() failure.
Posted by sp...@apache.org.
added a note for @dkuppitz about this weird hashCode() failure.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/f48ad191
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/f48ad191
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/f48ad191
Branch: refs/heads/TINKERPOP3-333
Commit: f48ad191fe4ce5f85902f5fd30825e230a625313
Parents: 60239ff
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Sep 1 14:40:24 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Sep 1 14:40:24 2015 -0600
----------------------------------------------------------------------
.../process/traversal/step/sideEffect/AddPropertyStepTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f48ad191/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java
index dde2fe6..4ecf311 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AddPropertyStepTest.java
@@ -35,7 +35,7 @@ public class AddPropertyStepTest extends StepTest {
return Arrays.asList(
__.property("x", 0),
__.property("x", 1)
- //__.property("y", 0) // TODO: when this is 0 is breaks?!
+ //__.property("y", 0) // TODO: when this is 0 is breaks?! I think this is because of ^ and y being 1 away from x and 0 being one away from x.
);
}
}
[03/50] incubator-tinkerpop git commit: TINKERPOP3-750: Fix bug in
Compare for BigInteger/BigDecimal by converting Number to BigDecimal
Posted by sp...@apache.org.
TINKERPOP3-750: Fix bug in Compare for BigInteger/BigDecimal by converting Number to BigDecimal
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/378dd6cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/378dd6cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/378dd6cb
Branch: refs/heads/TINKERPOP3-333
Commit: 378dd6cb920c9ac82ce53cc599882bf0704a3ab6
Parents: e191717
Author: mhfrantz <mf...@redsealnetworks.com>
Authored: Mon Aug 31 13:25:40 2015 -0700
Committer: mhfrantz <mf...@redsealnetworks.com>
Committed: Mon Aug 31 13:26:06 2015 -0700
----------------------------------------------------------------------
.../gremlin/process/traversal/Compare.java | 47 ++++++++++++--------
1 file changed, 28 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/378dd6cb/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
index aad8371..262347f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
@@ -18,6 +18,7 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal;
+import java.math.BigDecimal;
import java.util.function.BiPredicate;
/**
@@ -26,12 +27,13 @@ import java.util.function.BiPredicate;
*
* @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Stephen Mallette (http://stephen.genoprime.com)
+ * @author Matt Frantz (http://github.com/mhfrantz)
*/
public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is equal to the second. If both are of type {@link Number} but not of the
- * same class (i.e. double for the first object and long for the second object) both values are cast to
- * {@link Number} so that it can be evaluated via {@link Number#doubleValue()}. Otherwise they are evaluated
+ * same class (i.e. double for the first object and long for the second object) both values are converted to
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
* via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
@@ -40,7 +42,7 @@ public enum Compare implements BiPredicate<Object, Object> {
public boolean test(final Object first, final Object second) {
return null == first ? null == second : (first instanceof Number && second instanceof Number
&& !first.getClass().equals(second.getClass())
- ? ((Number) first).doubleValue() == ((Number) second).doubleValue()
+ ? big((Number) first).compareTo(big((Number) second)) == 0
: first.equals(second));
}
@@ -55,8 +57,8 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is not equal to the second. If both are of type {@link Number} but not of the
- * same class (i.e. double for the first object and long for the second object) both values are cast to
- * {@link Number} so that it can be evaluated via {@link Number#doubleValue()}. Otherwise they are evaluated
+ * same class (i.e. double for the first object and long for the second object) both values are converted to
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#equals()}. Otherwise they are evaluated
* via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
@@ -77,9 +79,9 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is greater than the second. If both are of type {@link Number} but not of the
- * same class (i.e. double for the first object and long for the second object) both values are cast to
- * {@link Number} so that it can be evaluated via {@link Number#doubleValue()}. Otherwise they are evaluated
- * via {@link Comparable#compareTo(Object)}. Testing against {@link Number#doubleValue()} enables the compare
+ * same class (i.e. double for the first object and long for the second object) both values are converted to
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
+ * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo()} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
gt {
@@ -87,7 +89,7 @@ public enum Compare implements BiPredicate<Object, Object> {
public boolean test(final Object first, final Object second) {
return null != first && null != second && (
first instanceof Number && second instanceof Number && !first.getClass().equals(second.getClass())
- ? ((Number) first).doubleValue() > ((Number) second).doubleValue()
+ ? big((Number) first).compareTo(big((Number) second)) > 0
: ((Comparable) first).compareTo(second) > 0);
}
@@ -102,9 +104,9 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is greater-equal to the second. If both are of type {@link Number} but not of the
- * same class (i.e. double for the first object and long for the second object) both values are cast to
- * {@link Number} so that it can be evaluated via {@link Number#doubleValue()}. Otherwise they are evaluated
- * via {@link Comparable#compareTo(Object)}. Testing against {@link Number#doubleValue()} enables the compare
+ * same class (i.e. double for the first object and long for the second object) both values are converted to
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
+ * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo()} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
gte {
@@ -124,9 +126,9 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is less than the second. If both are of type {@link Number} but not of the
- * same class (i.e. double for the first object and long for the second object) both values are cast to
- * {@link Number} so that it can be evaluated via {@link Number#doubleValue()}. Otherwise they are evaluated
- * via {@link Comparable#compareTo(Object)}. Testing against {@link Number#doubleValue()} enables the compare
+ * same class (i.e. double for the first object and long for the second object) both values are converted to
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
+ * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo()} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
lt {
@@ -134,7 +136,7 @@ public enum Compare implements BiPredicate<Object, Object> {
public boolean test(final Object first, final Object second) {
return null != first && null != second && (
first instanceof Number && second instanceof Number && !first.getClass().equals(second.getClass())
- ? ((Number) first).doubleValue() < ((Number) second).doubleValue()
+ ? big((Number) first).compareTo(big((Number) second)) < 0
: ((Comparable) first).compareTo(second) < 0);
}
@@ -149,9 +151,9 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is less-equal to the second. If both are of type {@link Number} but not of the
- * same class (i.e. double for the first object and long for the second object) both values are cast to
- * {@link Number} so that it can be evaluated via {@link Number#doubleValue()}. Otherwise they are evaluated
- * via {@link Comparable#compareTo(Object)}. Testing against {@link Number#doubleValue()} enables the compare
+ * same class (i.e. double for the first object and long for the second object) both values are converted to
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
+ * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo()} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
lte {
@@ -174,4 +176,11 @@ public enum Compare implements BiPredicate<Object, Object> {
*/
@Override
public abstract Compare negate();
+
+ /**
+ * Convert Number to BigDecimal.
+ */
+ private static BigDecimal big(final Number n) {
+ return new BigDecimal(n.toString());
+ }
}
[12/50] incubator-tinkerpop git commit: fix for RepeatTest. Sorry,
I got my branches all mixed up. This is basically me fixing things.
Posted by sp...@apache.org.
fix for RepeatTest. Sorry, I got my branches all mixed up. This is basically me fixing things.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/2253c67f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/2253c67f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/2253c67f
Branch: refs/heads/TINKERPOP3-333
Commit: 2253c67fc8a900b4835128f4baec429a3f48d1c9
Parents: 12de515
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 15:08:18 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 15:08:18 2015 -0600
----------------------------------------------------------------------
.../gremlin/process/traversal/step/branch/RepeatTest.java | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2253c67f/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
index 3d07ffd..f5ecbf8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
@@ -234,6 +234,14 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
assertTrue(counter > 0);
}
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name() {
+ final Traversal<Vertex, String> traversal = get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(convertToVertexId("marko"));
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList("lop", "lop", "ripple", "vadas"), traversal);
+ }
+
public static class Traversals extends RepeatTest {
@Override
[35/50] incubator-tinkerpop git commit: GraphComputer will convert
any Vertex or Edge ids to their id Object prior to submission to
GraphComputer (OLAP). @dkuppitz -- this is the 'backmerge' thing.
Posted by sp...@apache.org.
GraphComputer will convert any Vertex or Edge ids to their id Object prior to submission to GraphComputer (OLAP). @dkuppitz -- this is the 'backmerge' thing.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/7642fcb5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/7642fcb5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/7642fcb5
Branch: refs/heads/TINKERPOP3-333
Commit: 7642fcb537d995ece887d0d0376cc1a993b1477a
Parents: 5a38139
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Sep 3 11:00:44 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Sep 3 11:00:44 2015 -0600
----------------------------------------------------------------------
CHANGELOG.asciidoc | 5 +++++
.../gremlin/process/traversal/step/sideEffect/GraphStep.java | 4 ++++
.../strategy/verification/ComputerVerificationStrategy.java | 5 -----
3 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7642fcb5/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 87360e3..3669d6c 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -22,6 +22,11 @@ TinkerPop 3.0.0 (A Gremlin Rāga in 7/16 Time)
image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/static/images/gremlin-hindu.png[width=225]
+TinkerPop 3.0.2 (NOT OFFICIALLY RELEASED YET)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+* `GraphStep` will convert any `Vertex` or `Edge` ids to their id `Object` prior to submission to `GraphComputer` (OLAP).
+
TinkerPop 3.0.1 (Release Date: September 2, 2015)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7642fcb5/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GraphStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GraphStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GraphStep.java
index 1cfdbee..1006286 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GraphStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GraphStep.java
@@ -85,6 +85,10 @@ public class GraphStep<S extends Element> extends StartStep<S> implements Engine
public void onEngine(final TraversalEngine traversalEngine) {
if (traversalEngine.isComputer()) {
this.iteratorSupplier = Collections::emptyIterator;
+ for(int i=0; i<this.ids.length; i++) { // if this is going to OLAP, convert to ids so you don't serialize elements
+ if(this.ids[i] instanceof Element)
+ this.ids[i] = ((Element)this.ids[i]).id();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/7642fcb5/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
index 8923372..259531a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/ComputerVerificationStrategy.java
@@ -81,11 +81,6 @@ public final class ComputerVerificationStrategy extends AbstractTraversalStrateg
if (traversal.getParent() instanceof EmptyStep) {
if (!(traversal.getStartStep() instanceof GraphStep))
throw new VerificationException("GraphComputer does not support traversals starting from a non-GraphStep: " + traversal.getStartStep(), traversal);
- for (final Object id : ((GraphStep) traversal.getStartStep()).getIds()) {
- if (id instanceof Vertex || id instanceof Edge) {
- throw new VerificationException("GraphComputer does not support traversals starting from a particular vertex or edge.", traversal);
- }
- }
///
if (endStep instanceof CollectingBarrierStep && endStep instanceof TraversalParent) {
if (((TraversalParent) endStep).getLocalChildren().stream().filter(t ->
[40/50] incubator-tinkerpop git commit: Merge branch 'tp30'
Posted by sp...@apache.org.
Merge branch 'tp30'
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/0977a257
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/0977a257
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/0977a257
Branch: refs/heads/TINKERPOP3-333
Commit: 0977a257cde5994120c5c53082c53ff66337b69b
Parents: a20860b 847642e
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Sep 3 11:17:08 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Sep 3 11:17:08 2015 -0600
----------------------------------------------------------------------
RELEASE.asciidoc | 6 +++---
bin/bump.sh | 47 -----------------------------------------------
2 files changed, 3 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
[41/50] incubator-tinkerpop git commit: fixed the extra-whitespace
problem in the AsciiDoc preprocessor that occured with too small terminal
window dimensions
Posted by sp...@apache.org.
fixed the extra-whitespace problem in the AsciiDoc preprocessor that occured with too small terminal window dimensions
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/93bc0a82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/93bc0a82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/93bc0a82
Branch: refs/heads/TINKERPOP3-333
Commit: 93bc0a8208d1dd716bcba56f25284a1cad130b25
Parents: 847642e
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Thu Sep 3 19:45:47 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Thu Sep 3 19:45:47 2015 +0200
----------------------------------------------------------------------
docs/preprocessor/preprocess.sh | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/93bc0a82/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index dbd3ef0..7d78efb 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -107,6 +107,11 @@ else
fi
# process *.asciidoc files
+COLS=${COLUMNS}
+[[ ${COLUMNS} -lt 240 ]] && stty cols 240
+
+tput rmam
+
echo
echo "============================"
echo "+ Processing AsciiDocs +"
@@ -123,6 +128,9 @@ for i in {0..7}; do
[ ${ec} -eq 0 ] || break
done
+tput smam
+stty cols ${COLS}
+
if [ ${ec} -ne 0 ]; then
exit 1
else
[08/50] incubator-tinkerpop git commit: CHANGELOG update and JavaDoc
fixes for @mhfrantz Compare BigDecimal fix.
Posted by sp...@apache.org.
CHANGELOG update and JavaDoc fixes for @mhfrantz Compare BigDecimal fix.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/2ffde6c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/2ffde6c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/2ffde6c4
Branch: refs/heads/TINKERPOP3-333
Commit: 2ffde6c4c5ffc743d155ee3ba132988e5cfe964d
Parents: 0a11ae1
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 14:46:03 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 14:46:03 2015 -0600
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../gremlin/process/traversal/Compare.java | 20 ++++++++++----------
2 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2ffde6c4/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 4ee6bd6..d20c2fc 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::http://www.tinkerpop.com/docs/current/images/gremlin-hindu.png[width=225]
TinkerPop 3.0.1 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* `Compare` now uses `BigDecimal` internally to ensure that precision is not lost on standard number comparisons.
* Renamed `ComputerVerificationStrategy` to `VerificationStrategy` so all the verification strategies can use it.
* Added `StandardVerificationStrategy` that throws exceptions for illegal traversal patterns on the standard engine (which extends to `GraphComputer`).
* Clarified semantics of `Transaction.close()` in unit tests - now refers only to closing the current transaction in the current thread.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/2ffde6c4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
index 262347f..97b52b8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Compare.java
@@ -33,7 +33,7 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is equal to the second. If both are of type {@link Number} but not of the
* same class (i.e. double for the first object and long for the second object) both values are converted to
- * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated
* via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
@@ -58,7 +58,7 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is not equal to the second. If both are of type {@link Number} but not of the
* same class (i.e. double for the first object and long for the second object) both values are converted to
- * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#equals()}. Otherwise they are evaluated
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#equals}. Otherwise they are evaluated
* via {@link Object#equals(Object)}. Testing against {@link Number#doubleValue()} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
@@ -80,8 +80,8 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is greater than the second. If both are of type {@link Number} but not of the
* same class (i.e. double for the first object and long for the second object) both values are converted to
- * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
- * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo()} enables the compare
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated
+ * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
gt {
@@ -105,8 +105,8 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is greater-equal to the second. If both are of type {@link Number} but not of the
* same class (i.e. double for the first object and long for the second object) both values are converted to
- * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
- * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo()} enables the compare
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated
+ * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
gte {
@@ -127,8 +127,8 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is less than the second. If both are of type {@link Number} but not of the
* same class (i.e. double for the first object and long for the second object) both values are converted to
- * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
- * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo()} enables the compare
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated
+ * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
lt {
@@ -152,8 +152,8 @@ public enum Compare implements BiPredicate<Object, Object> {
/**
* Evaluates if the first object is less-equal to the second. If both are of type {@link Number} but not of the
* same class (i.e. double for the first object and long for the second object) both values are converted to
- * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo()}. Otherwise they are evaluated
- * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo()} enables the compare
+ * {@link BigDecimal} so that it can be evaluated via {@link BigDecimal#compareTo}. Otherwise they are evaluated
+ * via {@link Comparable#compareTo(Object)}. Testing against {@link BigDecimal#compareTo} enables the compare
* operations to be a bit more forgiving with respect to comparing different number types.
*/
lte {
[24/50] incubator-tinkerpop git commit: there is a meta-property test
case in AddVertexTest that needed to have FeatureRequirement be
meta-property. Neo4j without meta properties failed cause of it.
Posted by sp...@apache.org.
there is a meta-property test case in AddVertexTest that needed to have FeatureRequirement be meta-property. Neo4j without meta properties failed cause of it.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/97fbdfa7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/97fbdfa7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/97fbdfa7
Branch: refs/heads/TINKERPOP3-333
Commit: 97fbdfa7208f001b8eec6b0e0dfc2aef232cba85
Parents: f48ad19
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Sep 1 14:58:31 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Sep 1 14:58:31 2015 -0600
----------------------------------------------------------------------
.../tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/97fbdfa7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
index 131305a..c6ede24 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexTest.java
@@ -115,6 +115,7 @@ public abstract class AddVertexTest extends AbstractGremlinTest {
@LoadGraphWith(MODERN)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
@FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_PROPERTY)
+ @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
public void g_V_hasXname_markoX_addVXmetaPersonX_propertyXname_nameX_propertyXfriendWeight_outEXknowsX_weight_sum__acl_privateX() {
final Traversal<Vertex, Vertex> traversal = get_g_V_hasXname_markoX_propertyXfriendWeight_outEXknowsX_weight_sum__acl_privateX();
printTraversalForm(traversal);
[42/50] incubator-tinkerpop git commit: clean up in aisle 88 for Pair
on GryoMapper.
Posted by sp...@apache.org.
clean up in aisle 88 for Pair on GryoMapper.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/bddc44bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/bddc44bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/bddc44bc
Branch: refs/heads/TINKERPOP3-333
Commit: bddc44bcbdcbb4ef257193be510b35c0cbb0baca
Parents: 0977a25
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Sep 3 13:45:11 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Sep 3 13:45:11 2015 -0600
----------------------------------------------------------------------
.../apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/bddc44bc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
index 70bf659..619d657 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
@@ -236,7 +236,7 @@ public final class GryoMapper implements Mapper<Kryo> {
add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(O_Traverser.class, null, 76));
add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(B_LP_O_P_S_SE_SL_Traverser.class, null, 77));
add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(B_O_S_SE_SL_Traverser.class, null, 78));
- add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(B_LP_O_S_SE_SL_Traverser.class, null, 87)); // ***LAST ID**
+ add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(B_LP_O_S_SE_SL_Traverser.class, null, 87));
add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(TraverserSet.class, null, 58));
add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Tree.class, null, 61));
@@ -248,7 +248,7 @@ public final class GryoMapper implements Mapper<Kryo> {
add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(MapReduce.NullObject.class, null, 74));
add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(AtomicLong.class, null, 79));
add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(DependantMutableMetrics.class, null, 80));
- add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Pair.class, kryo -> new PairSerializer(), 87)); // ***LAST ID**
+ add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Pair.class, kryo -> new PairSerializer(), 88)); // ***LAST ID**
}};
private List<IoRegistry> registries = new ArrayList<>();
[21/50] incubator-tinkerpop git commit: Added Sack merge binary
operator. This is a breaking change as a method signature has changed. Note
that this breaking change is for language vendors,
NOT for users. TINKERPOP-796 #close.
Posted by sp...@apache.org.
Added Sack merge binary operator. This is a breaking change as a method signature has changed. Note that this breaking change is for language vendors, NOT for users. TINKERPOP-796 #close.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/60239ff0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/60239ff0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/60239ff0
Branch: refs/heads/TINKERPOP3-333
Commit: 60239ff052f9628677cd63facba51b61da7502af
Parents: b3d7098
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Sep 1 14:32:45 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Sep 1 14:32:45 2015 -0600
----------------------------------------------------------------------
.../traversal/VertexTraversalSideEffects.java | 9 ++--
.../process/traversal/SackFunctions.java | 23 ++------
.../gremlin/process/traversal/Traversal.java | 2 +-
.../process/traversal/TraversalSideEffects.java | 21 ++++----
.../dsl/graph/GraphTraversalSource.java | 36 ++++++-------
.../step/util/CollectingBarrierStep.java | 2 +-
.../step/util/LambdaCollectingBarrierStep.java | 6 +++
.../traverser/B_O_S_SE_SL_Traverser.java | 10 ++--
.../util/DefaultTraversalSideEffects.java | 15 +++---
.../util/EmptyTraversalSideEffects.java | 11 ++--
.../step/sideEffect/GroovySackTest.groovy | 6 +++
.../gremlin/groovy/loaders/StepLoader.groovy | 16 +++---
.../AbstractImportCustomizerProvider.java | 1 -
.../gremlin/groovy/function/GBiFunction.java | 55 --------------------
.../groovy/function/GBinaryOperator.java | 55 ++++++++++++++++++++
.../traversal/step/sideEffect/SackTest.java | 17 ++++++
.../tinkergraph/structure/TinkerGraphTest.java | 4 +-
17 files changed, 147 insertions(+), 142 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java
index 278dd10..d9889f1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/VertexTraversalSideEffects.java
@@ -19,7 +19,6 @@
package org.apache.tinkerpop.gremlin.process.computer.traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -27,7 +26,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
-import java.util.function.BiFunction;
+import java.util.function.BinaryOperator;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -60,12 +59,12 @@ public final class VertexTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <T, S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> mergeFunction) {
+ public <S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BinaryOperator<S> mergeOperator) {
throw EXCEPTION;
}
@Override
- public <S> Optional<Supplier<S>> getSackInitialValue() {
+ public <S> Supplier<S> getSackInitialValue() {
throw EXCEPTION;
}
@@ -75,7 +74,7 @@ public final class VertexTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <T, S> BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> getSackMerger() {
+ public <S> BinaryOperator<S> getSackMerger() {
throw EXCEPTION;
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java
index ac51212..78195cf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/SackFunctions.java
@@ -21,7 +21,6 @@ package org.apache.tinkerpop.gremlin.process.traversal;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
-import java.util.function.BiFunction;
import java.util.function.Consumer;
/**
@@ -33,32 +32,16 @@ public final class SackFunctions {
}
- public enum Merge implements BiFunction<Traverser.Admin<Object>, Traverser.Admin<Object>, Object> {
- weightedSum {
- @Override
- public Object apply(final Traverser.Admin<Object> a, final Traverser.Admin<Object> b) {
- final Object value = (a.bulk() * ((Number) a.sack()).doubleValue()) + (b.bulk() * ((Number) b.sack()).doubleValue());
- a.setBulk(1l);
- return value;
- }
- };
- }
-
public enum Barrier implements Consumer<TraverserSet<Object>> {
- noOp {
- @Override
- public void accept(final TraverserSet<Object> traverserSet) {
-
- }
- }, normSack {
+ normSack {
@Override
public void accept(final TraverserSet<Object> traverserSet) {
double total = 0.0d;
for (final Traverser.Admin<Object> traverser : traverserSet) {
- total = total + ((double) traverser.sack() * (double) traverser.bulk());
+ total = total + (((Number) traverser.sack()).doubleValue() * ((Number) traverser.bulk()).doubleValue());
}
for (final Traverser.Admin<Object> traverser : traverserSet) {
- traverser.sack(((double) traverser.sack() * (double) traverser.bulk()) / total);
+ traverser.sack((((Number) traverser.sack()).doubleValue() * ((Number) traverser.bulk()).doubleValue()) / total);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
index 735c537..5ee731a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
@@ -357,7 +357,7 @@ public interface Traversal<S, E> extends Iterator<E>, Serializable, Cloneable {
.collect(Collectors.toSet());
if (this.getSideEffects().keys().size() > 0)
requirements.add(TraverserRequirement.SIDE_EFFECTS);
- if (this.getSideEffects().getSackInitialValue().isPresent())
+ if (null != this.getSideEffects().getSackInitialValue())
requirements.add(TraverserRequirement.SACK);
if (this.getEngine().isComputer())
requirements.add(TraverserRequirement.BULK);
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java
index 8a11616..4619e23 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSideEffects.java
@@ -25,6 +25,7 @@ import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
+import java.util.function.BinaryOperator;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -107,27 +108,28 @@ public interface TraversalSideEffects extends Cloneable, Serializable {
}
/**
- * Set the initial value of each {@link Traverser} "sack" along with the methods for splitting and merging sacks.
+ * Set the initial value of each {@link Traverser} "sack" along with the operators for splitting and merging sacks.
* If no split operator is provided, then a direct memory copy is assumed (this is typically good for primitive types and strings).
- * If no merge function is provided, then traversers with sacks can not be merged.
+ * If no merge operator is provided, then traversers with sacks will not be merged.
*
* @param initialValue the initial value supplier of the traverser sack
* @param splitOperator the split operator for splitting traverser sacks
- * @param <T> the traverser object type
+ * @param mergeOperator the merge operator for merging traverser sacks
* @param <S> the sack type
*/
- public <T, S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> mergeFunction);
+ public <S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BinaryOperator<S> mergeOperator);
/**
* If sacks are enabled, get the initial value of the {@link Traverser} sack.
+ * If its not enabled, then <code>null</code> is returned.
*
* @param <S> the sack type
* @return the supplier of the initial value of the traverser sack
*/
- public <S> Optional<Supplier<S>> getSackInitialValue();
+ public <S> Supplier<S> getSackInitialValue();
/**
- * If sacks are enabled and a split operator has been specified, then get it (else null).
+ * If sacks are enabled and a split operator has been specified, then get it (else get <code>null</code>).
* The split operator is used to split a sack when a bifurcation in a {@link Traverser} happens.
*
* @param <S> the sack type
@@ -136,14 +138,13 @@ public interface TraversalSideEffects extends Cloneable, Serializable {
public <S> UnaryOperator<S> getSackSplitter();
/**
- * If sacks are enabled and a merge function has been specified, then get it (else null).
- * The merge function is used to merge a sack when two {@link Traverser}s converge.
+ * If sacks are enabled and a merge function has been specified, then get it (else get <code>null</code>).
+ * The merge function is used to merge two sacks when two {@link Traverser}s converge.
*
- * @param <T> the traverser object type
* @param <S> the sack type
* @return the operator for merging two traverser sacks
*/
- public <T, S> BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> getSackMerger();
+ public <S> BinaryOperator<S> getSackMerger();
/**
* If the sideEffect contains an object associated with the key, return it.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index 651ffbc..fe06948 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -23,7 +23,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep;
@@ -31,7 +30,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.PathIdentityStep;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Transaction;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
@@ -41,7 +39,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
-import java.util.function.BiFunction;
+import java.util.function.BinaryOperator;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -160,23 +158,23 @@ public class GraphTraversalSource implements TraversalSource {
return this.withSack(initialValue, splitOperator, null);
}
- public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
- return this.withSack(initialValue, null, mergeFunction);
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final BinaryOperator<A> mergeOperator) {
+ return this.withSack(initialValue, null, mergeOperator);
}
- public <A> GraphTraversalSourceStub withSack(final A initialValue, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
- return this.withSack(initialValue, null, mergeFunction);
+ public <A> GraphTraversalSourceStub withSack(final A initialValue, final BinaryOperator<A> mergeOperator) {
+ return this.withSack(initialValue, null, mergeOperator);
}
- public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
final GraphTraversal.Admin traversal = this.generateTraversal();
- traversal.getSideEffects().setSack(initialValue, splitOperator, mergeFunction);
+ traversal.getSideEffects().setSack(initialValue, splitOperator, mergeOperator);
return new GraphTraversalSourceStub(traversal, false);
}
- public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
+ public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
final GraphTraversal.Admin traversal = this.generateTraversal();
- traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, mergeFunction);
+ traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, mergeOperator);
return new GraphTraversalSourceStub(traversal, false);
}
@@ -333,23 +331,23 @@ public class GraphTraversalSource implements TraversalSource {
return this;
}
- public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
- this.traversal.getSideEffects().setSack(initialValue, null, mergeFunction);
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final BinaryOperator<A> mergeOperator) {
+ this.traversal.getSideEffects().setSack(initialValue, null, mergeOperator);
return this;
}
- public <A> GraphTraversalSourceStub withSack(final A initialValue, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
- this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), null, mergeFunction);
+ public <A> GraphTraversalSourceStub withSack(final A initialValue, final BinaryOperator<A> mergeOperator) {
+ this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), null, mergeOperator);
return this;
}
- public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
- this.traversal.getSideEffects().setSack(initialValue, splitOperator, mergeFunction);
+ public <A> GraphTraversalSourceStub withSack(final Supplier<A> initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
+ this.traversal.getSideEffects().setSack(initialValue, splitOperator, mergeOperator);
return this;
}
- public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, A> mergeFunction) {
- this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, mergeFunction);
+ public <A> GraphTraversalSourceStub withSack(final A initialValue, final UnaryOperator<A> splitOperator, final BinaryOperator<A> mergeOperator) {
+ this.traversal.getSideEffects().setSack(new ConstantSupplier<>(initialValue), splitOperator, mergeOperator);
return this;
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
index 6af4dbe..e73c655 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/CollectingBarrierStep.java
@@ -78,7 +78,7 @@ public abstract class CollectingBarrierStep<S> extends AbstractStep<S, S> {
@Override
public String toString() {
- return StringFactory.stepString(this, this.maxBarrierSize);
+ return StringFactory.stepString(this, this.maxBarrierSize == Integer.MAX_VALUE ? null : this.maxBarrierSize);
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
index a3c7bef..ec21d8c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
@@ -22,6 +22,7 @@ package org.apache.tinkerpop.gremlin.process.traversal.step.util;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
+import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import java.util.function.Consumer;
@@ -50,4 +51,9 @@ public final class LambdaCollectingBarrierStep<S> extends CollectingBarrierStep<
public void barrierConsumer(final TraverserSet<S> traverserSet) {
this.barrierConsumer.accept(traverserSet);
}
+
+ @Override
+ public String toString() {
+ return StringFactory.stepString(this, this.barrierConsumer.toString());
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
index 327bad3..b69db85 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/B_O_S_SE_SL_Traverser.java
@@ -23,8 +23,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import java.util.function.BiFunction;
-
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
@@ -40,7 +38,8 @@ public class B_O_S_SE_SL_Traverser<T> extends B_O_Traverser<T> {
public B_O_S_SE_SL_Traverser(final T t, final Step<T, ?> step, final long initialBulk) {
super(t, initialBulk);
this.sideEffects = step.getTraversal().getSideEffects();
- this.sideEffects.getSackInitialValue().ifPresent(supplier -> this.sack = supplier.get());
+ if (null != this.sideEffects.getSackInitialValue())
+ this.sack = this.sideEffects.getSackInitialValue().get();
}
/////////////////
@@ -104,8 +103,9 @@ public class B_O_S_SE_SL_Traverser<T> extends B_O_Traverser<T> {
@Override
public void merge(final Traverser.Admin<?> other) {
super.merge(other);
- if (this.sack != null && this.sideEffects.getSackMerger() != null)
- this.sack = ((BiFunction)this.sideEffects.getSackMerger()).apply(this,other);
+ if (null != this.sack && null != this.sideEffects.getSackMerger())
+ this.sack = this.sideEffects.getSackMerger().apply(this.sack, other.sack());
+
}
/////////////////
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
index 42bb04f..f1cccbd 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalSideEffects.java
@@ -19,7 +19,6 @@
package org.apache.tinkerpop.gremlin.process.traversal.util;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
@@ -31,7 +30,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
-import java.util.function.BiFunction;
+import java.util.function.BinaryOperator;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -43,7 +42,7 @@ public class DefaultTraversalSideEffects implements TraversalSideEffects {
protected Map<String, Object> objectMap = new HashMap<>();
protected Map<String, Supplier> supplierMap = new HashMap<>();
protected UnaryOperator sackSplitOperator = null;
- protected BiFunction sackMergeOperator = null;
+ protected BinaryOperator sackMergeOperator = null;
protected Supplier sackInitialValue = null;
public DefaultTraversalSideEffects() {
@@ -78,15 +77,15 @@ public class DefaultTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <T,S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> mergeFunction) {
+ public <S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BinaryOperator<S> mergeOperator) {
this.sackInitialValue = initialValue;
this.sackSplitOperator = splitOperator;
- this.sackMergeOperator = mergeFunction;
+ this.sackMergeOperator = mergeOperator;
}
@Override
- public <S> Optional<Supplier<S>> getSackInitialValue() {
- return Optional.ofNullable(this.sackInitialValue);
+ public <S> Supplier<S> getSackInitialValue() {
+ return this.sackInitialValue;
}
@Override
@@ -95,7 +94,7 @@ public class DefaultTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <T,S> BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> getSackMerger() {
+ public <S> BinaryOperator<S> getSackMerger() {
return this.sackMergeOperator;
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java
index b1aea21..584ccbf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalSideEffects.java
@@ -19,13 +19,12 @@
package org.apache.tinkerpop.gremlin.process.traversal.util;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import java.util.Collections;
import java.util.Optional;
import java.util.Set;
-import java.util.function.BiFunction;
+import java.util.function.BinaryOperator;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -71,13 +70,13 @@ public final class EmptyTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <T, S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> mergeFunction) {
+ public <S> void setSack(final Supplier<S> initialValue, final UnaryOperator<S> splitOperator, final BinaryOperator<S> mergeOperator) {
}
@Override
- public <S> Optional<Supplier<S>> getSackInitialValue() {
- return Optional.empty();
+ public <S> Supplier<S> getSackInitialValue() {
+ return null;
}
@Override
@@ -86,7 +85,7 @@ public final class EmptyTraversalSideEffects implements TraversalSideEffects {
}
@Override
- public <T, S> BiFunction<Traverser.Admin<T>, Traverser.Admin<T>, S> getSackMerger() {
+ public <S> BinaryOperator<S> getSackMerger() {
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
index 5739513..bf705e7 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovySackTest.groovy
@@ -58,5 +58,11 @@ public abstract class GroovySackTest {
public Traversal<Vertex, Map> get_g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack() {
TraversalScriptHelper.compute("g.withSack{[:]}{ it.clone() }.V.out().out().sack { m, v -> m['a'] = v.name; m }.sack()", g);
}
+
+ @Override
+ public Traversal<Vertex, Double> get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack(
+ final Object v1Id) {
+ TraversalScriptHelper.compute("g.withSack(1.0d,sum).V(${v1Id}).local(out('knows').barrier(normSack)).in('knows').barrier.sack", g, "v1Id", v1Id)
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy
index 8243e64..d5de45f 100644
--- a/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy
+++ b/gremlin-groovy/src/main/groovy/org/apache/tinkerpop/gremlin/groovy/loaders/StepLoader.groovy
@@ -42,13 +42,13 @@ class StepLoader {
return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure));
}
- GraphTraversalSource.metaClass.withSack = { final Closure closure, final Closure splitOrMerge ->
- return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure), splitOrMerge.getMaximumNumberOfParameters() == 1 ? new GUnaryOperator(splitOrMerge) : new GBiFunction(splitOrMerge));
+ GraphTraversalSource.metaClass.withSack = { final Closure closure, final Closure splitOrMergeOperator ->
+ return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure), splitOrMergeOperator.getMaximumNumberOfParameters() == 1 ? new GUnaryOperator(splitOrMergeOperator) : new GBinaryOperator(splitOrMergeOperator));
}
GraphTraversalSource.metaClass.withSack = {
- final Closure closure, final Closure splitOperator, final Closure mergeFunction ->
- return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure), new GUnaryOperator(splitOperator), new GBiFunction(mergeFunction));
+ final Closure closure, final Closure splitOperator, final Closure mergeOperator ->
+ return ((GraphTraversalSource) delegate).withSack(new GSupplier(closure), new GUnaryOperator(splitOperator), new GBinaryOperator(mergeOperator));
}
///////////////////
@@ -63,13 +63,13 @@ class StepLoader {
}
GraphTraversalSource.GraphTraversalSourceStub.metaClass.withSack = {
- final Closure closure, final Closure splitOrMerge ->
- return ((GraphTraversalSource.GraphTraversalSourceStub) delegate).withSack(new GSupplier(closure), splitOrMerge.getMaximumNumberOfParameters() == 1 ? new GUnaryOperator(splitOrMerge) : new GBiFunction(splitOrMerge));
+ final Closure closure, final Closure splitOrMergeOperator ->
+ return ((GraphTraversalSource.GraphTraversalSourceStub) delegate).withSack(new GSupplier(closure), splitOrMergeOperator.getMaximumNumberOfParameters() == 1 ? new GUnaryOperator(splitOrMergeOperator) : new GBinaryOperator(splitOrMergeOperator));
}
GraphTraversalSource.GraphTraversalSourceStub.metaClass.withSack = {
- final Closure closure, final Closure splitOperator, Closure mergeFunction ->
- return ((GraphTraversalSource.GraphTraversalSourceStub) delegate).withSack(new GSupplier(closure), new GUnaryOperator(splitOperator), new GBiFunction(mergeFunction));
+ final Closure closure, final Closure splitOperator, Closure mergeOperator ->
+ return ((GraphTraversalSource.GraphTraversalSourceStub) delegate).withSack(new GSupplier(closure), new GUnaryOperator(splitOperator), new GBinaryOperator(mergeOperator));
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
index 594a3a9..27bffff 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
@@ -105,7 +105,6 @@ public abstract class AbstractImportCustomizerProvider implements ImportCustomiz
staticImports.add(Scope.class.getCanonicalName() + DOT_STAR);
staticImports.add(Pop.class.getCanonicalName() + DOT_STAR);
staticImports.add(__.class.getCanonicalName() + DOT_STAR);
- staticImports.add(SackFunctions.Merge.class.getCanonicalName() + DOT_STAR);
staticImports.add(SackFunctions.Barrier.class.getCanonicalName() + DOT_STAR);
staticImports.add(TraversalOptionParent.Pick.class.getCanonicalName() + DOT_STAR);
staticImports.add(GraphTraversalSource.class.getCanonicalName() + DOT_STAR);
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBiFunction.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBiFunction.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBiFunction.java
deleted file mode 100644
index 939dffd..0000000
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBiFunction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.function;
-
-import groovy.lang.Closure;
-import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder;
-
-import java.util.function.BiFunction;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class GBiFunction<A, B, C> implements BiFunction<A, B, C>, LambdaHolder {
-
- private final Closure closure;
-
- public GBiFunction(final Closure closure) {
- this.closure = closure;
- }
-
- public static GBiFunction[] make(final Closure... closures) {
- final GBiFunction[] functions = new GBiFunction[closures.length];
- for (int i = 0; i < closures.length; i++) {
- functions[i] = new GBiFunction(closures[i]);
- }
- return functions;
- }
-
- @Override
- public String toString() {
- return "lambda";
- }
-
- @Override
- public C apply(final A a, final B b) {
- return (C) closure.call(a, b);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBinaryOperator.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBinaryOperator.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBinaryOperator.java
new file mode 100644
index 0000000..02f8d7a
--- /dev/null
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/function/GBinaryOperator.java
@@ -0,0 +1,55 @@
+/*
+ * 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.function;
+
+import groovy.lang.Closure;
+import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder;
+
+import java.util.function.BinaryOperator;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class GBinaryOperator<A> implements BinaryOperator<A>, LambdaHolder {
+
+ private final Closure closure;
+
+ public GBinaryOperator(final Closure closure) {
+ this.closure = closure;
+ }
+
+ public static GBinaryOperator[] make(final Closure... closures) {
+ final GBinaryOperator[] functions = new GBinaryOperator[closures.length];
+ for (int i = 0; i < closures.length; i++) {
+ functions[i] = new GBinaryOperator(closures[i]);
+ }
+ return functions;
+ }
+
+ @Override
+ public String toString() {
+ return "lambda";
+ }
+
+ @Override
+ public A apply(final A a, final A b) {
+ return (A) closure.call(a, b);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackTest.java
index 0db1b35..a886c3f 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SackTest.java
@@ -22,7 +22,9 @@ import org.apache.tinkerpop.gremlin.LoadGraphWith;
import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
import org.apache.tinkerpop.gremlin.process.traversal.Operator;
+import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
@@ -56,6 +58,8 @@ public abstract class SackTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Map> get_g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack();
+ public abstract Traversal<Vertex, Double> get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack(final Object v1Id);
+
@Test
@LoadGraphWith(MODERN)
public void g_V_withSackX0X_outE_sackXsum_weightX_inV_sack_sum() {
@@ -103,6 +107,14 @@ public abstract class SackTest extends AbstractGremlinProcessTest {
assertEquals(2, counter);
}
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack() {
+ final Traversal<Vertex, Double> traversal = get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack(convertToVertexId("marko"));
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList(1.0d, 1.0d), traversal);
+ }
+
public static class Traversals extends SackTest {
@Override
@@ -137,5 +149,10 @@ public abstract class SackTest extends AbstractGremlinProcessTest {
return map;
}).sack();
}
+
+ @Override
+ public Traversal<Vertex, Double> get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack(final Object v1Id) {
+ return g.withSack(1.0d, Operator.sum).V(v1Id).local(__.out("knows").barrier(SackFunctions.Barrier.normSack)).in("knows").barrier().sack();
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/60239ff0/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index 1a75b83..3e3b2dc 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -24,7 +24,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.LambdaCollectingBarrierStep;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
@@ -41,7 +40,6 @@ import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
-import java.util.function.BiFunction;
import java.util.function.Supplier;
import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
@@ -166,7 +164,7 @@ public class TinkerGraphTest {
public void testPlay7() throws Exception {
final Graph graph = TinkerFactory.createModern();
final GraphTraversalSource g = graph.traversal();
- g.withSack(1.0,(BiFunction)SackFunctions.Merge.weightedSum).V(1).local(outE("knows").barrier(SackFunctions.Barrier.normSack)).inV().in("knows").barrier().sack().forEachRemaining(System.out::println);
+ g.withSack(1.0, Operator.sum).V(1).local(outE("knows").barrier(SackFunctions.Barrier.normSack)).inV().in("knows").barrier().sack().forEachRemaining(System.out::println);
}
@Test
[48/50] incubator-tinkerpop git commit: Merge remote-tracking branch
'origin/tp30'
Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/tp30'
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/e6430068
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/e6430068
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/e6430068
Branch: refs/heads/TINKERPOP3-333
Commit: e6430068f9a54eb331badc4f8e0a616eb9dac48a
Parents: bddc44b 187ea93
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Sep 8 13:25:48 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Sep 8 13:25:48 2015 -0400
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
docs/preprocessor/preprocess.sh | 8 ++++
.../gremlin/driver/AuthProperties.java | 34 +++++++++++++--
.../tinkerpop/gremlin/driver/Cluster.java | 46 ++++++++++++++++++++
.../tinkerpop/gremlin/driver/Handler.java | 2 +-
.../step/branch/GroovyRepeatTest.groovy | 2 +-
.../step/sideEffect/GroovyStoreTest.groovy | 2 +-
.../server/GremlinDriverIntegrateTest.java | 11 +++--
8 files changed, 96 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6430068/CHANGELOG.asciidoc
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6430068/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Cluster.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6430068/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
----------------------------------------------------------------------
diff --cc gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
index c459740,8bdf020..691732f
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
@@@ -76,13 -76,8 +76,13 @@@ public abstract class GroovyRepeatTest
}
@Override
+ public Traversal<Vertex, Map<String, Vertex>> get_g_V_repeatXbothX_timesX10X_asXaX_out_asXbX_selectXa_bX() {
+ TraversalScriptHelper.compute("g.V.repeat(both()).times(10).as('a').out().as('b').select('a', 'b')", g);
+ }
+
+ @Override
public Traversal<Vertex, String> get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(final Object v1Id) {
- TraversalScriptHelper.compute("g.V(${v1Id}).repeat(out()).until(__.outE.count.is(0)).name", g, "v1Id", v1Id)
+ TraversalScriptHelper.compute("g.V(v1Id).repeat(out()).until(__.outE.count.is(0)).name", g, "v1Id", v1Id)
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/e6430068/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
[34/50] incubator-tinkerpop git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop
Posted by sp...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-tinkerpop
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/016694dd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/016694dd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/016694dd
Branch: refs/heads/TINKERPOP3-333
Commit: 016694dde00b93648f166b1526fb2e03dea9efe7
Parents: 9fd5129 bb78a64
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Sep 3 11:21:57 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Sep 3 11:21:57 2015 -0400
----------------------------------------------------------------------
.../traversal/VertexTraversalSideEffects.java | 12 +++-
.../process/traversal/SackFunctions.java | 49 +++++++++++++
.../gremlin/process/traversal/Traversal.java | 2 +-
.../process/traversal/TraversalSideEffects.java | 28 ++++++--
.../dsl/graph/GraphTraversalSource.java | 64 +++++++++++++----
.../process/traversal/step/map/AddEdgeStep.java | 6 +-
.../step/sideEffect/AddPropertyStep.java | 9 +--
.../step/util/CollectingBarrierStep.java | 2 +-
.../step/util/LambdaCollectingBarrierStep.java | 19 ++----
.../process/traversal/step/util/Parameters.java | 67 ++++++++++++------
.../traverser/B_LP_O_P_S_SE_SL_Traverser.java | 4 +-
.../traverser/B_LP_O_S_SE_SL_Traverser.java | 6 +-
.../traverser/B_O_S_SE_SL_Traverser.java | 21 ++++--
.../util/DefaultTraversalSideEffects.java | 20 ++++--
.../util/EmptyTraversalSideEffects.java | 20 ++++--
.../step/sideEffect/AddPropertyStepTest.java | 4 +-
.../PartitionStrategyTraverseTest.java | 8 +--
.../step/map/GroovyAddVertexTest.groovy | 10 +++
.../step/sideEffect/GroovySackTest.groovy | 6 ++
.../gremlin/groovy/loaders/StepLoader.groovy | 23 ++++---
.../AbstractImportCustomizerProvider.java | 4 +-
.../groovy/function/GBinaryOperator.java | 55 +++++++++++++++
.../traversal/step/map/AddVertexTest.java | 72 +++++++++++++++++++-
.../traversal/step/sideEffect/SackTest.java | 17 +++++
.../tinkergraph/structure/TinkerGraphTest.java | 4 +-
25 files changed, 420 insertions(+), 112 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/016694dd/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
----------------------------------------------------------------------
[04/50] incubator-tinkerpop git commit: added
LambdaCollectingBarrierStep which generalizes NoOpBarrierStep. Users can pass
a Consumer. NoOpBarrierStep is simply do nothing -- noOp.
However, we now have normSack which is for normalizing sac
Posted by sp...@apache.org.
added LambdaCollectingBarrierStep which generalizes NoOpBarrierStep. Users can pass a Consumer<TraverserSet>. NoOpBarrierStep is simply do nothing -- noOp. However, we now have normSack which is for normalizing sack values to ensure furcating energy is supported in Gremlin. Fixed a severe bug I introduced recently around reducing barrier steps and repeat().
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/969045ed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/969045ed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/969045ed
Branch: refs/heads/TINKERPOP3-333
Commit: 969045ed31953046fd84407b70ef4e5e43f734b2
Parents: 9e3a257
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Aug 31 14:29:44 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Aug 31 14:29:44 2015 -0600
----------------------------------------------------------------------
CHANGELOG.asciidoc | 1 +
.../GephiTraversalVisualizationStrategy.groovy | 6 --
.../traversal/TraversalVertexProgram.java | 1 -
.../traversal/dsl/graph/GraphTraversal.java | 12 +++-
.../gremlin/process/traversal/dsl/graph/__.java | 5 ++
.../step/util/LambdaCollectingBarrierStep.java | 66 ++++++++++++++++++++
.../traversal/step/util/NoOpBarrierStep.java | 41 ------------
.../finalization/LazyBarrierStrategy.java | 7 ++-
.../StandardVerificationStrategy.java | 2 +-
.../traversal/step/map/MatchStepTest.java | 4 +-
.../StandardVerificationStrategyTest.java | 8 +--
.../step/branch/GroovyRepeatTest.groovy | 5 ++
.../AbstractImportCustomizerProvider.java | 4 +-
.../traversal/step/branch/RepeatTest.java | 16 +++++
.../tinkergraph/structure/TinkerGraphTest.java | 33 +++-------
15 files changed, 123 insertions(+), 88 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 04f54f2..062a8c0 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/incubator-tinkerpop/master/docs/
TinkerPop 3.1.0 (NOT OFFICIALLY RELEASED YET)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Added `LambdaCollectingBarrierStep` which generalizes `NoOpBarrierStep` and allows for `barrier(normSack)`-type operations.
* Fixed bugs in the Gremlin Server's NIO protocol both on the server and driver side.
* Added `Path.popEquals(Pop,Object)` to check for path equality based on `Pop` (useful for `TraverserRequirement.LABELED_PATH`).
* Added `Operator.assign` to allow setting a direct value.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy
index 661d2ff..c099502 100644
--- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy
+++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/plugin/GephiTraversalVisualizationStrategy.groovy
@@ -23,20 +23,14 @@ 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.Traverser
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__
-import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterStep
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep
import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeOtherVertexStep
import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.FoldStep
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.TraversalMapStep
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.UnfoldStep
import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.LambdaSideEffectStep
import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.NoOpBarrierStep
import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy
import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
index 31a5e96..07075f6 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/TraversalVertexProgram.java
@@ -61,7 +61,6 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Optional;
import java.util.Set;
-import java.util.function.Function;
import java.util.function.Supplier;
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/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 e612e0d..70f61a3 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
@@ -126,9 +126,10 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeSideEf
import org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementFunctionComparator;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementValueComparator;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.NoOpBarrierStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.LambdaCollectingBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.TraversalComparator;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
@@ -1083,13 +1084,18 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> {
}
public default GraphTraversal<S, E> barrier() {
- return this.asAdmin().addStep(new NoOpBarrierStep<>(this.asAdmin()));
+ return this.barrier(Integer.MAX_VALUE);
}
public default GraphTraversal<S, E> barrier(final int maxBarrierSize) {
- return this.asAdmin().addStep(new NoOpBarrierStep<>(this.asAdmin(), maxBarrierSize));
+ return this.asAdmin().addStep(new LambdaCollectingBarrierStep<>(this.asAdmin(), (Consumer) LambdaCollectingBarrierStep.Consumers.noOp, maxBarrierSize));
}
+ public default GraphTraversal<S, E> barrier(final Consumer<TraverserSet<Object>> barrierConsumer) {
+ return this.asAdmin().addStep(new LambdaCollectingBarrierStep<>(this.asAdmin(), (Consumer) barrierConsumer, Integer.MAX_VALUE));
+ }
+
+
////
public default GraphTraversal<S, E> by(final Traversal<?, ?> byTraversal) {
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java
index 4fd55de..5702118 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Scope;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Property;
@@ -807,4 +808,8 @@ public class __ {
return __.<A>start().barrier(maxBarrierSize);
}
+ public static <A> GraphTraversal<A, A> barrier(final Consumer<TraverserSet<Object>> barrierConsumer) {
+ return __.<A>start().barrier(barrierConsumer);
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
new file mode 100644
index 0000000..a312dab
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/LambdaCollectingBarrierStep.java
@@ -0,0 +1,66 @@
+/*
+ * 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.process.traversal.step.util;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.LambdaHolder;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
+
+import java.util.function.Consumer;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class LambdaCollectingBarrierStep<S> extends CollectingBarrierStep<S> implements LambdaHolder {
+
+ public enum Consumers implements Consumer<TraverserSet<Object>> {
+ noOp {
+ @Override
+ public void accept(final TraverserSet<Object> traverserSet) {
+
+ }
+ }, normSack {
+ @Override
+ public void accept(final TraverserSet<Object> traverserSet) {
+ double total = 0.0d;
+ for (final Traverser.Admin<Object> traverser : traverserSet) {
+ total = total + ((double) traverser.sack() * (double) traverser.bulk());
+ }
+ for (final Traverser.Admin<Object> traverser : traverserSet) {
+ traverser.sack(((double) traverser.sack() * (double) traverser.bulk()) / total);
+ }
+ }
+ }
+ }
+
+
+ private final Consumer<TraverserSet<S>> barrierConsumer;
+
+ public LambdaCollectingBarrierStep(final Traversal.Admin traversal, final Consumer<TraverserSet<S>> barrierConsumer, final int maxBarrierSize) {
+ super(traversal, maxBarrierSize);
+ this.barrierConsumer = barrierConsumer;
+ }
+
+ @Override
+ public void barrierConsumer(final TraverserSet<S> traverserSet) {
+ this.barrierConsumer.accept(traverserSet);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/NoOpBarrierStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/NoOpBarrierStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/NoOpBarrierStep.java
deleted file mode 100644
index c5bec28..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/NoOpBarrierStep.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.process.traversal.step.util;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class NoOpBarrierStep<S> extends CollectingBarrierStep<S> {
-
- public NoOpBarrierStep(final Traversal.Admin traversal) {
- super(traversal);
- }
-
- public NoOpBarrierStep(final Traversal.Admin traversal, final int maxBarrierSize) {
- super(traversal, maxBarrierSize);
- }
-
- @Override
- public void barrierConsumer(final TraverserSet<S> traverserSet) {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/LazyBarrierStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/LazyBarrierStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/LazyBarrierStrategy.java
index 84f211f..6116bc8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/LazyBarrierStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/LazyBarrierStrategy.java
@@ -27,7 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GraphStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.CollectingBarrierStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.NoOpBarrierStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.LambdaCollectingBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.SupplyingBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
@@ -36,6 +36,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
import java.util.HashSet;
import java.util.Set;
+import java.util.function.Consumer;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -51,7 +52,7 @@ public final class LazyBarrierStrategy extends AbstractTraversalStrategy<Travers
protected static final int MAX_BARRIER_SIZE = 10000;
static {
- POSTS.add(ProfileStrategy.class);
+ POSTS.add(ProfileStrategy.class);
}
@@ -85,7 +86,7 @@ public final class LazyBarrierStrategy extends AbstractTraversalStrategy<Travers
!(step instanceof SupplyingBarrierStep) &&
!(step instanceof ReducingBarrierStep) &&
!(step instanceof VertexStep && ((VertexStep) step).returnsEdge())) {
- TraversalHelper.insertAfterStep(new NoOpBarrierStep<>(traversal, MAX_BARRIER_SIZE), step, traversal);
+ TraversalHelper.insertAfterStep(new LambdaCollectingBarrierStep<>(traversal, (Consumer) LambdaCollectingBarrierStep.Consumers.noOp, MAX_BARRIER_SIZE), step, traversal);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
index 5037da7..48cd7fd 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
@@ -37,7 +37,7 @@ public final class StandardVerificationStrategy extends AbstractTraversalStrateg
@Override
public void apply(final Traversal.Admin<?, ?> traversal) {
traversal.getSteps().forEach(step -> {
- if (step instanceof ReducingBarrierStep && step.getTraversal().getParent() instanceof RepeatStep)
+ if (step instanceof ReducingBarrierStep && step.getTraversal().getParent() instanceof RepeatStep && step.getTraversal().getParent().getGlobalChildren().get(0).getSteps().contains(step))
throw new VerificationException("The direct parent of a ReducingBarrierStep can not be a RepeatStep: " + step, traversal);
});
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
index 895b5e2..551be3a 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
@@ -26,7 +26,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.ConjunctionStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTraversalStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.NoOpBarrierStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.LambdaCollectingBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.EmptyTraverser;
import org.apache.tinkerpop.gremlin.structure.T;
import org.junit.Test;
@@ -121,7 +121,7 @@ public class MatchStepTest extends StepTest {
assertEquals(PathStep.class, ((MatchStep<?, ?>) pattern.getStartStep()).getGlobalChildren().get(0).getStartStep().getNextStep().getClass());
assertEquals("d", ((MatchStep.MatchEndStep) ((MatchStep<?, ?>) pattern.getStartStep()).getGlobalChildren().get(0).getEndStep()).getMatchKey().get());
assertEquals("e", ((MatchStep.MatchStartStep) ((MatchStep<?, ?>) pattern.getStartStep()).getGlobalChildren().get(1).getStartStep()).getSelectKey().get());
- assertEquals(NoOpBarrierStep.class, ((MatchStep<?, ?>) pattern.getStartStep()).getGlobalChildren().get(1).getStartStep().getNextStep().getClass());
+ assertEquals(LambdaCollectingBarrierStep.class, ((MatchStep<?, ?>) pattern.getStartStep()).getGlobalChildren().get(1).getStartStep().getNextStep().getClass());
assertFalse(((MatchStep.MatchEndStep) ((MatchStep<?, ?>) pattern.getStartStep()).getGlobalChildren().get(1).getEndStep()).getMatchKey().isPresent());
});
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java
index 50ca132..f08e9db 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategyTest.java
@@ -21,7 +21,6 @@ package org.apache.tinkerpop.gremlin.process.traversal.strategy.verification;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies;
import org.junit.Before;
import org.junit.Test;
@@ -30,6 +29,7 @@ import org.junit.runners.Parameterized;
import java.util.Arrays;
+import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
@@ -46,14 +46,14 @@ public class StandardVerificationStrategyTest {
@Before
public void setup() {
this.traversalEngine = mock(TraversalEngine.class);
- when(this.traversalEngine.getType()).thenReturn(TraversalEngine.Type.COMPUTER);
+ when(this.traversalEngine.getType()).thenReturn(TraversalEngine.Type.STANDARD);
}
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
- {"__.repeat(out().fold().unfold()).times(2)", __.repeat(__.out().fold().unfold()).times(2)},
- {"__.repeat(sum()).times(2)", __.repeat(__.sum()).times(2)},
+ {"__.repeat(out().fold().unfold()).times(2)", repeat(out().fold().unfold()).times(2)},
+ {"__.repeat(sum()).times(2)", repeat(sum()).times(2)},
});
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
index ced0753..c459740 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyRepeatTest.groovy
@@ -79,5 +79,10 @@ public abstract class GroovyRepeatTest {
public Traversal<Vertex, Map<String, Vertex>> get_g_V_repeatXbothX_timesX10X_asXaX_out_asXbX_selectXa_bX() {
TraversalScriptHelper.compute("g.V.repeat(both()).times(10).as('a').out().as('b').select('a', 'b')", g);
}
+
+ @Override
+ public Traversal<Vertex, String> get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(final Object v1Id) {
+ TraversalScriptHelper.compute("g.V(${v1Id}).repeat(out()).until(__.outE.count.is(0)).name", g, "v1Id", v1Id)
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
index f50395c..d91d049 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/AbstractImportCustomizerProvider.java
@@ -38,6 +38,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.LambdaCollectingBarrierStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.event.Event;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy;
@@ -96,14 +97,15 @@ public abstract class AbstractImportCustomizerProvider implements ImportCustomiz
imports.add(IdentityRemovalStrategy.class.getPackage().getName() + DOT_STAR); // optimization strategies
imports.add(ProfileStrategy.class.getPackage().getName() + DOT_STAR); // finalization strategies
imports.add(ReadOnlyStrategy.class.getPackage().getName() + DOT_STAR); // verification strategies
-
imports.add(Event.class.getPackage().getName() + DOT_STAR); // eventing
+
staticImports.add(P.class.getCanonicalName() + DOT_STAR);
staticImports.add(Order.class.getCanonicalName() + DOT_STAR);
staticImports.add(Operator.class.getCanonicalName() + DOT_STAR);
staticImports.add(Scope.class.getCanonicalName() + DOT_STAR);
staticImports.add(Pop.class.getCanonicalName() + DOT_STAR);
staticImports.add(__.class.getCanonicalName() + DOT_STAR);
+ staticImports.add(LambdaCollectingBarrierStep.Consumers.class.getCanonicalName() + DOT_STAR);
staticImports.add(TraversalOptionParent.Pick.class.getCanonicalName() + DOT_STAR);
staticImports.add(GraphTraversalSource.class.getCanonicalName() + DOT_STAR);
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
index e4ba1bb..f5ecbf8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
@@ -47,6 +47,7 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
// DO/WHILE
+
public abstract Traversal<Vertex, Path> get_g_V_repeatXoutX_timesX2X_emit_path();
public abstract Traversal<Vertex, String> get_g_V_repeatXoutX_timesX2X_repeatXinX_timesX2X_name();
@@ -73,6 +74,8 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Map<String, Vertex>> get_g_V_repeatXbothX_timesX10X_asXaX_out_asXbX_selectXa_bX();
+ public abstract Traversal<Vertex, String> get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(final Object v1Id);
+
@Test
@LoadGraphWith(MODERN)
public void g_V_repeatXoutX_timesX2X_emit_path() {
@@ -231,6 +234,14 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
assertTrue(counter > 0);
}
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name() {
+ final Traversal<Vertex, String> traversal = get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(convertToVertexId("marko"));
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList("lop", "lop", "ripple", "vadas"), traversal);
+ }
+
public static class Traversals extends RepeatTest {
@Override
@@ -282,5 +293,10 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
public Traversal<Vertex, Map<String, Vertex>> get_g_V_repeatXbothX_timesX10X_asXaX_out_asXbX_selectXa_bX() {
return g.V().repeat(both()).times(10).as("a").out().as("b").select("a", "b");
}
+
+ @Override
+ public Traversal<Vertex, String> get_g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name(final Object v1Id) {
+ return g.V(v1Id).repeat(out()).until(outE().count().is(0)).values("name");
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/969045ed/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index 96815ac..a1f6b1c 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -20,12 +20,10 @@ package org.apache.tinkerpop.gremlin.tinkergraph.structure;
import org.apache.tinkerpop.gremlin.process.traversal.Operator;
import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.Scope;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalMetrics;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.LambdaCollectingBarrierStep;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
@@ -41,7 +39,6 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;
@@ -165,37 +162,21 @@ public class TinkerGraphTest {
@Test
@Ignore
public void testPlay7() throws Exception {
- /*TinkerGraph graph = TinkerGraph.open();
- graph.createIndex("name",Vertex.class);
- graph.io(GraphMLIo.build()).readGraph("/Users/marko/software/tinkerpop/tinkerpop3/data/grateful-dead.xml");*/
- //System.out.println(g.V().properties().key().groupCount().next());
- TinkerGraph graph = TinkerGraph.open();
- GraphTraversalSource g = graph.traversal(GraphTraversalSource.standard());
- g.inject("alice", "bob", "charlie").as("a").addV("person").property("name", select("a")).forEachRemaining(System.out::println);
- g.V().valueMap().forEachRemaining(System.out::println);
- /*final List<Supplier<GraphTraversal<?,?>>> traversals = Arrays.asList(
- () -> g.V().out().as("v").match(
- __.as("v").outE().count().as("outDegree"),
- __.as("v").inE().count().as("inDegree")).select("v","outDegree","inDegree").by(valueMap()).by().by().local(union(select("v"), select("inDegree", "outDegree")).unfold().fold())
- );
-
- traversals.forEach(traversal -> {
- System.out.println("pre-strategy: " + traversal.get());
- System.out.println("post-strategy: " + traversal.get().iterate());
- System.out.println(TimeUtil.clockWithResult(50, () -> traversal.get().toList()));
- });*/
+ final Graph graph = TinkerFactory.createModern();
+ final GraphTraversalSource g = graph.traversal();
+ g.withSack(1.0).V(1).local(outE().barrier(LambdaCollectingBarrierStep.Consumers.normSack)).inV().sack().forEachRemaining(System.out::println);
}
@Test
@Ignore
public void testPlay5() throws Exception {
TinkerGraph graph = TinkerGraph.open();
- graph.createIndex("name",Vertex.class);
+ graph.createIndex("name", Vertex.class);
graph.io(GraphMLIo.build()).readGraph("/Users/marko/software/tinkerpop/tinkerpop3/data/grateful-dead.xml");
GraphTraversalSource g = graph.traversal(GraphTraversalSource.computer());
- final Supplier<Traversal<?,?>> traversal = () ->
- g.V().repeat(out()).times(5).as("a").out("writtenBy").as("b").select("a","b").count();
+ final Supplier<Traversal<?, ?>> traversal = () ->
+ g.V().repeat(out()).times(5).as("a").out("writtenBy").as("b").select("a", "b").count();
System.out.println(traversal.get());
System.out.println(traversal.get().iterate());
[36/50] incubator-tinkerpop git commit: Merge branch 'tp30'
Posted by sp...@apache.org.
Merge branch 'tp30'
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/aca507b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/aca507b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/aca507b1
Branch: refs/heads/TINKERPOP3-333
Commit: aca507b104e29458a4484c4c036498242f302eae
Parents: 016694d 7642fcb
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Sep 3 11:00:58 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Sep 3 11:00:58 2015 -0600
----------------------------------------------------------------------
CHANGELOG.asciidoc | 5 +++++
.../strategy/verification/ComputerVerificationStrategy.java | 5 -----
2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/aca507b1/CHANGELOG.asciidoc
----------------------------------------------------------------------