tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [09/50] [abbrv] tinkerpop git commit: removed TraversalScriptFunction and TraversalScriptHelper. Deprecated a long long time ago -- I can still remember...
Date Mon, 10 Jul 2017 18:18:38 GMT
removed TraversalScriptFunction and TraversalScriptHelper. Deprecated a long long time ago
-- I can still remember...


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

Branch: refs/heads/TINKERPOP-1698
Commit: 6a4fcaf603d64c2bb6492640d21b8ad340b15009
Parents: e5022c3
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Fri Jun 30 15:33:34 2017 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Fri Jun 30 15:33:34 2017 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  2 +
 docs/src/upgrade/release-3.3.x.asciidoc         |  2 +
 .../traversal/util/TraversalScriptFunction.java | 71 --------------------
 .../traversal/util/TraversalScriptHelper.java   | 55 ---------------
 4 files changed, 4 insertions(+), 126 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6a4fcaf6/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 956a725..989a0c7 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,8 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.3.0 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Removed previously deprecated `TraversalScriptFunction` class.
+* Removed previously deprecated `TraversalScriptHelper` class.
 * Graphite and Ganglia are no longer packaged with the Gremlin Server distribution.
 * `TransactionException` is no longer a class of `AbstractTransaction` and it extends `RuntimeException`.
 * Included an ellipse on long property names that are truncated.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6a4fcaf6/docs/src/upgrade/release-3.3.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.3.x.asciidoc b/docs/src/upgrade/release-3.3.x.asciidoc
index 0f71714..3ef6bf0 100644
--- a/docs/src/upgrade/release-3.3.x.asciidoc
+++ b/docs/src/upgrade/release-3.3.x.asciidoc
@@ -202,6 +202,8 @@ The following deprecated classes, methods or fields have been removed
in this ve
 ** `org.apache.tinkerpop.gremlin.jsr223.SingleGremlinScriptEngineManager#getInstance()`
 ** `org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngineManager#addModule(GremlinModule)`
 ** `org.apache.tinkerpop.gremlin.jsr223.console.PluginAcceptor`
+** `org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptFunction`
+** `org.apache.tinkerpop.gremlin.process.traversal.util.TraversalScriptHelper`
 ** `org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures#supportsAddProperty()`
 ** `org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures#FEATURE_ADD_PROPERTY`
 ** `org.apache.tinkerpop.gremlin.structure.Graph.OptIn#SUITE_GROOVY_PROCESS_STANDARD`

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6a4fcaf6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalScriptFunction.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalScriptFunction.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalScriptFunction.java
deleted file mode 100644
index fcd5408..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalScriptFunction.java
+++ /dev/null
@@ -1,71 +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.util;
-
-import org.apache.tinkerpop.gremlin.jsr223.SingleGremlinScriptEngineManager;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-
-import javax.script.Bindings;
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
-import java.io.Serializable;
-import java.util.function.Function;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated As of release 3.2.0, replaced by {@link ScriptTraversal}.
- */
-public final class TraversalScriptFunction<S, E> implements Function<Graph, Traversal.Admin<S,
E>>, Serializable {
-
-    private final TraversalSourceFactory traversalSourceFactory;
-    private final String scriptEngineName;
-    private final String traversalScript;
-    private final Object[] bindings;
-
-    public TraversalScriptFunction(final TraversalSource traversalSource, final String scriptEngineName,
final String traversalScript, final Object... bindings) {
-        this.traversalSourceFactory = new TraversalSourceFactory<>(traversalSource);
-        this.scriptEngineName = scriptEngineName;
-        this.traversalScript = traversalScript;
-        this.bindings = bindings;
-        if (this.bindings.length % 2 != 0)
-            throw new IllegalArgumentException("The provided key/value bindings array length
must be a multiple of two");
-    }
-
-    public Traversal.Admin<S, E> apply(final Graph graph) {
-        try {
-            final ScriptEngine engine = SingleGremlinScriptEngineManager.get(this.scriptEngineName);
-            final Bindings engineBindings = engine.createBindings();
-            engineBindings.put("g", this.traversalSourceFactory.createTraversalSource(graph));
-            for (int i = 0; i < this.bindings.length; i = i + 2) {
-                engineBindings.put((String) this.bindings[i], this.bindings[i + 1]);
-            }
-            final Traversal.Admin<S, E> traversal = (Traversal.Admin<S, E>) engine.eval(this.traversalScript,
engineBindings);
-            if (!traversal.isLocked()) traversal.applyStrategies();
-            return traversal;
-        } catch (final ScriptException e) {
-            throw new IllegalStateException(e.getMessage(), e);
-        }
-    }
-
-    public String toString() {
-        return this.traversalScript;
-    }
-}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6a4fcaf6/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalScriptHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalScriptHelper.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalScriptHelper.java
deleted file mode 100644
index 4fa6e69..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalScriptHelper.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.process.traversal.util;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- * @deprecated As of release 3.2.0, replaced by {@link ScriptTraversal}.
- */
-@Deprecated
-public final class TraversalScriptHelper {
-
-    private TraversalScriptHelper() {
-    }
-
-    @Deprecated
-    public static <S, E> Traversal.Admin<S, E> compute(
-            final Graph graph,
-            final TraversalSource traversalSource,
-            final String scriptEngineName,
-            final String traversalScript,
-            final Object... bindings) {
-
-        try {
-            return new TraversalScriptFunction<S, E>(traversalSource, scriptEngineName,
traversalScript, bindings).apply(graph);
-        } catch (final Exception e) {
-            throw new IllegalStateException(e.getMessage(), e);
-        }
-    }
-
-    @Deprecated
-    public static <S, E> Traversal.Admin<S, E> compute(final String script, final
GraphTraversalSource g, final Object... bindings) {
-        return new ScriptTraversal<>(g, "gremlin-groovy", script, bindings);
-    }
-}


Mime
View raw message