diff --git a/changelog/README.md b/changelog/README.md
index b90979e2e71..66a7ffe1473 100644
--- a/changelog/README.md
+++ b/changelog/README.md
@@ -23,6 +23,8 @@ under the License.
### 4.19.2
+- [improvement] Remove unused DSE metadata and query-builder extensions (#1031)
+- [improvement] Remove unused DSE Graph support and TinkerPop integration (#1028)
- [bug] CASSJAVA-116: Retry or Speculative Execution with RequestIdGenerator throws "Duplicate Key"
### 4.19.1
diff --git a/core-shaded/pom.xml b/core-shaded/pom.xml
index 4d6ccfd8fad..f627c5f9c1d 100644
--- a/core-shaded/pom.xml
+++ b/core-shaded/pom.xml
@@ -99,16 +99,6 @@
esri-geometry-apitrue
-
- org.apache.tinkerpop
- gremlin-core
- true
-
-
- org.apache.tinkerpop
- tinkergraph-gremlin
- true
- org.reactivestreamsreactive-streams
@@ -316,16 +306,6 @@
lz4-java${lz4.version}
-
- org.apache.tinkerpop
- gremlin-core
- ${tinkerpop.version}
-
-
- org.apache.tinkerpop
- tinkergraph-gremlin
- ${tinkerpop.version}
- com.esri.geometryesri-geometry-api
@@ -375,7 +355,7 @@
Note: dependencies marked as optional are by default included with optional
resolution in the manifest; we only need to manually set the resolution to
optional for dependencies declared as non-optional in the pom files.
- -->jnr.*;resolution:=optional, com.esri.core.geometry.*;resolution:=optional,org.reactivestreams.*;resolution:=optional, org.apache.tinkerpop.*;resolution:=optional, org.javatuples.*;resolution:=optional, reactor.blockhound.*;resolution:=optional,
+ -->jnr.*;resolution:=optional, com.esri.core.geometry.*;resolution:=optional,org.reactivestreams.*;resolution:=optional, reactor.blockhound.*;resolution:=optional,
jnr.*;resolution:=optional, com.esri.core.geometry.*;resolution:=optional, org.reactivestreams.*;resolution:=optional, org.apache.tinkerpop.*;resolution:=optional, org.javatuples.*;resolution:=optional, reactor.blockhound.*;resolution:=optional, *
+ -->jnr.*;resolution:=optional, com.esri.core.geometry.*;resolution:=optional, org.reactivestreams.*;resolution:=optional, reactor.blockhound.*;resolution:=optional, *
com.datastax.oss.driver.*.core.*, com.datastax.dse.driver.*.core.*
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/auth/ProxyAuthentication.java b/core/src/main/java/com/datastax/dse/driver/api/core/auth/ProxyAuthentication.java
index a3624ba736d..0794f2da52f 100644
--- a/core/src/main/java/com/datastax/dse/driver/api/core/auth/ProxyAuthentication.java
+++ b/core/src/main/java/com/datastax/dse/driver/api/core/auth/ProxyAuthentication.java
@@ -17,7 +17,6 @@
*/
package com.datastax.dse.driver.api.core.auth;
-import com.datastax.dse.driver.api.core.graph.GraphStatement;
import com.datastax.oss.driver.api.core.cql.Statement;
import com.datastax.oss.driver.shaded.guava.common.base.Charsets;
import com.datastax.oss.protocol.internal.util.collection.NullAllowingImmutableMap;
@@ -52,18 +51,6 @@ public static > StatementT executeAs(
addProxyExecuteEntry(statement.getCustomPayload(), userOrRole));
}
- /**
- * Adds proxy authentication information to a graph statement.
- *
- * @see #executeAs(String, Statement)
- */
- @NonNull
- public static > StatementT executeAs(
- @NonNull String userOrRole, @NonNull StatementT statement) {
- return statement.setCustomPayload(
- addProxyExecuteEntry(statement.getCustomPayload(), userOrRole));
- }
-
private static Map addProxyExecuteEntry(
Map currentPayload, @NonNull String userOrRole) {
NullAllowingImmutableMap.Builder builder =
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/config/DseDriverOption.java b/core/src/main/java/com/datastax/dse/driver/api/core/config/DseDriverOption.java
index 4d10501f6d2..612448cb99e 100644
--- a/core/src/main/java/com/datastax/dse/driver/api/core/config/DseDriverOption.java
+++ b/core/src/main/java/com/datastax/dse/driver/api/core/config/DseDriverOption.java
@@ -125,50 +125,6 @@ public enum DseDriverOption implements DriverOption {
CONTINUOUS_PAGING_METRICS_SESSION_CQL_REQUESTS_INTERVAL(
"advanced.metrics.session.continuous-cql-requests.refresh-interval"),
- /**
- * The read consistency level to use for graph statements.
- *
- *
Value type: {@link String}
- */
- GRAPH_READ_CONSISTENCY_LEVEL("basic.graph.read-consistency-level"),
- /**
- * The write consistency level to use for graph statements.
- *
- *
Value type: {@link String}
- */
- GRAPH_WRITE_CONSISTENCY_LEVEL("basic.graph.write-consistency-level"),
- /**
- * The traversal source to use for graph statements.
- *
- *
Value type: {@link String}
- */
- GRAPH_TRAVERSAL_SOURCE("basic.graph.traversal-source"),
- /**
- * The sub-protocol the driver will use to communicate with DSE Graph, on top of the Cassandra
- * native protocol.
- *
- *
Value type: {@link String}
- */
- GRAPH_SUB_PROTOCOL("advanced.graph.sub-protocol"),
- /**
- * Whether a script statement represents a system query.
- *
- *
Value type: boolean
- */
- GRAPH_IS_SYSTEM_QUERY("basic.graph.is-system-query"),
- /**
- * The name of the graph targeted by graph statements.
- *
- *
Value type: {@link String}
- */
- GRAPH_NAME("basic.graph.name"),
- /**
- * How long the driver waits for a graph request to complete.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- GRAPH_TIMEOUT("basic.graph.timeout"),
-
/**
* Whether to send events for Insights monitoring.
*
@@ -176,80 +132,6 @@ public enum DseDriverOption implements DriverOption {
*/
MONITOR_REPORTING_ENABLED("advanced.monitor-reporting.enabled"),
- /**
- * Whether to enable paging for Graph queries.
- *
- *
Value type: {@link String}
- */
- GRAPH_PAGING_ENABLED("advanced.graph.paging-enabled"),
-
- /**
- * The page size for Graph continuous paging.
- *
- *
Value type: int
- */
- GRAPH_CONTINUOUS_PAGING_PAGE_SIZE("advanced.graph.paging-options.page-size"),
-
- /**
- * The maximum number of Graph continuous pages to return.
- *
- *
Value type: int
- */
- GRAPH_CONTINUOUS_PAGING_MAX_PAGES("advanced.graph.paging-options.max-pages"),
- /**
- * The maximum number of Graph continuous pages per second.
- *
- *
Value type: int
- */
- GRAPH_CONTINUOUS_PAGING_MAX_PAGES_PER_SECOND(
- "advanced.graph.paging-options.max-pages-per-second"),
- /**
- * The maximum number of Graph continuous pages that can be stored in the local queue.
- *
- *
Value type: int
- */
- GRAPH_CONTINUOUS_PAGING_MAX_ENQUEUED_PAGES("advanced.graph.paging-options.max-enqueued-pages"),
- /**
- * The largest latency that we expect to record for graph requests.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- METRICS_SESSION_GRAPH_REQUESTS_HIGHEST("advanced.metrics.session.graph-requests.highest-latency"),
- /**
- * The number of significant decimal digits to which internal structures will maintain for graph
- * requests.
- *
- *
Value-type: int
- */
- METRICS_SESSION_GRAPH_REQUESTS_DIGITS(
- "advanced.metrics.session.graph-requests.significant-digits"),
- /**
- * The interval at which percentile data is refreshed for graph requests.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- METRICS_SESSION_GRAPH_REQUESTS_INTERVAL(
- "advanced.metrics.session.graph-requests.refresh-interval"),
- /**
- * The largest latency that we expect to record for graph requests.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- METRICS_NODE_GRAPH_MESSAGES_HIGHEST("advanced.metrics.node.graph-messages.highest-latency"),
- /**
- * The number of significant decimal digits to which internal structures will maintain for graph
- * requests.
- *
- *
Value-type: int
- */
- METRICS_NODE_GRAPH_MESSAGES_DIGITS("advanced.metrics.node.graph-messages.significant-digits"),
- /**
- * The interval at which percentile data is refreshed for graph requests.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- METRICS_NODE_GRAPH_MESSAGES_INTERVAL("advanced.metrics.node.graph-messages.refresh-interval"),
-
/**
* The shortest latency that we expect to record for continuous requests.
*
@@ -265,49 +147,6 @@ public enum DseDriverOption implements DriverOption {
CONTINUOUS_PAGING_METRICS_SESSION_CQL_REQUESTS_SLO(
"advanced.metrics.session.continuous-cql-requests.slo"),
- /**
- * The shortest latency that we expect to record for graph requests.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- METRICS_SESSION_GRAPH_REQUESTS_LOWEST("advanced.metrics.session.graph-requests.lowest-latency"),
- /**
- * Optional service-level objectives to meet, as a list of latencies to track.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- METRICS_SESSION_GRAPH_REQUESTS_SLO("advanced.metrics.session.graph-requests.slo"),
-
- /**
- * The shortest latency that we expect to record for graph requests.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- METRICS_NODE_GRAPH_MESSAGES_LOWEST("advanced.metrics.node.graph-messages.lowest-latency"),
- /**
- * Optional service-level objectives to meet, as a list of latencies to track.
- *
- *
Value-type: {@link java.time.Duration Duration}
- */
- METRICS_NODE_GRAPH_MESSAGES_SLO("advanced.metrics.node.graph-messages.slo"),
- /**
- * Optional list of percentiles to publish for graph-requests metric. Produces an additional time
- * series for each requested percentile. This percentile is computed locally, and so can't be
- * aggregated with percentiles computed across other dimensions (e.g. in a different instance).
- *
- *
Value type: {@link java.util.List List}<{@link Double}>
- */
- METRICS_SESSION_GRAPH_REQUESTS_PUBLISH_PERCENTILES(
- "advanced.metrics.session.graph-requests.publish-percentiles"),
- /**
- * Optional list of percentiles to publish for node graph-messages metric. Produces an additional
- * time series for each requested percentile. This percentile is computed locally, and so can't be
- * aggregated with percentiles computed across other dimensions (e.g. in a different instance).
- *
- *
Value type: {@link java.util.List List}<{@link Double}>
- */
- METRICS_NODE_GRAPH_MESSAGES_PUBLISH_PERCENTILES(
- "advanced.metrics.node.graph-messages.publish-percentiles"),
/**
* Optional list of percentiles to publish for continuous paging requests metric. Produces an
* additional time series for each requested percentile. This percentile is computed locally, and
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/AsyncGraphResultSet.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/AsyncGraphResultSet.java
deleted file mode 100644
index 995de53959b..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/AsyncGraphResultSet.java
+++ /dev/null
@@ -1,101 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.GraphExecutionInfoConverter;
-import com.datastax.oss.driver.api.core.cql.ExecutionInfo;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.util.Iterator;
-import java.util.concurrent.CompletionStage;
-
-/**
- * The result of an asynchronous graph query.
- *
- *
The default implementation returned by the driver is not thread-safe: the iterable
- * returned by {@link #currentPage()} should only be iterated by a single thread. However, if
- * subsequent pages are requested via {@link #fetchNextPage()}, it's safe to process those new
- * instances in other threads (as long as each individual page of results is not accessed
- * concurrently).
- *
- * @see GraphResultSet
- */
-public interface AsyncGraphResultSet {
-
- /** The execution information for this page of results. */
- @NonNull
- default ExecutionInfo getRequestExecutionInfo() {
- return GraphExecutionInfoConverter.convert(getExecutionInfo());
- }
-
- /**
- * The execution information for this page of results.
- *
- * @deprecated Use {@link #getRequestExecutionInfo()} instead.
- */
- @Deprecated
- @NonNull
- com.datastax.dse.driver.api.core.graph.GraphExecutionInfo getExecutionInfo();
-
- /** How many rows are left before the current page is exhausted. */
- int remaining();
-
- /**
- * The nodes in the current page. To keep iterating beyond that, use {@link #hasMorePages()} and
- * {@link #fetchNextPage()}.
- *
- *
Note that this method always returns the same object, and that that object can only be
- * iterated once: nodes are "consumed" as they are read.
- */
- @NonNull
- Iterable currentPage();
-
- /**
- * Returns the next node, or {@code null} if the result set is exhausted.
- *
- *
This is convenient for queries that are known to return exactly one node.
- */
- @Nullable
- default GraphNode one() {
- Iterator iterator = currentPage().iterator();
- return iterator.hasNext() ? iterator.next() : null;
- }
-
- /**
- * Whether there are more pages of results. If so, call {@link #fetchNextPage()} to fetch the next
- * one asynchronously.
- */
- boolean hasMorePages();
-
- /**
- * Fetch the next page of results asynchronously.
- *
- * @throws IllegalStateException if there are no more pages. Use {@link #hasMorePages()} to check
- * if you can call this method.
- */
- @NonNull
- CompletionStage fetchNextPage() throws IllegalStateException;
-
- /**
- * Cancels the query and asks the server to stop sending results.
- *
- *
At this time, graph queries are not paginated and the server sends all the results at once;
- * therefore this method has no effect.
- */
- void cancel();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/BatchGraphStatement.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/BatchGraphStatement.java
deleted file mode 100644
index 2169dc5f053..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/BatchGraphStatement.java
+++ /dev/null
@@ -1,150 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.DefaultBatchGraphStatement;
-import com.datastax.oss.driver.api.core.cql.Statement;
-import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableList;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.util.Collections;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-
-/**
- * A graph statement that groups multiple mutating traversals together, to be executed in the
- * same transaction.
- *
- *
It is reserved for graph mutations, and does not return any result.
- *
- *
All the mutations grouped in the batch will either all succeed, or they will all be discarded
- * and return an error.
- *
- *
The default implementation returned by the driver is immutable and thread-safe. Each mutation
- * operation returns a copy. If you chain many of those operations, it is recommended to use {@link
- * #builder()} instead for better memory usage.
- *
- *
Traversals can be added with {@link #addTraversal(GraphTraversal)}.
- */
- @NonNull
- static BatchGraphStatement newInstance() {
- return new DefaultBatchGraphStatement(
- ImmutableList.of(),
- null,
- null,
- null,
- Statement.NO_DEFAULT_TIMESTAMP,
- null,
- null,
- Collections.emptyMap(),
- null,
- null,
- null,
- null,
- null,
- null);
- }
-
- /** Create a new instance from the given list of traversals. */
- @NonNull
- static BatchGraphStatement newInstance(@NonNull Iterable traversals) {
- return new DefaultBatchGraphStatement(
- traversals,
- null,
- null,
- null,
- Statement.NO_DEFAULT_TIMESTAMP,
- null,
- null,
- Collections.emptyMap(),
- null,
- null,
- null,
- null,
- null,
- null);
- }
-
- /** Create a new instance from the given list of traversals. */
- @NonNull
- static BatchGraphStatement newInstance(@NonNull GraphTraversal... traversals) {
- return newInstance(ImmutableList.copyOf(traversals));
- }
-
- /**
- * Create a builder helper object to start creating a new instance.
- *
- *
Note that this builder is mutable and not thread-safe.
- */
- @NonNull
- static BatchGraphStatementBuilder builder() {
- return new BatchGraphStatementBuilder();
- }
-
- /**
- * Create a builder helper object to start creating a new instance with an existing statement as a
- * template. The traversals and options set on the template will be copied for the new statement
- * at the moment this method is called.
- *
- *
Note that this builder is mutable and not thread-safe.
- */
- @NonNull
- static BatchGraphStatementBuilder builder(@NonNull BatchGraphStatement template) {
- return new BatchGraphStatementBuilder(template);
- }
-
- /**
- * Add a traversal to this statement. If many traversals need to be added, use a {@link
- * #builder()}, or the {@link #addTraversals(Iterable)} method instead to avoid intermediary
- * copies.
- */
- @NonNull
- BatchGraphStatement addTraversal(@NonNull GraphTraversal traversal);
-
- /**
- * Adds several traversals to this statement. If this method is to be called many times, consider
- * using a {@link #builder()} instead to avoid intermediary copies.
- */
- @NonNull
- BatchGraphStatement addTraversals(@NonNull Iterable traversals);
-
- /** Get the number of traversals already added to this statement. */
- int size();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/BatchGraphStatementBuilder.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/BatchGraphStatementBuilder.java
deleted file mode 100644
index ac1b85bdc71..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/BatchGraphStatementBuilder.java
+++ /dev/null
@@ -1,112 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.DefaultBatchGraphStatement;
-import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableList;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import net.jcip.annotations.NotThreadSafe;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-
-/**
- * A builder to create a batch graph statement.
- *
- *
This class is mutable and not thread-safe.
- */
-@NotThreadSafe
-public class BatchGraphStatementBuilder
- extends GraphStatementBuilderBase {
-
- private ImmutableList.Builder traversalsBuilder = ImmutableList.builder();
- private int traversalsCount;
-
- public BatchGraphStatementBuilder() {
- // nothing to do
- }
-
- public BatchGraphStatementBuilder(BatchGraphStatement template) {
- super(template);
- traversalsBuilder.addAll(template);
- traversalsCount = template.size();
- }
-
- /** Add a traversal to this builder to include in the generated {@link BatchGraphStatement}. */
- @NonNull
- public BatchGraphStatementBuilder addTraversal(@NonNull GraphTraversal traversal) {
- traversalsBuilder.add(traversal);
- traversalsCount += 1;
- return this;
- }
-
- /**
- * Add several traversals to this builder to include in the generated {@link BatchGraphStatement}.
- */
- @NonNull
- public BatchGraphStatementBuilder addTraversals(@NonNull Iterable traversals) {
- for (GraphTraversal traversal : traversals) {
- traversalsBuilder.add(traversal);
- traversalsCount += 1;
- }
- return this;
- }
-
- /**
- * Add several traversals to this builder to include in the generated {@link BatchGraphStatement}.
- */
- @NonNull
- public BatchGraphStatementBuilder addTraversals(@NonNull GraphTraversal... traversals) {
- for (GraphTraversal traversal : traversals) {
- traversalsBuilder.add(traversal);
- traversalsCount += 1;
- }
- return this;
- }
-
- /** Clears all the traversals previously added to this builder. */
- @NonNull
- public BatchGraphStatementBuilder clearTraversals() {
- traversalsBuilder = ImmutableList.builder();
- traversalsCount = 0;
- return this;
- }
-
- /** Returns the number of traversals added to this statement so far. */
- public int getTraversalsCount() {
- return traversalsCount;
- }
-
- @NonNull
- @Override
- public BatchGraphStatement build() {
- return new DefaultBatchGraphStatement(
- traversalsBuilder.build(),
- isIdempotent,
- timeout,
- node,
- timestamp,
- executionProfile,
- executionProfileName,
- buildCustomPayload(),
- graphName,
- traversalSource,
- subProtocol,
- consistencyLevel,
- readConsistencyLevel,
- writeConsistencyLevel);
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/DseGraph.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/DseGraph.java
deleted file mode 100644
index dd1dbe95bc8..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/DseGraph.java
+++ /dev/null
@@ -1,79 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.DefaultDseRemoteConnectionBuilder;
-import com.datastax.oss.driver.api.core.CqlSession;
-import org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
-
-/**
- * General purpose utility class for interaction with DSE Graph via the DataStax Enterprise Java
- * driver.
- */
-public class DseGraph {
-
- /**
- * IMPORTANT: As of Tinkerpop 3.3.5, you should no longer use this shortcut if you intend
- * to connect the traversal to DSE Graph using a {@linkplain
- * org.apache.tinkerpop.gremlin.process.remote.RemoteConnection remote connection}, for example
- * via the {@link #remoteConnectionBuilder} method declared below. Instead of:
- *
- *
- *
- * A general-purpose shortcut for a non-connected TinkerPop {@link GraphTraversalSource}
- * based on an immutable empty graph. This is really just a shortcut to {@code
- * EmptyGraph.instance().traversal();}.
- *
- *
It can be used to create {@link FluentGraphStatement} instances (recommended); for ease of
- * use you may statically import this variable.
- *
- *
Calling {@code g.getGraph()} will return a local immutable empty graph which is in no way
- * connected to the DSE Graph server, it will not allow to modify a DSE Graph directly. To act on
- * data stored in DSE Graph you must use {@linkplain
- * org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal traversal}s such as
- * {@code DseGraph.g.V()}, {@code DseGraph.g.addV/addE()}.
- */
- public static final GraphTraversalSource g = EmptyGraph.instance().traversal();
-
- /**
- * Returns a builder helper class to help create {@link
- * org.apache.tinkerpop.gremlin.process.remote.RemoteConnection} implementations that seamlessly
- * connect to DSE Graph using the {@link CqlSession} in parameter.
- */
- public static DseGraphRemoteConnectionBuilder remoteConnectionBuilder(CqlSession dseSession) {
- return new DefaultDseRemoteConnectionBuilder(dseSession);
- }
-
- private DseGraph() {
- // nothing to do
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/DseGraphRemoteConnectionBuilder.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/DseGraphRemoteConnectionBuilder.java
deleted file mode 100644
index c4210a5b3dd..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/DseGraphRemoteConnectionBuilder.java
+++ /dev/null
@@ -1,61 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.oss.driver.api.core.CqlSession;
-import com.datastax.oss.driver.api.core.config.DriverExecutionProfile;
-import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
-
-/**
- * A builder helper to create a {@link RemoteConnection} that will be used to build
- * implicitly-executing fluent traversals.
- *
- *
To create an instance of this, use the {@link DseGraph#remoteConnectionBuilder(CqlSession)}
- * method:
- *
- *
- *
- * @see CqlSession
- */
-public interface DseGraphRemoteConnectionBuilder {
-
- /** Build the remote connection that was configured with this builder. */
- RemoteConnection build();
-
- /**
- * Set a configuration profile that will be used for every traversal built using the remote
- * connection.
- *
- *
For the list of options available for Graph requests, see the {@code reference.conf}
- * configuration file.
- */
- DseGraphRemoteConnectionBuilder withExecutionProfile(DriverExecutionProfile executionProfile);
-
- /**
- * Set the name of an execution profile that will be used for every traversal using from the
- * remote connection. Named profiles are pre-defined in the driver configuration.
- *
- *
For the list of options available for Graph requests, see the {@code reference.conf}
- * configuration file.
- */
- DseGraphRemoteConnectionBuilder withExecutionProfileName(String executionProfileName);
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/FluentGraphStatement.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/FluentGraphStatement.java
deleted file mode 100644
index 051c6501c65..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/FluentGraphStatement.java
+++ /dev/null
@@ -1,93 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.DefaultFluentGraphStatement;
-import com.datastax.oss.driver.api.core.cql.Statement;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.util.Collections;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-
-/**
- * A graph statement that uses a TinkerPop {@link GraphTraversal} as the query.
- *
- *
- *
- * @see DseGraph#g
- */
-public interface FluentGraphStatement extends GraphStatement {
-
- /**
- * Create a new instance from the given traversal.
- *
- *
Use {@link #builder(GraphTraversal)} if you want to set more options before building the
- * final statement instance.
- */
- @NonNull
- static FluentGraphStatement newInstance(@NonNull GraphTraversal, ?> traversal) {
- return new DefaultFluentGraphStatement(
- traversal,
- null,
- null,
- null,
- Statement.NO_DEFAULT_TIMESTAMP,
- null,
- null,
- Collections.emptyMap(),
- null,
- null,
- null,
- null,
- null,
- null);
- }
-
- /**
- * Create a builder object to start creating a new instance from the given traversal.
- *
- *
Note that this builder is mutable and not thread-safe.
- */
- @NonNull
- static FluentGraphStatementBuilder builder(@NonNull GraphTraversal, ?> traversal) {
- return new FluentGraphStatementBuilder(traversal);
- }
-
- /**
- * Create a builder helper object to start creating a new instance with an existing statement as a
- * template. The traversal and options set on the template will be copied for the new statement at
- * the moment this method is called.
- *
- *
Note that this builder is mutable and not thread-safe.
- */
- @NonNull
- static FluentGraphStatementBuilder builder(@NonNull FluentGraphStatement template) {
- return new FluentGraphStatementBuilder(template);
- }
-
- /** The underlying TinkerPop object representing the traversal executed by this statement. */
- @NonNull
- GraphTraversal, ?> getTraversal();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/FluentGraphStatementBuilder.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/FluentGraphStatementBuilder.java
deleted file mode 100644
index 59e588c564a..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/FluentGraphStatementBuilder.java
+++ /dev/null
@@ -1,64 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.DefaultFluentGraphStatement;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import net.jcip.annotations.NotThreadSafe;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-
-/**
- * A builder to create a fluent graph statement.
- *
- *
This class is mutable and not thread-safe.
- */
-@NotThreadSafe
-public class FluentGraphStatementBuilder
- extends GraphStatementBuilderBase {
-
- private GraphTraversal, ?> traversal;
-
- public FluentGraphStatementBuilder(@NonNull GraphTraversal, ?> traversal) {
- this.traversal = traversal;
- }
-
- public FluentGraphStatementBuilder(@NonNull FluentGraphStatement template) {
- super(template);
- this.traversal = template.getTraversal();
- }
-
- @NonNull
- @Override
- public FluentGraphStatement build() {
- return new DefaultFluentGraphStatement(
- this.traversal,
- isIdempotent,
- timeout,
- node,
- timestamp,
- executionProfile,
- executionProfileName,
- buildCustomPayload(),
- graphName,
- traversalSource,
- subProtocol,
- consistencyLevel,
- readConsistencyLevel,
- writeConsistencyLevel);
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphExecutionInfo.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphExecutionInfo.java
deleted file mode 100644
index 758f6b358ed..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphExecutionInfo.java
+++ /dev/null
@@ -1,94 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.oss.driver.api.core.DefaultProtocolVersion;
-import com.datastax.oss.driver.api.core.metadata.Node;
-import com.datastax.oss.driver.api.core.specex.SpeculativeExecutionPolicy;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Information about the execution of a graph statement.
- *
- * @deprecated This interface is not used by any driver component anymore; the driver now exposes
- * instances of {@link com.datastax.oss.driver.api.core.cql.ExecutionInfo} for all Graph
- * queries.
- */
-@Deprecated
-public interface GraphExecutionInfo {
-
- /** The statement that was executed. */
- GraphStatement> getStatement();
-
- /** The node that was used as a coordinator to successfully complete the query. */
- Node getCoordinator();
-
- /**
- * The number of speculative executions that were started for this query.
- *
- *
This does not include the initial, normal execution of the query. Therefore, if speculative
- * executions are disabled, this will always be 0. If they are enabled and one speculative
- * execution was triggered in addition to the initial execution, this will be 1, etc.
- *
- * @see SpeculativeExecutionPolicy
- */
- int getSpeculativeExecutionCount();
-
- /**
- * The index of the execution that completed this query.
- *
- *
0 represents the initial, normal execution of the query, 1 the first speculative execution,
- * etc.
- *
- * @see SpeculativeExecutionPolicy
- */
- int getSuccessfulExecutionIndex();
-
- /**
- * The errors encountered on previous coordinators, if any.
- *
- *
The list is in chronological order, based on the time that the driver processed the error
- * responses. If speculative executions are enabled, they run concurrently so their errors will be
- * interleaved. A node can appear multiple times (if the retry policy decided to retry on the same
- * node).
- */
- List> getErrors();
-
- /**
- * The server-side warnings for this query, if any (otherwise the list will be empty).
- *
- *
This feature is only available with {@link DefaultProtocolVersion#V4} or above; with lower
- * versions, this list will always be empty.
- */
- List getWarnings();
-
- /**
- * The custom payload sent back by the server with the response, if any (otherwise the map will be
- * empty).
- *
- *
This method returns a read-only view of the original map, but its values remain inherently
- * mutable. If multiple clients will read these values, care should be taken not to corrupt the
- * data (in particular, preserve the indices by calling {@link ByteBuffer#duplicate()}).
- *
- *
This feature is only available with {@link DefaultProtocolVersion#V4} or above; with lower
- * versions, this map will always be empty.
- */
- Map getIncomingPayload();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphNode.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphNode.java
deleted file mode 100644
index 97d48a6b04d..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphNode.java
+++ /dev/null
@@ -1,234 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.oss.driver.api.core.type.reflect.GenericType;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.Property;
-import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.VertexProperty;
-
-/**
- * A node in a tree-like structure representing a Graph or a Graph component.
- *
- *
It can be:
- *
- *
- *
a scalar value of a primitive type (boolean, string, int, long, double);
- *
a graph element (vertex, edge, path or property);
- *
a list of nodes;
- *
a set of nodes;
- *
a map of nodes.
- *
- *
- * This interface provides test methods to find out what a node represents, and conversion methods
- * to cast it to a particular Java type. Two generic methods {@link #as(Class)} and {@link
- * #as(GenericType)} can produce any arbitrary Java type, provided that the underlying serialization
- * runtime has been correctly configured to support the requested conversion.
- */
-public interface GraphNode {
-
- /** Whether this node represents a {@code null} value. */
- boolean isNull();
-
- /**
- * Returns {@code true} if this node is a {@link Map}, and {@code false} otherwise.
- *
- *
If this method returns {@code true}, you can convert this node with {@link #asMap()}, or use
- * {@link #keys()} and {@link #getByKey(Object)} to access the individual fields (note that
- * entries are not ordered, so {@link #getByIndex(int)} does not work).
- */
- boolean isMap();
-
- /** The keys of this map node, or an empty iterator if it is not a map. */
- Iterable> keys();
-
- /**
- * Returns the value for the given key as a node.
- *
- *
If this node is not a map, or does not contain the specified key, {@code null} is returned.
- *
- *
If the property value has been explicitly set to {@code null}, implementors may return a
- * special "null node" instead of {@code null}.
- */
- GraphNode getByKey(Object key);
-
- /** Deserializes and returns this node as a {@link Map}. */
- Map asMap();
-
- /**
- * Returns {@code true} if this node is a {@link List}, and {@code false} otherwise.
- *
- *
If this method returns {@code true}, you can convert this node with {@link #asList()}, or
- * use {@link #size()} and {@link #getByIndex(int)} to access the individual fields.
- */
- boolean isList();
-
- /** The size of the current node, if it is a list or map, or {@code 0} otherwise. */
- int size();
-
- /**
- * Returns the element at the given index as a node.
- *
- *
If this node is not a list, or {@code index} is out of bounds (i.e. less than zero or {@code
- * >= size()}, {@code null} is returned; no exception will be thrown.
- *
- *
If the requested element has been explicitly set to {@code null}, implementors may return a
- * special "null node" instead of {@code null}.
- */
- GraphNode getByIndex(int index);
-
- /** Deserializes and returns this node as a {@link List}. */
- List asList();
-
- /**
- * Returns {@code true} if this node is a simple scalar value, (i.e., string, boolean or number),
- * and {@code false} otherwise.
- *
- *
If this method returns {@code true}, you can convert this node with {@link #asString()},
- * {@link #asBoolean()}, {@link #asInt()}, {@link #asLong()} or {@link #asDouble()}.
- */
- boolean isValue();
-
- /**
- * Returns this node as an integer.
- *
- *
If the underlying object is not convertible to integer, implementors may choose to either
- * throw {@link ClassCastException} or return [null | empty | some default value], whichever is
- * deemed more appropriate.
- */
- int asInt();
-
- /**
- * Returns this node as a boolean.
- *
- *
If the underlying object is not convertible to boolean, implementors may choose to either
- * throw {@link ClassCastException} or return [null | empty | some default value], whichever is
- * deemed more appropriate.
- */
- boolean asBoolean();
-
- /**
- * Returns this node as a long integer.
- *
- *
If the underlying object is not convertible to long, implementors may choose to either throw
- * {@link ClassCastException} or return [null | empty | some default value], whichever is deemed
- * more appropriate.
- */
- long asLong();
-
- /**
- * Returns this node as a long integer.
- *
- *
If the underlying object is not convertible to double, implementors may choose to either
- * throw {@link ClassCastException} or return [null | empty | some default value], whichever is
- * deemed more appropriate.
- */
- double asDouble();
-
- /**
- * A valid string representation of this node.
- *
- *
If the underlying object is not convertible to a string, implementors may choose to either
- * throw {@link ClassCastException} or return an empty string, whichever is deemed more
- * appropriate.
- */
- String asString();
-
- /**
- * Deserializes and returns this node as an instance of {@code clazz}.
- *
- *
Before attempting such a conversion, there must be an appropriate converter configured on
- * the underlying serialization runtime.
- */
- ResultT as(Class clazz);
-
- /**
- * Deserializes and returns this node as an instance of the given {@link GenericType type}.
- *
- *
Before attempting such a conversion, there must be an appropriate converter configured on
- * the underlying serialization runtime.
- */
- ResultT as(GenericType type);
-
- /**
- * Returns {@code true} if this node is a {@link Vertex}, and {@code false} otherwise.
- *
- *
If this method returns {@code true}, then {@link #asVertex()} can be safely called.
- */
- boolean isVertex();
-
- /** Returns this node as a Tinkerpop {@link Vertex}. */
- Vertex asVertex();
-
- /**
- * Returns {@code true} if this node is a {@link Edge}, and {@code false} otherwise.
- *
- *
If this method returns {@code true}, then {@link #asEdge()} can be safely called.
- */
- boolean isEdge();
-
- /** Returns this node as a Tinkerpop {@link Edge}. */
- Edge asEdge();
-
- /**
- * Returns {@code true} if this node is a {@link Path}, and {@code false} otherwise.
- *
- *
If this method returns {@code true}, then {@link #asPath()} can be safely called.
- */
- boolean isPath();
-
- /** Returns this node as a Tinkerpop {@link Path}. */
- Path asPath();
-
- /**
- * Returns {@code true} if this node is a {@link Property}, and {@code false} otherwise.
- *
- *
If this method returns {@code true}, then {@link #asProperty()} can be safely called.
- */
- boolean isProperty();
-
- /** Returns this node as a Tinkerpop {@link Property}. */
- Property asProperty();
-
- /**
- * Returns {@code true} if this node is a {@link VertexProperty}, and {@code false} otherwise.
- *
- *
If this method returns {@code true}, then {@link #asVertexProperty()} ()} can be safely
- * called.
- */
- boolean isVertexProperty();
-
- /** Returns this node as a Tinkerpop {@link VertexProperty}. */
- VertexProperty asVertexProperty();
-
- /**
- * Returns {@code true} if this node is a {@link Set}, and {@code false} otherwise.
- *
- *
If this method returns {@code true}, you can convert this node with {@link #asSet()}, or use
- * {@link #size()}.
- */
- boolean isSet();
-
- /** Deserializes and returns this node as a {@link Set}. */
- Set asSet();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphResultSet.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphResultSet.java
deleted file mode 100644
index d9c8d8fa460..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphResultSet.java
+++ /dev/null
@@ -1,93 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.GraphExecutionInfoConverter;
-import com.datastax.oss.driver.api.core.cql.ExecutionInfo;
-import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableList;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * The result of a synchronous Graph query.
- *
- *
This object is a container for {@link GraphNode} objects that will contain the data returned
- * by Graph queries.
- *
- *
Note that this object can only be iterated once: items are "consumed" as they are read,
- * subsequent calls to {@code iterator()} will return the same iterator instance.
- *
- *
The default implementation returned by the driver is not thread-safe. It can only be
- * iterated by the thread that invoked {@code dseSession.execute}.
- *
- * @see GraphNode
- * @see GraphSession#execute(GraphStatement)
- */
-public interface GraphResultSet extends Iterable {
-
- /**
- * Returns the next node, or {@code null} if the result set is exhausted.
- *
- *
This is convenient for queries that are known to return exactly one row, for example count
- * queries.
- */
- @Nullable
- default GraphNode one() {
- Iterator graphNodeIterator = iterator();
- return graphNodeIterator.hasNext() ? graphNodeIterator.next() : null;
- }
-
- /**
- * Returns all the remaining nodes as a list; not recommended for paginated queries that return
- * a large number of nodes.
- *
- *
At this time (DSE 6.0.0), graph queries are not paginated and the server sends all the
- * results at once.
- */
- @NonNull
- default List all() {
- if (!iterator().hasNext()) {
- return Collections.emptyList();
- }
- return ImmutableList.copyOf(this);
- }
-
- /**
- * Cancels the query and asks the server to stop sending results.
- *
- *
At this time (DSE 6.0.0), graph queries are not paginated and the server sends all the
- * results at once; therefore this method has no effect.
- */
- void cancel();
-
- /**
- * The execution information for the query that have been performed to assemble this result set.
- */
- @NonNull
- default ExecutionInfo getRequestExecutionInfo() {
- return GraphExecutionInfoConverter.convert(getExecutionInfo());
- }
-
- /** @deprecated Use {@link #getRequestExecutionInfo()} instead. */
- @Deprecated
- @NonNull
- com.datastax.dse.driver.api.core.graph.GraphExecutionInfo getExecutionInfo();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphSession.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphSession.java
deleted file mode 100644
index b985bc56353..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphSession.java
+++ /dev/null
@@ -1,87 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.oss.driver.api.core.CqlSession;
-import com.datastax.oss.driver.api.core.session.Session;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.util.Objects;
-import java.util.concurrent.CompletionStage;
-
-/**
- * A session that has the ability to execute DSE Graph requests.
- *
- *
Generally this interface won't be referenced directly in an application; instead, you should
- * use {@link CqlSession}, which is a combination of this interface and many others for a more
- * integrated usage of DataStax Enterprise's multi-model database via a single entry point. However,
- * it is still possible to cast a {@code CqlSession} to a {@code GraphSession} to only expose the
- * DSE Graph execution methods.
- */
-public interface GraphSession extends Session {
-
- /**
- * Executes a graph statement synchronously (the calling thread blocks until the result becomes
- * available).
- *
- *
The driver provides different kinds of graph statements:
- *
- *
{@link BatchGraphStatement}: groups together multiple mutating traversals ({@code
- * g.addV()/g.addE()}) inside a single transaction and avoids multiple client-server
- * round-trips. Improves performance in data ingestion scenarios;
- *
{@link ScriptGraphStatement}: wraps a Gremlin-groovy script provided as a plain Java
- * string. Required for administrative queries such as creating/dropping a graph,
- * configuration and schema.
- *
- *
- *
This feature is only available with DataStax Enterprise. Executing graph queries against an
- * Apache Cassandra® cluster will result in a runtime error.
- *
- * @see GraphResultSet
- * @param graphStatement the graph query to execute (that can be any {@code GraphStatement}).
- * @return the result of the graph query. That result will never be null but can be empty.
- */
- @NonNull
- default GraphResultSet execute(@NonNull GraphStatement> graphStatement) {
- return Objects.requireNonNull(
- execute(graphStatement, GraphStatement.SYNC),
- "The graph processor should never return a null result");
- }
-
- /**
- * Executes a graph statement asynchronously (the call returns as soon as the statement was sent,
- * generally before the result is available).
- *
- *
This feature is only available with DataStax Enterprise. Executing graph queries against an
- * Apache Cassandra® cluster will result in a runtime error.
- *
- * @see #execute(GraphStatement)
- * @see AsyncGraphResultSet
- * @param graphStatement the graph query to execute (that can be any {@code GraphStatement}).
- * @return the {@code CompletionStage} on the result of the graph query.
- */
- @NonNull
- default CompletionStage executeAsync(
- @NonNull GraphStatement> graphStatement) {
- return Objects.requireNonNull(
- execute(graphStatement, GraphStatement.ASYNC),
- "The graph processor should never return a null result");
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphStatement.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphStatement.java
deleted file mode 100644
index f770469b824..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphStatement.java
+++ /dev/null
@@ -1,378 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.oss.driver.api.core.ConsistencyLevel;
-import com.datastax.oss.driver.api.core.CqlIdentifier;
-import com.datastax.oss.driver.api.core.CqlSession;
-import com.datastax.oss.driver.api.core.NoNodeAvailableException;
-import com.datastax.oss.driver.api.core.config.DriverExecutionProfile;
-import com.datastax.oss.driver.api.core.loadbalancing.LoadBalancingPolicy;
-import com.datastax.oss.driver.api.core.loadbalancing.NodeDistance;
-import com.datastax.oss.driver.api.core.metadata.Node;
-import com.datastax.oss.driver.api.core.metadata.token.Token;
-import com.datastax.oss.driver.api.core.session.Request;
-import com.datastax.oss.driver.api.core.session.Session;
-import com.datastax.oss.driver.api.core.specex.SpeculativeExecutionPolicy;
-import com.datastax.oss.driver.api.core.type.reflect.GenericType;
-import edu.umd.cs.findbugs.annotations.CheckReturnValue;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.nio.ByteBuffer;
-import java.time.Duration;
-import java.util.Map;
-import java.util.concurrent.CompletionStage;
-
-/**
- * A request to execute a DSE Graph query.
- *
- * @param the "self type" used for covariant returns in subtypes.
- */
-public interface GraphStatement> extends Request {
-
- /**
- * The type returned when a graph statement is executed synchronously.
- *
- *
Most users won't use this explicitly. It is needed for the generic execute method ({@link
- * Session#execute(Request, GenericType)}), but graph statements will generally be run with one of
- * the DSE driver's built-in helper methods (such as {@link CqlSession#execute(GraphStatement)}).
- */
- GenericType SYNC = GenericType.of(GraphResultSet.class);
-
- /**
- * The type returned when a graph statement is executed asynchronously.
- *
- *
Most users won't use this explicitly. It is needed for the generic execute method ({@link
- * Session#execute(Request, GenericType)}), but graph statements will generally be run with one of
- * the DSE driver's built-in helper methods (such as {@link
- * CqlSession#executeAsync(GraphStatement)}).
- */
- GenericType> ASYNC =
- new GenericType>() {};
-
- /**
- * Set the idempotence to use for execution.
- *
- *
Idempotence defines whether it will be possible to speculatively re-execute the statement,
- * based on a {@link SpeculativeExecutionPolicy}.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @param idempotent a boolean instance to set a statement-specific value, or {@code null} to use
- * the default idempotence defined in the configuration.
- */
- @NonNull
- @CheckReturnValue
- SelfT setIdempotent(@Nullable Boolean idempotent);
-
- /**
- * {@inheritDoc}
- *
- *
Note that, if this method returns {@code null}, graph statements fall back to a dedicated
- * configuration option: {@code basic.graph.timeout}. See {@code reference.conf} in the DSE driver
- * distribution for more details.
- */
- @Nullable
- @Override
- Duration getTimeout();
-
- /**
- * Sets how long to wait for this request to complete. This is a global limit on the duration of a
- * session.execute() call, including any retries the driver might do.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @param newTimeout the timeout to use, or {@code null} to use the default value defined in the
- * configuration.
- * @see #getTimeout()
- */
- @NonNull
- @CheckReturnValue
- SelfT setTimeout(@Nullable Duration newTimeout);
-
- /**
- * Sets the {@link Node} that should handle this query.
- *
- *
In the general case, use of this method is heavily discouraged and should only be
- * used in specific cases, such as applying a series of schema changes, which may be advantageous
- * to execute in sequence on the same node.
- *
- *
Configuring a specific node causes the configured {@link LoadBalancingPolicy} to be
- * completely bypassed. However, if the load balancing policy dictates that the node is at
- * distance {@link NodeDistance#IGNORED} or there is no active connectivity to the node, the
- * request will fail with a {@link NoNodeAvailableException}.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @param newNode The node that should be used to handle executions of this statement or null to
- * delegate to the configured load balancing policy.
- */
- @NonNull
- @CheckReturnValue
- SelfT setNode(@Nullable Node newNode);
-
- /**
- * Get the timestamp set on the statement.
- *
- *
By default, if left unset, the value returned by this is {@code Long.MIN_VALUE}, which means
- * that the timestamp will be set via the Timestamp Generator.
- *
- * @return the timestamp set on this statement.
- */
- long getTimestamp();
-
- /**
- * Set the timestamp to use for execution.
- *
- *
By default the timestamp generator (see reference config file) will be used for timestamps,
- * unless set explicitly via this method.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- */
- @CheckReturnValue
- SelfT setTimestamp(long timestamp);
-
- /**
- * Sets the configuration profile to use for execution.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- */
- @NonNull
- @CheckReturnValue
- SelfT setExecutionProfile(@Nullable DriverExecutionProfile executionProfile);
-
- /**
- * Sets the name of the driver configuration profile that will be used for execution.
- *
- *
For all the driver's built-in implementations, this method has no effect if {@link
- * #setExecutionProfile} has been called with a non-null argument.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- */
- @NonNull
- @CheckReturnValue
- SelfT setExecutionProfileName(@Nullable String name);
-
- /**
- * Sets the custom payload to use for execution.
- *
- *
This is intended for advanced use cases, such as tools with very advanced knowledge of DSE
- * Graph, and reserved for internal settings like transaction settings. Note that the driver also
- * adds graph-related options to the payload, in addition to the ones provided here; it won't
- * override any option that is already present.
- *
- *
All the driver's built-in statement implementations are immutable, and return a new instance
- * from this method. However custom implementations may choose to be mutable and return the same
- * instance.
- *
- *
Note that it's your responsibility to provide a thread-safe map. This can be achieved with a
- * concurrent or immutable implementation, or by making it effectively immutable (meaning that
- * it's never modified after being set on the statement).
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- */
- @NonNull
- @CheckReturnValue
- SelfT setCustomPayload(@NonNull Map newCustomPayload);
-
- /**
- * The name of the graph to use for this statement.
- *
- *
This is the programmatic equivalent of the configuration option {@code basic.graph.name},
- * and takes precedence over it. That is, if this property is non-null, then the configuration
- * will be ignored.
- */
- @Nullable
- String getGraphName();
-
- /**
- * Sets the graph name.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @see #getGraphName()
- */
- @NonNull
- @CheckReturnValue
- SelfT setGraphName(@Nullable String newGraphName);
-
- /**
- * The name of the traversal source to use for this statement.
- *
- *
This is the programmatic equivalent of the configuration option {@code
- * basic.graph.traversal-source}, and takes precedence over it. That is, if this property is
- * non-null, then the configuration will be ignored.
- */
- @Nullable
- String getTraversalSource();
-
- /**
- * Sets the traversal source.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @see #getTraversalSource()
- */
- @NonNull
- @CheckReturnValue
- SelfT setTraversalSource(@Nullable String newTraversalSource);
-
- /**
- * The DSE graph sub-protocol to use for this statement.
- *
- *
This is the programmatic equivalent of the configuration option {@code
- * advanced.graph.sub-protocol}, and takes precedence over it. That is, if this property is
- * non-null, then the configuration will be ignored.
- */
- @Nullable
- String getSubProtocol();
-
- /**
- * Sets the sub-protocol.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @see #getSubProtocol()
- */
- @NonNull
- @CheckReturnValue
- SelfT setSubProtocol(@Nullable String newSubProtocol);
-
- /**
- * Returns the consistency level to use for the statement.
- *
- *
This is the programmatic equivalent of the configuration option {@code
- * basic.request.consistency}, and takes precedence over it. That is, if this property is
- * non-null, then the configuration will be ignored.
- */
- @Nullable
- ConsistencyLevel getConsistencyLevel();
-
- /**
- * Sets the consistency level to use for this statement.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @param newConsistencyLevel the consistency level to use, or null to use the default value
- * defined in the configuration.
- * @see #getConsistencyLevel()
- */
- @CheckReturnValue
- SelfT setConsistencyLevel(@Nullable ConsistencyLevel newConsistencyLevel);
-
- /**
- * The consistency level to use for the internal read queries that will be produced by this
- * statement.
- *
- *
This is the programmatic equivalent of the configuration option {@code
- * basic.graph.read-consistency-level}, and takes precedence over it. That is, if this property is
- * non-null, then the configuration will be ignored.
- *
- *
If this property isn't set here or in the configuration, the default consistency level will
- * be used ({@link #getConsistencyLevel()} or {@code basic.request.consistency}).
- */
- @Nullable
- ConsistencyLevel getReadConsistencyLevel();
-
- /**
- * Sets the read consistency level.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @see #getReadConsistencyLevel()
- */
- @NonNull
- @CheckReturnValue
- SelfT setReadConsistencyLevel(@Nullable ConsistencyLevel newReadConsistencyLevel);
-
- /**
- * The consistency level to use for the internal write queries that will be produced by this
- * statement.
- *
- *
This is the programmatic equivalent of the configuration option {@code
- * basic.graph.write-consistency-level}, and takes precedence over it. That is, if this property
- * is non-null, then the configuration will be ignored.
- *
- *
If this property isn't set here or in the configuration, the default consistency level will
- * be used ({@link #getConsistencyLevel()} or {@code basic.request.consistency}).
- */
- @Nullable
- ConsistencyLevel getWriteConsistencyLevel();
-
- /**
- * Sets the write consistency level.
- *
- *
All the driver's built-in implementations are immutable, and return a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @see #getWriteConsistencyLevel()
- */
- @NonNull
- @CheckReturnValue
- SelfT setWriteConsistencyLevel(@Nullable ConsistencyLevel newWriteConsistencyLevel);
-
- /** Graph statements do not have a per-query keyspace, this method always returns {@code null}. */
- @Nullable
- @Override
- default CqlIdentifier getKeyspace() {
- return null;
- }
-
- /** Graph statements can't be routed, this method always returns {@code null}. */
- @Nullable
- @Override
- default CqlIdentifier getRoutingKeyspace() {
- return null;
- }
-
- /** Graph statements can't be routed, this method always returns {@code null}. */
- @Nullable
- @Override
- default ByteBuffer getRoutingKey() {
- return null;
- }
-
- /** Graph statements can't be routed, this method always returns {@code null}. */
- @Nullable
- @Override
- default Token getRoutingToken() {
- return null;
- }
-
- /**
- * Whether tracing information should be recorded for this statement.
- *
- *
This method is only exposed for future extensibility. At the time of writing, graph
- * statements do not support tracing, and this always returns {@code false}.
- */
- default boolean isTracing() {
- return false;
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphStatementBuilderBase.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphStatementBuilderBase.java
deleted file mode 100644
index 5cb48613cf5..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/GraphStatementBuilderBase.java
+++ /dev/null
@@ -1,190 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.oss.driver.api.core.ConsistencyLevel;
-import com.datastax.oss.driver.api.core.config.DriverExecutionProfile;
-import com.datastax.oss.driver.api.core.cql.Statement;
-import com.datastax.oss.driver.api.core.metadata.Node;
-import com.datastax.oss.protocol.internal.util.collection.NullAllowingImmutableMap;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.nio.ByteBuffer;
-import java.time.Duration;
-import java.util.Map;
-import net.jcip.annotations.NotThreadSafe;
-
-@NotThreadSafe
-public abstract class GraphStatementBuilderBase<
- SelfT extends GraphStatementBuilderBase,
- StatementT extends GraphStatement> {
-
- @SuppressWarnings({"unchecked"})
- private final SelfT self = (SelfT) this;
-
- protected Boolean isIdempotent;
- protected Duration timeout;
- protected Node node;
- protected long timestamp = Statement.NO_DEFAULT_TIMESTAMP;
- protected DriverExecutionProfile executionProfile;
- protected String executionProfileName;
- private NullAllowingImmutableMap.Builder customPayloadBuilder;
- protected String graphName;
- protected String traversalSource;
- protected String subProtocol;
- protected ConsistencyLevel consistencyLevel;
- protected ConsistencyLevel readConsistencyLevel;
- protected ConsistencyLevel writeConsistencyLevel;
-
- protected GraphStatementBuilderBase() {
- // nothing to do
- }
-
- protected GraphStatementBuilderBase(StatementT template) {
- this.isIdempotent = template.isIdempotent();
- this.timeout = template.getTimeout();
- this.node = template.getNode();
- this.timestamp = template.getTimestamp();
- this.executionProfile = template.getExecutionProfile();
- this.executionProfileName = template.getExecutionProfileName();
- if (!template.getCustomPayload().isEmpty()) {
- this.customPayloadBuilder =
- NullAllowingImmutableMap.builder()
- .putAll(template.getCustomPayload());
- }
- this.graphName = template.getGraphName();
- this.traversalSource = template.getTraversalSource();
- this.subProtocol = template.getSubProtocol();
- this.consistencyLevel = template.getConsistencyLevel();
- this.readConsistencyLevel = template.getReadConsistencyLevel();
- this.writeConsistencyLevel = template.getWriteConsistencyLevel();
- }
-
- /** @see GraphStatement#setIdempotent(Boolean) */
- @NonNull
- public SelfT setIdempotence(@Nullable Boolean idempotent) {
- this.isIdempotent = idempotent;
- return self;
- }
-
- /** @see GraphStatement#setTimeout(Duration) */
- @NonNull
- public SelfT setTimeout(@Nullable Duration timeout) {
- this.timeout = timeout;
- return self;
- }
-
- /** @see GraphStatement#setNode(Node) */
- @NonNull
- public SelfT setNode(@Nullable Node node) {
- this.node = node;
- return self;
- }
-
- /** @see GraphStatement#setTimestamp(long) */
- @NonNull
- public SelfT setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- return self;
- }
-
- /** @see GraphStatement#setExecutionProfileName(String) */
- @NonNull
- public SelfT setExecutionProfileName(@Nullable String executionProfileName) {
- this.executionProfileName = executionProfileName;
- return self;
- }
-
- /** @see GraphStatement#setExecutionProfile(DriverExecutionProfile) */
- @NonNull
- public SelfT setExecutionProfile(@Nullable DriverExecutionProfile executionProfile) {
- this.executionProfile = executionProfile;
- this.executionProfileName = null;
- return self;
- }
-
- /** @see GraphStatement#setCustomPayload(Map) */
- @NonNull
- public SelfT addCustomPayload(@NonNull String key, @Nullable ByteBuffer value) {
- if (customPayloadBuilder == null) {
- customPayloadBuilder = NullAllowingImmutableMap.builder();
- }
- customPayloadBuilder.put(key, value);
- return self;
- }
-
- /** @see GraphStatement#setCustomPayload(Map) */
- @NonNull
- public SelfT clearCustomPayload() {
- customPayloadBuilder = null;
- return self;
- }
-
- /** @see GraphStatement#setGraphName(String) */
- @NonNull
- public SelfT setGraphName(@Nullable String graphName) {
- this.graphName = graphName;
- return self;
- }
-
- /** @see GraphStatement#setTraversalSource(String) */
- @NonNull
- public SelfT setTraversalSource(@Nullable String traversalSource) {
- this.traversalSource = traversalSource;
- return self;
- }
-
- /** @see GraphStatement#setSubProtocol(String) */
- @NonNull
- public SelfT setSubProtocol(@Nullable String subProtocol) {
- this.subProtocol = subProtocol;
- return self;
- }
-
- /** @see GraphStatement#setConsistencyLevel(ConsistencyLevel) */
- @NonNull
- public SelfT setConsistencyLevel(@Nullable ConsistencyLevel consistencyLevel) {
- this.consistencyLevel = consistencyLevel;
- return self;
- }
-
- /** @see GraphStatement#setReadConsistencyLevel(ConsistencyLevel) */
- @NonNull
- public SelfT setReadConsistencyLevel(@Nullable ConsistencyLevel readConsistencyLevel) {
- this.readConsistencyLevel = readConsistencyLevel;
- return self;
- }
-
- /** @see GraphStatement#setWriteConsistencyLevel(ConsistencyLevel) */
- @NonNull
- public SelfT setWriteConsistencyLevel(@Nullable ConsistencyLevel writeConsistencyLevel) {
- this.writeConsistencyLevel = writeConsistencyLevel;
- return self;
- }
-
- @NonNull
- protected Map buildCustomPayload() {
- return (customPayloadBuilder == null)
- ? NullAllowingImmutableMap.of()
- : customPayloadBuilder.build();
- }
-
- /** Create the statement with the configuration defined by this builder object. */
- @NonNull
- public abstract StatementT build();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/PagingEnabledOptions.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/PagingEnabledOptions.java
deleted file mode 100644
index f59d0e50e93..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/PagingEnabledOptions.java
+++ /dev/null
@@ -1,24 +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 com.datastax.dse.driver.api.core.graph;
-
-public enum PagingEnabledOptions {
- ENABLED,
- DISABLED,
- AUTO
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/ScriptGraphStatement.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/ScriptGraphStatement.java
deleted file mode 100644
index 2ad7aafc232..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/ScriptGraphStatement.java
+++ /dev/null
@@ -1,171 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.DefaultScriptGraphStatement;
-import com.datastax.oss.driver.api.core.cql.Statement;
-import com.datastax.oss.protocol.internal.util.collection.NullAllowingImmutableMap;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * A graph statement that uses a Gremlin-groovy script the query.
- *
- *
These statements are generally used for DSE Graph set-up queries, such as creating or dropping
- * a graph, or defining a graph schema. For graph traversals, we recommend using {@link
- * FluentGraphStatement} instead. To do bulk data ingestion in graph, we recommend using {@link
- * BatchGraphStatement} instead.
- *
- *
- */
-public interface ScriptGraphStatement extends GraphStatement {
-
- /** Create a new instance from the given script. */
- @NonNull
- static ScriptGraphStatement newInstance(@NonNull String script) {
- return new DefaultScriptGraphStatement(
- script,
- NullAllowingImmutableMap.of(),
- null,
- null,
- null,
- null,
- Statement.NO_DEFAULT_TIMESTAMP,
- null,
- null,
- Collections.emptyMap(),
- null,
- null,
- null,
- null,
- null,
- null);
- }
-
- /**
- * Create a builder object to start creating a new instance from the given script.
- *
- *
Note that this builder is mutable and not thread-safe.
- */
- @NonNull
- static ScriptGraphStatementBuilder builder(@NonNull String script) {
- return new ScriptGraphStatementBuilder(script);
- }
-
- /**
- * Create a builder helper object to start creating a new instance with an existing statement as a
- * template. The script and options set on the template will be copied for the new statement at
- * the moment this method is called.
- *
- *
Note that this builder is mutable and not thread-safe.
- */
- @NonNull
- static ScriptGraphStatementBuilder builder(@NonNull ScriptGraphStatement template) {
- return new ScriptGraphStatementBuilder(template);
- }
-
- /** The Gremlin-groovy script representing the graph query. */
- @NonNull
- String getScript();
-
- /**
- * Whether the statement is a system query, or {@code null} if it defaults to the value defined in
- * the configuration.
- *
- * @see #setSystemQuery(Boolean)
- */
- @Nullable
- Boolean isSystemQuery();
-
- /**
- * Defines if this statement is a system query.
- *
- *
Script statements that access the {@code system} variable must not specify a graph
- * name (otherwise {@code system} is not available). However, if your application executes a lot
- * of non-system statements, it is convenient to configure the graph name in your configuration to
- * avoid repeating it every time. This method allows you to ignore that global graph name for a
- * specific statement.
- *
- *
This property is the programmatic equivalent of the configuration option {@code
- * basic.graph.is-system-query}, and takes precedence over it. That is, if this property is
- * non-null, then the configuration will be ignored.
- *
- *
The driver's built-in implementation is immutable, and returns a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- *
- * @param newValue {@code true} to mark this statement as a system query (the driver will ignore
- * any graph name set on the statement or the configuration); {@code false} to mark it as a
- * non-system query; {@code null} to default to the value defined in the configuration.
- * @see #isSystemQuery()
- */
- @NonNull
- ScriptGraphStatement setSystemQuery(@Nullable Boolean newValue);
-
- /**
- * The query parameters to send along the request.
- *
- * @see #setQueryParam(String, Object)
- */
- @NonNull
- Map getQueryParams();
-
- /**
- * Set a value for a parameter defined in the Groovy script.
- *
- *
The script engine in the DSE Graph server allows to define parameters in a Groovy script and
- * set the values of these parameters as a binding. Defining parameters allows to re-use scripts
- * and only change their parameters values, which improves the performance of the script executed,
- * so defining parameters is encouraged; however, for optimal Graph traversal performance, we
- * recommend either using {@link BatchGraphStatement}s for data ingestion, or {@link
- * FluentGraphStatement} for normal traversals.
- *
- *
Parameters in a Groovy script are always named; unlike CQL, they are not prefixed by a
- * column ({@code :}).
- *
- *
The driver's built-in implementation is immutable, and returns a new instance from this
- * method. However custom implementations may choose to be mutable and return the same instance.
- * If many parameters are to be set in a query, it is recommended to create the statement with
- * {@link #builder(String)} instead.
- *
- * @param name the name of the parameter defined in the script. If the statement already had a
- * binding for this name, it gets replaced.
- * @param value the value that will be transmitted with the request.
- */
- @NonNull
- ScriptGraphStatement setQueryParam(@NonNull String name, @Nullable Object value);
-
- /**
- * Removes a binding for the given name from this statement.
- *
- *
If the statement did not have such a binding, this method has no effect and returns the same
- * statement instance. Otherwise, the driver's built-in implementation returns a new instance
- * (however custom implementations may choose to be mutable and return the same instance).
- *
- * @see #setQueryParam(String, Object)
- */
- @NonNull
- ScriptGraphStatement removeQueryParam(@NonNull String name);
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/ScriptGraphStatementBuilder.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/ScriptGraphStatementBuilder.java
deleted file mode 100644
index 1985c58955f..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/ScriptGraphStatementBuilder.java
+++ /dev/null
@@ -1,136 +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 com.datastax.dse.driver.api.core.graph;
-
-import com.datastax.dse.driver.internal.core.graph.DefaultScriptGraphStatement;
-import com.datastax.oss.driver.shaded.guava.common.base.Preconditions;
-import com.datastax.oss.driver.shaded.guava.common.collect.Maps;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.util.Map;
-import net.jcip.annotations.NotThreadSafe;
-
-/**
- * A builder to create a script graph statement.
- *
- *
This class is mutable and not thread-safe.
- */
-@NotThreadSafe
-public class ScriptGraphStatementBuilder
- extends GraphStatementBuilderBase {
-
- private String script;
- private Boolean isSystemQuery;
- private final Map queryParams;
-
- public ScriptGraphStatementBuilder() {
- this.queryParams = Maps.newHashMap();
- }
-
- public ScriptGraphStatementBuilder(String script) {
- this.script = script;
- this.queryParams = Maps.newHashMap();
- }
-
- public ScriptGraphStatementBuilder(ScriptGraphStatement template) {
- super(template);
- this.script = template.getScript();
- this.queryParams = Maps.newHashMap(template.getQueryParams());
- this.isSystemQuery = template.isSystemQuery();
- }
-
- @NonNull
- public ScriptGraphStatementBuilder setScript(@NonNull String script) {
- this.script = script;
- return this;
- }
-
- /** @see ScriptGraphStatement#isSystemQuery() */
- @NonNull
- public ScriptGraphStatementBuilder setSystemQuery(@Nullable Boolean isSystemQuery) {
- this.isSystemQuery = isSystemQuery;
- return this;
- }
-
- /**
- * Set a value for a parameter defined in the script query.
- *
- * @see ScriptGraphStatement#setQueryParam(String, Object)
- */
- @NonNull
- public ScriptGraphStatementBuilder setQueryParam(@NonNull String name, @Nullable Object value) {
- this.queryParams.put(name, value);
- return this;
- }
-
- /**
- * Set multiple values for named parameters defined in the script query.
- *
- * @see ScriptGraphStatement#setQueryParam(String, Object)
- */
- @NonNull
- public ScriptGraphStatementBuilder setQueryParams(@NonNull Map params) {
- this.queryParams.putAll(params);
- return this;
- }
-
- /**
- * Removes a parameter.
- *
- *
This is useful if the builder was {@linkplain
- * ScriptGraphStatement#builder(ScriptGraphStatement) initialized with a template statement} that
- * has more parameters than desired.
- *
- * @see ScriptGraphStatement#setQueryParam(String, Object)
- * @see #clearQueryParams()
- */
- @NonNull
- public ScriptGraphStatementBuilder removeQueryParam(@NonNull String name) {
- this.queryParams.remove(name);
- return this;
- }
-
- /** Clears all the parameters previously added to this builder. */
- public ScriptGraphStatementBuilder clearQueryParams() {
- this.queryParams.clear();
- return this;
- }
-
- @NonNull
- @Override
- public ScriptGraphStatement build() {
- Preconditions.checkNotNull(this.script, "Script hasn't been defined in this builder.");
- return new DefaultScriptGraphStatement(
- this.script,
- this.queryParams,
- this.isSystemQuery,
- isIdempotent,
- timeout,
- node,
- timestamp,
- executionProfile,
- executionProfileName,
- buildCustomPayload(),
- graphName,
- traversalSource,
- subProtocol,
- consistencyLevel,
- readConsistencyLevel,
- writeConsistencyLevel);
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/predicates/CqlCollection.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/predicates/CqlCollection.java
deleted file mode 100644
index fdbf3fbe397..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/predicates/CqlCollection.java
+++ /dev/null
@@ -1,81 +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 com.datastax.dse.driver.api.core.graph.predicates;
-
-import com.datastax.dse.driver.internal.core.graph.CqlCollectionPredicate;
-import java.util.Collection;
-import java.util.Map;
-import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.javatuples.Pair;
-
-/**
- * Predicates that can be used on CQL collections (lists, sets and maps).
- *
- *
Note: CQL collection predicates are only available when using the binary subprotocol.
- */
-public class CqlCollection {
-
- /**
- * Checks if the target collection contains the given value.
- *
- * @param value the value to look for; cannot be {@code null}.
- * @return a predicate to apply in a {@link
- * org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal}.
- */
- @SuppressWarnings("unchecked")
- public static , V> P contains(V value) {
- return new P(CqlCollectionPredicate.contains, value);
- }
-
- /**
- * Checks if the target map contains the given key.
- *
- * @param key the key to look for; cannot be {@code null}.
- * @return a predicate to apply in a {@link
- * org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal}.
- */
- @SuppressWarnings("unchecked")
- public static , K> P containsKey(K key) {
- return new P(CqlCollectionPredicate.containsKey, key);
- }
-
- /**
- * Checks if the target map contains the given value.
- *
- * @param value the value to look for; cannot be {@code null}.
- * @return a predicate to apply in a {@link
- * org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal}.
- */
- @SuppressWarnings("unchecked")
- public static , V> P containsValue(V value) {
- return new P(CqlCollectionPredicate.containsValue, value);
- }
-
- /**
- * Checks if the target map contains the given entry.
- *
- * @param key the key to look for; cannot be {@code null}.
- * @param value the value to look for; cannot be {@code null}.
- * @return a predicate to apply in a {@link
- * org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal}.
- */
- @SuppressWarnings("unchecked")
- public static , K, V> P entryEq(K key, V value) {
- return new P(CqlCollectionPredicate.entryEq, new Pair<>(key, value));
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/graph/predicates/Geo.java b/core/src/main/java/com/datastax/dse/driver/api/core/graph/predicates/Geo.java
deleted file mode 100644
index 65dd84d0076..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/graph/predicates/Geo.java
+++ /dev/null
@@ -1,160 +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 com.datastax.dse.driver.api.core.graph.predicates;
-
-import com.datastax.dse.driver.api.core.data.geometry.LineString;
-import com.datastax.dse.driver.api.core.data.geometry.Point;
-import com.datastax.dse.driver.api.core.data.geometry.Polygon;
-import com.datastax.dse.driver.internal.core.data.geometry.Distance;
-import com.datastax.dse.driver.internal.core.graph.GeoPredicate;
-import com.datastax.dse.driver.internal.core.graph.GeoUtils;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import org.apache.tinkerpop.gremlin.process.traversal.P;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
-
-public interface Geo {
-
- enum Unit {
- MILES(GeoUtils.MILES_TO_KM * GeoUtils.KM_TO_DEG),
- KILOMETERS(GeoUtils.KM_TO_DEG),
- METERS(GeoUtils.KM_TO_DEG / 1000.0),
- DEGREES(1);
-
- private final double multiplier;
-
- Unit(double multiplier) {
- this.multiplier = multiplier;
- }
-
- /** Convert distance to degrees (used internally only). */
- public double toDegrees(double distance) {
- return distance * multiplier;
- }
- }
-
- /**
- * Finds whether an entity is inside the given circular area using a geo coordinate system.
- *
- * @return a predicate to apply in a {@link GraphTraversal}.
- */
- static P