Examples of VLSN


Examples of com.sleepycat.je.utilint.VLSN

    /* For reading from disk. */
    private VLSNBucket(TupleInput ti) {
        fileNumber = ti.readPackedLong();
        stride = ti.readPackedInt();
        firstVLSN = new VLSN(ti.readPackedLong());
        lastVLSN = new VLSN(ti.readPackedLong());
        lastLsn = ti.readPackedLong();
        int size = ti.readPackedInt();
        fileOffsets = new TruncateableList<Integer>(size);
        for (int i = 0; i < size; i++) {
            fileOffsets.add(i, DbLsn.getFileOffsetAsInt(ti.readUnsignedInt()));
View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

            lastVLSN = VLSN.NULL_VLSN;
            lastLsn = DbLsn.NULL_LSN;
            return null;
        }

        VLSN indexVLSN = firstVLSN;
        int newFirstIndex = -1;

        /*
         * Find the mappings that still belong. Using the example above, we
         * should find that we can delete fileOffset[0] and fileOffset[1] and
         * preserve fileOffset[2]
         */
        for (int i = 0; i < fileOffsets.size(); i++) {
            if ((indexVLSN.compareTo(lastDuplicate) > 0) &&
                (fileOffsets.get(i) != NO_OFFSET)) {
                newFirstIndex = i;
                break;
            }
            indexVLSN = new VLSN(indexVLSN.getSequence() + stride);
        }

        VLSNBucket remainder = null;
        int lastOffset;
        if (newFirstIndex == -1) {

            /*
             * None of the VLSNs represented by the strided file offsets are
             * needed anymore. This bucket consists solely of the last
             * VLSN->LSN pair.
             */
            lastOffset = fileOffsets.get(fileOffsets.size() - 1);
            fileOffsets = new TruncateableList<Integer>();
            fileOffsets.add(DbLsn.getFileOffsetAsInt(lastLsn));
            firstVLSN = lastVLSN;
        } else {
            /* Move the still-valid mappings to a new list. */
            assert (newFirstIndex > 0);
            lastOffset = fileOffsets.get(newFirstIndex - 1);
            TruncateableList<Integer> newFileOffsets =
                new TruncateableList<Integer>
                (fileOffsets.subList(newFirstIndex, fileOffsets.size()));
            fileOffsets = newFileOffsets;
            firstVLSN =  new VLSN((newFirstIndex * stride) +
                                  firstVLSN.getSequence());
        }

        if (!firstVLSN.equals(lastDuplicate.getNext())) {

View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

            }
        }

        /* Now set the lastVLSN -> lastLSN mapping. */
        if (prevLsn == DbLsn.NULL_LSN) {
            lastVLSN = new VLSN(((fileOffsets.size()-1) * stride) +
                                firstVLSN.getSequence());
            Integer lastOffset = fileOffsets.get(fileOffsets.size() - 1);
            assert lastOffset != null;
            lastLsn = DbLsn.makeLsn(fileNumber,  lastOffset);
        } else {
View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

        throws IOException, DatabaseException {

        protocol.read(namedChannel.getChannel(), FeederInfoReq.class);
        int feeders = feederManager.getActiveFeederCount() -
                      1 /* Exclude this one */;
        VLSN rangeFirst = VLSN.NULL_VLSN;
        VLSN rangeLast = VLSN.NULL_VLSN;
        if (feederManager.getEnvImpl() instanceof RepImpl) {
            /* Include replication stream feeders as a load component. */
            RepImpl repImpl = (RepImpl) feederManager.getEnvImpl();
            feeders +=
                repImpl.getRepNode().feederManager().activeReplicaCount();
View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

     * A new VLSN->LSN mapping has been registered in a bucket. Update the
     * range accordingly.
     */
    VLSNRange getUpdateForNewMapping(final VLSN newValue,
                                     final byte entryTypeNum) {
        VLSN newFirst = first;
        VLSN newLast = last;
        VLSN newLastSync = lastSync;
        VLSN newLastTxnEnd = lastTxnEnd;

        if (first.equals(NULL_VLSN) || first.compareTo(newValue) > 0) {
            newFirst = newValue;
        }

View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

    /**
     * Incorporate the information in "other" in this range.
     */
    VLSNRange getUpdate(final VLSNRange other) {
        VLSN newFirst = getComparison(first, other.first,
                                      other.first.compareTo(first) < 0);
        VLSN newLast = getComparison(last, other.last,
                                     other.last.compareTo(last) > 0);
        VLSN newLastSync =
            getComparison(lastSync, other.lastSync,
                          other.lastSync.compareTo(lastSync) > 0);
        VLSN newLastTxnEnd =
            getComparison(lastTxnEnd, other.lastTxnEnd,
                          other.lastTxnEnd.compareTo(lastTxnEnd) > 0);
        return new VLSNRange(newFirst, newLast, newLastSync, newLastTxnEnd);
    }
View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

    /**
     * The "other" range is going to be appended to this range.
     */
    VLSNRange merge(final VLSNRange other) {
        VLSN newLast = getComparison(last, other.last, true);
        VLSN newLastSync = getComparison(lastSync, other.lastSync, true);
        VLSN newLastTxnEnd = getComparison(lastTxnEnd, other.lastTxnEnd, true);
        return new VLSNRange(first, newLast, newLastSync, newLastTxnEnd);
    }
View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

     * on a sync-able boundary. We can also assume that lastTxnEnd has not
     * been changed. And lastly, we can assume that this range is not empty,
     * since that was checked earlier on.
     */
    VLSNRange shortenFromEnd(final VLSN deleteStart) {
        VLSN newLast = deleteStart.getPrev();

        assert newLast.compareTo(lastTxnEnd) >= 0 :
        "Can't truncate at " + newLast +
            " because it overwrites a commit at " +  lastTxnEnd;

        if (newLast.equals(NULL_VLSN)) {
            return new VLSNRange(NULL_VLSN, NULL_VLSN, NULL_VLSN, NULL_VLSN);
        }
        return new VLSNRange(first, newLast, newLast, lastTxnEnd);
    }
View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

     * @return an new VLSNRange which starts at deleteEnd.getNext()
     */
    VLSNRange shortenFromHead(final VLSN deleteEnd) {
        /* We shouldn't be truncating the last sync */

        VLSN newFirst = null;
        VLSN newLast = last;
        if (deleteEnd.compareTo(last) == 0) {
            newFirst = NULL_VLSN;
            newLast = NULL_VLSN;
        } else {
            newFirst = deleteEnd.getNext();
        }

        assert (lastSync.equals(NULL_VLSN) ||
                lastSync.compareTo(newFirst) >= 0 ) :
            "Can't truncate lastSync= " + lastSync + " deleteEnd=" + deleteEnd;

        VLSN newTxnEnd = lastTxnEnd.compareTo(newFirst) > 0 ?
            lastTxnEnd : NULL_VLSN;

        return new VLSNRange(newFirst, newLast, lastSync, newTxnEnd);
    }
View Full Code Here

Examples of com.sleepycat.je.utilint.VLSN

                     " source=" +
                     VERSION);
            }

            VLSNRange range =
                new VLSNRange(new VLSN(ti.readPackedLong()), // first
                              new VLSN(ti.readPackedLong()), // last
                              new VLSN(ti.readPackedLong()), // lastSync
                              new VLSN(ti.readPackedLong())); // lastTxnEnd
            return range;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.