After you have created an archiving application using the Data Archiving Library, you may want to run the application locally to test it before deploying it as pipeline on the HERE platform. There are two ways you can run the application locally:
- Run locally with Intellij
- Run locally with a local Flink cluster
The following information shows how to run the SDK example apps using both these methods.
- Download the HERE Data SDK examples project.
Fill in the necessary information in these two files:
- If you want to use a custom logger, modify the
log4j.propertiesfile inside the
Run this Java application:
Ensure that either the maven profile
add-dependencies-for-IDEAis selected or the checkbox for
Include dependencies with "Provided" scopein
AvroExampleRunner.javais selected before running the application.
Download Flink 1.7.1 and start a local cluster:
wget https://archive.apache.org/dist/flink/flink-1.7.1/flink-1.7.1-bin-hadoop27-scala_2.11.tgz tar -xvf flink-1.7.1-bin-hadoop27-scala_2.11.tgz chmod 777 flink-1.7.1 cd flink-1.7.1/bin start-cluster.sh
Download the HERE Data SDK examples project.
Fill in the necessary information in this file:
credentials.propertiesfile containing the credentials to allow the example application to access the input and output catalogs and place the file in the
~/.here/folder. For instructions, see Get Credentials.
Make sure that the credentials you use to generate the
credentials.properiesfile provide read permission to the input stream layer and read/write permission to the index layer. The credentials should match those in the
Alternatively, you can place the
credentials.propertiesfile in the folder:
Note that the
~/.here/folder takes priority over the
examples/data-archive/java/avro-example/src/main/resources/folder. The format for the
here.client.id = <Client Id> here.access.key.id = <Access Key Id> here.access.key.secret = <Access Key Secret> here.token.endpoint.url = <Token Endpoint>
Go to your example project root folder (
examples/data-archive/java/avro-example) and run this command:
mvn clean install
This command builds the JAR file to upload to the local Flink cluster. The output JAR file should be generated in the folder:
Go to your local Flink UI at
http://localhost:8081. Click the left menu Submit new job, then Add New to upload the JAR file (has to be platform jar file).
- To run the application, click the checkbox on the left to select your uploaded JAR file.
- Set the Entry class field to
com.here.platform.dal.DALMain, then click Submit.
- Go to "Running job" in the left menu to check whether your job is successfully running. You can also look at the Logs tab inside each job to see the generated logs. There is a
src/test/resourcethat you can copy to the