Java Client API
The CDAP Java Client API provides methods for interacting with CDAP from Java applications.
Note: Datasets are deprecated and will be removed in CDAP 7.0.0.
Maven Dependency
To use the Java Client API in your project, add this Maven dependency:
<dependency>
<groupId>io.cdap.cdap</groupId>
<artifactId>cdap-client</artifactId>
<version>${cdap.version}</version>
</dependency>
Components
The Java Client API allows you to interact with these CDAP components:
ApplicationClient:Â interacting with applications
DatasetClient:Â interacting with datasets
DatasetModuleClient:Â interacting with dataset Modules
DatasetTypeClient:Â interacting with dataset Types
MetricsClient:Â interacting with metrics
MonitorClient:Â monitoring system services
PreferencesClient:Â interacting with preferences
ProgramClient:Â interacting with MapReduce Programs, user services, workflows, and workers
QueryClient:Â querying datasets
ServiceClient:Â interacting with user services
StreamClient:Â interacting with streams
The above list links to the examples below for each portion of the API.
Configuring your *Client
Every *Client constructor requires a ClientConfig instance which configures the hostname and port of the CDAP instance that you wish to interact with.
In a non-secure (default) CDAP instance, instantiate as follows:
// Interact with the CDAP instance located at example.com, port 11015
ClientConfig clientConfig = ClientConfig.builder()
.setConnectionConfig(new ConnectionConfig("example.com", 11015, false))
.build();
In a secure CDAP instance, first pull in the cdap-authentication-client
 Maven dependency:
<dependency>
<groupId>io.cdap.cdap</groupId>
<artifactId>cdap-authentication-client</artifactId>
<version>${cdap.client.version}</version>
</dependency>
Then, instantiate as follows:
ApplicationClient
DatasetClient
DatasetModuleClient
DatasetTypeClient
MetricsClient
MonitorClient
PreferencesClient
ProgramClient
ServiceClient
StreamClient
Â
Created in 2020 by Google Inc.