Java Code Examples for org.apache.hadoop.hbase.client.coprocessor.Batch#Callback

The following examples show how to use org.apache.hadoop.hbase.client.coprocessor.Batch#Callback . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
@Override
public <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback) throws
  IOException, InterruptedException {
  if (tx == null) {
    throw new IOException("Transaction not started");
  }
  hTable.batchCallback(transactionalizeActions(actions), results, callback);
}
 
Example 2
Source File: MockHTable.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@Override
public <R extends Message> void batchCoprocessorService(Descriptors.MethodDescriptor methodDescriptor,
        Message request, byte[] startKey, byte[] endKey, R responsePrototype, Batch.Callback<R> callback)
        throws ServiceException, Throwable {
    throw new NotImplementedException();

}
 
Example 3
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
@Override
public <R> Object[] batchCallback(List<? extends Row> actions, Batch.Callback<R> callback) throws IOException,
  InterruptedException {
  if (tx == null) {
    throw new IOException("Transaction not started");
  }
  return hTable.batchCallback(transactionalizeActions(actions), callback);
}
 
Example 4
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
@Override
public <R> Object[] batchCallback(List<? extends Row> actions, Batch.Callback<R> callback) throws IOException,
  InterruptedException {
  if (tx == null) {
    throw new IOException("Transaction not started");
  }
  return hTable.batchCallback(transactionalizeActions(actions), callback);
}
 
Example 5
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
@Override
public <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback) throws
  IOException, InterruptedException {
  if (tx == null) {
    throw new IOException("Transaction not started");
  }
  hTable.batchCallback(transactionalizeActions(actions), results, callback);
}
 
Example 6
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
@Override
public <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback) throws
  IOException, InterruptedException {
  if (tx == null) {
    throw new IOException("Transaction not started");
  }
  hTable.batchCallback(transactionalizeActions(actions), results, callback);
}
 
Example 7
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
@Override
public <R> Object[] batchCallback(List<? extends Row> actions, Batch.Callback<R> callback) throws IOException,
  InterruptedException {
  if (tx == null) {
    throw new IOException("Transaction not started");
  }
  return hTable.batchCallback(transactionalizeActions(actions), callback);
}
 
Example 8
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 5 votes vote down vote up
@Override
public <R> void batchCallback(List<? extends Row> actions, Object[] results,
    Batch.Callback<R> callback) throws IOException, InterruptedException {
  if (tx == null) {
    throw new IOException("Transaction not started");
  }
  hTable.batchCallback(transactionalizeActions(actions), results, callback);
}
 
Example 9
Source File: MockHTable.java    From simplified-lambda with Apache License 2.0 4 votes vote down vote up
@Override
public <T extends Service, R> void coprocessorService(Class<T> var1, byte[] var2, byte[] var3, Batch.Call<T, R> var4, Batch.Callback<R> var5) throws ServiceException, Throwable {
    throw new RuntimeException(this.getClass() + " does NOT implement this method.");
}
 
Example 10
Source File: MockHTable.java    From kylin with Apache License 2.0 4 votes vote down vote up
@Override
public <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback)
        throws IOException, InterruptedException {

}
 
Example 11
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 4 votes vote down vote up
@Override
public <T extends Service, R> void coprocessorService(Class<T> service, byte[] startKey,
    byte[] endKey, Batch.Call<T, R> callable, Batch.Callback<R> callback)
    throws ServiceException, Throwable {
  hTable.coprocessorService(service, startKey, endKey, callable, callback);
}
 
Example 12
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 4 votes vote down vote up
@Override
public <T extends Service, R> void coprocessorService(Class<T> service, byte[] startKey, byte[] endKey,
                                                      Batch.Call<T, R> callable, Batch.Callback<R> callback)
  throws ServiceException, Throwable {
  hTable.coprocessorService(service, startKey, endKey, callable, callback);
}
 
Example 13
Source File: MockHTable.java    From metron with Apache License 2.0 4 votes vote down vote up
@Override
public <R extends Message> void batchCoprocessorService(Descriptors.MethodDescriptor methodDescriptor, Message message, byte[] bytes, byte[] bytes1, R r, Batch.Callback<R> callback) throws ServiceException, Throwable {
  throw new UnsupportedOperationException();
}
 
Example 14
Source File: MockHTable.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
@Override
public <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback)
        throws IOException, InterruptedException {

}
 
Example 15
Source File: TransactionAwareHTable.java    From phoenix-tephra with Apache License 2.0 4 votes vote down vote up
@Override
public <T extends Service, R> void coprocessorService(Class<T> service, byte[] startKey, byte[] endKey,
                                                      Batch.Call<T, R> callable, Batch.Callback<R> callback)
  throws ServiceException, Throwable {
  hTable.coprocessorService(service, startKey, endKey, callable, callback);
}
 
Example 16
Source File: MockHTable.java    From simplified-lambda with Apache License 2.0 4 votes vote down vote up
@Override
public <R> void batchCallback(List<? extends Row> var1, Object[] var2, Batch.Callback<R> var3) throws IOException, InterruptedException {
    throw new RuntimeException(this.getClass() + " does NOT implement this method.");
}
 
Example 17
Source File: MockHTable.java    From metron with Apache License 2.0 4 votes vote down vote up
@Override
public <T extends Service, R> void coprocessorService(Class<T> aClass, byte[] bytes, byte[] bytes1, Batch.Call<T, R> call, Batch.Callback<R> callback) throws ServiceException, Throwable {
  throw new UnsupportedOperationException();
}
 
Example 18
Source File: MockHTable.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
@Override
public <R> Object[] batchCallback(List<? extends Row> actions, Batch.Callback<R> callback)
        throws IOException, InterruptedException {
    return new Object[0];
}
 
Example 19
Source File: Table.java    From hbase with Apache License 2.0 3 votes vote down vote up
/**
 * Creates an instance of the given {@link Service} subclass for each table region spanning the
 * range from the {@code startKey} row to {@code endKey} row (inclusive), and invokes the passed
 * {@link org.apache.hadoop.hbase.client.coprocessor.Batch.Call#call} method with each
 * {@link Service} instance.
 * <p/>
 * The given
 * {@link org.apache.hadoop.hbase.client.coprocessor.Batch.Callback#update(byte[],byte[],Object)}
 * method will be called with the return value from each region's
 * {@link org.apache.hadoop.hbase.client.coprocessor.Batch.Call#call} invocation.
 * @param service the protocol buffer {@code Service} implementation to call
 * @param startKey start region selection with region containing this row. If {@code null}, the
 *          selection will start with the first table region.
 * @param endKey select regions up to and including the region containing this row. If
 *          {@code null}, selection will continue through the last table region.
 * @param callable this instance's
 *          {@link org.apache.hadoop.hbase.client.coprocessor.Batch.Call#call} method will be
 *          invoked once per table region, using the {@link Service} instance connected to that
 *          region.
 * @param <T> the {@link Service} subclass to connect to
 * @param <R> Return type for the {@code callable} parameter's
 *          {@link org.apache.hadoop.hbase.client.coprocessor.Batch.Call#call} method
 * @deprecated since 3.0.0, will removed in 4.0.0. The batch call here references the blocking
 *             interface for of a protobuf stub, so it is not possible to do it in an asynchronous
 *             way, even if now we are building the {@link Table} implementation based on the
 *             {@link AsyncTable}, which is not good. Use the coprocessorService methods in
 *             {@link AsyncTable} directly instead.
 * @see Connection#toAsyncConnection()
 */
@Deprecated
default <T extends Service, R> void coprocessorService(final Class<T> service, byte[] startKey,
    byte[] endKey, final Batch.Call<T, R> callable, final Batch.Callback<R> callback)
    throws ServiceException, Throwable {
  throw new NotImplementedException("Add an implementation!");
}
 
Example 20
Source File: Table.java    From hbase with Apache License 2.0 2 votes vote down vote up
/**
 * Same as {@link #batch(List, Object[])}, but with a callback.
 * @since 0.96.0
 * @deprecated since 3.0.0, will removed in 4.0.0. Please use the batch related methods in
 *             {@link AsyncTable} directly if you want to use callback. We reuse the callback for
 *             coprocessor here, and the problem is that for batch operation, the
 *             {@link AsyncTable} does not tell us the region, so in this method we need an extra
 *             locating after we get the result, which is not good.
 */
@Deprecated
default <R> void batchCallback(final List<? extends Row> actions, final Object[] results,
    final Batch.Callback<R> callback) throws IOException, InterruptedException {
  throw new NotImplementedException("Add an implementation!");
}