tree: a8454e6b2fd118e4e58f2a80ad9e3ad98a2c8dd9 [path history] [tgz]
  1. src/
  2. pom.xml
  3. readme.md
contrib/views/utils/readme.md

Utils

Description

This module provides common utils for views

Requirements

  • Ambari 2.1.0 or later

HDFS Utility

HdfsApi class provides business delegate for HDFS client that provides proxyuser configuration. You can create the HdfsApi based on your ViewContext:

HdfsApi api = HdfsUtil.connectToHDFSApi(viewContext);

It will read instance properties and create HdfsApi configured to specific cluster. NameNodes HA is supported.

AmbariApi

AmbariApi provides methods to get Ambari configurations and cluster topology.

Custer association functionality:

AmbariApi api = new AmbariApi(viewContext);
Cluster cluster = api.getCluster();

It can work with local cluster or with remote cluster based on your instance properties of Ambari URL, username and password in the ViewContext. To determine if you have associated cluster, either local or remote:

boolean isAssociated = api.isClusterAssociated();

Also provides the API to get cluster topology:

List<String> nnHosts = api.getHostsWithComponent("NAMENODE");