From bc9e2b41507d6029f5878e7e487e64aebfbdeb7b Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Thu, 19 Nov 2020 14:18:16 -0800 Subject: [PATCH] Create presto-yugabyte module --- pom.xml | 7 ++ presto-server/src/main/provisio/presto.xml | 7 ++ presto-yugabyte/pom.xml | 100 ++++++++++++++++++ .../yugabyte/YugabyteConnectorFactory.java | 26 +++++ .../plugin/yugabyte/YugabytePlugin.java | 31 ++++++ 5 files changed, 171 insertions(+) create mode 100644 presto-yugabyte/pom.xml create mode 100644 presto-yugabyte/src/main/java/io/prestosql/plugin/yugabyte/YugabyteConnectorFactory.java create mode 100644 presto-yugabyte/src/main/java/io/prestosql/plugin/yugabyte/YugabytePlugin.java diff --git a/pom.xml b/pom.xml index 98b1674d68d8..2f7b57a2f742 100644 --- a/pom.xml +++ b/pom.xml @@ -153,6 +153,7 @@ presto-tpcds presto-tpch presto-verifier + presto-yugabyte @@ -195,6 +196,12 @@ ${project.version} + + io.prestosql + presto-cassandra + ${project.version} + + io.prestosql presto-cli diff --git a/presto-server/src/main/provisio/presto.xml b/presto-server/src/main/provisio/presto.xml index 1ef267f816cc..ff9f23f2796b 100644 --- a/presto-server/src/main/provisio/presto.xml +++ b/presto-server/src/main/provisio/presto.xml @@ -252,4 +252,11 @@ + + + + + + + diff --git a/presto-yugabyte/pom.xml b/presto-yugabyte/pom.xml new file mode 100644 index 000000000000..0d57208d10bb --- /dev/null +++ b/presto-yugabyte/pom.xml @@ -0,0 +1,100 @@ + + + 4.0.0 + + io.prestosql + presto-root + 347-SNAPSHOT + + + presto-yugabyte + Presto - Yugabyte Connector + presto-plugin + + + ${project.parent.basedir} + + + + + io.prestosql + presto-cassandra + + + io.prestosql.cassandra + cassandra-driver + + + + + + com.google.guava + guava + + + + io.prestosql.yugabyte + yugabyte-driver + 3.2.0-yb-19-1 + runtime + + + + + io.prestosql + presto-spi + provided + + + + io.airlift + slice + provided + + + + com.fasterxml.jackson.core + jackson-annotations + provided + + + + org.openjdk.jol + jol-core + provided + + + + + + + + + org.basepom.maven + duplicate-finder-maven-plugin + + + + org.cassandraunit + cassandra-unit + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + + + org.yaml:snakeyaml + + + + + + + + diff --git a/presto-yugabyte/src/main/java/io/prestosql/plugin/yugabyte/YugabyteConnectorFactory.java b/presto-yugabyte/src/main/java/io/prestosql/plugin/yugabyte/YugabyteConnectorFactory.java new file mode 100644 index 000000000000..90503636b7e3 --- /dev/null +++ b/presto-yugabyte/src/main/java/io/prestosql/plugin/yugabyte/YugabyteConnectorFactory.java @@ -0,0 +1,26 @@ +/* + * Licensed 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 io.prestosql.plugin.yugabyte; + +import io.prestosql.plugin.cassandra.CassandraConnectorFactory; + +public class YugabyteConnectorFactory + extends CassandraConnectorFactory +{ + @Override + public String getName() + { + return "yugabyte"; + } +} diff --git a/presto-yugabyte/src/main/java/io/prestosql/plugin/yugabyte/YugabytePlugin.java b/presto-yugabyte/src/main/java/io/prestosql/plugin/yugabyte/YugabytePlugin.java new file mode 100644 index 000000000000..a9a0252b51f6 --- /dev/null +++ b/presto-yugabyte/src/main/java/io/prestosql/plugin/yugabyte/YugabytePlugin.java @@ -0,0 +1,31 @@ +/* + * Licensed 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 io.prestosql.plugin.yugabyte; + +import com.google.common.collect.ImmutableList; +import io.prestosql.spi.Plugin; +import io.prestosql.spi.connector.ConnectorFactory; + +/* + * This class is the plugin. + */ +public class YugabytePlugin + implements Plugin +{ + @Override + public Iterable getConnectorFactories() + { + return ImmutableList.of(new YugabyteConnectorFactory()); + } +}