tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [04/50] tinkerpop git commit: TINKERPOP-1562 Add new Neo4j GremlinPlugin and deprecated old one
Date Fri, 16 Dec 2016 15:55:05 GMT
TINKERPOP-1562 Add new Neo4j GremlinPlugin and deprecated old one


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

Branch: refs/heads/TINKERPOP-1490
Commit: 2e65a113e2a9e0b56bcbdba4c124cb1590759cf3
Parents: c41250c
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Tue Nov 22 11:15:57 2016 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Fri Dec 2 06:28:51 2016 -0500

----------------------------------------------------------------------
 .../groovy/plugin/AbstractGremlinPlugin.java    |  2 +
 .../neo4j/groovy/plugin/Neo4jGremlinPlugin.java |  1 +
 .../neo4j/jsr223/Neo4jGremlinPlugin.java        | 71 ++++++++++++++++++++
 ...pache.tinkerpop.gremlin.jsr223.GremlinPlugin |  1 +
 ...pache.tinkerpop.gremlin.jsr223.GremlinPlugin |  1 +
 .../jsr223/TinkerGraphGremlinPlugin.java        |  7 +-
 6 files changed, 78 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2e65a113/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/plugin/AbstractGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/plugin/AbstractGremlinPlugin.java
b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/plugin/AbstractGremlinPlugin.java
index fcc8d05..090da6e 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/plugin/AbstractGremlinPlugin.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/plugin/AbstractGremlinPlugin.java
@@ -30,7 +30,9 @@ import java.util.Map;
  * shell and io objects.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
+ * @deprecated As of release 3.2.4, replaced by {@link org.apache.tinkerpop.gremlin.jsr223.AbstractGremlinPlugin}.
  */
+@Deprecated
 public abstract class AbstractGremlinPlugin implements GremlinPlugin {
     public static final String ENV_CONSOLE_IO = "ConsolePluginAcceptor.io";
     public static final String ENV_CONSOLE_SHELL = "ConsolePluginAcceptor.shell";

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2e65a113/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
index f3fe37c..9053cf3 100644
--- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java
@@ -30,6 +30,7 @@ import java.util.Set;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
+ * @deprecated As of release 3.2.4, replaced by {@link org.apache.tinkerpop.gremlin.neo4j.jsr223.Neo4jGremlinPlugin}.
  */
 public final class Neo4jGremlinPlugin extends AbstractGremlinPlugin {
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2e65a113/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/jsr223/Neo4jGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/jsr223/Neo4jGremlinPlugin.java
b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/jsr223/Neo4jGremlinPlugin.java
new file mode 100644
index 0000000..82a8d18
--- /dev/null
+++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/jsr223/Neo4jGremlinPlugin.java
@@ -0,0 +1,71 @@
+/*
+ * 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.neo4j.jsr223;
+
+import org.apache.tinkerpop.gremlin.jsr223.AbstractGremlinPlugin;
+import org.apache.tinkerpop.gremlin.jsr223.DefaultImportCustomizer;
+import org.apache.tinkerpop.gremlin.jsr223.ImportCustomizer;
+import org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jEdge;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jElement;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraphVariables;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jHelper;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jProperty;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex;
+import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public final class Neo4jGremlinPlugin extends AbstractGremlinPlugin {
+
+    private static final String NAME = "tinkerpop.neo4j";
+
+    private static final ImportCustomizer imports;
+
+    static {
+        try {
+            imports = DefaultImportCustomizer.build()
+                    .addClassImports(Neo4jEdge.class,
+                            Neo4jElement.class,
+                            Neo4jGraph.class,
+                            Neo4jGraphVariables.class,
+                            Neo4jHelper.class,
+                            Neo4jProperty.class,
+                            Neo4jVertex.class,
+                            Neo4jVertexProperty.class)
+                    .addMethodImports(LabelP.class.getMethod("of", String.class)).create();
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    public Neo4jGremlinPlugin() {
+        super(NAME, imports);
+    }
+
+    @Override
+    public boolean requireRestart() {
+        return true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2e65a113/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
----------------------------------------------------------------------
diff --git a/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
b/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
new file mode 100644
index 0000000..cb86e57
--- /dev/null
+++ b/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
@@ -0,0 +1 @@
+org.apache.tinkerpop.gremlin.neo4j.jsr223.Neo4jGremlinPlugin
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2e65a113/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
----------------------------------------------------------------------
diff --git a/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
b/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
new file mode 100644
index 0000000..939b6ff
--- /dev/null
+++ b/spark-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
@@ -0,0 +1 @@
+org.apache.tinkerpop.gremlin.spark.jsr223.SparkGremlinPlugin
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2e65a113/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
index 68e649c..19188d2 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/jsr223/TinkerGraphGremlinPlugin.java
@@ -19,7 +19,6 @@
 package org.apache.tinkerpop.gremlin.tinkergraph.jsr223;
 
 import org.apache.tinkerpop.gremlin.jsr223.AbstractGremlinPlugin;
-import org.apache.tinkerpop.gremlin.jsr223.Customizer;
 import org.apache.tinkerpop.gremlin.jsr223.DefaultImportCustomizer;
 import org.apache.tinkerpop.gremlin.jsr223.ImportCustomizer;
 import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer;
@@ -41,13 +40,11 @@ import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerProperty;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertexProperty;
 
-import java.util.Optional;
-
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class TinkerGraphGremlinPlugin extends AbstractGremlinPlugin {
-    private static final String MODULE_NAME = "tinkerpop.tinkergraph";
+    private static final String NAME = "tinkerpop.tinkergraph";
 
     private static final ImportCustomizer imports = DefaultImportCustomizer.build()
             .addClassImports(TinkerEdge.class,
@@ -70,6 +67,6 @@ public final class TinkerGraphGremlinPlugin extends AbstractGremlinPlugin
{
                              TinkerWorkerPool.class).create();
 
     public TinkerGraphGremlinPlugin() {
-        super(MODULE_NAME, imports);
+        super(NAME, imports);
     }
 }


Mime
View raw message