Setting FE dev env using Eclipse

    1. Under Linux, enter the source code directory and execute the following command:

    2. If use windows as development environment, then package the generated fe/fe-core/target/generated-sources directory:

      fe/fe-core/target/ && tar czf java.tar.gz generated-sources/

    3. Copy java.tar.gz to the fe/fe-core/target/ directory of the development environment and unzip

      1. cp java.tar.gz /path/to/doris/fe/fe-core/target/

    Import FE project

    1. In the fe/ directory of the development environment, execute the following command to generate the Eclipse project file:

      cd /path/to/doris/fe/ && mvn -npr eclipse:eclipse -Dskip.plugin=true

      After the execution is completed, the .project and .classpath files will be generated in the fe/ directory.

    2. Import FE project

      • Open Eclipse, choose File -> Import.
      • Choose General -> Existing Projects into Workspace.
      • Select root directory and choose fe/ directory, click Finish to finish.
      • Right click the project, and choose Build Path -> Configure Build Path.
      • In the Java Build Path dialog, choose the Source tab, click , and select the java/ directory that was copied and unzipped before adding.
      • Click Apply and Close to finish.

    At this point, FE project import is complete. The project directory in Eclipse is roughly as follows:

    Right-click on the unit test file you want to run and select Run As -> JUnit Test. (If you want to debug, select Debug As -> JUnit Test).

    If the following error occurs:

    Then right-click the unit test file and select Run As -> Run Configurations.... (If you want to debug, select Debug As -> Debug Configurations...).

    Add to the VM arguments in the Arguments tab:

    1. -javaagent:${settings.localRepository}/org/jmockit/jmockit/1.48/jmockit-1.48.jar

    Among them, ${settings.localRepository} should be replaced with the path of the maven library path, such as:

    Then just run Run/Debug.

    Run FE

    You can directly start an FE process in Eclipse to facilitate debugging the code.

    1. Create a runtime directory

      1. mkdir /path/to/doris/fe/run/
      2. cd /path/to/doris/fe/run/
      3. mkdir conf/ log/ palo-meta/
    2. Create configuration file

    3. Right-click PaloFe.java and select Run As -> Java Application to start FE.
    1. Update lexical and grammar files or proto and thrift files

      If you modified fe/src/main/cup/sql_parser.cup or fe/src/main/jflex/sql_scanner.flex file or proto and thrift files. You need to execute the following commands in the fe/ directory:

      Then refresh the project in Eclipse.

    2. Update maven dependencies

      If you update the dependency in fe/pom.xml, you need to execute the following command in the fe/ directory:

      mvn -npr eclipse:eclipse -Dskip.plugin=true

      Then refresh the project in Eclipse. If it cannot be updated, it is recommended to delete the project and import it again according to this document.

    Imports Order

    In order to maintain the Imports order of Java, please perform the following operations to set the Imports Order of the project.

      1. #Organize Import Order
      2. #Wed Jul 01 16:42:47 CST 2020
      3. 4=javax
      4. 3=java
      5. 2=org
      6. 1=com
      7. 0=org.apache.doris