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, writeMiniBatchOperationsToMemStoreprivate 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.BatchOperationgetMutationsForCoprocs 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>IOExceptionpublic void closeRegionOperation() throws IOException
closeRegionOperation in class HRegion.BatchOperation<Mutation>IOExceptionpublic void checkAndPreparePut(Put p) throws IOException
HRegion.BatchOperationHRegion.BatchOperation.checkAndPrepareMutation(Mutation, long) for how its used.checkAndPreparePut in class HRegion.BatchOperation<Mutation>IOExceptionpublic void checkAndPrepare() throws IOException
HRegion.BatchOperationHRegion.BatchOperation.checkAndPrepareMutation(int, long) in a
'for' loop over mutations.checkAndPrepare in class HRegion.BatchOperation<Mutation>IOExceptionpublic void prepareMiniBatchOperations(MiniBatchOperationInProgress<Mutation> miniBatchOp, long timestamp, List<Region.RowLock> acquiredRowLocks) throws IOException
HRegion.BatchOperationprepareMiniBatchOperations in class HRegion.BatchOperation<Mutation>IOExceptionpublic List<Pair<NonceKey,WALEdit>> buildWALEdits(MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException
HRegion.BatchOperationbuildWALEdits in class HRegion.BatchOperation<Mutation>IOExceptionpublic MultiVersionConcurrencyControl.WriteEntry writeMiniBatchOperationsToMemStore(MiniBatchOperationInProgress<Mutation> miniBatchOp, @Nullable MultiVersionConcurrencyControl.WriteEntry writeEntry) throws IOException
HRegion.BatchOperationwriteMiniBatchOperationsToMemStore in class HRegion.BatchOperation<Mutation>IOExceptionpublic void completeMiniBatchOperations(MiniBatchOperationInProgress<Mutation> miniBatchOp, MultiVersionConcurrencyControl.WriteEntry writeEntry) throws IOException
HRegion.BatchOperationcompleteMiniBatchOperations in class HRegion.BatchOperation<Mutation>IOExceptionpublic void doPostOpCleanupForMiniBatch(MiniBatchOperationInProgress<Mutation> miniBatchOp, WALEdit walEdit, boolean success) throws IOException
doPostOpCleanupForMiniBatch in class HRegion.BatchOperation<Mutation>IOExceptionprivate 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 deletesIOExceptionprivate void checkAndMergeCPMutations(MiniBatchOperationInProgress<Mutation> miniBatchOp, List<Region.RowLock> acquiredRowLocks, long timestamp) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.