/** * Implementation of {@link org.apache.hadoop.hbase.client.Table#existsAll(List)}. * * @param gets a {@link java.util.List} object. * @return an array of {@link java.lang.Boolean} objects. * @throws java.io.IOException if any. */ public boolean[] exists(List<Get> gets) throws IOException { // get(gets) will throw if there are any errors: Result[] getResults = batch(gets); boolean[] exists = new boolean[getResults.length]; for (int index = 0; index < getResults.length; index++) { exists[index] = !getResults[index].isEmpty(); } return exists; } }
/** * Implementation of {@link org.apache.hadoop.hbase.client.Table#existsAll(List)}. * * @param gets a {@link java.util.List} object. * @return an array of {@link java.lang.Boolean} objects. * @throws java.io.IOException if any. */ public boolean[] exists(List<Get> gets) throws IOException { // get(gets) will throw if there are any errors: Result[] getResults = batch(gets); boolean[] exists = new boolean[getResults.length]; for (int index = 0; index < getResults.length; index++) { exists[index] = !getResults[index].isEmpty(); } return exists; } }
/** {@inheritDoc} */ @Override public void put(List<Put> puts) throws IOException { LOG.trace("put(List<Put>)"); if (puts == null || puts.isEmpty()) { return; } else if (puts.size() == 1) { try { put(puts.get(0)); } catch (IOException e) { throw createRetriesExhaustedWithDetailsException(e, puts.get(0)); } } else { getBatchExecutor().batch(puts); } }
/** {@inheritDoc} */ @Override public void put(List<Put> puts) throws IOException { LOG.trace("put(List<Put>)"); if (puts == null || puts.isEmpty()) { return; } else if (puts.size() == 1) { try { put(puts.get(0)); } catch (IOException e) { throw createRetriesExhaustedWithDetailsException(e, puts.get(0)); } } else { getBatchExecutor().batch(puts); } }
/** {@inheritDoc} */ @Deprecated @Override public Object[] batch(List<? extends Row> actions) throws IOException, InterruptedException { LOG.trace("batch(List<>)"); try (Scope scope = TRACER.spanBuilder("BigtableTable.batch").startScopedSpan()) { addBatchSizeAnnotation(actions); return getBatchExecutor().batch(actions); } }
/** {@inheritDoc} */ @Override public void delete(List<Delete> deletes) throws IOException { LOG.trace("delete(List<Delete>)"); try (Scope scope = TRACER.spanBuilder("BigtableTable.delete").startScopedSpan()) { getBatchExecutor().batch(deletes); } }
/** {@inheritDoc} */ @Deprecated @Override public Object[] batch(List<? extends Row> actions) throws IOException, InterruptedException { LOG.trace("batch(List<>)"); try (Scope scope = TRACER.spanBuilder("BigtableTable.batch").startScopedSpan()) { addBatchSizeAnnotation(actions); return getBatchExecutor().batch(actions); } }
/** {@inheritDoc} */ @Override public Result[] get(List<Get> gets) throws IOException { LOG.trace("get(List<>)"); if (gets == null || gets.isEmpty()) { return new Result[0]; } else if (gets.size() == 1) { try { return new Result[] { get(gets.get(0)) }; } catch(IOException e) { throw createRetriesExhaustedWithDetailsException(e, gets.get(0)); } } else { try (Scope scope = TRACER.spanBuilder("BigtableTable.get").startScopedSpan()) { addBatchSizeAnnotation(gets); return getBatchExecutor().batch(gets); } } }
/** {@inheritDoc} */ @Override public void delete(List<Delete> deletes) throws IOException { LOG.trace("delete(List<Delete>)"); try (Scope scope = TRACER.spanBuilder("BigtableTable.delete").startScopedSpan()) { getBatchExecutor().batch(deletes); } }
/** {@inheritDoc} */ @Override public Result[] get(List<Get> gets) throws IOException { LOG.trace("get(List<>)"); if (gets == null || gets.isEmpty()) { return new Result[0]; } else if (gets.size() == 1) { try { return new Result[] { get(gets.get(0)) }; } catch(IOException e) { throw createRetriesExhaustedWithDetailsException(e, gets.get(0)); } } else { try (Scope scope = TRACER.spanBuilder("BigtableTable.get").startScopedSpan()) { addBatchSizeAnnotation(gets); return getBatchExecutor().batch(gets); } } }
/** {@inheritDoc} */ @Override public void batch(List<? extends Row> actions, Object[] results) throws IOException, InterruptedException { LOG.trace("batch(List<>, Object[])"); try (Scope scope = TRACER.spanBuilder("BigtableTable.batch").startScopedSpan()) { addBatchSizeAnnotation(actions); getBatchExecutor().batch(actions, results); } }
/** {@inheritDoc} */ @Override public void batch(List<? extends Row> actions, Object[] results) throws IOException, InterruptedException { LOG.trace("batch(List<>, Object[])"); try (Scope scope = TRACER.spanBuilder("BigtableTable.batch").startScopedSpan()) { addBatchSizeAnnotation(actions); getBatchExecutor().batch(actions, results); } }