我是靠谱客的博主 义气季节,最近开发中收集的这篇文章主要介绍presto源码编译,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

fork代码:https://github.com/trinodb/trino

下载代码到本地,如果下载慢,可以通过码云导入

 

进入代码目录,切换分支,git checkout 347

 

环境要求:

  • Mac OS X or Linux
  • Java 11.0.7+, 64-bit
  • Docker 

 

编译:mvn clean install -DskipTests

速度很慢,切换阿里云的maven源

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <mirrors>
        <mirror>
            <id>aliyunmaven</id>
            <mirrorOf>*</mirrorOf>
            <name>阿里云公共仓库</name>
            <url>https://maven.aliyun.com/repository/public</url>
        </mirror>
        <mirror>
            <id>aliyunmaven</id>
            <mirrorOf>*</mirrorOf>
            <name>阿里云谷歌仓库</name>
            <url>https://maven.aliyun.com/repository/google</url>
        </mirror>
        <mirror>
            <id>aliyunmaven</id>
            <mirrorOf>*</mirrorOf>
            <name>阿里云阿帕奇仓库</name>
            <url>https://maven.aliyun.com/repository/apache-snapshots</url>
        </mirror>
        <mirror>
            <id>aliyunmaven</id>
            <mirrorOf>*</mirrorOf>
            <name>阿里云spring仓库</name>
            <url>https://maven.aliyun.com/repository/spring</url>
        </mirror>
        <mirror>
            <id>aliyunmaven</id>
            <mirrorOf>*</mirrorOf>
            <name>阿里云spring插件仓库</name>
            <url>https://maven.aliyun.com/repository/spring-plugin</url>
        </mirror>
    </mirrors>
</settings>

 

编译成功:

 

导入IDE:

  • Main Class: io.prestosql.server.PrestoServer
  • VM Options: -ea -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties -Djdk.attach.allowAttachSelf=true
  • Working directory: $MODULE_DIR$
  • Use classpath of module: presto-server-main

 

In the SDKs section, ensure that JDK 11 is selected (create one if none exist)

 

 

启动PrestoServer main方法,成功日志:

2021-01-16T02:38:46.481+0800 INFO main io.airlift.bootstrap.LifeCycleManager Life cycle starting...
2021-01-16T02:38:46.481+0800 INFO main io.airlift.bootstrap.LifeCycleManager Life cycle startup complete
2021-01-16T02:38:46.483+0800 INFO main io.prestosql.metadata.StaticCatalogStore -- Added catalog memsql using connector memsql --
2021-01-16T02:38:46.485+0800 INFO main io.prestosql.security.AccessControlManager -- Loading system access control etc/access-control.properties --
2021-01-16T02:38:46.487+0800 INFO main io.prestosql.security.AccessControlManager -- Loaded system access control default --
2021-01-16T02:38:46.527+0800 INFO main io.prestosql.server.Server ======== SERVER STARTED ========

 

启动客户端:

java -jar presto-cli/target/presto-cli-347-executable.jar --server http://localhost:8080

presto> show catalogs;
Catalog 
------------
blackhole 
druid 
example 
hive

 

访问:http://127.0.0.1:8080/ui/

 

 

参考资料:https://zhuanlan.zhihu.com/p/318608271

 

最后

以上就是义气季节为你收集整理的presto源码编译的全部内容,希望文章能够帮你解决presto源码编译所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(43)

评论列表共有 0 条评论

立即
投稿
返回
顶部