@Override public void closeInputFormat() throws IOException { try { if (table != null) { table.close(); } } finally { table = null; } }
public void close() throws IOException { if (conn != null) { conn.close(); } } }
@Override public Object run() throws Exception { Get g = new Get(TEST_ROW); g.addFamily(family2); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName)) { t.get(g); } return null; } };
@Override public Object run() throws Exception { Delete d = new Delete(TEST_ROW); d.addFamily(family1); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName)) { t.delete(d); } return null; } };
@Override public Object run() throws Exception { Delete d = new Delete(TEST_ROW); d.addColumn(family1, qualifier); // d.deleteFamily(family1); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName)) { t.delete(d); } return null; } };
private void createTableWithCoprocessor(TableName tableName, String coprocessor) throws IOException { TableDescriptor tableDesc = TableDescriptorBuilder.newBuilder(tableName) .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(CF1_BYTES).build()) .setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(CF2_BYTES).build()) .setCoprocessor(coprocessor).build(); connection.getAdmin().createTable(tableDesc); }
@Override protected ScannerCallable createScannerCallable() { if (!scan.includeStartRow() && !isEmptyStartRow(scan.getStartRow())) { // we have not implemented locate to next row for sync client yet, so here we change the // inclusive of start row to true. scan.withStartRow(createClosestRowAfter(scan.getStartRow()), true); } return new ScannerCallable(getConnection(), getTable(), scan, this.scanMetrics, this.rpcControllerFactory); } }
@Override public CompletableFuture<Result> get(Get get) { return timelineConsistentRead(conn.getLocator(), tableName, get, get.getRow(), RegionLocateType.CURRENT, replicaId -> get(get, replicaId), readRpcTimeoutNs, conn.connConf.getPrimaryCallTimeoutNs(), retryTimer); }
public static ScanResultCache createScanResultCache(Scan scan) { if (scan.getAllowPartialResults()) { return new AllowPartialScanResultCache(); } else if (scan.getBatch() > 0) { return new BatchScanResultCache(scan.getBatch()); } else { return new CompleteScanResultCache(); } }
@Override protected Void postOperationResult(final Void result, final long deadlineTs) throws IOException, TimeoutException { // Delete cached information to prevent clients from using old locations ((ClusterConnection) getAdmin().getConnection()).clearRegionCache(getTableName()); return super.postOperationResult(result, deadlineTs); } }
@Override public Object run() throws Exception { try(Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(TEST_TABLE)) { return t.get(new Get(TEST_ROW)); } } };
@Override public Object run() throws Exception { Delete d = new Delete(TEST_ROW); d.addFamily(family2); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName)) { t.delete(d); } return null; } };
@Override public Object run() throws Exception { Get g = new Get(TEST_ROW); g.addFamily(family1); try (Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(tableName)) { t.get(g); } return null; } };
@Override public Object run() throws Exception { Delete d = new Delete(TEST_ROW); d.addFamily(TEST_FAMILY); try(Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(TEST_TABLE)) { t.delete(d); } return null; } };
@Override public Object run() throws Exception { Get g = new Get(TEST_ROW); g.addFamily(TEST_FAMILY); try(Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(TEST_TABLE)) { t.get(g); } return null; } };
@Override public Object run() throws Exception { try(Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(TEST_TABLE)) { return t.get(new Get(TEST_ROW)); } } };
@Override public Object run() throws Exception { try(Connection conn = ConnectionFactory.createConnection(conf); Table t = conn.getTable(TEST_TABLE)) { return t.get(new Get(TEST_ROW)); } } };