Compiling and Running HPE Ezmeral Data Fabric Database Binary Applications

For applications that use the HPE Ezmeral Data Fabric Database Java API for binary tables, use Maven to compile and determine the application's dependencies. Then, when you run the application, specify those dependencies in the application's classpath.

Compile and Determine Dependencies

  1. Add the Data Fabric maven repository to the list of repositories in your application's pom.xml, if it is not there already:
    <repository>
          <id>mapr-releases</id>
          <url>https://repository.mapr.com/maven/</url>
          <snapshots><enabled>true</enabled></snapshots>
          <releases><enabled>true</enabled></releases>
    </repository>
    For more information, see Maven Artifacts for the HPE Ezmeral Data Fabric.
  2. Add a dependency to the HBase client project:
    <dependencies>
    <dependency>
      <groupId>org.apache.hbase</groupId>
      <artifactId>hbase-client</artifactId>
      <version><version selected from the repository></version>
    </dependency>
    <dependencies>
     
    NOTE
    • The hbase-client version mentioned above is an example. The actual version that your application requires is based on the current EEP and Data Fabric core version that you are running. The file versions are listed in the following location: https://repository.mapr.com/nexus/content/groups/mapr-public/org/apache/hbase/hbase-client/ Ensure that the version tags include reference to m7-<maprversion>. Otherwise, your applications will not be able to access HPE Ezmeral Data Fabric Database binary tables.
    • If your application uses both the HPE Ezmeral Data Fabric Database JSON and HPE Ezmeral Data Fabric Database Binary APIs, you may encounter a conflict in the netty library used by each API. To avoid this, exclude the netty library from your hbase-client dependency as follows:
      <dependency>
         <groupId>org.apache.hbase</groupId>
         <artifactId>hbase-client</artifactId>
         <version><version selected from the repository></version>
         <exclusions>
           <exclusion>
              <artifactId>netty-all</artifactId>
                 <groupId>io.netty</groupId>
           </exclusion>
         </exclusions>
      </dependency>
  3. Use Maven to compile the application and resolve dependencies. For example, you can run mvn clean package.

Running Applications

When you develop a Java application, you can use a dependency management tool such as Maven to compile your application. However, it is recommended that you do the following instead:
  1. Compile the Java application without including dependencies
  2. Specify the required classpath when you submit the application to the cluster
If you choose to bundle the JAR file, and there is a mismatch between the bundled JAR file and the version that your Data Fabric cluster expects, this can result in failures. The failures differ depending on the version of Data Fabric you are using. For more information, see Using the File System JAR to Connect to the Cluster.

If the cluster is secure, the node must also have a Data Fabric ticket configured for the user that runs the application. See Managing Tickets.

You can use the following command to launch HPE Ezmeral Data Fabric Database binary applications:
java -cp <classpath>:. -Djava.library.path=/opt/mapr/lib <main class JAR> <command line arguments>
NOTE
The classpath should include items that are part of the 'hbase classpath' script plus any other required dependencies.