public void closeTable() { tableName = null; store = null; Util.closeQuietly(table); table = null; }
public void endScan() { if (currentScanner != null) { Util.closeQuietly(currentScanner); currentScanner = null; } }
@Override public void close() { Util.closeQuietly(hTable); }
@Override public void insertTableIndex(final IndexSchema indexSchema) { checkNotNull(indexSchema, "The index schema is invalid"); final Collection<IndexSchema> indices = ImmutableList.of(indexSchema); final Scanner scanner = tableScan(); while (scanner.hasNext()) { HBaseOperations.performPut(hTable, mutationFactory.insertIndices(tableId, Row.deserialize(scanner.next()), indices)); } Util.closeQuietly(scanner); }
/** * Drop the table with the given specifications. The table is not open when * this is called. * * @param tableName Name of the table to be dropped */ public void dropTable(String tableName) { Verify.isNotNullOrEmpty(tableName); Store store = storeFactory.createStore(tableName); Table table = store.openTable(tableName); table.deleteAllRows(); Util.closeQuietly(table); store.deleteTable(tableName); }
Util.closeQuietly(scanner); Util.closeQuietly(t);