⛔ Cloudera Altus has reached end of life, so this repository is no longer maintained. ⛔
To work with Cloudera Data Platform (CDP), use the Cloudera CDP SDK for Java instead.
This is a set of simple sample applications that demonstrates how to connect to Altus service to make basic requests using the Altus SDK. The sample code is based on the tutorials mentioned in the Cloudera documentation.
- Must have a valid Altus account. Please refer to Getting Started in Altus.
- Make sure you have a valid Altus Environment associated with your cloud provider per Altus requirements. These samples assume the use of an AWS environment. Please refer to Altus Environment.
- Make sure you have the Altus credentials to run the project. Please refer to
Configure the Altus Client with the API Access Key.
The Altus credential provider chain
DefaultCredentialProviderChain.javalooks for credentials in this order:- EnvironmentVariables:
AltusEnvironmentVariableCredentialsProvider.java - Java System properties
AltusSystemPropertiesCredentialsProvider.java - Altus credentials file:
AltusProfileCredentialsProvider.java
- EnvironmentVariables:
- Java 1.8 or newer.
- Maven 3.5 or newer.
ListClusters: List the data engineering clusters present in your Altus account.HiveIntegration: Run the data transformation using a Hive job.MapReduceIntegration: Run the data transformation using a MapReduce job.SparkIntegration: Run the data transformation using a Spark job.SparkAllInOneIntegration: Run the data transformation using a Spark job and the Altus SDK's all-in-one API that defines the cluster and the job in a single call.
- Checkout the source code
- Replace the missing values in
src/main/resources/SampleResources.ini. file such asenvironmentName,outputLocation,ssh_public_key_location, etc. - Build the samples with maven:
mvn clean install
- Run the command from the
targetdirectory. SparkAllInOneIntegration is the default class so no need to specify class.java -jar altus-sdk-java-samplecode-0.1-SNAPSHOT.jar
- To run other classes such as the HiveIntegration class from the
targetdirectory:java -cp altus-sdk-java-samplecode-0.1-SNAPSHOT.jar:lib/* com.cloudera.altus.sdk.samples.HiveIntegration