static class HRegion.MutationBatchOperation extends HRegion.BatchOperation<Mutation>
HRegion.ReplayBatchOperation
as most
of the logic is same.HRegion.BatchOperation.Visitor
Modifier and Type | Field and Description |
---|---|
private long |
nonce |
private long |
nonceGroup |
atomic, durability, familyCellMaps, nextIndexToProcess, observedExceptions, operations, region, retCodeDetails, walEditsFromCoprocessors
Constructor and Description |
---|
MutationBatchOperation(HRegion region,
Mutation[] operations,
boolean atomic,
long nonceGroup,
long nonce) |
Modifier and Type | Method and Description |
---|---|
List<Pair<NonceKey,WALEdit>> |
buildWALEdits(MiniBatchOperationInProgress<Mutation> miniBatchOp)
Builds separate WALEdit per nonce by applying input mutations.
|
private void |
callPreMutateCPHook(int index,
WALEdit walEdit,
int[] metrics)
Runs prePut/ preDelete coprocessor hook for input mutation in a batch
|
private void |
checkAndMergeCPMutations(MiniBatchOperationInProgress<Mutation> miniBatchOp,
List<Region.RowLock> acquiredRowLocks,
long timestamp) |
void |
checkAndPrepare()
Validates each mutation and prepares a batch for write.
|
void |
checkAndPreparePut(Put p)
Implement any Put request specific check and prepare logic here.
|
void |
closeRegionOperation() |
void |
completeMiniBatchOperations(MiniBatchOperationInProgress<Mutation> miniBatchOp,
MultiVersionConcurrencyControl.WriteEntry writeEntry)
This method completes mini-batch operations by calling postBatchMutate() CP hook (if
required) and completing mvcc.
|
void |
doPostOpCleanupForMiniBatch(MiniBatchOperationInProgress<Mutation> miniBatchOp,
WALEdit walEdit,
boolean success) |
Mutation |
getMutation(int index) |
Mutation[] |
getMutationsForCoprocs()
This method is potentially expensive and useful mostly for non-replay CP path.
|
long |
getNonce(int index) |
long |
getNonceGroup(int index) |
long |
getOrigLogSeqNum() |
boolean |
isInReplay() |
private void |
mergeFamilyMaps(Map<byte[],List<Cell>> familyMap,
Map<byte[],List<Cell>> toBeMerged) |
void |
prepareMiniBatchOperations(MiniBatchOperationInProgress<Mutation> miniBatchOp,
long timestamp,
List<Region.RowLock> acquiredRowLocks)
If necessary, calls preBatchMutate() CP hook for a mini-batch and updates metrics, cell
count, tags and timestamp for all cells of all operations in a mini-batch.
|
void |
startRegionOperation() |
MultiVersionConcurrencyControl.WriteEntry |
writeMiniBatchOperationsToMemStore(MiniBatchOperationInProgress<Mutation> miniBatchOp,
MultiVersionConcurrencyControl.WriteEntry writeEntry)
Write mini-batch operations to MemStore
|
applyFamilyMapToMemStore, checkAndPrepareMutation, checkAndPrepareMutation, createMiniBatch, getClusterIds, isAtomic, isDone, isOperationPending, lockRowsAndBuildMiniBatch, size, visitBatchOperations, writeMiniBatchOperationsToMemStore
private long nonceGroup
private long nonce
public MutationBatchOperation(HRegion region, Mutation[] operations, boolean atomic, long nonceGroup, long nonce)
public Mutation getMutation(int index)
getMutation
in class HRegion.BatchOperation<Mutation>
public long getNonceGroup(int index)
getNonceGroup
in class HRegion.BatchOperation<Mutation>
public long getNonce(int index)
getNonce
in class HRegion.BatchOperation<Mutation>
public Mutation[] getMutationsForCoprocs()
HRegion.BatchOperation
getMutationsForCoprocs
in class HRegion.BatchOperation<Mutation>
public boolean isInReplay()
isInReplay
in class HRegion.BatchOperation<Mutation>
public long getOrigLogSeqNum()
getOrigLogSeqNum
in class HRegion.BatchOperation<Mutation>
public void startRegionOperation() throws IOException
startRegionOperation
in class HRegion.BatchOperation<Mutation>
IOException
public void closeRegionOperation() throws IOException
closeRegionOperation
in class HRegion.BatchOperation<Mutation>
IOException
public void checkAndPreparePut(Put p) throws IOException
HRegion.BatchOperation
HRegion.BatchOperation.checkAndPrepareMutation(Mutation, long)
for how its used.checkAndPreparePut
in class HRegion.BatchOperation<Mutation>
IOException
public void checkAndPrepare() throws IOException
HRegion.BatchOperation
HRegion.BatchOperation.checkAndPrepareMutation(int, long)
in a
'for' loop over mutations.checkAndPrepare
in class HRegion.BatchOperation<Mutation>
IOException
public void prepareMiniBatchOperations(MiniBatchOperationInProgress<Mutation> miniBatchOp, long timestamp, List<Region.RowLock> acquiredRowLocks) throws IOException
HRegion.BatchOperation
prepareMiniBatchOperations
in class HRegion.BatchOperation<Mutation>
IOException
public List<Pair<NonceKey,WALEdit>> buildWALEdits(MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException
HRegion.BatchOperation
buildWALEdits
in class HRegion.BatchOperation<Mutation>
IOException
public MultiVersionConcurrencyControl.WriteEntry writeMiniBatchOperationsToMemStore(MiniBatchOperationInProgress<Mutation> miniBatchOp, @Nullable MultiVersionConcurrencyControl.WriteEntry writeEntry) throws IOException
HRegion.BatchOperation
writeMiniBatchOperationsToMemStore
in class HRegion.BatchOperation<Mutation>
IOException
public void completeMiniBatchOperations(MiniBatchOperationInProgress<Mutation> miniBatchOp, MultiVersionConcurrencyControl.WriteEntry writeEntry) throws IOException
HRegion.BatchOperation
completeMiniBatchOperations
in class HRegion.BatchOperation<Mutation>
IOException
public void doPostOpCleanupForMiniBatch(MiniBatchOperationInProgress<Mutation> miniBatchOp, WALEdit walEdit, boolean success) throws IOException
doPostOpCleanupForMiniBatch
in class HRegion.BatchOperation<Mutation>
IOException
private void callPreMutateCPHook(int index, WALEdit walEdit, int[] metrics) throws IOException
metrics
- Array of 2 ints. index 0: count of puts and index 1: count of deletesIOException
private void checkAndMergeCPMutations(MiniBatchOperationInProgress<Mutation> miniBatchOp, List<Region.RowLock> acquiredRowLocks, long timestamp) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.