public static HbaseSinkConfig load(String yamlFile) throws IOException {
        ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
        return mapper.readValue(new File(yamlFile), HbaseSinkConfig.class);
    }
@Test
    public final void loadFromMapTest() throws IOException {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("hbaseConfigResources", "hbase-site.xml");
        map.put("zookeeperQuorum", "localhost");
        map.put("zookeeperClientPort", "2181");
        map.put("zookeeperZnodeParent", "/hbase");
        map.put("tableName", "pulsar_hbase");
        map.put("rowKeyName", "rowKey");
        map.put("familyName", "info");

        HbaseSinkConfig config = HbaseSinkConfig.load(map);
        assertNotNull(config);
        assertEquals("hbase-site.xml", config.getHbaseConfigResources());
        assertEquals("localhost", config.getZookeeperQuorum());
        assertEquals("2181", config.getZookeeperClientPort());
        assertEquals("/hbase", config.getZookeeperZnodeParent());
        assertEquals("pulsar_hbase", config.getTableName());
        assertEquals("rowKey", config.getRowKeyName());
        assertEquals("info", config.getFamilyName());

    }