public abstract class Batch extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Batch.Call<T,R>
Defines a unit of work to be executed.
|
static interface |
Batch.Callback<R>
Defines a generic callback to be triggered for each
Batch.Call.call(Object)
result. |
Constructor and Description |
---|
Batch() |
Modifier and Type | Method and Description |
---|---|
static <T extends CoprocessorProtocol,R> |
forMethod(Class<T> protocol,
String method,
Object... args)
Creates a new
Batch.Call instance that invokes a method
with the given parameters and returns the result. |
static <T extends CoprocessorProtocol,R> |
forMethod(Method method,
Object... args)
Creates a new
Batch.Call instance that invokes a method
with the given parameters and returns the result. |
public static <T extends CoprocessorProtocol,R> Batch.Call<T,R> forMethod(Class<T> protocol, String method, Object... args) throws NoSuchMethodException
Batch.Call
instance that invokes a method
with the given parameters and returns the result.
Note that currently the method is naively looked up using the method name
and class types of the passed arguments, which means that
none of the arguments can be null
.
For more flexibility, see
forMethod(java.lang.reflect.Method, Object...)
.
T
- the class type of the protocol implementation being invokedR
- the return type for the method callprotocol
- the protocol class being calledmethod
- the method nameargs
- zero or more arguments to be passed to the method
(individual args cannot be null
!)Callable
instance that will invoke the given method
and return the resultsNoSuchMethodException
- if the method named, with the given argument
types, cannot be found in the protocol classforMethod(java.lang.reflect.Method, Object...)
,
HTable.coprocessorExec(Class, byte[], byte[], org.apache.hadoop.hbase.client.coprocessor.Batch.Call, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback)
public static <T extends CoprocessorProtocol,R> Batch.Call<T,R> forMethod(Method method, Object... args)
Batch.Call
instance that invokes a method
with the given parameters and returns the result.T
- the class type of the protocol implementation being invokedR
- the return type for the method callmethod
- the method reference to invokeargs
- zero or more arguments to be passed to the methodCallable
instance that will invoke the given method and
return the resultsHTable.coprocessorExec(Class, byte[], byte[], org.apache.hadoop.hbase.client.coprocessor.Batch.Call, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback)
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.