Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shade and relocate datastax/scylladb drivers #3740

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 5 additions & 23 deletions cassandra-hadoop-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,14 @@

<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<groupId>org.janusgraph</groupId>
<artifactId>janusgraph-shaded-datastax-java-driver</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>3.11.3</version>
<exclusions>
<exclusion>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-ffi</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
</exclusion>
<exclusion>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</exclusion>
</exclusions>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package org.apache.cassandra.hadoop.cql3;

import com.datastax.driver.core.Host;
import com.datastax.driver.core.Metadata;
import com.datastax.driver.core.Token;
import com.datastax.driver.core.TokenRange;
import org.janusgraph.shaded.datastax.driver.core.Host;
import org.janusgraph.shaded.datastax.driver.core.Metadata;
import org.janusgraph.shaded.datastax.driver.core.Token;
import org.janusgraph.shaded.datastax.driver.core.TokenRange;

import java.util.ArrayList;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
*
*/

import com.datastax.driver.core.AuthProvider;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.PlainTextAuthProvider;
import com.datastax.driver.core.PoolingOptions;
import com.datastax.driver.core.ProtocolOptions;
import com.datastax.driver.core.ProtocolVersion;
import com.datastax.driver.core.QueryOptions;
import com.datastax.driver.core.RemoteEndpointAwareJdkSSLOptions;
import com.datastax.driver.core.SSLOptions;
import com.datastax.driver.core.SocketOptions;
import com.datastax.driver.core.policies.LoadBalancingPolicy;
import org.janusgraph.shaded.datastax.driver.core.AuthProvider;
import org.janusgraph.shaded.datastax.driver.core.Cluster;
import org.janusgraph.shaded.datastax.driver.core.HostDistance;
import org.janusgraph.shaded.datastax.driver.core.PlainTextAuthProvider;
import org.janusgraph.shaded.datastax.driver.core.PoolingOptions;
import org.janusgraph.shaded.datastax.driver.core.ProtocolOptions;
import org.janusgraph.shaded.datastax.driver.core.ProtocolVersion;
import org.janusgraph.shaded.datastax.driver.core.QueryOptions;
import org.janusgraph.shaded.datastax.driver.core.RemoteEndpointAwareJdkSSLOptions;
import org.janusgraph.shaded.datastax.driver.core.SSLOptions;
import org.janusgraph.shaded.datastax.driver.core.SocketOptions;
import org.janusgraph.shaded.datastax.driver.core.policies.LoadBalancingPolicy;
import com.google.common.base.Optional;
import org.apache.cassandra.hadoop.ConfigHelper;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -280,7 +280,7 @@ private static QueryOptions getReadQueryOptions(Configuration conf)
Optional<Integer> fetchSize = getInputPageRowSize(conf);
QueryOptions queryOptions = new QueryOptions();
if (CL != null && !CL.isEmpty())
queryOptions.setConsistencyLevel(com.datastax.driver.core.ConsistencyLevel.valueOf(CL));
queryOptions.setConsistencyLevel(org.janusgraph.shaded.datastax.driver.core.ConsistencyLevel.valueOf(CL));

if (fetchSize.isPresent())
queryOptions.setFetchSize(fetchSize.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
*/
package org.apache.cassandra.hadoop.cql3;

import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Host;
import com.datastax.driver.core.Metadata;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.SimpleStatement;
import com.datastax.driver.core.Statement;
import com.datastax.driver.core.TokenRange;
import com.datastax.driver.core.exceptions.InvalidQueryException;
import org.janusgraph.shaded.datastax.driver.core.Cluster;
import org.janusgraph.shaded.datastax.driver.core.Host;
import org.janusgraph.shaded.datastax.driver.core.Metadata;
import org.janusgraph.shaded.datastax.driver.core.ResultSet;
import org.janusgraph.shaded.datastax.driver.core.Row;
import org.janusgraph.shaded.datastax.driver.core.Session;
import org.janusgraph.shaded.datastax.driver.core.SimpleStatement;
import org.janusgraph.shaded.datastax.driver.core.Statement;
import org.janusgraph.shaded.datastax.driver.core.TokenRange;
import org.janusgraph.shaded.datastax.driver.core.exceptions.InvalidQueryException;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@
*/
package org.apache.cassandra.hadoop.cql3;

import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.ColumnDefinitions;
import com.datastax.driver.core.ColumnMetadata;
import com.datastax.driver.core.LocalDate;
import com.datastax.driver.core.Metadata;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.TableMetadata;
import com.datastax.driver.core.Token;
import com.datastax.driver.core.TupleValue;
import com.datastax.driver.core.TypeCodec;
import com.datastax.driver.core.UDTValue;
import org.janusgraph.shaded.datastax.driver.core.Cluster;
import org.janusgraph.shaded.datastax.driver.core.ColumnDefinitions;
import org.janusgraph.shaded.datastax.driver.core.ColumnMetadata;
import org.janusgraph.shaded.datastax.driver.core.LocalDate;
import org.janusgraph.shaded.datastax.driver.core.Metadata;
import org.janusgraph.shaded.datastax.driver.core.ResultSet;
import org.janusgraph.shaded.datastax.driver.core.Row;
import org.janusgraph.shaded.datastax.driver.core.Session;
import org.janusgraph.shaded.datastax.driver.core.TableMetadata;
import org.janusgraph.shaded.datastax.driver.core.Token;
import org.janusgraph.shaded.datastax.driver.core.TupleValue;
import org.janusgraph.shaded.datastax.driver.core.TypeCodec;
import org.janusgraph.shaded.datastax.driver.core.UDTValue;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
*/
package org.apache.cassandra.hadoop.cql3;

import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Host;
import com.datastax.driver.core.HostDistance;
import com.datastax.driver.core.Statement;
import com.datastax.driver.core.policies.LoadBalancingPolicy;
import org.janusgraph.shaded.datastax.driver.core.Cluster;
import org.janusgraph.shaded.datastax.driver.core.Host;
import org.janusgraph.shaded.datastax.driver.core.HostDistance;
import org.janusgraph.shaded.datastax.driver.core.Statement;
import org.janusgraph.shaded.datastax.driver.core.policies.LoadBalancingPolicy;
import com.google.common.base.Function;
import com.google.common.collect.Iterators;
import com.google.common.collect.Sets;
Expand Down
2 changes: 1 addition & 1 deletion docs/configs/janusgraph-cfg.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ Configuration options for CQL request tracker and builtin request logger

| Name | Description | Datatype | Default Value | Mutability |
| ---- | ---- | ---- | ---- | ---- |
| storage.cql.request-tracker.class | It is either a predefined DataStax driver value for a builtin request tracker or a full qualified class name which implements `com.datastax.oss.driver.internal.core.tracker.RequestTracker` interface. If no any value provided, the default DataStax request tracker is used, which is `NoopRequestTracker` which doesn't do anything. If `RequestLogger` value is provided, the DataStax [RequestLogger](https://docs.datastax.com/en/developer/java-driver/4.9/manual/core/request_tracker/#request-logger) is used. | String | (no default value) | LOCAL |
| storage.cql.request-tracker.class | It is either a predefined DataStax driver value for a builtin request tracker or a full qualified class name which implements `org.janusgraph.shaded.datastax.oss.driver.internal.core.tracker.RequestTracker` interface. If no any value provided, the default DataStax request tracker is used, which is `NoopRequestTracker` which doesn't do anything. If `RequestLogger` value is provided, the DataStax [RequestLogger](https://docs.datastax.com/en/developer/java-driver/4.9/manual/core/request_tracker/#request-logger) is used. | String | (no default value) | LOCAL |
| storage.cql.request-tracker.logs-error-enabled | Whether to log failed requests.Can be used when `root.storage.cql.request-tracker.class` is set to `RequestLogger`. | Boolean | (no default value) | LOCAL |
| storage.cql.request-tracker.logs-max-query-length | The maximum length of the query string in the log message. Can be used when `root.storage.cql.request-tracker.class` is set to `RequestLogger`. | Integer | (no default value) | LOCAL |
| storage.cql.request-tracker.logs-max-value-length | The maximum length for bound values in the log message. Can be used when `root.storage.cql.request-tracker.class` is set to `RequestLogger`. | Integer | (no default value) | LOCAL |
Expand Down
55 changes: 3 additions & 52 deletions janusgraph-cql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,58 +74,9 @@
</dependency>

<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>java-driver-core</artifactId>
<version>${cassandra-driver.version}</version>
<exclusions>
<exclusion>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</exclusion>
<exclusion>
<groupId>com.esri.geometry</groupId>
<artifactId>esri-geometry-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</exclusion>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>java-driver-query-builder</artifactId>
<version>${cassandra-driver.version}</version>
<exclusions>
<exclusion>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
</exclusion>
</exclusions>
<groupId>org.janusgraph</groupId>
<artifactId>janusgraph-shaded-datastax-java-driver</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.vavr</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package org.janusgraph.diskstorage.cql;

import com.datastax.oss.driver.api.core.cql.Row;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.Row;
import io.vavr.Tuple3;
import org.janusgraph.diskstorage.EntryMetaData;
import org.janusgraph.diskstorage.StaticBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package org.janusgraph.diskstorage.cql;

import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
import org.janusgraph.shaded.datastax.oss.driver.api.core.config.DefaultDriverOption;
import org.janusgraph.diskstorage.configuration.ConfigElement;
import org.janusgraph.diskstorage.configuration.ConfigNamespace;
import org.janusgraph.diskstorage.configuration.ConfigOption;
Expand Down Expand Up @@ -518,7 +518,7 @@ public interface CQLConfigOptions {
"class",
"It is either a predefined DataStax driver value for a builtin request tracker " +
"or a full qualified class name which implements " +
"`com.datastax.oss.driver.internal.core.tracker.RequestTracker` interface. " +
"`org.janusgraph.shaded.datastax.oss.driver.internal.core.tracker.RequestTracker` interface. " +
"If no any value provided, the default DataStax request tracker is used, which is `NoopRequestTracker` " +
"which doesn't do anything. If `RequestLogger` value is provided, the DataStax [RequestLogger]" +
"(https://docs.datastax.com/en/developer/java-driver/4.9/manual/core/request_tracker/#request-logger) " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@

package org.janusgraph.diskstorage.cql;

import com.datastax.oss.driver.api.core.AllNodesFailedException;
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.cql.BatchableStatement;
import com.datastax.oss.driver.api.core.cql.BoundStatement;
import com.datastax.oss.driver.api.core.cql.BoundStatementBuilder;
import com.datastax.oss.driver.api.core.cql.ExecutionInfo;
import com.datastax.oss.driver.api.core.cql.PreparedStatement;
import com.datastax.oss.driver.api.core.cql.ResultSet;
import com.datastax.oss.driver.api.core.cql.Row;
import com.datastax.oss.driver.api.core.metadata.TokenMap;
import com.datastax.oss.driver.api.core.servererrors.QueryValidationException;
import com.datastax.oss.driver.api.core.servererrors.ServerError;
import com.datastax.oss.driver.api.core.type.DataTypes;
import com.datastax.oss.driver.api.querybuilder.delete.DeleteSelection;
import com.datastax.oss.driver.api.querybuilder.insert.Insert;
import com.datastax.oss.driver.api.querybuilder.relation.Relation;
import com.datastax.oss.driver.api.querybuilder.schema.CreateTableWithOptions;
import com.datastax.oss.driver.api.querybuilder.schema.compaction.CompactionStrategy;
import com.datastax.oss.driver.api.querybuilder.select.Select;
import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
import org.janusgraph.shaded.datastax.oss.driver.api.core.AllNodesFailedException;
import org.janusgraph.shaded.datastax.oss.driver.api.core.CqlSession;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.BatchableStatement;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.BoundStatement;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.BoundStatementBuilder;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.ExecutionInfo;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.PreparedStatement;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.ResultSet;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.Row;
import org.janusgraph.shaded.datastax.oss.driver.api.core.metadata.TokenMap;
import org.janusgraph.shaded.datastax.oss.driver.api.core.servererrors.QueryValidationException;
import org.janusgraph.shaded.datastax.oss.driver.api.core.servererrors.ServerError;
import org.janusgraph.shaded.datastax.oss.driver.api.core.type.DataTypes;
import org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.delete.DeleteSelection;
import org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.insert.Insert;
import org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.relation.Relation;
import org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.schema.CreateTableWithOptions;
import org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.schema.compaction.CompactionStrategy;
import org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.select.Select;
import org.janusgraph.shaded.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
import io.vavr.Tuple;
import io.vavr.Tuple3;
import io.vavr.collection.Array;
Expand Down Expand Up @@ -72,15 +72,15 @@
import java.util.concurrent.ExecutorService;
import java.util.function.Function;

import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.bindMarker;
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.deleteFrom;
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.insertInto;
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.selectFrom;
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilder.createTable;
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilder.leveledCompactionStrategy;
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilder.sizeTieredCompactionStrategy;
import static com.datastax.oss.driver.api.querybuilder.SchemaBuilder.timeWindowCompactionStrategy;
import static com.datastax.oss.driver.api.querybuilder.select.Selector.column;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.QueryBuilder.bindMarker;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.QueryBuilder.deleteFrom;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.QueryBuilder.insertInto;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.QueryBuilder.selectFrom;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.SchemaBuilder.createTable;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.SchemaBuilder.leveledCompactionStrategy;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.SchemaBuilder.sizeTieredCompactionStrategy;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.SchemaBuilder.timeWindowCompactionStrategy;
import static org.janusgraph.shaded.datastax.oss.driver.api.querybuilder.select.Selector.column;
import static io.vavr.API.$;
import static io.vavr.API.Case;
import static io.vavr.API.Match;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package org.janusgraph.diskstorage.cql;

import com.datastax.oss.driver.api.core.cql.Row;
import org.janusgraph.shaded.datastax.oss.driver.api.core.cql.Row;
import com.google.common.collect.AbstractIterator;
import io.vavr.Tuple;
import io.vavr.Tuple3;
Expand Down
Loading