public static void hdfsSmokeTest(ViewContext context) {
    try {
      Optional<Map<String, String>> props = ViewPropertyHelper.getViewConfigs(context, VIEW_CONF_KEYVALUES);
      HdfsApi api;
      if(props.isPresent()){
        api = HdfsUtil.connectToHDFSApi(context, props.get());
      }else{
        api = HdfsUtil.connectToHDFSApi(context);
      }

      api.getStatus();
    } catch (WebApplicationException ex) {
      LOG.error("Error occurred : ", ex);
      throw ex;
    } catch (Exception ex) {
      LOG.error("Error occurred : ", ex);
      throw new ServiceFormattedException(ex.getMessage(), ex);
    }
  }
Checks connection to HDFS
@param context View Context
contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java