Index: src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (revision 1164808) +++ src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (working copy) @@ -1649,23 +1649,17 @@ BatchOperationInProgress> batchOp) throws IOException { /* Run coprocessor pre hook outside of locks to avoid deadlock */ if (coprocessorHost != null) { - List> ops = - new ArrayList>(batchOp.operations.length); for (int i = 0; i < batchOp.operations.length; i++) { Pair nextPair = batchOp.operations[i]; Put put = nextPair.getFirst(); Map> familyMap = put.getFamilyMap(); if (coprocessorHost.prePut(familyMap, put.getWriteToWAL())) { // pre hook says skip this Put - // adjust nextIndexToProcess if we skipped before it - if (batchOp.nextIndexToProcess > i) { - batchOp.nextIndexToProcess--; - } - continue; + // mark as success and skip below + batchOp.retCodeDetails[i] = new OperationStatus( + OperationStatusCode.SUCCESS); } - ops.add(nextPair); } - batchOp.operations = ops.toArray(new Pair[ops.size()]); } long now = EnvironmentEdgeManager.currentTimeMillis(); @@ -1695,6 +1689,12 @@ // store the family map reference to allow for mutations familyMaps[lastIndexExclusive] = familyMap; + if (batchOp.retCodeDetails[lastIndexExclusive].getOperationStatusCode() + != OperationStatusCode.NOT_RUN) { + lastIndexExclusive++; + continue; + } + // Check the families in the put. If bad, skip this one. try { checkFamilies(familyMap.keySet());