~pbeaman/akiban-persistit/accelerate-pruning

« back to all changes in this revision

Viewing changes to src/main/java/com/persistit/Buffer.java

  • Committer: Peter Beaman
  • Date: 2012-06-05 18:37:45 UTC
  • mfrom: (308.2.9 stage)
  • Revision ID: pbeaman@akiban.com-20120605183745-gdlt5zz6uq5vvc8v
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
3079
3079
            int tbData = getInt(tail);
3080
3080
 
3081
3081
            int size = (decodeTailBlockSize(tbData) + ~TAILBLOCK_MASK) & TAILBLOCK_MASK;
 
3082
            if (size <= 0) {
 
3083
                _persistit.fatal("Buffer has invalid tailblock length " + size + " at " + tail + " in "
 
3084
                        + this, null);
 
3085
            }
3082
3086
 
3083
3087
            if ((tbData & TAILBLOCK_INUSE_MASK) != 0) {
3084
3088
                plan[tail / TAILBLOCK_FACTOR] = (back << 16) | free;
3606
3610
                        final long copyTimestamp = _persistit.getTimestampAllocator().updateTimestamp();
3607
3611
                        writePageOnCheckpoint(copyTimestamp);
3608
3612
                        System.arraycopy(copy._bytes, 0, _bytes, 0, _bufferSize);
 
3613
                        _alloc = copy._alloc;
 
3614
                        _slack = copy._slack;
 
3615
                        _mvvCount = copy._mvvCount;
 
3616
                        _keyBlockEnd = copy._keyBlockEnd;
3609
3617
                        if (copy.getGeneration() > getGeneration()) {
3610
3618
                            bumpGeneration();
3611
3619
                        }
3757
3765
                        // Rewrite the tail block header
3758
3766
                        putInt(tail, encodeTailBlock(newTailSize, klength));
3759
3767
                        valueByte = newSize > 0 ? _bytes[offset] & 0xFF : -1;
 
3768
                        value.changeLongRecordMode(false);
3760
3769
                    }
3761
3770
                }
3762
 
                boolean prunedAntiValue = pruneAntiValue(valueByte, p, tree);
3763
 
                changed |= prunedAntiValue;
3764
 
                if (prunedAntiValue) {
 
3771
                if (pruneAntiValue(valueByte, p, tree)) {
3765
3772
                    changed = true;
3766
3773
                    p -= KEYBLOCK_LENGTH;
3767
3774
                    if (!bumped) {