Legacy DSE versions did not have a specific version, but instead reused a Cassandra protocol - * version: DSE 5.0 is supported via {@link DefaultProtocolVersion#V4}, and DSE 4.7 and 4.8 via - * {@link DefaultProtocolVersion#V3}. - * - *
DSE 4.6 and earlier are not supported by this version of the driver, use the 1.x series. - */ -public enum DseProtocolVersion implements ProtocolVersion { - - /** Version 1, supported by DSE 5.1.0 and above. */ - DSE_V1(DseProtocolConstants.Version.DSE_V1, false), - - /** Version 2, supported by DSE 6 and above. */ - DSE_V2(DseProtocolConstants.Version.DSE_V2, false), - ; - - private final int code; - private final boolean beta; - - DseProtocolVersion(int code, boolean beta) { - this.code = code; - this.beta = beta; - } - - @Override - public int getCode() { - return code; - } - - @Override - public boolean isBeta() { - return beta; - } - - @Override - public boolean supportsShardingInfo() { - return false; - } -} diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/DseSession.java b/core/src/main/java/com/datastax/dse/driver/api/core/DseSession.java deleted file mode 100644 index 8251aaf767c..00000000000 --- a/core/src/main/java/com/datastax/dse/driver/api/core/DseSession.java +++ /dev/null @@ -1,47 +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; - -import com.datastax.oss.driver.api.core.CqlSession; -import com.datastax.oss.driver.api.core.MavenCoordinates; -import edu.umd.cs.findbugs.annotations.NonNull; - -/** - * @deprecated All DSE functionality is now available directly on {@link CqlSession}. This type is - * preserved for backward compatibility, but you should now use {@link CqlSession} instead. - */ -@Deprecated -public interface DseSession extends CqlSession { - - /** - * @deprecated the DSE driver is no longer published as a separate artifact. This field is - * preserved for backward compatibility, but it returns the same value as {@link - * CqlSession#OSS_DRIVER_COORDINATES}. - */ - @Deprecated @NonNull MavenCoordinates DSE_DRIVER_COORDINATES = CqlSession.OSS_DRIVER_COORDINATES; - - /** - * Returns a builder to create a new instance. - * - *
Note that this builder is mutable and not thread-safe.
- */
- @NonNull
- static DseSessionBuilder builder() {
- return new DseSessionBuilder();
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/DseSessionBuilder.java b/core/src/main/java/com/datastax/dse/driver/api/core/DseSessionBuilder.java
deleted file mode 100644
index 01e5f9f9125..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/DseSessionBuilder.java
+++ /dev/null
@@ -1,39 +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;
-
-import com.datastax.oss.driver.api.core.CqlSession;
-import com.datastax.oss.driver.api.core.session.SessionBuilder;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import net.jcip.annotations.NotThreadSafe;
-
-/**
- * @deprecated DSE functionality is now exposed directly on {@link CqlSession}. This class is
- * preserved for backward compatibility, but {@link CqlSession#builder()} should be used
- * instead.
- */
-@NotThreadSafe
-@Deprecated
-public class DseSessionBuilder extends SessionBuilder This should be one of:
- *
- * This should be one of:
- *
- * Use {@link #builder()} to create an instance.
- */
- @Immutable
- public static class GssApiOptions {
-
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
- private final Configuration loginConfiguration;
- private final Subject subject;
- private final String saslProtocol;
- private final String authorizationId;
- private final Map You MUST call either a withLoginConfiguration method or {@link #withSubject(Subject)};
- * if both are called, the subject takes precedence, and the login configuration will be
- * ignored.
- *
- * @see #withLoginConfiguration(Map)
- */
- @NonNull
- public Builder withLoginConfiguration(@Nullable Configuration loginConfiguration) {
- this.loginConfiguration = loginConfiguration;
- return this;
- }
- /**
- * Sets a login configuration that will be used to create a {@link LoginContext}.
- *
- * This is an alternative to {@link #withLoginConfiguration(Configuration)}, that builds
- * the configuration from {@code Krb5LoginModule} with the given options.
- *
- * You MUST call either a withLoginConfiguration method or {@link #withSubject(Subject)};
- * if both are called, the subject takes precedence, and the login configuration will be
- * ignored.
- */
- @NonNull
- public Builder withLoginConfiguration(@Nullable Map You MUST call either this method or {@link #withLoginConfiguration(Configuration)}; if
- * both are called, the subject takes precedence, and the login configuration will be ignored.
- */
- @NonNull
- public Builder withSubject(@Nullable Subject subject) {
- this.subject = subject;
- return this;
- }
-
- /**
- * Sets the SASL protocol name to use; should match the username of the Kerberos service
- * principal used by the DSE server.
- */
- @NonNull
- public Builder withSaslProtocol(@Nullable String saslProtocol) {
- this.saslProtocol = saslProtocol;
- return this;
- }
-
- /** Sets the authorization ID (allows proxy authentication). */
- @NonNull
- public Builder withAuthorizationId(@Nullable String authorizationId) {
- this.authorizationId = authorizationId;
- return this;
- }
-
- /**
- * Add a SASL property to use when creating the SASL client.
- *
- * Note that this builder pre-initializes these two default properties:
- *
- * To use this provider the corresponding GssApiOptions must be passed into the provider
- * directly, for example:
- *
- * See the following documents for further details:
- *
- * Important: the SASL protocol name should match the username of the Kerberos
- * service principal used by the DSE server. This information is specified in the dse.yaml file by
- * the {@code service_principal} option under the kerberos_options
- * section, and may vary from one DSE installation to another – especially if you installed
- * DSE with an automated package installer.
- *
- * For example, if your dse.yaml file contains the following:
- *
- * Should you need to change the SASL protocol name specify it in the GssApiOptions, use the
- * method below:
- *
- * Should internal sasl properties need to be set such as qop. This can also be accomplished by
- * setting it in the GssApiOptions:
- *
- * This allows executing a statement as another role than the one the session is currently
- * authenticated as.
- *
- * @param userOrRole the role to use for execution. If the statement was already configured with
- * another role, it will get replaced by this one.
- * @param statement the statement to modify.
- * @return a statement that will run the same CQL query as {@code statement}, but acting as the
- * provided role. Note: with the driver's default implementations, this will always be a copy;
- * but if you use a custom implementation, it might return the same instance (depending on the
- * behavior of {@link Statement#setCustomPayload(Map) statement.setCustomPayload()}).
- * @see Setting
- * up roles for applications (DSE 6.0 admin guide)
- */
- @NonNull
- public static Value type: {@link String}
- */
- APPLICATION_NAME("basic.application.name"),
- /**
- * The version of the application using the session.
- *
- * Value type: {@link String}
- */
- APPLICATION_VERSION("basic.application.version"),
-
- /**
- * Proxy authentication for GSSAPI authentication: allows to login as another user or role.
- *
- * Value type: {@link String}
- */
- AUTH_PROVIDER_AUTHORIZATION_ID("advanced.auth-provider.authorization-id"),
- /**
- * Service name for GSSAPI authentication.
- *
- * Value type: {@link String}
- */
- AUTH_PROVIDER_SERVICE("advanced.auth-provider.service"),
- /**
- * Login configuration for GSSAPI authentication.
- *
- * Value type: {@link java.util.Map Map}<{@link String},{@link String}>
- */
- AUTH_PROVIDER_LOGIN_CONFIGURATION("advanced.auth-provider.login-configuration"),
- /**
- * Internal SASL properties, if any, such as QOP, for GSSAPI authentication.
- *
- * Value type: {@link java.util.Map Map}<{@link String},{@link String}>
- */
- AUTH_PROVIDER_SASL_PROPERTIES("advanced.auth-provider.sasl-properties"),
-
- /**
- * The page size for continuous paging.
- *
- * Value type: int
- */
- CONTINUOUS_PAGING_PAGE_SIZE("advanced.continuous-paging.page-size"),
- /**
- * Whether {@link #CONTINUOUS_PAGING_PAGE_SIZE} should be interpreted in number of rows or bytes.
- *
- * Value type: boolean
- */
- CONTINUOUS_PAGING_PAGE_SIZE_BYTES("advanced.continuous-paging.page-size-in-bytes"),
- /**
- * The maximum number of continuous pages to return.
- *
- * Value type: int
- */
- CONTINUOUS_PAGING_MAX_PAGES("advanced.continuous-paging.max-pages"),
- /**
- * The maximum number of continuous pages per second.
- *
- * Value type: int
- */
- CONTINUOUS_PAGING_MAX_PAGES_PER_SECOND("advanced.continuous-paging.max-pages-per-second"),
- /**
- * The maximum number of continuous pages that can be stored in the local queue.
- *
- * Value type: int
- */
- CONTINUOUS_PAGING_MAX_ENQUEUED_PAGES("advanced.continuous-paging.max-enqueued-pages"),
- /**
- * How long to wait for the coordinator to send the first continuous page.
- *
- * Value-type: {@link java.time.Duration Duration}
- */
- CONTINUOUS_PAGING_TIMEOUT_FIRST_PAGE("advanced.continuous-paging.timeout.first-page"),
- /**
- * How long to wait for the coordinator to send subsequent continuous pages.
- *
- * Value-type: {@link java.time.Duration Duration}
- */
- CONTINUOUS_PAGING_TIMEOUT_OTHER_PAGES("advanced.continuous-paging.timeout.other-pages"),
-
- /**
- * The largest latency that we expect to record for continuous requests.
- *
- * Value-type: {@link java.time.Duration Duration}
- */
- CONTINUOUS_PAGING_METRICS_SESSION_CQL_REQUESTS_HIGHEST(
- "advanced.metrics.session.continuous-cql-requests.highest-latency"),
- /**
- * The number of significant decimal digits to which internal structures will maintain for
- * continuous requests.
- *
- * Value-type: int
- */
- CONTINUOUS_PAGING_METRICS_SESSION_CQL_REQUESTS_DIGITS(
- "advanced.metrics.session.continuous-cql-requests.significant-digits"),
- /**
- * The interval at which percentile data is refreshed for continuous requests.
- *
- * Value-type: {@link java.time.Duration Duration}
- */
- 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.
- *
- * Value type: boolean
- */
- 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.
- *
- * Value-type: {@link java.time.Duration Duration}
- */
- CONTINUOUS_PAGING_METRICS_SESSION_CQL_REQUESTS_LOWEST(
- "advanced.metrics.session.continuous-cql-requests.lowest-latency"),
- /**
- * Optional service-level objectives to meet, as a list of latencies to track.
- *
- * Value-type: {@link java.time.Duration Duration}
- */
- 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
- * 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}>
- */
- CONTINUOUS_PAGING_METRICS_SESSION_CQL_REQUESTS_PUBLISH_PERCENTILES(
- "advanced.metrics.session.continuous-cql-requests.publish-percentiles"),
- ;
-
- private final String path;
-
- DseDriverOption(String path) {
- this.path = path;
- }
-
- @NonNull
- @Override
- public String getPath() {
- return path;
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/cql/continuous/ContinuousAsyncResultSet.java b/core/src/main/java/com/datastax/dse/driver/api/core/cql/continuous/ContinuousAsyncResultSet.java
deleted file mode 100644
index a9491ec2414..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/cql/continuous/ContinuousAsyncResultSet.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.cql.continuous;
-
-import com.datastax.oss.driver.api.core.AsyncPagingIterable;
-import com.datastax.oss.driver.api.core.cql.ExecutionInfo;
-import com.datastax.oss.driver.api.core.cql.Row;
-import com.datastax.oss.driver.api.core.cql.Statement;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.nio.ByteBuffer;
-import java.util.concurrent.CancellationException;
-
-/**
- * The result of an {@linkplain ContinuousSession#executeContinuouslyAsync(Statement) asynchronous
- * continuous paging query}.
- *
- * DSE replies to a continuous query with a stream of response frames. There is one instance of
- * this class for each frame.
- */
-public interface ContinuousAsyncResultSet
- extends AsyncPagingIterable There might still be rows available in the {@linkplain #currentPage() current page} after
- * the cancellation; these rows can be retrieved normally.
- *
- * Also, there might be more pages available in the driver's local page cache after the
- * cancellation; these extra pages will be discarded.
- *
- * Therefore, if you plan to resume the iteration later, the correct procedure is as follows:
- *
- * Note: because the driver does not support query traces for continuous queries, {@link
- * ExecutionInfo#getTracingId()} will always be {@code null}.
- */
- @NonNull
- @Override
- ExecutionInfo getExecutionInfo();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/cql/continuous/ContinuousResultSet.java b/core/src/main/java/com/datastax/dse/driver/api/core/cql/continuous/ContinuousResultSet.java
deleted file mode 100644
index a333801a59a..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/cql/continuous/ContinuousResultSet.java
+++ /dev/null
@@ -1,80 +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.cql.continuous;
-
-import com.datastax.oss.driver.api.core.cql.ExecutionInfo;
-import com.datastax.oss.driver.api.core.cql.ResultSet;
-import com.datastax.oss.driver.api.core.cql.Statement;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.nio.ByteBuffer;
-import java.util.List;
-
-/**
- * The result of a {@linkplain ContinuousSession#executeContinuously(Statement) synchronous
- * continuous paging query}.
- *
- * It uses {@linkplain ContinuousAsyncResultSet asynchronous calls} internally, but blocks on the
- * results in order to provide a synchronous API to its clients. If the query is paged, only the
- * first page will be fetched initially, and iteration will trigger background fetches of the next
- * pages when necessary.
- *
- * Note that this object can only be iterated once: rows are "consumed" as they are read,
- * subsequent calls to {@code iterator()} will return the same iterator instance.
- *
- * Implementations of this type are not thread-safe. They can only be iterated by the
- * thread that invoked {@code session.executeContinuously}.
- */
-public interface ContinuousResultSet extends ResultSet {
-
- /**
- * Cancels the continuous query.
- *
- * There might still be rows available in the current page after the cancellation; the
- * iteration will only stop when such rows are fully iterated upon.
- *
- * Also, there might be more pages available in the driver's local page cache after the
- * cancellation; these extra pages will be discarded.
- *
- * Therefore, if you plan to resume the iteration later, the correct procedure is as follows:
- *
- * Note: because the driver does not support query traces for continuous queries, {@link
- * ExecutionInfo#getTracingId()} will always be {@code null}.
- */
- @NonNull
- @Override
- default ExecutionInfo getExecutionInfo() {
- List Continuous paging is a new method of streaming bulk amounts of records from DataStax
- * Enterprise (DSE) to the Java Driver, available since DSE 5.1. It is mainly intended to be
- * leveraged by DSE
- * Analytics and Apache Spark™, or by any similar analytics tool that needs to read large
- * portions of a table in one single operation, as quick and reliably as possible.
- *
- * Continuous paging provides the best performance improvement against regular paging when the
- * following conditions are met:
- *
- * If the above conditions are met, the coordinator will be able to optimize the read path and
- * serve results from local data, thus significantly improving response times; if however these
- * conditions cannot be met, continuous paging would still work, but response times wouldn't be
- * significantly better than those of regular paging anymore.
- *
- * @see Continuous
- * paging options in cassandra.yaml configuration file
- * @see DSE
- * Continuous Paging Tuning and Support Guide
- */
-public interface ContinuousSession extends Session {
-
- /**
- * Executes the provided query with continuous paging synchronously.
- *
- * This method takes care of chaining the successive results into a convenient iterable,
- * provided that you always access the result from the same thread. For more flexibility, consider
- * using the {@linkplain #executeContinuouslyAsync(Statement) asynchronous variant} of this method
- * instead.
- *
- * See {@link ContinuousSession} for more explanations about continuous paging.
- *
- * This feature is only available with DataStax Enterprise. Executing continuous queries
- * against an Apache Cassandra© cluster will result in a runtime error.
- *
- * @param statement the query to execute.
- * @return a synchronous iterable on the results.
- */
- @NonNull
- default ContinuousResultSet executeContinuously(@NonNull Statement> statement) {
- return Objects.requireNonNull(
- execute(statement, ContinuousCqlRequestSyncProcessor.CONTINUOUS_RESULT_SYNC));
- }
-
- /**
- * Executes the provided query with continuous paging asynchronously.
- *
- * The server will push all requested pages asynchronously, according to the options defined in
- * the current execution profile. The client should consume all pages as quickly as possible, to
- * avoid blocking the server for too long. The server will adjust the rate according to the client
- * speed, but it will give up if the client does not consume any pages in a period of time equal
- * to the read request timeout.
- *
- * See {@link ContinuousSession} for more explanations about continuous paging.
- *
- * This feature is only available with DataStax Enterprise. Executing continuous queries
- * against an Apache Cassandra© cluster will result in a runtime error.
- *
- * @param statement the query to execute.
- * @return a future to the first asynchronous result.
- */
- @NonNull
- default CompletionStage Methods in this interface all return {@link ContinuousReactiveResultSet} instances. All
- * publishers support multiple subscriptions in a unicast fashion: each subscriber triggers an
- * independent request execution and gets its own copy of the results.
- *
- * Also, note that the publishers may emit items to their subscribers on an internal driver IO
- * thread. Subscriber implementors are encouraged to abide by Reactive Streams
- * Specification rule 2.2 and avoid performing heavy computations or blocking calls inside
- * {@link org.reactivestreams.Subscriber#onNext(Object) onNext} calls, as doing so could slow down
- * the driver and impact performance. Instead, they should asynchronously dispatch received signals
- * to their processing logic.
- *
- * @see ReactiveRow
- */
-public interface ContinuousReactiveSession extends Session {
-
- /**
- * Returns a {@link Publisher} that, once subscribed to, executes the given query continuously and
- * emits all the results.
- *
- * See {@link ContinuousSession} for more explanations about continuous paging.
- *
- * This feature is only available with DataStax Enterprise. Executing continuous queries
- * against an Apache Cassandra® cluster will result in a runtime error.
- *
- * @param query the query to execute.
- * @return The {@link Publisher} that will publish the returned results.
- */
- @NonNull
- default ContinuousReactiveResultSet executeContinuouslyReactive(@NonNull String query) {
- return executeContinuouslyReactive(SimpleStatement.newInstance(query));
- }
-
- /**
- * Returns a {@link Publisher} that, once subscribed to, executes the given query continuously and
- * emits all the results.
- *
- * See {@link ContinuousSession} for more explanations about continuous paging.
- *
- * This feature is only available with DataStax Enterprise. Executing continuous queries
- * against an Apache Cassandra® cluster will result in a runtime error.
- *
- * @param statement the statement to execute.
- * @return The {@link Publisher} that will publish the returned results.
- */
- @NonNull
- default ContinuousReactiveResultSet executeContinuouslyReactive(@NonNull Statement> statement) {
- return Objects.requireNonNull(
- execute(statement, ContinuousCqlRequestReactiveProcessor.CONTINUOUS_REACTIVE_RESULT_SET));
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/Geometry.java b/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/Geometry.java
deleted file mode 100644
index 66a5708832e..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/Geometry.java
+++ /dev/null
@@ -1,65 +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.data.geometry;
-
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.nio.ByteBuffer;
-
-/**
- * The driver-side representation for a DSE geospatial type.
- *
- * Note that, due to DSE implementation details, the resulting byte buffer always uses
- * little-endian order, regardless of the platform's native order.
- */
- @NonNull
- ByteBuffer asWellKnownBinary();
-
- /** Returns a JSON representation of this geospatial type. */
- @NonNull
- String asGeoJson();
-
- /**
- * Tests whether this geospatial type instance contains another instance.
- *
- * @param other the other instance.
- * @return whether {@code this} contains {@code other}.
- */
- boolean contains(@NonNull Geometry other);
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/LineString.java b/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/LineString.java
deleted file mode 100644
index 7f77b3202a2..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/LineString.java
+++ /dev/null
@@ -1,91 +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.data.geometry;
-
-import com.datastax.dse.driver.internal.core.data.geometry.DefaultGeometry;
-import com.datastax.dse.driver.internal.core.data.geometry.DefaultLineString;
-import com.esri.core.geometry.ogc.OGCLineString;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.nio.ByteBuffer;
-import java.util.List;
-
-/**
- * The driver-side representation for DSE's {@code LineString}.
- *
- * This is a curve in a two-dimensional XY-plane, represented by a set of points (with linear
- * interpolation between them).
- *
- * The default implementation returned by the driver is immutable.
- */
-public interface LineString extends Geometry {
- /**
- * Creates a line string from its Well-known Text (WKT) representation.
- *
- * @param source the Well-known Text representation to parse.
- * @return the line string represented by the WKT.
- * @throws IllegalArgumentException if the string does not contain a valid Well-known Text
- * representation.
- */
- @NonNull
- static LineString fromWellKnownText(@NonNull String source) {
- return new DefaultLineString(DefaultGeometry.fromOgcWellKnownText(source, OGCLineString.class));
- }
-
- /**
- * Creates a line string from its Well-known Binary
- * (WKB) representation.
- *
- * @param source the Well-known Binary representation to parse.
- * @return the line string represented by the WKB.
- * @throws IllegalArgumentException if the provided {@link ByteBuffer} does not contain a valid
- * Well-known Binary representation.
- */
- @NonNull
- static LineString fromWellKnownBinary(@NonNull ByteBuffer source) {
- return new DefaultLineString(
- DefaultGeometry.fromOgcWellKnownBinary(source, OGCLineString.class));
- }
-
- /**
- * Creates a line string from a GeoJSON
- * LineString representation.
- *
- * @param source the GeoJSON
- * LineString representation to parse.
- * @return the line string represented by the GeoJSON LineString.
- * @throws IllegalArgumentException if the string does not contain a valid GeoJSON LineString
- * representation.
- */
- @NonNull
- static LineString fromGeoJson(@NonNull String source) {
- return new DefaultLineString(DefaultGeometry.fromOgcGeoJson(source, OGCLineString.class));
- }
-
- /** Creates a line string from two or more points. */
- @NonNull
- static LineString fromPoints(@NonNull Point p1, @NonNull Point p2, @NonNull Point... pn) {
- return new DefaultLineString(p1, p2, pn);
- }
-
- @NonNull
- List This is a zero-dimensional object that represents a specific (X,Y) location in a
- * two-dimensional XY-plane. In case of Geographic Coordinate Systems, the X coordinate is the
- * longitude and the Y is the latitude.
- *
- * The default implementation returned by the driver is immutable.
- */
-public interface Point extends Geometry {
-
- /**
- * Creates a point from its Well-known
- * Text (WKT) representation.
- *
- * @param source the Well-known Text representation to parse.
- * @return the point represented by the WKT.
- * @throws IllegalArgumentException if the string does not contain a valid Well-known Text
- * representation.
- */
- @NonNull
- static Point fromWellKnownText(@NonNull String source) {
- return new DefaultPoint(DefaultGeometry.fromOgcWellKnownText(source, OGCPoint.class));
- }
-
- /**
- * Creates a point from its Well-known Binary
- * (WKB) representation.
- *
- * @param source the Well-known Binary representation to parse.
- * @return the point represented by the WKB.
- * @throws IllegalArgumentException if the provided {@link ByteBuffer} does not contain a valid
- * Well-known Binary representation.
- */
- @NonNull
- static Point fromWellKnownBinary(@NonNull ByteBuffer source) {
- return new DefaultPoint(DefaultGeometry.fromOgcWellKnownBinary(source, OGCPoint.class));
- }
-
- /**
- * Creates a point from a GeoJSON
- * Point representation.
- *
- * @param source the GeoJSON Point
- * representation to parse.
- * @return the point represented by the GeoJSON Point.
- * @throws IllegalArgumentException if the string does not contain a valid GeoJSON Point representation.
- */
- @NonNull
- static Point fromGeoJson(@NonNull String source) {
- return new DefaultPoint(DefaultGeometry.fromOgcGeoJson(source, OGCPoint.class));
- }
-
- /**
- * Creates a new point.
- *
- * @param x The X coordinate of this point (or its longitude in Geographic Coordinate Systems).
- * @param y The Y coordinate of this point (or its latitude in Geographic Coordinate Systems).
- * @return the point represented by coordinates.
- */
- @NonNull
- static Point fromCoordinates(double x, double y) {
- return new DefaultPoint(x, y);
- }
-
- /**
- * Returns the X coordinate of this 2D point (or its longitude in Geographic Coordinate Systems).
- */
- double X();
-
- /**
- * Returns the Y coordinate of this 2D point (or its latitude in Geographic Coordinate Systems).
- */
- double Y();
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/Polygon.java b/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/Polygon.java
deleted file mode 100644
index d793704defa..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/Polygon.java
+++ /dev/null
@@ -1,127 +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.data.geometry;
-
-import com.datastax.dse.driver.internal.core.data.geometry.DefaultGeometry;
-import com.datastax.dse.driver.internal.core.data.geometry.DefaultPolygon;
-import com.esri.core.geometry.ogc.OGCPolygon;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.nio.ByteBuffer;
-import java.util.List;
-
-/**
- * The driver-side representation of DSE's {@code Polygon}.
- *
- * This is a planar surface in a two-dimensional XY-plane, represented by one exterior boundary
- * and 0 or more interior boundaries.
- *
- * The default implementation returned by the driver is immutable.
- */
-public interface Polygon extends Geometry {
- /**
- * Creates a polygon from its Well-known
- * Text (WKT) representation.
- *
- * @param source the Well-known Text representation to parse.
- * @return the polygon represented by the WKT.
- * @throws IllegalArgumentException if the string does not contain a valid Well-known Text
- * representation.
- */
- @NonNull
- static Polygon fromWellKnownText(@NonNull String source) {
- return new DefaultPolygon(DefaultGeometry.fromOgcWellKnownText(source, OGCPolygon.class));
- }
-
- /**
- * Creates a polygon from its Well-known Binary
- * (WKB) representation.
- *
- * @param source the Well-known Binary representation to parse.
- * @return the polygon represented by the WKB.
- * @throws IllegalArgumentException if the provided {@link ByteBuffer} does not contain a valid
- * Well-known Binary representation.
- */
- @NonNull
- static Polygon fromWellKnownBinary(@NonNull ByteBuffer source) {
- return new DefaultPolygon(DefaultGeometry.fromOgcWellKnownBinary(source, OGCPolygon.class));
- }
-
- /**
- * Creates a polygon from a GeoJSON
- * Polygon representation.
- *
- * @param source the GeoJSON Polygon
- * representation to parse.
- * @return the polygon represented by the GeoJSON Polygon.
- * @throws IllegalArgumentException if the string does not contain a valid GeoJSON Polygon representation.
- */
- @NonNull
- static Polygon fromGeoJson(@NonNull String source) {
- return new DefaultPolygon(DefaultGeometry.fromOgcGeoJson(source, OGCPolygon.class));
- }
-
- /** Creates a polygon from a series of 3 or more points. */
- @NonNull
- static Polygon fromPoints(
- @NonNull Point p1, @NonNull Point p2, @NonNull Point p3, @NonNull Point... pn) {
- return new DefaultPolygon(p1, p2, p3, pn);
- }
-
- /**
- * Returns a polygon builder.
- *
- * This is intended for complex polygons with multiple rings (i.e. holes inside the polygon).
- * For simple cases, consider {@link #fromPoints(Point, Point, Point, Point...)} instead.
- */
- @NonNull
- static Builder builder() {
- return new DefaultPolygon.Builder();
- }
-
- /** Returns the external ring of the polygon. */
- @NonNull
- List There can be one or more outer rings and zero or more inner rings. If a polygon has an
- * inner ring, the inner ring looks like a hole. If the hole contains another outer ring, that
- * outer ring looks like an island.
- *
- * There must be one "main" outer ring that contains all the others.
- */
- @NonNull
- Builder addRing(@NonNull Point p1, @NonNull Point p2, @NonNull Point p3, @NonNull Point... pn);
-
- @NonNull
- Polygon build();
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/data/time/DateRange.java b/core/src/main/java/com/datastax/dse/driver/api/core/data/time/DateRange.java
deleted file mode 100644
index 3dd48915dba..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/data/time/DateRange.java
+++ /dev/null
@@ -1,257 +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.data.time;
-
-import com.datastax.oss.driver.shaded.guava.common.base.Preconditions;
-import com.datastax.oss.driver.shaded.guava.common.base.Strings;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.io.Serializable;
-import java.text.ParseException;
-import java.time.ZonedDateTime;
-import java.util.Objects;
-import java.util.Optional;
-
-/**
- * A date range, as defined by the server type {@code
- * org.apache.cassandra.db.marshal.DateRangeType}, corresponding to the Apache Solr type {@code
- * DateRangeField}.
- *
- * A date range can be either {@linkplain DateRange#DateRange(DateRangeBound) single-bounded}, in
- * which case it represents a unique instant (e.g. "{@code 2001-01-01}"), or {@linkplain
- * #DateRange(DateRangeBound, DateRangeBound) double-bounded}, in which case it represents an
- * interval of time (e.g. "{@code [2001-01-01 TO 2002]}").
- *
- * Date range {@linkplain DateRangeBound bounds} are always inclusive; they must be either valid
- * dates, or the special value {@link DateRangeBound#UNBOUNDED UNBOUNDED}, represented by a "{@code
- * *}", e.g. "{@code [2001 TO *]}".
- *
- * Instances can be more easily created with the {@link #parse(String)} method.
- *
- * This class is immutable and thread-safe.
- *
- * @since DSE 5.1
- */
-public class DateRange implements Serializable {
-
- /**
- * Parses the given string as a date range.
- *
- * The given input must be compliant with Apache Solr type {@code
- * DateRangeField} syntax; it can either be a {@linkplain #DateRange(DateRangeBound)
- * single-bounded range}, or a {@linkplain #DateRange(DateRangeBound, DateRangeBound)
- * double-bounded range}.
- *
- * @throws ParseException if the given string could not be parsed into a valid range.
- * @see DateRangeBound#parseLowerBound(String)
- * @see DateRangeBound#parseUpperBound(String)
- */
- @NonNull
- public static DateRange parse(@NonNull String source) throws ParseException {
- if (Strings.isNullOrEmpty(source)) {
- throw new ParseException("Date range is null or empty", 0);
- }
-
- if (source.charAt(0) == '[') {
- if (source.charAt(source.length() - 1) != ']') {
- throw new ParseException(
- "If date range starts with '[' it must end with ']'; got " + source,
- source.length() - 1);
- }
- int middle = source.indexOf(" TO ");
- if (middle < 0) {
- throw new ParseException(
- "If date range starts with '[' it must contain ' TO '; got " + source, 0);
- }
- String lowerBoundString = source.substring(1, middle);
- int upperBoundStart = middle + 4;
- String upperBoundString = source.substring(upperBoundStart, source.length() - 1);
- DateRangeBound lowerBound;
- try {
- lowerBound = DateRangeBound.parseLowerBound(lowerBoundString);
- } catch (Exception e) {
- throw newParseException("Cannot parse date range lower bound: " + source, 1, e);
- }
- DateRangeBound upperBound;
- try {
- upperBound = DateRangeBound.parseUpperBound(upperBoundString);
- } catch (Exception e) {
- throw newParseException(
- "Cannot parse date range upper bound: " + source, upperBoundStart, e);
- }
- return new DateRange(lowerBound, upperBound);
- } else {
- try {
- return new DateRange(DateRangeBound.parseLowerBound(source));
- } catch (Exception e) {
- throw newParseException("Cannot parse single date range bound: " + source, 0, e);
- }
- }
- }
-
- @NonNull private final DateRangeBound lowerBound;
- @Nullable private final DateRangeBound upperBound;
-
- /**
- * Creates a "single bounded" instance, i.e., a date range whose upper and lower bounds are
- * identical.
- *
- * @throws NullPointerException if {@code singleBound} is null.
- */
- public DateRange(@NonNull DateRangeBound singleBound) {
- this.lowerBound = Preconditions.checkNotNull(singleBound, "singleBound cannot be null");
- this.upperBound = null;
- }
-
- /**
- * Creates an instance composed of two distinct bounds.
- *
- * @throws NullPointerException if {@code lowerBound} or {@code upperBound} is null.
- * @throws IllegalArgumentException if both {@code lowerBound} and {@code upperBound} are not
- * unbounded and {@code lowerBound} is greater than {@code upperBound}.
- */
- public DateRange(@NonNull DateRangeBound lowerBound, @NonNull DateRangeBound upperBound) {
- Preconditions.checkNotNull(lowerBound, "lowerBound cannot be null");
- Preconditions.checkNotNull(upperBound, "upperBound cannot be null");
- if (!lowerBound.isUnbounded()
- && !upperBound.isUnbounded()
- && lowerBound.getTimestamp().compareTo(upperBound.getTimestamp()) >= 0) {
- throw new IllegalArgumentException(
- String.format(
- "Lower bound of a date range should be before upper bound, got: [%s TO %s]",
- lowerBound, upperBound));
- }
- this.lowerBound = lowerBound;
- this.upperBound = upperBound;
- }
-
- /** Returns the lower bound of this range (inclusive). */
- @NonNull
- public DateRangeBound getLowerBound() {
- return lowerBound;
- }
-
- /**
- * Returns the upper bound of this range (inclusive), or empty if the range is {@linkplain
- * #isSingleBounded() single-bounded}.
- */
- @NonNull
- public Optional It is composed of a {@link ZonedDateTime} field and a corresponding {@link
- * DateRangePrecision}.
- *
- * Date range bounds are inclusive. The special value {@link #UNBOUNDED} denotes an un unbounded
- * (infinite) bound, represented by a {@code *} sign.
- *
- * This class is immutable and thread-safe.
- */
-public class DateRangeBound {
-
- /**
- * The unbounded {@link DateRangeBound} instance. It is syntactically represented by a {@code *}
- * (star) sign.
- */
- public static final DateRangeBound UNBOUNDED = new DateRangeBound();
-
- /**
- * Parses the given input as a lower date range bound.
- *
- * The input should be a Lucene-compliant
- * string.
- *
- * The returned bound will have its {@linkplain DateRangePrecision precision} inferred from the
- * input, and its timestamp will be {@linkplain DateRangePrecision#roundDown(ZonedDateTime)
- * rounded down} to that precision.
- *
- * Note that, in order to align with the server's parsing behavior, dates will always be parsed
- * in the UTC time zone.
- *
- * @throws NullPointerException if {@code lowerBound} is {@code null}.
- * @throws ParseException if the given input cannot be parsed.
- */
- @NonNull
- public static DateRangeBound parseLowerBound(@NonNull String source) throws ParseException {
- Preconditions.checkNotNull(source);
- Calendar calendar = DateRangeUtil.parseCalendar(source);
- DateRangePrecision precision = DateRangeUtil.getPrecision(calendar);
- return (precision == null)
- ? UNBOUNDED
- : lowerBound(DateRangeUtil.toZonedDateTime(calendar), precision);
- }
-
- /**
- * Parses the given input as an upper date range bound.
- *
- * The input should be a Lucene-compliant
- * string.
- *
- * The returned bound will have its {@linkplain DateRangePrecision precision} inferred from the
- * input, and its timestamp will be {@linkplain DateRangePrecision#roundUp(ZonedDateTime)} rounded
- * up} to that precision.
- *
- * Note that, in order to align with the server's behavior (e.g. when using date range literals
- * in CQL query strings), dates must always be in the UTC time zone: an optional trailing {@code
- * Z}" is allowed, but no other time zone ID (not even {@code UTC}, {@code GMT} or {@code +00:00})
- * is permitted.
- *
- * @throws NullPointerException if {@code upperBound} is {@code null}.
- * @throws ParseException if the given input cannot be parsed.
- */
- public static DateRangeBound parseUpperBound(String source) throws ParseException {
- Preconditions.checkNotNull(source);
- Calendar calendar = DateRangeUtil.parseCalendar(source);
- DateRangePrecision precision = DateRangeUtil.getPrecision(calendar);
- return (precision == null)
- ? UNBOUNDED
- : upperBound(DateRangeUtil.toZonedDateTime(calendar), precision);
- }
-
- /**
- * Creates a date range lower bound from the given date and precision. Temporal fields smaller
- * than the precision will be rounded down.
- */
- public static DateRangeBound lowerBound(ZonedDateTime timestamp, DateRangePrecision precision) {
- return new DateRangeBound(precision.roundDown(timestamp), precision);
- }
-
- /**
- * Creates a date range upper bound from the given date and precision. Temporal fields smaller
- * than the precision will be rounded up.
- */
- public static DateRangeBound upperBound(ZonedDateTime timestamp, DateRangePrecision precision) {
- return new DateRangeBound(precision.roundUp(timestamp), precision);
- }
-
- @Nullable private final ZonedDateTime timestamp;
- @Nullable private final DateRangePrecision precision;
-
- private DateRangeBound(@NonNull ZonedDateTime timestamp, @NonNull DateRangePrecision precision) {
- Preconditions.checkNotNull(timestamp);
- Preconditions.checkNotNull(precision);
- this.timestamp = timestamp;
- this.precision = precision;
- }
-
- // constructor used for the special UNBOUNDED value
- private DateRangeBound() {
- this.timestamp = null;
- this.precision = null;
- }
-
- /** Whether this bound is unbounded (i.e. denotes the special {@code *} value). */
- public boolean isUnbounded() {
- return this.timestamp == null && this.precision == null;
- }
-
- /**
- * Returns the timestamp of this bound.
- *
- * @throws IllegalStateException if this bound is {@linkplain #isUnbounded() unbounded}.
- */
- @NonNull
- public ZonedDateTime getTimestamp() {
- if (isUnbounded()) {
- throw new IllegalStateException(
- "Can't call this method on UNBOUNDED, use isUnbounded() to check first");
- }
- assert timestamp != null;
- return timestamp;
- }
-
- /**
- * Returns the precision of this bound.
- *
- * @throws IllegalStateException if this bound is {@linkplain #isUnbounded() unbounded}.
- */
- @NonNull
- public DateRangePrecision getPrecision() {
- if (isUnbounded()) {
- throw new IllegalStateException(
- "Can't call this method on UNBOUNDED, use isUnbounded() to check first");
- }
- assert precision != null;
- return precision;
- }
-
- /**
- * Returns this bound as a Lucene-compliant string.
- *
- * Unbounded bounds always return "{@code *}"; all other bounds are formatted in one of the
- * common ISO-8601 datetime formats, depending on their precision.
- *
- * Note that Lucene expects timestamps in UTC only. Timezone presence is always optional, and
- * if present, it must be expressed with the symbol "Z" exclusively. Therefore this method does
- * not include any timezone information in the returned string, except for bounds with {@linkplain
- * DateRangePrecision#MILLISECOND millisecond} precision, where the symbol "Z" is always appended
- * to the resulting string.
- */
- @NonNull
- @Override
- public String toString() {
- if (isUnbounded()) {
- return "*";
- } else {
- assert timestamp != null && precision != null;
- return precision.format(timestamp);
- }
- }
-
- @Override
- public boolean equals(@Nullable Object other) {
- if (other == this) {
- return true;
- } else if (other instanceof DateRangeBound) {
- DateRangeBound that = (DateRangeBound) other;
- return Objects.equals(this.timestamp, that.timestamp)
- && Objects.equals(this.precision, that.precision);
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(timestamp, precision);
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/data/time/DateRangePrecision.java b/core/src/main/java/com/datastax/dse/driver/api/core/data/time/DateRangePrecision.java
deleted file mode 100644
index a0b5d0e5500..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/data/time/DateRangePrecision.java
+++ /dev/null
@@ -1,197 +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.data.time;
-
-import com.datastax.dse.driver.internal.core.search.DateRangeUtil;
-import com.datastax.oss.driver.shaded.guava.common.base.Preconditions;
-import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.time.ZoneOffset;
-import java.time.ZonedDateTime;
-import java.time.format.DateTimeFormatter;
-import java.time.format.DateTimeFormatterBuilder;
-import java.time.temporal.ChronoField;
-import java.time.temporal.ChronoUnit;
-import java.util.Locale;
-import java.util.Map;
-
-/** The precision of a {@link DateRangeBound}. */
-public enum DateRangePrecision {
- MILLISECOND(
- 0x06,
- ChronoUnit.MILLIS,
- new DateTimeFormatterBuilder()
- .parseCaseSensitive()
- .parseStrict()
- .appendPattern("uuuu-MM-dd'T'HH:mm:ss.SSS")
- .optionalStart()
- .appendZoneId()
- .optionalEnd()
- .toFormatter()
- .withZone(ZoneOffset.UTC)
- .withLocale(Locale.ROOT)),
- SECOND(
- 0x05,
- ChronoUnit.SECONDS,
- new DateTimeFormatterBuilder()
- .parseCaseSensitive()
- .parseStrict()
- .appendPattern("uuuu-MM-dd'T'HH:mm:ss")
- .parseDefaulting(ChronoField.MILLI_OF_SECOND, 0)
- .toFormatter()
- .withZone(ZoneOffset.UTC)
- .withLocale(Locale.ROOT)),
- MINUTE(
- 0x04,
- ChronoUnit.MINUTES,
- new DateTimeFormatterBuilder()
- .parseCaseSensitive()
- .parseStrict()
- .appendPattern("uuuu-MM-dd'T'HH:mm")
- .parseDefaulting(ChronoField.SECOND_OF_MINUTE, 0)
- .parseDefaulting(ChronoField.MILLI_OF_SECOND, 0)
- .toFormatter()
- .withZone(ZoneOffset.UTC)
- .withLocale(Locale.ROOT)),
- HOUR(
- 0x03,
- ChronoUnit.HOURS,
- new DateTimeFormatterBuilder()
- .parseCaseSensitive()
- .parseStrict()
- .appendPattern("uuuu-MM-dd'T'HH")
- .parseDefaulting(ChronoField.MINUTE_OF_HOUR, 0)
- .parseDefaulting(ChronoField.SECOND_OF_MINUTE, 0)
- .parseDefaulting(ChronoField.MILLI_OF_SECOND, 0)
- .toFormatter()
- .withZone(ZoneOffset.UTC)
- .withLocale(Locale.ROOT)),
- DAY(
- 0x02,
- ChronoUnit.DAYS,
- new DateTimeFormatterBuilder()
- .parseCaseSensitive()
- .parseStrict()
- .appendPattern("uuuu-MM-dd")
- .parseDefaulting(ChronoField.HOUR_OF_DAY, 0)
- .parseDefaulting(ChronoField.MINUTE_OF_HOUR, 0)
- .parseDefaulting(ChronoField.SECOND_OF_MINUTE, 0)
- .parseDefaulting(ChronoField.MILLI_OF_SECOND, 0)
- .toFormatter()
- .withZone(ZoneOffset.UTC)
- .withLocale(Locale.ROOT)),
- MONTH(
- 0x01,
- ChronoUnit.MONTHS,
- new DateTimeFormatterBuilder()
- .parseCaseSensitive()
- .parseStrict()
- .appendPattern("uuuu-MM")
- .parseDefaulting(ChronoField.DAY_OF_MONTH, 1)
- .parseDefaulting(ChronoField.HOUR_OF_DAY, 0)
- .parseDefaulting(ChronoField.MINUTE_OF_HOUR, 0)
- .parseDefaulting(ChronoField.SECOND_OF_MINUTE, 0)
- .parseDefaulting(ChronoField.MILLI_OF_SECOND, 0)
- .toFormatter()
- .withZone(ZoneOffset.UTC)
- .withLocale(Locale.ROOT)),
- YEAR(
- 0x00,
- ChronoUnit.YEARS,
- new DateTimeFormatterBuilder()
- .parseCaseSensitive()
- .parseStrict()
- .appendPattern("uuuu")
- .parseDefaulting(ChronoField.MONTH_OF_YEAR, 1)
- .parseDefaulting(ChronoField.DAY_OF_MONTH, 1)
- .parseDefaulting(ChronoField.HOUR_OF_DAY, 0)
- .parseDefaulting(ChronoField.MINUTE_OF_HOUR, 0)
- .parseDefaulting(ChronoField.SECOND_OF_MINUTE, 0)
- .parseDefaulting(ChronoField.MILLI_OF_SECOND, 0)
- .toFormatter()
- .withZone(ZoneOffset.UTC)
- .withLocale(Locale.ROOT));
-
- private final byte encoding;
- private final ChronoUnit roundingUnit;
- // The formatter is only used for formatting (parsing is done with DateRangeUtil.parseCalendar to
- // be exactly the same as DSE's).
- // If that ever were to change, note that DateTimeFormatters with a time zone had a parsing bug
- // on older JDKs: the formatter's zone would always be used, even if the input string specified
- // one explicitly.
- // See https://stackoverflow.com/questions/41999421
- private final DateTimeFormatter formatter;
-
- DateRangePrecision(int encoding, ChronoUnit roundingUnit, DateTimeFormatter formatter) {
- this.encoding = (byte) encoding;
- this.roundingUnit = roundingUnit;
- this.formatter = formatter;
- }
-
- private static final Map Temporal fields smaller than this precision will be rounded up; other fields will be left
- * untouched.
- */
- @NonNull
- public ZonedDateTime roundUp(@NonNull ZonedDateTime timestamp) {
- Preconditions.checkNotNull(timestamp);
- return DateRangeUtil.roundUp(timestamp, roundingUnit);
- }
-
- /**
- * Rounds down the given timestamp to this precision.
- *
- * Temporal fields smaller than this precision will be rounded down; other fields will be left
- * untouched.
- */
- @NonNull
- public ZonedDateTime roundDown(@NonNull ZonedDateTime timestamp) {
- Preconditions.checkNotNull(timestamp);
- return DateRangeUtil.roundDown(timestamp, roundingUnit);
- }
-
- /** Formats the given timestamp according to this precision. */
- public String format(ZonedDateTime timestamp) {
- return formatter.format(timestamp);
- }
-}
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 This is convenient for queries that are known to return exactly one node.
- */
- @Nullable
- default GraphNode one() {
- Iterator 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.
- *
- * Typically used like so:
- *
- * 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 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 This class is mutable and not thread-safe.
- */
-@NotThreadSafe
-public class BatchGraphStatementBuilder
- extends GraphStatementBuilderBase 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:
- *
- * 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.
- *
- * Typically used like so:
- *
- * 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 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 This feature is only available with {@link DefaultProtocolVersion#V4} or above; with lower
- * versions, this list will always be empty.
- */
- List 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 It can be:
- *
- * 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}. */
- 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}. */
- 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.
- */
- Before attempting such a conversion, there must be an appropriate converter configured on
- * the underlying serialization runtime.
- */
- 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}. */
- If this method returns {@code true}, then {@link #asVertexProperty()} ()} can be safely
- * called.
- */
- boolean isVertexProperty();
-
- /** Returns this node as a Tinkerpop {@link VertexProperty}. */
- 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}. */
- 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 This is convenient for queries that are known to return exactly one row, for example count
- * queries.
- */
- @Nullable
- default GraphNode one() {
- Iterator At this time (DSE 6.0.0), graph queries are not paginated and the server sends all the
- * results at once.
- */
- @NonNull
- default List 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:
- *
- * 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 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 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 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 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 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.
- *
- * Typical usage:
- *
- * 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 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 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 DseAuthenticator.
- */
-@ThreadSafe
-public abstract class BaseDseAuthenticator implements SyncAuthenticator {
-
- private static final String DSE_AUTHENTICATOR =
- "com.datastax.bdp.cassandra.auth.DseAuthenticator";
-
- private final String serverAuthenticator;
-
- protected BaseDseAuthenticator(@NonNull String serverAuthenticator) {
- this.serverAuthenticator = serverAuthenticator;
- }
-
- /**
- * Return a byte buffer containing the required SASL mechanism.
- *
- *
- *
- *
- * This must be either a {@linkplain ByteBuffer#asReadOnlyBuffer() read-only} buffer, or a new
- * instance every time.
- */
- @NonNull
- protected abstract ByteBuffer getMechanism();
-
- /**
- * Return a byte buffer containing the expected successful server challenge.
- *
- *
- *
- *
- * This must be either a {@linkplain ByteBuffer#asReadOnlyBuffer() read-only} buffer, or a new
- * instance every time.
- */
- @NonNull
- protected abstract ByteBuffer getInitialServerChallenge();
-
- @Nullable
- @Override
- public ByteBuffer initialResponseSync() {
- // DseAuthenticator communicates back the mechanism in response to server authenticate message.
- // older authenticators simply expect the auth response with credentials.
- if (isDseAuthenticator()) {
- return getMechanism();
- } else {
- return evaluateChallengeSync(getInitialServerChallenge());
- }
- }
-
- @Override
- public void onAuthenticationSuccessSync(@Nullable ByteBuffer token) {}
-
- private boolean isDseAuthenticator() {
- return serverAuthenticator.equals(DSE_AUTHENTICATOR);
- }
-}
diff --git a/core/src/main/java/com/datastax/dse/driver/api/core/auth/DseGssApiAuthProviderBase.java b/core/src/main/java/com/datastax/dse/driver/api/core/auth/DseGssApiAuthProviderBase.java
deleted file mode 100644
index 48a0e5b0ef3..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/auth/DseGssApiAuthProviderBase.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.auth;
-
-import com.datastax.oss.driver.api.core.auth.AuthProvider;
-import com.datastax.oss.driver.api.core.auth.AuthenticationException;
-import com.datastax.oss.driver.api.core.auth.Authenticator;
-import com.datastax.oss.driver.api.core.metadata.EndPoint;
-import com.datastax.oss.driver.api.core.session.Session;
-import com.datastax.oss.driver.shaded.guava.common.base.Charsets;
-import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
-import com.datastax.oss.protocol.internal.util.Bytes;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import edu.umd.cs.findbugs.annotations.Nullable;
-import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
-import javax.security.auth.Subject;
-import javax.security.auth.login.AppConfigurationEntry;
-import javax.security.auth.login.Configuration;
-import javax.security.auth.login.LoginContext;
-import javax.security.auth.login.LoginException;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-import net.jcip.annotations.Immutable;
-import net.jcip.annotations.NotThreadSafe;
-import net.jcip.annotations.ThreadSafe;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@ThreadSafe
-public abstract class DseGssApiAuthProviderBase implements AuthProvider {
-
- /** The default SASL service name used by this auth provider. */
- public static final String DEFAULT_SASL_SERVICE_NAME = "dse";
-
- /** The name of the system property to use to specify the SASL service name. */
- public static final String SASL_SERVICE_NAME_PROPERTY = "dse.sasl.service";
-
- /**
- * Legacy system property for SASL protocol name. Clients should migrate to
- * SASL_SERVICE_NAME_PROPERTY above.
- */
- private static final String LEGACY_SASL_PROTOCOL_PROPERTY = "dse.sasl.protocol";
-
- private static final Logger LOG = LoggerFactory.getLogger(DseGssApiAuthProviderBase.class);
-
- private final String logPrefix;
-
- /**
- * @param logPrefix a string that will get prepended to the logs (this is used for discrimination
- * when you have multiple driver instances executing in the same JVM). Config-based
- * implementations fill this with {@link Session#getName()}.
- */
- protected DseGssApiAuthProviderBase(@NonNull String logPrefix) {
- this.logPrefix = Objects.requireNonNull(logPrefix);
- }
-
- @NonNull
- protected abstract GssApiOptions getOptions(
- @NonNull EndPoint endPoint, @NonNull String serverAuthenticator);
-
- @NonNull
- @Override
- public Authenticator newAuthenticator(
- @NonNull EndPoint endPoint, @NonNull String serverAuthenticator)
- throws AuthenticationException {
- return new GssApiAuthenticator(
- getOptions(endPoint, serverAuthenticator), endPoint, serverAuthenticator);
- }
-
- @Override
- public void onMissingChallenge(@NonNull EndPoint endPoint) {
- LOG.warn(
- "[{}] {} did not send an authentication challenge; "
- + "This is suspicious because the driver expects authentication",
- logPrefix,
- endPoint);
- }
-
- @Override
- public void close() {
- // nothing to do
- }
-
- /**
- * The options to initialize a new authenticator.
- *
- *
- * javax.security.sasl.server.authentication = true
- * javax.security.sasl.qop = auth
- *
- */
- @NonNull
- public Builder addSaslProperty(@NonNull String name, @NonNull String value) {
- this.saslProperties.put(Objects.requireNonNull(name), Objects.requireNonNull(value));
- return this;
- }
-
- @NonNull
- public GssApiOptions build() {
- return new GssApiOptions(
- loginConfiguration,
- subject,
- saslProtocol,
- authorizationId,
- ImmutableMap.copyOf(saslProperties));
- }
-
- public static Configuration fetchLoginConfiguration(Map
- * DseGssApiAuthProviderBase.GssApiOptions.Builder builder =
- * DseGssApiAuthProviderBase.GssApiOptions.builder();
- * Map<String, String> loginConfig =
- * ImmutableMap.of(
- * "principal",
- * "user principal here ex cassandra@DATASTAX.COM",
- * "useKeyTab",
- * "true",
- * "refreshKrb5Config",
- * "true",
- * "keyTab",
- * "Path to keytab file here");
- *
- * builder.withLoginConfiguration(loginConfig);
- *
- * CqlSession session =
- * CqlSession.builder()
- * .withAuthProvider(new ProgrammaticDseGssApiAuthProvider(builder.build()))
- * .build();
- *
- *
- * or alternatively
- *
- *
- * DseGssApiAuthProviderBase.GssApiOptions.Builder builder =
- * DseGssApiAuthProviderBase.GssApiOptions.builder().withSubject(subject);
- * CqlSession session =
- * CqlSession.builder()
- * .withAuthProvider(new ProgrammaticDseGssApiAuthProvider(builder.build()))
- * .build();
- *
- *
- * Kerberos Authentication
- *
- * Keytab and ticket cache settings are specified using a standard JAAS configuration file. The
- * location of the file can be set using the java.security.auth.login.config system
- * property or by adding a login.config.url.n entry in the java.security
- * properties file. Alternatively a login-configuration, or subject can be provided to the provider
- * via the GssApiOptions (see above).
- *
- *
- *
- *
- * Authentication using ticket cache
- *
- * Run kinit to obtain a ticket and populate the cache before connecting. JAAS config:
- *
- *
- * DseClient {
- * com.sun.security.auth.module.Krb5LoginModule required
- * useTicketCache=true
- * renewTGT=true;
- * };
- *
- *
- * Authentication using a keytab file
- *
- * To enable authentication using a keytab file, specify its location on disk. If your keytab
- * contains more than one principal key, you should also specify which one to select. This
- * information can also be specified in the driver config, under the login-configuration section.
- *
- *
- * DseClient {
- * com.sun.security.auth.module.Krb5LoginModule required
- * useKeyTab=true
- * keyTab="/path/to/file.keytab"
- * principal="user@MYDOMAIN.COM";
- * };
- *
- *
- * Specifying SASL protocol name
- *
- * The SASL protocol name used by this auth provider defaults to "
- * {@value #DEFAULT_SASL_SERVICE_NAME}".
- *
- * {@code
- * kerberos_options:
- * ...
- * service_principal: cassandra/my.host.com@MY.REALM.COM
- * }
- *
- * The correct SASL protocol name to use when authenticating against this DSE server is "{@code
- * cassandra}".
- *
- *
- * DseGssApiAuthProviderBase.GssApiOptions.Builder builder =
- * DseGssApiAuthProviderBase.GssApiOptions.builder();
- * builder.withSaslProtocol("alternate");
- * DseGssApiAuthProviderBase.GssApiOptions options = builder.build();
- *
- *
- *
- * DseGssApiAuthProviderBase.GssApiOptions.Builder builder =
- * DseGssApiAuthProviderBase.GssApiOptions.builder();
- * builder.addSaslProperty("javax.security.sasl.qop", "auth-conf");
- * DseGssApiAuthProviderBase.GssApiOptions options = builder.build();
- *
- *
- * @see Authenticating
- * a DSE cluster with Kerberos
- */
-public class ProgrammaticDseGssApiAuthProvider extends DseGssApiAuthProviderBase {
- private final GssApiOptions options;
-
- public ProgrammaticDseGssApiAuthProvider(GssApiOptions options) {
- super("Programmatic-Kerberos");
- this.options = options;
- }
-
- @NonNull
- @Override
- protected GssApiOptions getOptions(
- @NonNull EndPoint endPoint, @NonNull String serverAuthenticator) {
- return options;
- }
-}
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
deleted file mode 100644
index a3624ba736d..00000000000
--- a/core/src/main/java/com/datastax/dse/driver/api/core/auth/ProxyAuthentication.java
+++ /dev/null
@@ -1,82 +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.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;
-import edu.umd.cs.findbugs.annotations.NonNull;
-import java.nio.ByteBuffer;
-import java.util.Map;
-
-public class ProxyAuthentication {
- private static final String PROXY_EXECUTE = "ProxyExecute";
-
- /**
- * Adds proxy authentication information to a CQL statement.
- *
- *
- *
- *
- * After a cancellation, futures returned by {@link #fetchNextPage()} that are not yet complete
- * will always complete exceptionally by throwing a {@link CancellationException}, even if
- * they were obtained before the cancellation.
- */
- void cancel();
-
- /**
- * {@inheritDoc}
- *
- *
- *
- */
- void cancel();
-
- /**
- * {@inheritDoc}
- *
- *
- *
- *
- *
- * Row row = dseSession.execute("SELECT coords FROM points_of_interest WHERE name = 'Eiffel Tower'").one();
- * Point coords = row.get("coords", Point.class);
- *
- *
- * The default implementations returned by the driver are immutable and serializable. If you write
- * your own implementations, they should at least be thread-safe; serializability is not mandatory,
- * but recommended for use with some 3rd-party tools like Apache Spark ™.
- */
-public interface Geometry {
-
- /**
- * Returns a Well-known Text (WKT)
- * representation of this geospatial type.
- */
- @NonNull
- String asWellKnownText();
-
- /**
- * Returns a Well-known
- * Binary (WKB) representation of this geospatial type.
- *
- * > getInteriorRings();
-
- /** Provides a simple DSL to build a polygon. */
- interface Builder {
- /**
- * Adds a new ring for this polygon.
- *
- *
{@code
- * import static com.datastax.dse.driver.api.core.graph.DseGraph.g;
- *
- * BatchGraphStatement statement =
- * BatchGraphStatement.builder()
- * .addTraversal(
- * g.addV("person").property("name", "batch1").property("age", 1))
- * .addTraversal(
- * g.addV("person").property("name", "batch2").property("age", 2))
- * .build();
- *
- * GraphResultSet graphResultSet = dseSession.execute(statement);
- * }
- *
- * @see DseGraph#g
- */
-public interface BatchGraphStatement
- extends GraphStatement{@code
- * DseSession session = ...;
- * RemoteConnection remoteConnection = DseGraph.remoteConnectionBuilder(session).build();
- * GraphTraversalSource g = DseGraph.g.withRemote(remoteConnection);
- * }
- *
- * You should now use {@link AnonymousTraversalSource#traversal()}, and adopt the following idiom:
- *
- * {@code
- * DseSession session = ...;
- * RemoteConnection remoteConnection = DseGraph.remoteConnectionBuilder(session).build();
- * GraphTraversalSource g = AnonymousTraversalSource.traversal().withRemote(remoteConnection);
- * }
- *
- * 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();}.
- *
- * {@code
- * DseSession dseSession = DseSession.builder().build();
- * GraphTraversalSource g = AnonymousTraversalSource.traversal().withRemote(DseGraph.remoteConnectionBuilder(dseSession).build());
- * List
- *
- * @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.
- *
- * {@code
- * import static com.datastax.dse.driver.api.core.graph.DseGraph.g;
- *
- * FluentGraphStatement statement = FluentGraphStatement.newInstance(g.V().has("name", "marko"));
- *
- * GraphResultSet graphResultSet = dseSession.execute(statement);
- * }
- *
- * @see DseGraph#g
- */
-public interface FluentGraphStatement extends GraphStatement
- *
- *
- * 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.
- *
- *
- *
- *
- * {@code
- * ScriptGraphStatement statement = ScriptGraphStatement.newInstance("schema.propertyKey('age').Int().create()");
- *
- * GraphResultSet graphResultSet = dseSession.execute(statement);
- * }
- */
-public interface ScriptGraphStatement extends GraphStatement