private void consumeCompaction(CompactionUpdateBatch updateBatch) throws Exception {
        int ignoreCount = 0;
        int updateCount = updateBatch.size();
        int totalIgnoreBytes = 0;
        int totalUpdateBytes = updateBatch.getDataSizeTotal();
        
        /* Using lwMark is to guarantee that redo logs from compaction will not increase
         * the hwMark of the underlying array file. If hwMark is being used, the current
         * redo entry is discarded upon crash. Upon restart, the hwMark from the underlying
         * array file may prevent updates in the lost redo entry from being resent.   
         */
        long updateScn = _addressArray.getLWMark();
        Segment segTarget = updateBatch.getTargetSegment();
        
        for(int i = 0; i < updateCount; i++) {
            int index = updateBatch.getUpdateIndex(i);
            long origAddr = updateBatch.getOriginDataAddr(i);
            long currAddr = getAddress(index);
            
            if(currAddr == 0 ||      /* data at the given index is deleted by writer */ 
               currAddr != origAddr  /* data at the given index is updated by writer */) {
                /*
                 * The address generated by the compactor is obsolete.
                 */
                int updateBytes = updateBatch.getUpdateDataSize(i);
                totalIgnoreBytes += updateBytes;
                ignoreCount++;
            } else {
                /*
                 * The address generated by the compactor has not been touched by the writer.
                 * Update the address array directly.
                 */ 
                setCompactionAddress(index, updateBatch.getUpdateDataAddr(i), updateScn);
            }
        }
        
        int consumeCount = updateCount - ignoreCount;
        int totalConsumeBytes = totalUpdateBytes - totalIgnoreBytes;
        
        if(_log.isTraceEnabled()) {
            _log.trace("consumed compaction batch " +
                       updateBatch.getDescriptiveId() +
                       " updates " + consumeCount + "/" + updateCount +
                       " bytes " + totalConsumeBytes + "/" + totalUpdateBytes);
        }
        
        // Update segment load size
        segTarget.decrLoadSize(totalIgnoreBytes);
    }
private void consumeCompaction ( CompactionUpdateBatch updateBatch ) throws Exception { int ignoreCount = 0 ; int updateCount = updateBatch . size ( ) ; int totalIgnoreBytes = 0 ; int totalUpdateBytes = updateBatch . getDataSizeTotal ( ) ; long updateScn = _addressArray . getLWMark ( ) ; Segment segTarget = updateBatch . getTargetSegment ( ) ; for ( int i = 0 ; i < updateCount ; i ++ ) { int index = updateBatch . getUpdateIndex ( i ) ; long origAddr = updateBatch . getOriginDataAddr ( i ) ; long currAddr = getAddress ( index ) ; if ( currAddr == 0 || currAddr != origAddr ) { int updateBytes = updateBatch . getUpdateDataSize ( i ) ; totalIgnoreBytes += updateBytes ; ignoreCount ++ ; } else { setCompactionAddress ( index , updateBatch . getUpdateDataAddr ( i ) , updateScn ) ; } } int consumeCount = updateCount - ignoreCount ; int totalConsumeBytes = totalUpdateBytes - totalIgnoreBytes ; if ( _log . isTraceEnabled ( ) ) { _log . trace ( "consumed compaction batch " + updateBatch . getDescriptiveId ( ) + " updates " + consumeCount + "/" + updateCount + " bytes " + totalConsumeBytes + "/" + totalUpdateBytes ) ; } segTarget . decrLoadSize ( totalIgnoreBytes ) ; }
Consumes a {@link CompactionUpdateBatch} produced by the Segment compactor.

@param updateBatch - the batch of compaction updates produced by the Segment compactor.
@throws Exception if the updateBatch cannot be consumed