public HdfsApi getApi() {
    if (_api == null) {
      try {
        if(this.customProperties != null){
          _api = HdfsUtil.connectToHDFSApi(context, customProperties);
        }else{
          _api = HdfsUtil.connectToHDFSApi(context);
        }
      } catch (Exception ex) {
        logger.error("Exception while connecting to hdfs : {}", ex.getMessage(), ex);
        throw new ServiceFormattedException("HdfsApi connection failed. Check \"webhdfs.url\" property", ex);
      }
    }
    return _api;
  }
Ger HdfsApi instance
@return HdfsApi business delegate
contrib/views/commons/src/main/java/org/apache/ambari/view/commons/hdfs/HdfsService.java