@InterfaceAudience.Private class MultiRowMutationProcessor extends BaseRowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
MultiRowProcessor
that performs multiple puts and deletes.Modifier and Type | Field and Description |
---|---|
(package private) MiniBatchOperationInProgress<Mutation> |
miniBatch |
(package private) Collection<Mutation> |
mutations |
(package private) Collection<byte[]> |
rowsToLock |
Constructor and Description |
---|
MultiRowMutationProcessor(Collection<Mutation> mutations,
Collection<byte[]> rowsToLock) |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest |
getRequestData()
This method should return any additional data that is needed on the
server side to construct the RowProcessor.
|
org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse |
getResult()
Obtain the processing result.
|
Collection<byte[]> |
getRowsToLock()
Rows to lock while operation.
|
void |
initialize(org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest msg)
This method should initialize any field(s) of the RowProcessor with
a parsing of the passed message bytes (used on the server side).
|
void |
postBatchMutate(HRegion region)
The hook to be executed after the process() and applying the Mutations to region.
|
void |
postProcess(HRegion region,
WALEdit walEdit,
boolean success)
The hook to be executed after process() and applying the Mutations to region.
|
void |
preBatchMutate(HRegion region,
WALEdit walEdit)
The hook to be executed after the process() but before applying the Mutations to region.
|
void |
preProcess(HRegion region,
WALEdit walEdit)
The hook to be executed before process().
|
void |
process(long now,
HRegion region,
List<Mutation> mutationsToApply,
WALEdit walEdit)
HRegion handles the locks and MVCC and invokes this method properly.
|
boolean |
readOnly()
Is this operation read only? If this is true, process() should not add
any mutations or it throws IOException.
|
Durability |
useDurability() |
getClusterIds, getName
Collection<byte[]> rowsToLock
Collection<Mutation> mutations
MiniBatchOperationInProgress<Mutation> miniBatch
MultiRowMutationProcessor(Collection<Mutation> mutations, Collection<byte[]> rowsToLock)
public Collection<byte[]> getRowsToLock()
RowProcessor
RowProcessor
to avoid deadlock.public boolean readOnly()
RowProcessor
public org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse getResult()
RowProcessor
public void process(long now, HRegion region, List<Mutation> mutationsToApply, WALEdit walEdit) throws IOException
RowProcessor
IsolationLevel.READ_UNCOMMITTED
for scan because
we advance MVCC after releasing the locks for optimization purpose.now
- the current system millisecondregion
- the HRegionmutationsToApply
- the output mutations to apply to memstorewalEdit
- the output WAL edits to apply to write ahead logIOException
public void preProcess(HRegion region, WALEdit walEdit) throws IOException
RowProcessor
preProcess
in interface RowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
preProcess
in class BaseRowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
region
- the HRegionwalEdit
- the output WAL edits to apply to write ahead logIOException
public void preBatchMutate(HRegion region, WALEdit walEdit) throws IOException
RowProcessor
preBatchMutate
in interface RowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
preBatchMutate
in class BaseRowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
walEdit
- the output WAL edits to apply to write ahead logIOException
public void postBatchMutate(HRegion region) throws IOException
RowProcessor
RowProcessor.postProcess(HRegion, WALEdit, boolean)
is this hook will
be executed before the mvcc transaction completion.postBatchMutate
in interface RowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
postBatchMutate
in class BaseRowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
IOException
public void postProcess(HRegion region, WALEdit walEdit, boolean success) throws IOException
RowProcessor
postProcess
in interface RowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
postProcess
in class BaseRowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
region
- the HRegionwalEdit
- the output WAL edits to apply to write ahead logsuccess
- true if batch operation is successful otherwise false.IOException
public org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest getRequestData()
RowProcessor
RowProcessor.initialize(Message msg)
method. If there is no RowProcessor
specific data then null should be returned.public void initialize(org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest msg)
RowProcessor
public Durability useDurability()
useDurability
in interface RowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
useDurability
in class BaseRowProcessor<org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorRequest,org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos.MultiRowMutationProcessorResponse>
Durability
to useCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.