@Test public void testConvertResultToEntity() { HBaseDataStore hbasedatastore = new HBaseDataStore(); hbasedatastore.convertResultToEntity("tableName", (Result) null); hbasedatastore.convertResultToEntity("tableName", result); }
public HBaseEntity convertResultToEntity(String tableName, Result result) { if (result == null) { return null; } HBaseEntity resultEntity = new HBaseEntity(); resultEntity.setTableName(tableName); resultEntity.setRowKey(Bytes.toString(result.getRow())); List<HBaseColumn> noSQLColumnList = new ArrayList<>(); NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = result.getMap(); for (byte[] currentByteFamily : map.keySet()) { NavigableMap<byte[], NavigableMap<Long, byte[]>> columnMap = map.get(currentByteFamily); for (byte[] currentByteColumn : columnMap.keySet()) { HBaseColumn noSQLColumn = new HBaseColumn(); noSQLColumn.setColumnFamily(Bytes.toString(currentByteFamily)); noSQLColumn.setColumnQualifier(Bytes.toString(currentByteColumn)); noSQLColumn.setValue(Bytes.toString(result.getValue(currentByteFamily, currentByteColumn))); noSQLColumnList.add(noSQLColumn); } } resultEntity.setColumns(noSQLColumnList); return resultEntity; }
HBaseDataStore { public HBaseEntity convertResultToEntity(String tableName, Result result) { if (result == null) { return null; } HBaseEntity resultEntity = new HBaseEntity(); resultEntity.setTableName(tableName); resultEntity.setRowKey(Bytes.toString(result.getRow())); List<HBaseColumn> noSQLColumnList = new ArrayList<>(); NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = result.getMap(); for (byte[] currentByteFamily : map.keySet()) { NavigableMap<byte[], NavigableMap<Long, byte[]>> columnMap = map.get(currentByteFamily); for (byte[] currentByteColumn : columnMap.keySet()) { HBaseColumn noSQLColumn = new HBaseColumn(); noSQLColumn.setColumnFamily(Bytes.toString(currentByteFamily)); noSQLColumn.setColumnQualifier(Bytes.toString(currentByteColumn)); noSQLColumn.setValue(Bytes.toString(result.getValue(currentByteFamily, currentByteColumn))); noSQLColumnList.add(noSQLColumn); } } resultEntity.setColumns(noSQLColumnList); return resultEntity; } }
HBaseDataStore { public HBaseEntity convertResultToEntity(String tableName, Result result) { if (result == null) { return null; } HBaseEntity resultEntity = new HBaseEntity(); resultEntity.setTableName(tableName); resultEntity.setRowKey(Bytes.toString(result.getRow())); List<HBaseColumn> noSQLColumnList = new ArrayList<>(); NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = result.getMap(); for (byte[] currentByteFamily : map.keySet()) { NavigableMap<byte[], NavigableMap<Long, byte[]>> columnMap = map.get(currentByteFamily); for (byte[] currentByteColumn : columnMap.keySet()) { HBaseColumn noSQLColumn = new HBaseColumn(); noSQLColumn.setColumnFamily(Bytes.toString(currentByteFamily)); noSQLColumn.setColumnQualifier(Bytes.toString(currentByteColumn)); noSQLColumn.setValue(Bytes.toString(result.getValue(currentByteFamily, currentByteColumn))); noSQLColumnList.add(noSQLColumn); } } resultEntity.setColumns(noSQLColumnList); return resultEntity; } HBaseDataStore();  HBaseDataStore(HBaseDataStoreContext context); }
HBaseDataStore { public HBaseEntity convertResultToEntity(String tableName, Result result) { if (result == null) { return null; } HBaseEntity resultEntity = new HBaseEntity(); resultEntity.setTableName(tableName); resultEntity.setRowKey(Bytes.toString(result.getRow())); List<HBaseColumn> noSQLColumnList = new ArrayList<>(); NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = result.getMap(); for (byte[] currentByteFamily : map.keySet()) { NavigableMap<byte[], NavigableMap<Long, byte[]>> columnMap = map.get(currentByteFamily); for (byte[] currentByteColumn : columnMap.keySet()) { HBaseColumn noSQLColumn = new HBaseColumn(); noSQLColumn.setColumnFamily(Bytes.toString(currentByteFamily)); noSQLColumn.setColumnQualifier(Bytes.toString(currentByteColumn)); noSQLColumn.setValue(Bytes.toString(result.getValue(currentByteFamily, currentByteColumn))); noSQLColumnList.add(noSQLColumn); } } resultEntity.setColumns(noSQLColumnList); return resultEntity; } 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 HBaseEntity convertResultToEntity(String tableName, Result result) { if (result == null) { return null; } HBaseEntity resultEntity = new HBaseEntity(); resultEntity.setTableName(tableName); resultEntity.setRowKey(Bytes.toString(result.getRow())); List<HBaseColumn> noSQLColumnList = new ArrayList<>(); NavigableMap<byte[], NavigableMap<byte[], NavigableMap<Long, byte[]>>> map = result.getMap(); for (byte[] currentByteFamily : map.keySet()) { NavigableMap<byte[], NavigableMap<Long, byte[]>> columnMap = map.get(currentByteFamily); for (byte[] currentByteColumn : columnMap.keySet()) { HBaseColumn noSQLColumn = new HBaseColumn(); noSQLColumn.setColumnFamily(Bytes.toString(currentByteFamily)); noSQLColumn.setColumnQualifier(Bytes.toString(currentByteColumn)); noSQLColumn.setValue(Bytes.toString(result.getValue(currentByteFamily, currentByteColumn))); noSQLColumnList.add(noSQLColumn); } } resultEntity.setColumns(noSQLColumnList); return resultEntity; } 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);  }