Skip to content

Commit

Permalink
[KYUUBI #1511] Initialize kyuubi trino engine module
Browse files Browse the repository at this point in the history
<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
  2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
  3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the use case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->
1. Initialize kyuubi trino engine module
2. Add `TrinoThriftBinaryFrontendService`

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1514 from hddong/init-trino-engine.

Closes #1511

9dd0e55 [hongdongdong] [KYUUBI #1511] Initialize kyuubi trino engine module

Authored-by: hongdongdong <hongdongdong@cmss.chinamobile.com>
Signed-off-by: Kent Yao <yao@apache.org>
  • Loading branch information
hddong authored and yaooqinn committed Dec 7, 2021
1 parent 42674ae commit 6ea83e0
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
50 changes: 50 additions & 0 deletions externals/kyuubi-trino-engine/pom.xml
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>kyuubi-parent</artifactId>
<groupId>org.apache.kyuubi</groupId>
<version>1.5.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>kyuubi-trino-engine_2.12</artifactId>
<name>Kyuubi Project Engine Trino</name>
<packaging>jar</packaging>

<dependencies>
<!-- kyuubi dependency -->
<dependency>
<groupId>org.apache.kyuubi</groupId>
<artifactId>kyuubi-common_${scala.binary.version}</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.kyuubi</groupId>
<artifactId>kyuubi-ha_${scala.binary.version}</artifactId>
<version>${project.version}</version>
</dependency>

</dependencies>

</project>
@@ -0,0 +1,36 @@
/*
* 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 org.apache.kyuubi.engine.trino

import org.apache.kyuubi.ha.client.EngineServiceDiscovery
import org.apache.kyuubi.ha.client.ServiceDiscovery
import org.apache.kyuubi.service.Serverable
import org.apache.kyuubi.service.Service
import org.apache.kyuubi.service.ThriftBinaryFrontendService

class TrinoThriftBinaryFrontendService(
override val serverable: Serverable)
extends ThriftBinaryFrontendService("TrinoThriftBinaryFrontendService") {

override lazy val discoveryService: Option[Service] =
if (ServiceDiscovery.supportServiceDiscovery(conf)) {
Some(new EngineServiceDiscovery(this))
} else {
None
}
}
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -69,6 +69,7 @@
<module>externals/kyuubi-download</module>
<module>externals/kyuubi-flink-sql-engine</module>
<module>externals/kyuubi-spark-sql-engine</module>
<module>externals/kyuubi-trino-engine</module>
<module>kyuubi-assembly</module>
<module>kyuubi-common</module>
<module>kyuubi-ctl</module>
Expand Down

0 comments on commit 6ea83e0

Please sign in to comment.