Skip to content

Commit

Permalink
TINKERPOP-2080 Removed deprecated withRemote() method
Browse files Browse the repository at this point in the history
This was removed for 3.4.0 but we reverted at the last minute to give folks more time to use the new traversal().withRemote() approach that is more consistent across languages. Safe to remove now that we're on 3.5.0. Given that this PR was approved was before revert just going to CTR
  • Loading branch information
spmallette committed May 29, 2019
1 parent 44fd0c2 commit dfbb88c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 119 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
This release also includes changes from <<release-3-4-3, 3.4.3>>.
* Removed previously deprecated `TraversalSource.withRemote()`.
== TinkerPop 3.4.0 (Avant-Gremlin Construction #3 for Theremin and Flowers)
Expand Down
22 changes: 20 additions & 2 deletions docs/src/upgrade/release-3.5.x.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,26 @@ See the License for the specific language governing permissions and
limitations under the License.
////
= TinkerPop 3.4.0
= TinkerPop 3.5.0
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/images/gremlin-running.png[width=225]
*NEED A NAME*
*NEED A NAME*
== TinkerPop 3.5.0
*Release Date: NOT OFFICIALLY RELEASED YET*
Please see the link:https://github.com/apache/tinkerpop/blob/3.5.0/CHANGELOG.asciidoc#release-3-5-0[changelog] for a complete list of all the modifications that are part of this release.
=== Upgrading for Users
==== Deprecation Removal
The following deprecated classes, methods or fields have been removed in this version:
* `gremlin-core`
** `org.apache.tinkerpop.gremlin.process.traversal.TraversalSource#withRemote(*)`
** `org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource#withRemote(*)`
See: link:https://issues.apache.org/jira/browse/TINKERPOP-2080[TINKERPOP-2080]
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,20 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.tinkerpop.gremlin.process.computer.Computer;
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.OptionsStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SackStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SideEffectStrategy;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;

import java.lang.reflect.Constructor;
import java.util.Optional;
import java.util.function.BinaryOperator;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;

import static org.apache.tinkerpop.gremlin.process.remote.RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS;

/**
* A {@code TraversalSource} is used to create {@link Traversal} instances.
* A traversal source can generate any number of {@link Traversal} instances.
Expand Down Expand Up @@ -373,52 +367,6 @@ public default <A> TraversalSource withSack(final A initialValue, final BinaryOp
return clone;
}

/**
* Configures the {@code TraversalSource} as a "remote" to issue the {@link Traversal} for execution elsewhere.
* Expects key for {@link #GREMLIN_REMOTE_CONNECTION_CLASS} as well as any configuration required by
* the underlying {@link RemoteConnection} which will be instantiated. Note that the {@code Configuration} object
* is passed down without change to the creation of the {@link RemoteConnection} instance.
*
* @deprecated As of release 3.3.5, replaced by {@link AnonymousTraversalSource#withRemote(Configuration)}.
* @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-2078">TINKERPOP-2078</a>
*/
@Deprecated
public default TraversalSource withRemote(final Configuration conf) {
if (!conf.containsKey(GREMLIN_REMOTE_CONNECTION_CLASS))
throw new IllegalArgumentException("Configuration must contain the '" + GREMLIN_REMOTE_CONNECTION_CLASS + "' key");
final RemoteConnection remoteConnection;
try {
final Class<? extends RemoteConnection> clazz = Class.forName(conf.getString(GREMLIN_REMOTE_CONNECTION_CLASS)).asSubclass(RemoteConnection.class);
final Constructor<? extends RemoteConnection> ctor = clazz.getConstructor(Configuration.class);
remoteConnection = ctor.newInstance(conf);
} catch (Exception ex) {
throw new IllegalStateException(ex);
}
return withRemote(remoteConnection);
}
/**
* Configures the {@code TraversalSource} as a "remote" to issue the {@link Traversal} for execution elsewhere.
* Calls {@link #withRemote(Configuration)} after reading the properties file specified.
*
* @deprecated As of release 3.3.5, replaced by {@link AnonymousTraversalSource#withRemote(String)}.
* @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-2078">TINKERPOP-2078</a>
*/
@Deprecated
public default TraversalSource withRemote(final String configFile) throws Exception {
return withRemote(new PropertiesConfiguration(configFile));
}
/**
* Configures the {@code TraversalSource} as a "remote" to issue the {@link Traversal} for execution elsewhere.
* Implementations should track {@link RemoteConnection} instances that are created and call
* {@link RemoteConnection#close()} on them when the {@code TraversalSource} itself is closed.
*
* @param connection the {@link RemoteConnection} instance to use to submit the {@link Traversal}.
* @deprecated As of release 3.3.5, replaced by {@link AnonymousTraversalSource#withRemote(RemoteConnection)}.
* @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-2078">TINKERPOP-2078</a>
*/
@Deprecated
public TraversalSource withRemote(final RemoteConnection connection);

public default Optional<Class> getAnonymousTraversalClass() {
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,49 +295,6 @@ public GraphTraversalSource withPath() {
return clone;
}

/**
* {@inheritDoc}
*
* @deprecated As of release 3.3.5, replaced by {@link AnonymousTraversalSource#withRemote(Configuration)}.
* @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-2078">TINKERPOP-2078</a>
*/
@Override
@Deprecated
public GraphTraversalSource withRemote(final Configuration conf) {
return (GraphTraversalSource) TraversalSource.super.withRemote(conf);
}

/**
* {@inheritDoc}
*
* @deprecated As of release 3.3.5, replaced by {@link AnonymousTraversalSource#withRemote(String)}.
* @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-2078">TINKERPOP-2078</a>
*/
@Override
@Deprecated
public GraphTraversalSource withRemote(final String configFile) throws Exception {
return (GraphTraversalSource) TraversalSource.super.withRemote(configFile);
}

/**
* {@inheritDoc}
*
* @deprecated As of release 3.3.5, replaced by {@link AnonymousTraversalSource#withRemote(RemoteConnection)}.
* @see <a href="https://issues.apache.org/jira/browse/TINKERPOP-2078">TINKERPOP-2078</a>
*/
@Override
@Deprecated
public GraphTraversalSource withRemote(final RemoteConnection connection) {
// check if someone called withRemote() more than once, so just release resources on the initial
// connection as you can't have more than one. maybe better to toss IllegalStateException??
if (this.connection != null)
throw new IllegalStateException(String.format("TraversalSource already configured with a RemoteConnection [%s]", connection));
final GraphTraversalSource clone = this.clone();
clone.connection = connection;
clone.getStrategies().addStrategies(new RemoteStrategy(connection));
return clone;
}

//// SPAWNS


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@
*/
package org.apache.tinkerpop.gremlin.sparql.process.traversal.dsl.sparql;

import org.apache.commons.configuration.Configuration;
import org.apache.tinkerpop.gremlin.process.computer.Computer;
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
import org.apache.tinkerpop.gremlin.process.remote.traversal.strategy.decoration.RemoteStrategy;
import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
Expand All @@ -33,9 +30,6 @@
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectStep;
import org.apache.tinkerpop.gremlin.sparql.process.traversal.strategy.SparqlStrategy;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Transaction;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;

import java.util.function.BinaryOperator;
import java.util.function.Supplier;
Expand Down Expand Up @@ -174,21 +168,6 @@ public SparqlTraversalSource withoutStrategies(final Class<? extends TraversalSt
return (SparqlTraversalSource) super.withoutStrategies(traversalStrategyClasses);
}

@Override
public SparqlTraversalSource withRemote(final Configuration conf) {
return (SparqlTraversalSource) super.withRemote(conf);
}

@Override
public SparqlTraversalSource withRemote(final String configFile) throws Exception {
return (SparqlTraversalSource) super.withRemote(configFile);
}

@Override
public SparqlTraversalSource withRemote(final RemoteConnection connection) {
return (SparqlTraversalSource) super.withRemote(connection);
}

/**
* The start step for a SPARQL based traversal that accepts a string representation of the query to execute.
*/
Expand Down

0 comments on commit dfbb88c

Please sign in to comment.