public static Configuration getTimelineServiceHBaseConf(Configuration conf)
      throws IOException {
    if (conf == null) {
      throw new NullPointerException();
    }

    Configuration hbaseConf;
    String timelineServiceHBaseConfFilePath =
        conf.get(YarnConfiguration.TIMELINE_SERVICE_HBASE_CONFIGURATION_FILE);

    if (timelineServiceHBaseConfFilePath != null
          && timelineServiceHBaseConfFilePath.length() > 0) {
      LOG.info("Using hbase configuration at " +
          timelineServiceHBaseConfFilePath);
      // create a clone so that we don't mess with out input one
      hbaseConf = new Configuration(conf);
      Configuration plainHBaseConf = new Configuration(false);
      Path hbaseConfigPath = new Path(timelineServiceHBaseConfFilePath);
      try (FileSystem fs =
          FileSystem.newInstance(hbaseConfigPath.toUri(), conf);
          FSDataInputStream in = fs.open(hbaseConfigPath)) {
        plainHBaseConf.addResource(in);
        HBaseConfiguration.merge(hbaseConf, plainHBaseConf);
      }
    } else {
      // default to what is on the classpath
      hbaseConf = HBaseConfiguration.create(conf);
    }
    return hbaseConf;
  }
@Test
  void testWithHbaseConfAtLocalFileSystem() throws IOException {
    // Verifying With Hbase Conf from Local FileSystem
    Configuration conf = new Configuration();
    conf.set(YarnConfiguration.TIMELINE_SERVICE_HBASE_CONFIGURATION_FILE,
        hbaseConfigPath);
    Configuration hbaseConfFromLocal =
        HBaseTimelineStorageUtils.getTimelineServiceHBaseConf(conf);
    assertEquals("test", hbaseConfFromLocal.get("input"),
        "Failed to read hbase config from Local FileSystem");
  }