Using the Altus SDK for Java

You can use the Cloudera Altus SDK for Java to integrate Altus services with your applications. Use the Altus SDK to connect to Altus services and create and manage clusters and run jobs from your Java application or other data integration tools that you use in your organization.

To use the Altus SDK for Java, you must have an Altus account and a user account or machine user account with the appropriate role and environment to enable you to perform your required tasks in Altus. Before you use the Altus SDK to perform the tasks from an application, Cloudera recommends that you first verify that you can perform the tasks on the Altus console or through the CLI. You can use the examples provided in the Altus tutorials or run your own jobs to test that you are able to create clusters and runs jobs in Altus.

For a tutorial on clusters and jobs on AWS, see Tutorial: Clusters and Jobs on AWS.

For a tutorial on clusters and jobs on Azure, see Tutorial: Clusters and Jobs on Azure.

When you are able to successfully create clusters and run jobs on the console or using the CLI, use the Altus SDK to create clusters and run jobs from your application

To use the Altus SDK for Java, complete the following steps:
  1. Download the latest version of the Altus SDK jar files from the Altus SDK repository.
  2. Set up your API access credentials.

    Altus uses an access key to manage access to Altus services through the Altus API. You must set up the API credentials for your application.

    • Use the Cloudera Altus console to generate an access key.
      You must be an Altus administrator or have the IAMUser role to generate an API access key.
    • You can set up the API access key for your application in one of the following ways:
  3. Create your application.

    View or run the Altus SDK sample applications to understand how to use the Altus API to access Altus services.

The Altus SDK for Java sample applications show how to use the SDK to connect to Altus services and create clusters and run jobs. You can take the code in the sample applications and modify it for your own use.

You can find the sample applications on the Cloudera Altus SDK sample page on the Cloudera GitHub site. The readme.md file describes the requirements and provides instructions to run the applications.

The SDK sample applications show you how to do the following tasks:
Creating an Altus Data Engineering cluster
The BaseIntegration class contains a createAWSCluster method that shows how to configure and create a cluster. The application defines the default cluster configuration in a resource file.
Creating a cluster and running a Spark job on the cluster
The SparkAllInOneIntegration class shows how to create a cluster and submit a Spark job to run on the cluster.
Running a Hive job
The HiveIntegration class shows how run a Hive job on an existing cluster.
Running a MapReduce2 job
The MapreduceIntegration class shows how to run a MapReduce2 job on an existing cluster.

The sample applications for running Hive and Spark jobs are based on the tutorials provided in Tutorial: Clusters and Jobs on AWS. The sample application for running the MapReduce2 job is based on the example for MapReduce in MapReduce Job Example for a Cluster in AWS. You can run the tutorials and the MapReduce2 example to see how the same processes can be done on the Altus console and CLI.