@Test public void testCreateTable() throws Exception { hbaseDataStore.createTable(null); hbaseDataStore.createTable("tableName"); }
public void createTable(String tableName) throws IOException { LOG.debug("Entering createTable(tableName)"); if (tableName == null) { return; } ClassLoader ocl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(HBaseConfiguration.class.getClassLoader()); try (HBaseAdmin hbase = getNewHBaseAdmin()) { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor column = new HColumnDescriptor("c1".getBytes(StandardCharsets.UTF_8)); desc.addFamily(column); if (!hbase.tableExists(tableName)) { hbase.createTable(desc); } } catch (IllegalArgumentException e) { throw new IOException("Error creating htable " + tableName, e); } finally { Thread.currentThread().setContextClassLoader(ocl); } LOG.debug("Exiting createTable(tableName)"); }
HBaseDataStore { public void createTable(String tableName) throws IOException { LOG.debug("Entering createTable(tableName)"); if (tableName == null) { return; } ClassLoader ocl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(HBaseConfiguration.class.getClassLoader()); try (HBaseAdmin hbase = getNewHBaseAdmin()) { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor column = new HColumnDescriptor("c1".getBytes(StandardCharsets.UTF_8)); desc.addFamily(column); if (!hbase.tableExists(tableName)) { hbase.createTable(desc); } } catch (IllegalArgumentException e) { throw new IOException("Error creating htable " + tableName, e); } finally { Thread.currentThread().setContextClassLoader(ocl); } LOG.debug("Exiting createTable(tableName)"); } }
HBaseDataStore { public void createTable(String tableName) throws IOException { LOG.debug("Entering createTable(tableName)"); if (tableName == null) { return; } ClassLoader ocl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(HBaseConfiguration.class.getClassLoader()); try (HBaseAdmin hbase = getNewHBaseAdmin()) { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor column = new HColumnDescriptor("c1".getBytes(StandardCharsets.UTF_8)); desc.addFamily(column); if (!hbase.tableExists(tableName)) { hbase.createTable(desc); } } catch (IllegalArgumentException e) { throw new IOException("Error creating htable " + tableName, e); } finally { Thread.currentThread().setContextClassLoader(ocl); } LOG.debug("Exiting createTable(tableName)"); } HBaseDataStore();  HBaseDataStore(HBaseDataStoreContext context); }
HBaseDataStore { public void createTable(String tableName) throws IOException { LOG.debug("Entering createTable(tableName)"); if (tableName == null) { return; } ClassLoader ocl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(HBaseConfiguration.class.getClassLoader()); try (HBaseAdmin hbase = getNewHBaseAdmin()) { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor column = new HColumnDescriptor("c1".getBytes(StandardCharsets.UTF_8)); desc.addFamily(column); if (!hbase.tableExists(tableName)) { hbase.createTable(desc); } } catch (IllegalArgumentException e) { throw new IOException("Error creating htable " + tableName, e); } finally { Thread.currentThread().setContextClassLoader(ocl); } LOG.debug("Exiting createTable(tableName)"); } HBaseDataStore();  HBaseDataStore(HBaseDataStoreContext context); HTableInterface getConnection(String tableName); void createTable(String tableName); HBaseEntity create(final HBaseEntity entity); List<HBaseEntity> create(List<HBaseEntity> entityList); List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,
            String family, String qualifier); List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,
            String family, String qualifier, long pageSize); List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,
            String family, List<String> qualifierList); List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,
            String family, List<String> qualifierList, long pageSize); List<HBaseEntity> getDataByTimeRange(String tableName, long startTime, long endTime); List<HBaseEntity> getDataByTimeRange(String tableName, List<String> filters, long startTime, long endTime); void deleteByTimestamp(String tableName, long timestamp); HBaseEntity convertResultToEntity(String tableName, Result result); void flushCommit(String tableName); void closeConnection(String tableName); void closeConnection(HTable htable); }
HBaseDataStore { public void createTable(String tableName) throws IOException { LOG.debug("Entering createTable(tableName)"); if (tableName == null) { return; } ClassLoader ocl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(HBaseConfiguration.class.getClassLoader()); try (HBaseAdmin hbase = getNewHBaseAdmin()) { HTableDescriptor desc = new HTableDescriptor(tableName); HColumnDescriptor column = new HColumnDescriptor("c1".getBytes(StandardCharsets.UTF_8)); desc.addFamily(column); if (!hbase.tableExists(tableName)) { hbase.createTable(desc); } } catch (IllegalArgumentException e) { throw new IOException("Error creating htable " + tableName, e); } finally { Thread.currentThread().setContextClassLoader(ocl); } LOG.debug("Exiting createTable(tableName)"); } HBaseDataStore();  HBaseDataStore(HBaseDataStoreContext context); HTableInterface getConnection(String tableName); void createTable(String tableName); HBaseEntity create(final HBaseEntity entity); List<HBaseEntity> create(List<HBaseEntity> entityList); List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,
            String family, String qualifier); List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,
            String family, String qualifier, long pageSize); List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,
            String family, List<String> qualifierList); List<HBaseEntity> getDataByRowFamilyQualifier(String tableName, String startRow, String endRow,
            String family, List<String> qualifierList, long pageSize); List<HBaseEntity> getDataByTimeRange(String tableName, long startTime, long endTime); List<HBaseEntity> getDataByTimeRange(String tableName, List<String> filters, long startTime, long endTime); void deleteByTimestamp(String tableName, long timestamp); HBaseEntity convertResultToEntity(String tableName, Result result); void flushCommit(String tableName); void closeConnection(String tableName); void closeConnection(HTable htable);  }