@Override public void prepareMiniBatchOperations(MiniBatchOperationInProgress<Mutation> miniBatchOp, long timestamp, final List<RowLock> acquiredRowLocks) throws IOException { visitBatchOperations(true, miniBatchOp.getLastIndexExclusive(), (int index) -> { // update cell count for (List<Cell> cells : getMutation(index).getFamilyCellMap().values()) { miniBatchOp.addCellCount(cells.size()); } return true; }); }
private void doFinishHotnessProtector( final MiniBatchOperationInProgress<Mutation> miniBatchOp) { // check and return if the protector is not enabled if (!region.storeHotnessProtector.isEnable()) { return; } // miniBatchOp is null, if and only if lockRowsAndBuildMiniBatch throwing exception. // This case was handled. if (miniBatchOp == null) { return; } final int finalLastIndexExclusive = miniBatchOp.getLastIndexExclusive(); for (int i = nextIndexToProcess; i < finalLastIndexExclusive; i++) { switch (retCodeDetails[i].getOperationStatusCode()) { case SUCCESS: case FAILURE: region.storeHotnessProtector.finish(getMutation(i).getFamilyCellMap()); break; default: // do nothing // We won't start the protector for NOT_RUN/BAD_FAMILY/SANITY_CHECK_FAILURE and the // STORE_TOO_BUSY case is handled in StoreHotnessProtector#start break; } } }
long timestamp, final List<RowLock> acquiredRowLocks) throws IOException { byte[] byteTS = Bytes.toBytes(timestamp); visitBatchOperations(true, miniBatchOp.getLastIndexExclusive(), (int index) -> { Mutation mutation = getMutation(index); if (mutation instanceof Put) {
protected void writeMiniBatchOperationsToMemStore( final MiniBatchOperationInProgress<Mutation> miniBatchOp, final long writeNumber) throws IOException { MemStoreSizing memStoreAccounting = new NonThreadSafeMemStoreSizing(); visitBatchOperations(true, miniBatchOp.getLastIndexExclusive(), (int index) -> { // We need to update the sequence id for following reasons. // 1) If the op is in replay mode, FSWALEntry#stampRegionSequenceId won't stamp sequence id. // 2) If no WAL, FSWALEntry won't be used // we use durability of the original mutation for the mutation passed by CP. if (isInReplay() || getMutation(index).getDurability() == Durability.SKIP_WAL) { region.updateSequenceId(familyCellMaps[index].values(), writeNumber); } applyFamilyMapToMemStore(familyCellMaps[index], memStoreAccounting); return true; }); // update memStore size region.incMemStoreSize(memStoreAccounting.getDataSize(), memStoreAccounting.getHeapSize(), memStoreAccounting.getOffHeapSize(), memStoreAccounting.getCellsCount()); }
miniBatchOp != null ? miniBatchOp.getLastIndexExclusive() : batchOp.size(); final boolean finalSuccess = success; batchOp.visitBatchOperations(true, finalLastIndexExclusive, (int i) -> {
visitBatchOperations(false, miniBatchOp.getLastIndexExclusive(), (int i) -> {