美文网首页elasticsearch
玩转Elasticsearch源码-Elasticsearch构

玩转Elasticsearch源码-Elasticsearch构

作者: 左手java右手go | 来源:发表于2018-12-24 18:47 被阅读1次

    作为 玩转Elasticsearch源码 系列第二篇,先介绍下分析思路,本系列不会直接进入代码执行流程,而是先从Elasticsearch源代码的工程结构,构建任务等入手,按照先整体脉络,后细节的方式进行。

    Gradle

    Gradle是一个基于Apache AntApache Maven概念的项目自动化建构工具。它使用一种基于Groovy特定领域语言来声明项目设置,而不是传统的XML[2]
    当前其支持的语言限于JavaGroovyScala[3],计划未来将支持更多的语言。

    构建命令

    进入ES源码根目录,执行

    gradle tasks
    

    可以看到ES所有tasks:

    Application tasks
    -----------------
    distShadowTar - Bundles the project as a JVM application with libs and OS specific scripts.
    将项目作为JVM应用程序与libs和特定于OS的脚本捆绑在一起。
    distShadowZip - Bundles the project as a JVM application with libs and OS specific scripts.
    将项目作为JVM应用程序与libs和特定于OS的脚本捆绑在一起。
    installShadowApp - Installs the project as a JVM application along with libs and OS specific scripts.
    将项目安装为JVM应用程序,以及libs和特定于操作系统的脚本
    run - Runs this project as a JVM application
    将此项目作为JVM应用程序运行
    runShadow - Runs this project as a JVM application using the shadow jar
    使用影子jar将此项目作为JVM应用程序运行
    startShadowScripts - Creates OS specific scripts to run the project as a JVM application using the shadow jar
    创建特定于操作系统的脚本,使用影子jar将项目作为JVM应用程序运行
    
    Benchmark tasks
    ---------------
    jmh - Runs all microbenchmarks
    运行所有微基准测试
    jmhJar - Generates an uberjar with the microbenchmarks and all dependencies
    使用微基准测试和所有依赖项生成uberjar
    
    Build tasks
    -----------
    assemble - Assembles the outputs of this project.
    编译工程到outputs
    build - Assembles and tests this project.
    编译和测试这个项目。
    buildDependents - Assembles and tests this project and all projects that depend on it.
    编译和测试这个项目以及所有依赖它的项目。
    buildNeeded - Assembles and tests this project and all projects it depends on.
    编译和测试这个项目以及它所依赖的所有项目。
    classes - Assembles main classes.
    编译主类。
    clean - Deletes the build directory.
    删除构建目录。
    jar - Assembles a jar archive containing the main classes.
    编译包含主要类的jar归档文件。
    javadocJar - Assembles a jar containing javadocs.
    装配一个包含javadoc的jar。
    sourcesJar - Assembles a jar containing source files.
    装配一个包含源文件的jar。
    testClasses - Assembles test classes.
    编译测试类。
    war - Generates a war archive with all the compiled classes, the web-app content and the libraries.
    生成包含所有编译类、web - app内容和库的war存档。
    
    
    Build Setup tasks
    -----------------
    init - Initializes a new Gradle build. [incubating]
    初始化一个新的Gradle构建。(孵化)
    wrapper - Generates Gradle wrapper files. [incubating]
    生成Gradle包装文件。(孵化)
    
    Distribution tasks
    ------------------
    assembleDist - Assembles the main distributions
    编译主要的发行版
    distTar - Bundles the project as a distribution.
    将项目打包为一个发行版。
    distZip - Bundles the project as a distribution.
    将项目打包为一个发行版。
    installDist - Installs the project as a distribution as-is.
    将项目安装为按原样发布的版本。
    
    
    Docs tasks
    ----------
    listConsoleCandidates
    listSnippets - List each snippet
    列表中每一个片段
    
    Documentation tasks
    -------------------
    groovydoc - Generates Groovydoc API documentation for the main source code.
    为主要源代码生成Groovydoc API文档。
    javadoc - Generates Javadoc API documentation for the main source code.
    为主要源代码生成Javadoc API文档。
    
    Help tasks
    ----------
    buildEnvironment - Displays all buildscript dependencies declared in root project 'elasticsearch'.
    显示根项目“elasticsearch”中声明的所有构建脚本依赖项。
    components - Displays the components produced by root project 'elasticsearch'. [incubating]
    显示根项目“elasticsearch”生成的组件。(孵化)
    dependencies - Displays all dependencies declared in root project 'elasticsearch'.
    显示根项目“elasticsearch”中声明的所有依赖项。
    dependencyInsight - Displays the insight into a specific dependency in root project 'elasticsearch'.
    显示根项目“elasticsearch”中的特定依赖关系。
    dependentComponents - Displays the dependent components of components in root project 'elasticsearch'. [incubating]
    显示根项目“elasticsearch”中组件的依赖组件。(孵化)
    help - Displays a help message.
    显示帮助消息。
    model - Displays the configuration model of root project 'elasticsearch'. [incubating]
    显示根项目“elasticsearch”的配置模型。(孵化)
    projects - Displays the sub-projects of root project 'elasticsearch'.
    显示根项目的子项目。
    properties - Displays the properties of root project 'elasticsearch'.
    显示根项目的属性。
    tasks - Displays the tasks runnable from root project 'elasticsearch' (some of the displayed tasks may belong to subprojects).
    显示可从根项目“elasticsearch”运行的任务(显示的一些任务可能属于子项目)。
    
    
    IDE tasks
    ---------
    cleanEclipse - Cleans all Eclipse files.
    清除所有Eclipse文件。
    cleanEclipseWtp - Cleans Eclipse wtp configuration files.
    清理Eclipse wtp配置文件。
    cleanIdea - Cleans IDEA project files (IML, IPR)
    清理idea项目文件(IML、IPR)
    cleanIdeaBuildDir - Deletes the IDEA build directory.
    删除IDEA构建目录。
    eclipse - Generates all Eclipse files.
    生成所有Eclipse文件。
    eclipseWtp - Generates Eclipse wtp configuration files.
    生成Eclipse wtp配置文件。
    idea - Generates IDEA project files (IML, IPR, IWS)
    生成IDEA项目文件(IML、IPR、IWS)
    
    Publishing tasks
    ----------------
    generatePomFileForClientJarPublication - Generates the Maven POM file for publication 'clientJar'.
    为发布“clientJar”生成Maven POM文件。
    generatePomFileForNebulaPublication - Generates the Maven POM file for publication 'nebula'.
    为发布“nebula”生成Maven POM文件
    generatePomFileForNebulaRealPomPublication - Generates the Maven POM file for publication 'nebulaRealPom'.
    为发布“nebulaRealPom”生成Maven POM文件。
    generatePomFileForZipPublication - Generates the Maven POM file for publication 'zip'.
    为发布“zip”生成Maven POM文件。
    generatePomFileForZipRealPublication - Generates the Maven POM file for publication 'zipReal'.
    为发布“zip Real”生成Maven POM文件。
    publish - Publishes all publications produced by this project.
    出版由本项目制作的所有出版物。
    publishClientJarPublicationToMavenLocal - Publishes Maven publication 'clientJar' to the local Maven repository.
    将Maven发布“clientJar”到本地Maven存储库。
    publishNebulaPublicationToMavenLocal - Publishes Maven publication 'nebula' to the local Maven repository.
    将Maven发布“nebula”到本地Maven存储库。
    publishNebulaRealPomPublicationToMavenLocal - Publishes Maven publication 'nebulaRealPom' to the local Maven repository.
    将Maven出版物“nebulaRealPom”发布到本地Maven存储库。
    publishToMavenLocal - Publishes all Maven publications produced by this project to the local Maven cache.
    将此项目生成的所有Maven发布发布到本地Maven缓存。
    publishZipPublicationToMavenLocal - Publishes Maven publication 'zip' to the local Maven repository.
    将Maven发布“zip”到本地Maven存储库。
    publishZipRealPublicationToMavenLocal - Publishes Maven publication 'zipReal' to the local Maven repository.
    将Maven发布“zip Real”到本地Maven存储库。
    
    Shadow tasks
    ------------
    knows - Do you know who knows?
    shadowJar - Create a combined JAR of project and runtime dependencies
    创建项目和运行时依赖项的组合JAR
    
    Verification tasks
    ------------------
    branchConsistency - Ensures this branch is internally consistent. For example, that versions constants match released versions.
    确保这个分支内部一致。例如,版本常量匹配发布的版本。
    bwcTest - Runs backwards compatibility tests.
    运行向后兼容性测试。
    check - Runs all checks.
    运行所有检查。
    integTest - Multi-node tests
    多节点测试
    packagingTest - Tests yum/apt packages using vagrant and bats.
        使用agrant and bats测试yum / apt包。
        Specify the vagrant boxes to test using the gradle property 'vagrant.boxes'.
        指定要使用gradle属性'vagrant.boxes'测试的vagrant boxes.
        'sample' can be used to test a single yum and apt box. 'all' can be used to
        “sample”可以用来测试单个yum和apt box。
        test all available boxes. The available boxes are:
        [centos-6, centos-7, debian-8, debian-9, fedora-26, fedora-27, oel-6, oel-7, opensuse-42, sles-12, ubuntu-1404, ubuntu-1604]
    platformTest - Test unit and integ tests on different platforms using vagrant.
        使用vagrant在不同平台上进行测试单元和集成测试。
        Specify the vagrant boxes to test using the gradle property 'vagrant.boxes'.
        指定要使用gradle属性'vagrant.boxes'测试的vagrant boxes。
        'all' can be used to test all available boxes. The available boxes are:
        “all”可用于测试所有可用的boxes,可用的boxes有:
        [centos-6, centos-7, debian-8, debian-9, fedora-26, fedora-27, oel-6, oel-7, opensuse-42, sles-12, ubuntu-1404, ubuntu-1604]
    precommit - Runs all non-test checks.
        运行所有非测试检查。
    run - Runs elasticsearch in the foreground
        在前台运行elasticsearch
    stop - Stop any tasks from tests that still may be running
        从仍然可能运行的测试中停止任何任务
    test - Runs unit tests with the randomized testing framework
        使用随机测试框架运行单元测试
    vagrantCheckVersion - Check the Vagrant version
        检查Vagrant version
    vagrantSmokeTest - Smoke test the specified vagrant boxes
        冒烟测试指定的vagrant boxes
    virtualboxCheckVersion - Check the Virtualbox version
        检查Virtualbox版本
    
    
    To see all tasks and more detail, run gradle tasks --all
    要查看所有任务和更多细节,请运行 run gradle tasks --all
    
    To see more detail about a task, run gradle help --task <task>
    要查看任务的更多细节,请运行 gradle help --task <task>
    

    相关文章

      网友评论

        本文标题:玩转Elasticsearch源码-Elasticsearch构

        本文链接:https://www.haomeiwen.com/subject/nwhpkqtx.html