/** * <p>batch.</p> * * @param actions a {@link java.util.List} object. * @param results an array of {@link java.lang.Object} objects. * @throws java.io.IOException if any. * @throws java.lang.InterruptedException if any. */ public void batch(List<? extends Row> actions, @Nullable Object[] results) throws IOException, InterruptedException { if (results == null) { results = new Object[actions.size()]; } batchCallback(actions, results, null); }
/** * <p>batch.</p> * * @param actions a {@link java.util.List} object. * @param results an array of {@link java.lang.Object} objects. * @throws java.io.IOException if any. * @throws java.lang.InterruptedException if any. */ public void batch(List<? extends Row> actions, @Nullable Object[] results) throws IOException, InterruptedException { if (results == null) { results = new Object[actions.size()]; } batchCallback(actions, results, null); }
/** * <p>batch.</p> * * @param actions a {@link java.util.List} object. * @return an array of {@link org.apache.hadoop.hbase.client.Result} objects. * @throws java.io.IOException if any. */ public Result[] batch(List<? extends Row> actions) throws IOException { try { Object[] resultsOrErrors = new Object[actions.size()]; batchCallback(actions, resultsOrErrors, null); // At this point we are guaranteed that the array only contains results, // if it had any errors, batch would've thrown an exception Result[] results = new Result[resultsOrErrors.length]; System.arraycopy(resultsOrErrors, 0, results, 0, results.length); return results; } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.error("Encountered exception in batch(List<>).", e); throw new IOException("Batch error", e); } }
/** * <p>batch.</p> * * @param actions a {@link java.util.List} object. * @return an array of {@link org.apache.hadoop.hbase.client.Result} objects. * @throws java.io.IOException if any. */ public Result[] batch(List<? extends Row> actions) throws IOException { try { Object[] resultsOrErrors = new Object[actions.size()]; batchCallback(actions, resultsOrErrors, null); // At this point we are guaranteed that the array only contains results, // if it had any errors, batch would've thrown an exception Result[] results = new Result[resultsOrErrors.length]; System.arraycopy(resultsOrErrors, 0, results, 0, results.length); return results; } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.error("Encountered exception in batch(List<>).", e); throw new IOException("Batch error", e); } }
/** {@inheritDoc} */ @Deprecated @Override public <R> Object[] batchCallback(List<? extends Row> actions, Batch.Callback<R> callback) throws IOException, InterruptedException { LOG.trace("batchCallback(List<>, Batch.Callback)"); try (Scope scope = TRACER.spanBuilder("BigtableTable.batchCallback").startScopedSpan()) { addBatchSizeAnnotation(actions); Object[] results = new Object[actions.size()]; getBatchExecutor().batchCallback(actions, results, callback); return results; } }
/** {@inheritDoc} */ @Deprecated @Override public <R> Object[] batchCallback(List<? extends Row> actions, Batch.Callback<R> callback) throws IOException, InterruptedException { LOG.trace("batchCallback(List<>, Batch.Callback)"); try (Scope scope = TRACER.spanBuilder("BigtableTable.batchCallback").startScopedSpan()) { addBatchSizeAnnotation(actions); Object[] results = new Object[actions.size()]; getBatchExecutor().batchCallback(actions, results, callback); return results; } }
/** {@inheritDoc} */ @Override public <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback) throws IOException, InterruptedException { LOG.trace("batchCallback(List<>, Object[], Batch.Callback)"); try (Scope scope = TRACER.spanBuilder("BigtableTable.batchCallback").startScopedSpan()) { addBatchSizeAnnotation(actions); getBatchExecutor().batchCallback(actions, results, callback); } }
/** {@inheritDoc} */ @Override public <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback) throws IOException, InterruptedException { LOG.trace("batchCallback(List<>, Object[], Batch.Callback)"); try (Scope scope = TRACER.spanBuilder("BigtableTable.batchCallback").startScopedSpan()) { addBatchSizeAnnotation(actions); getBatchExecutor().batchCallback(actions, results, callback); } }