@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public class MultiRowMutationEndpoint extends MultiRowMutationProtos.MultiRowMutationService implements CoprocessorService, Coprocessor
HRegion.mutateRowsWithLocks(java.util.Collection, java.util.Collection)
and Coprocessor endpoints.
Defines a protocol to perform multi row transactions.
See MultiRowMutationEndpoint
for the implementation.
See
HRegion.mutateRowsWithLocks(java.util.Collection, java.util.Collection)
for details and limitations.
Example:
List mutations = ...;
Put p1 = new Put(row1);
Put p2 = new Put(row2);
...
Mutate m1 = ProtobufUtil.toMutate(MutateType.PUT, p1);
Mutate m2 = ProtobufUtil.toMutate(MutateType.PUT, p2);
MutateRowsRequest.Builder mrmBuilder = MutateRowsRequest.newBuilder();
mrmBuilder.addMutationRequest(m1);
mrmBuilder.addMutationRequest(m2);
CoprocessorRpcChannel channel = t.coprocessorService(ROW);
MultiRowMutationService.BlockingInterface service =
MultiRowMutationService.newBlockingStub(channel);
MutateRowsRequest mrm = mrmBuilder.build();
service.mutateRows(null, mrm);
MultiRowMutationProtos.MultiRowMutationService.BlockingInterface, MultiRowMutationProtos.MultiRowMutationService.Interface, MultiRowMutationProtos.MultiRowMutationService.Stub
Coprocessor.State
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
Constructor and Description |
---|
MultiRowMutationEndpoint() |
Modifier and Type | Method and Description |
---|---|
com.google.protobuf.Service |
getService() |
void |
mutateRows(com.google.protobuf.RpcController controller,
MultiRowMutationProtos.MutateRowsRequest request,
com.google.protobuf.RpcCallback<MultiRowMutationProtos.MutateRowsResponse> done)
rpc MutateRows(.MutateRowsRequest) returns (.MutateRowsResponse); |
void |
start(CoprocessorEnvironment env)
Stores a reference to the coprocessor environment provided by the
RegionCoprocessorHost from the region where this
coprocessor is loaded. |
void |
stop(CoprocessorEnvironment env) |
callMethod, getDescriptor, getDescriptorForType, getRequestPrototype, getResponsePrototype, newBlockingStub, newReflectiveBlockingService, newReflectiveService, newStub
public void mutateRows(com.google.protobuf.RpcController controller, MultiRowMutationProtos.MutateRowsRequest request, com.google.protobuf.RpcCallback<MultiRowMutationProtos.MutateRowsResponse> done)
MultiRowMutationProtos.MultiRowMutationService
rpc MutateRows(.MutateRowsRequest) returns (.MutateRowsResponse);
mutateRows
in class MultiRowMutationProtos.MultiRowMutationService
public com.google.protobuf.Service getService()
getService
in interface CoprocessorService
public void start(CoprocessorEnvironment env) throws IOException
RegionCoprocessorHost
from the region where this
coprocessor is loaded. Since this is a coprocessor endpoint, it always expects to be loaded
on a table region, so always expects this to be an instance of
RegionCoprocessorEnvironment
.start
in interface Coprocessor
env
- the environment provided by the coprocessor hostIOException
- if the provided environment is not an instance of
RegionCoprocessorEnvironment
public void stop(CoprocessorEnvironment env) throws IOException
stop
in interface Coprocessor
IOException
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.