• Data Ingestion Service

dis
  1. Help Center
  2. Data Ingestion Service
  3. User Guide
  4. DIS SDK Usage Guide
  5. Configuring a Sample Project

Configuring a Sample Project

The dis-sdk-1.2.3.zip package downloaded in Downloading SDKs provides a sample project. You can use a development tool (such as Eclipse) to compile and run a sample project on a local device. You can also develop applications based on the sample project. The sample project code in available in the \dis-sdk-demo\src\com\bigdata\dis\sdk\demo directory.

Sample Code

Describes

ConsumerDemo.java

How to download data.

ProducerDemo.java

How to upload data.

Procedure

  1. Decompress the dis-sdk-1.2.3.zip package downloaded in Downloading SDKs to obtain the dis-sdk-demo package and sample project.
  2. Import an Eclipse project.

    1. Launch Eclipse. Choose File > Import.
    1. In the Import window, choose General > Existing Projects into Workspace and click Next.
    2. In the Import Projects dialog box, click Browse to select the location of the sample project dis-sdk-demo and select the sample project name.
      Figure 1 Import Projects
    3. Click Finish to import the project.

  3. Configure the Demo project.

    1. Set the project encoding scheme to UTF-8.
      1. In the navigation pane, choose Project Explorer. Right-click the chosen project and choose Properties from the shortcut menu.
      2. In the navigation pane of the Properties for dis-sdk-demo window, choose Resource.
      3. In the Text file encoding area of the Resource pane, select UTF-8 from the Other drop-down list.
      4. Click Apply and Close to complete the configuration.
      Figure 2 Resource

    2. Import the dependency package, which is a JAR package.
      1. In the navigation pane, choose Project Explorer. Right-click the chosen project and choose Properties from the shortcut menu.
      2. In the navigation pane of the Properties for dis-sdk-demo window, choose Java Build Path.
      3. In the Java Build Path window, click the Libraries tab. On the Libraries tab page, click Add External JARs.
      4. In the Add External JARs dialog box, select the location of the dis-sdk folder in the dis-sdk-1.2.3 directory decompressed from the SDK package and click Open.
      5. Click Apply and Close to import all JAR files in the dis-sdk-1.2.3 and third_lib folders into the project.
      Figure 3 Java Build Path
    3. Add a JDK.
      1. In the navigation pane, choose Project Explorer. Right-click the chosen project and choose Properties from the shortcut menu.
      2. In the navigation pane of the Properties for dis-sdk-demo window, choose Java Build Path.
      3. In the Java Build Path window, click the Libraries tab. On the Libraries tab page, click Add Library.
      4. In the Add Library dialog box, select JRE System Library and click Next. Confirm that Workspace default JRE is jdk1.8 or a later version.
      5. Click Finish to exit the Add Library dialog box.
      6. Click Apply and Close to add the JDK.