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 2016/10/25 20:35:13 UTC

[1/2] tinkerpop git commit: Deprecated OptIn "performance" tests [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-919 ead131069 -> dc0f79633 (forced update)


Deprecated OptIn "performance" tests

This should have been done a long time ago on 3.2.1, but it was missed CTR


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

Branch: refs/heads/TINKERPOP-919
Commit: 2d9bb2047271ccf453c6aedbf756322fe87f535e
Parents: 285ff35
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 25 16:13:51 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Oct 25 16:13:51 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                  |  1 +
 docs/src/upgrade/release-3.2.x-incubating.asciidoc  | 16 ++++++++++++++++
 .../apache/tinkerpop/gremlin/structure/Graph.java   | 15 +++++++++++++++
 3 files changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d9bb204/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index a281c38..73bfa1e 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Deprecated the "performance" tests in `OptIn`.
 * Fixed a severe bug where `GraphComputer` strategies are not being loaded until the second use of the traversal source.
 
 [[release-3-2-3]]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d9bb204/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 3ed46b2..0fba8f5 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -29,6 +29,22 @@ TinkerPop 3.2.4
 
 Please see the link:https://github.com/apache/tinkerpop/blob/3.2.4/CHANGELOG.asciidoc#release-3-2-4[changelog] for a complete list of all the modifications that are part of this release.
 
+Upgrading for Providers
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Graph Database Providers
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Deprecated Performance OptIn
+++++++++++++++++++++++++++++
+
+In 3.2.1, all `junit-benchmark` performance tests were deprecated. At that time, the `OptIn` representations of these
+tests should have been deprecated as well, but they were not. That omission has been remedied now. Specifically, the
+following fields were deprecated:
+
+* `OptIn.SUITE_GROOVY_ENVIRONMENT_PERFORMANCE`
+* `OptIn.SUITE_PROCESS_PERFORMANCE`
+* `OptIn.SUITE_STRUCTURE_PERFORMANCE`
 
 TinkerPop 3.2.3
 ---------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d9bb204/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
index 01379f4..ed3f12d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
@@ -1200,14 +1200,29 @@ public interface Graph extends AutoCloseable, Host {
     public @interface OptIn {
         public static String SUITE_STRUCTURE_STANDARD = "org.apache.tinkerpop.gremlin.structure.StructureStandardSuite";
         public static String SUITE_STRUCTURE_INTEGRATE = "org.apache.tinkerpop.gremlin.structure.StructureIntegrateSuite";
+
+        /**
+         * @deprecated As of release 3.2.4, effectively replaced by the gremlin-benchmarks module.
+         */
+        @Deprecated
         public static String SUITE_STRUCTURE_PERFORMANCE = "org.apache.tinkerpop.gremlin.structure.StructurePerformanceSuite";
         public static String SUITE_PROCESS_COMPUTER = "org.apache.tinkerpop.gremlin.process.ProcessComputerSuite";
         public static String SUITE_PROCESS_STANDARD = "org.apache.tinkerpop.gremlin.process.ProcessStandardSuite";
+
+        /**
+         * @deprecated As of release 3.2.4, effectively replaced by the gremlin-benchmarks module.
+         */
+        @Deprecated
         public static String SUITE_PROCESS_PERFORMANCE = "org.apache.tinkerpop.gremlin.process.ProcessPerformanceSuite";
         public static String SUITE_GROOVY_PROCESS_STANDARD = "org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite";
         public static String SUITE_GROOVY_PROCESS_COMPUTER = "org.apache.tinkerpop.gremlin.process.GroovyProcessComputerSuite";
         public static String SUITE_GROOVY_ENVIRONMENT = "org.apache.tinkerpop.gremlin.groovy.GroovyEnvironmentSuite";
         public static String SUITE_GROOVY_ENVIRONMENT_INTEGRATE = "org.apache.tinkerpop.gremlin.groovy.GroovyEnvironmentIntegrateSuite";
+
+        /**
+         * @deprecated As of release 3.2.4, effectively replaced by the gremlin-benchmarks module.
+         */
+        @Deprecated
         public static String SUITE_GROOVY_ENVIRONMENT_PERFORMANCE = "org.apache.tinkerpop.gremlin.groovy.GroovyEnvironmentPerformanceSuite";
 
         /**


[2/2] tinkerpop git commit: TINKERPOP-919 Added supportsDuplicateMultiProperties()

Posted by sp...@apache.org.
TINKERPOP-919 Added supportsDuplicateMultiProperties()

That feature allows a graph to specify whether or not it supports multi-properties that allow the same value to be supplied on the same key.


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

Branch: refs/heads/TINKERPOP-919
Commit: dc0f7963356e9d68e56347d98512b27d757f0aaa
Parents: 2d9bb20
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 25 13:50:48 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Oct 25 16:34:54 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../upgrade/release-3.2.x-incubating.asciidoc   |  8 ++++++
 .../tinkerpop/gremlin/structure/Graph.java      | 12 +++++++++
 .../gremlin/structure/VertexProperty.java       |  4 +++
 .../gremlin/structure/FeatureSupportTest.java   | 27 ++++++++++++++++++--
 .../gremlin/structure/VertexPropertyTest.java   | 26 ++++++++++++++++---
 6 files changed, 73 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc0f7963/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 73bfa1e..1df17de 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.4 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added `VertexFeatures.supportsDuplicateMultiProperties()` for graphs that only support unique values in multi-properties.
 * Deprecated the "performance" tests in `OptIn`.
 * Fixed a severe bug where `GraphComputer` strategies are not being loaded until the second use of the traversal source.
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc0f7963/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 0fba8f5..30daae1 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -35,6 +35,14 @@ Upgrading for Providers
 Graph Database Providers
 ^^^^^^^^^^^^^^^^^^^^^^^^
 
+Duplicate Multi-Properties
+++++++++++++++++++++++++++
+
+Added `supportsDuplicateMultiProperties` to `VertexFeatures` so that graph provider who only support unique values as
+multi-properties have more flexibility in describing their graph capabilities.
+
+See: https://issues.apache.org/jira/browse/TINKERPOP-919[TINKERPOP-919]
+
 Deprecated Performance OptIn
 ++++++++++++++++++++++++++++
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc0f7963/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
index ed3f12d..b1961c9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java
@@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.engine.ComputerTraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.io.Io;
 import org.apache.tinkerpop.gremlin.structure.io.IoRegistry;
 import org.apache.tinkerpop.gremlin.structure.util.FeatureDescriptor;
@@ -512,6 +513,7 @@ public interface Graph extends AutoCloseable, Host {
         public interface VertexFeatures extends ElementFeatures {
             public static final String FEATURE_ADD_VERTICES = "AddVertices";
             public static final String FEATURE_MULTI_PROPERTIES = "MultiProperties";
+            public static final String FEATURE_DUPLICATE_MULTI_PROPERTIES = "IdenticalMultiProperties";
             public static final String FEATURE_META_PROPERTIES = "MetaProperties";
             public static final String FEATURE_REMOVE_VERTICES = "RemoveVertices";
 
@@ -550,6 +552,16 @@ public interface Graph extends AutoCloseable, Host {
             }
 
             /**
+             * Determines if a {@link Vertex} can support non-unique values on the same key. For this value to be
+             * {@code true}, then {@link #supportsMetaProperties()} must also return true. By default this method,
+             * just returns what {@link #supportsMultiProperties()} returns.
+             */
+            @FeatureDescriptor(name = FEATURE_DUPLICATE_MULTI_PROPERTIES)
+            public default boolean supportsDuplicateMultiProperties() {
+                return supportsMultiProperties();
+            }
+
+            /**
              * Determines if a {@link Vertex} can support properties on vertex properties.  It is assumed that a
              * graph will support all the same data types for meta-properties that are supported for regular
              * properties.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc0f7963/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexProperty.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexProperty.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexProperty.java
index ecbefb3..c6b443c 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexProperty.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexProperty.java
@@ -99,6 +99,10 @@ public interface VertexProperty<V> extends Property<V>, Element {
             return new UnsupportedOperationException("Multiple properties on a vertex is not supported");
         }
 
+        public static UnsupportedOperationException identicalMultiPropertiesNotSupported() {
+            return new UnsupportedOperationException("Multiple properties on a vertex is supported, but a single key may not hold the same value more than once");
+        }
+
         public static UnsupportedOperationException metaPropertiesNotSupported() {
             return new UnsupportedOperationException("Properties on a vertex property is not supported");
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc0f7963/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
index 98406b4..c73474c 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
@@ -697,7 +697,8 @@ public class FeatureSupportTest {
             "multiPropertiesNotSupported",
             "metaPropertiesNotSupported",
             "userSuppliedIdsNotSupported",
-            "userSuppliedIdsOfThisTypeNotSupported"
+            "userSuppliedIdsOfThisTypeNotSupported",
+            "identicalMultiPropertiesNotSupported"
     })
     @ExceptionCoverage(exceptionClass = Element.Exceptions.class, methods = {
             "propertyRemovalNotSupported"
@@ -877,6 +878,22 @@ public class FeatureSupportTest {
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
         @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 = VertexFeatures.FEATURE_MULTI_PROPERTIES)
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = VertexFeatures.FEATURE_DUPLICATE_MULTI_PROPERTIES, supported = false)
+        public void shouldSupportIdenticalMultiPropertyIfTheSameKeyCanBeAssignedSameValueMoreThanOnce() throws Exception {
+            try {
+                final Vertex v = graph.addVertex("name", "stephen", "name", "stephen");
+                if (2 == IteratorUtils.count(v.properties()))
+                    fail(String.format(INVALID_FEATURE_SPECIFICATION, VertexFeatures.class.getSimpleName(), VertexFeatures.FEATURE_DUPLICATE_MULTI_PROPERTIES));
+            } catch (Exception ex) {
+                validateException(VertexProperty.Exceptions.identicalMultiPropertiesNotSupported(), ex);
+            }
+        }
+
+        @Test
+        @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
+        @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 = VertexFeatures.FEATURE_MULTI_PROPERTIES, supported = false)
         public void shouldSupportMultiPropertyIfTheSameKeyCanBeAssignedMoreThanOnce() throws Exception {
             try {
@@ -1023,7 +1040,13 @@ public class FeatureSupportTest {
         @Test
         public void shouldSupportRegularTransactionsIfThreadedTransactionsAreEnabled() {
             if (graphFeatures.supportsThreadedTransactions())
-                assertTrue(graphFeatures.supportsThreadedTransactions());
+                assertThat(graphFeatures.supportsThreadedTransactions(), is(true));
+        }
+
+        @Test
+        public void shouldSupportMultiPropertiesIfSupportingIdenticalMultiProperties() {
+            if (vertexFeatures.supportsDuplicateMultiProperties())
+                assertThat(vertexFeatures.supportsMultiProperties(), is(true));
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc0f7963/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
index 845be70..04b431d 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexPropertyTest.java
@@ -34,6 +34,7 @@ import java.util.Map;
 import java.util.UUID;
 
 import static org.hamcrest.Matchers.hasItem;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertThat;
@@ -288,11 +289,8 @@ public class VertexPropertyTest extends AbstractGremlinTest {
                     }
                 }
             });
-
-
         }
 
-
         @Test
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
@@ -329,6 +327,28 @@ public class VertexPropertyTest extends AbstractGremlinTest {
             assertEquals(0, IteratorUtils.count(newMexico.properties(T.key.getAccessor())));
             assertEquals(0, IteratorUtils.count(newMexico.properties(T.value.getAccessor())));
         }
+
+        @Test
+        @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_MULTI_PROPERTIES)
+        @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_DUPLICATE_MULTI_PROPERTIES)
+        public void shouldAllowIdenticalValuedMultiProperties() {
+            final Vertex v = graph.addVertex();
+            v.property(VertexProperty.Cardinality.list, "name", "stephen");
+            v.property(VertexProperty.Cardinality.list, "name", "stephen");
+            v.property(VertexProperty.Cardinality.list, "name", "steve");
+            v.property(VertexProperty.Cardinality.list, "name", "stephen");
+            v.property(VertexProperty.Cardinality.list, "color", "red");
+
+            tryCommit(graph, g -> {
+                final Vertex vertex = graph.vertices(v).next();
+                assertEquals(4, IteratorUtils.count(vertex.properties("name")));
+                assertEquals(1, IteratorUtils.count(vertex.properties("color")));
+                assertEquals(5, IteratorUtils.count(vertex.properties()));
+
+                assertThat(IteratorUtils.set(vertex.values("name")), contains("stephen", "steve"));
+            });
+        }
     }
 
     public static class VertexPropertyRemoval extends AbstractGremlinTest {