Package com.sleepycat.je.utilint

Examples of com.sleepycat.je.utilint.VLSN


            long interval = now - lastHeartbeat;

            if (interval <= heartbeatInterval) {
                return;
            }
            final VLSN vlsn = repNode.getCurrentTxnEndVLSN();
            protocol.write(protocol.new Heartbeat(now, vlsn.getSequence()),
                           feederReplicaChannel);
            lastHeartbeat = now;

            nMaxReplicaLag.setMax(vlsn.getSequence() -
                                  feederVLSN.getSequence());
        }
View Full Code Here


            return;
        }

        synchronized (this) {
            if (newVLSN.compareTo(lastSyncableVLSN) > 0) {
                VLSN old = lastSyncableVLSN;
                lastSyncableVLSN = newVLSN;
                if (DbLsn.getFileNumber(lsn) != currentFile) {
                    currentFile = DbLsn.getFileNumber(lsn);
                    currentLocalCBVLSN = old;
                }
View Full Code Here

         */
        if (padValue == 0) {
            return currentLocalCBVLSN;
        }

        VLSN minVLSN = vlsnIndex.getRange().getFirst();
        long paddedCBVLSNVal =
            (currentLocalCBVLSN.getSequence() - padValue);
        if (paddedCBVLSNVal < minVLSN.getSequence()) {
            return minVLSN;
        }

        return new VLSN(paddedCBVLSNVal);
    }
View Full Code Here

     * An LN has two transient fields that are derived from its parent log
     * entry: last logged size and VLSN sequence.
     */
    private void setLNTransientFields(LogEntryHeader header, LN ln) {
        ln.setLastLoggedSize(header.getSize() + header.getItemSize());
        final VLSN vlsn = header.getVLSN();
        if (vlsn != null) {
            ln.setVLSNSequence(vlsn.getSequence());
        }
    }
View Full Code Here

         * The checkpoint ensures that we do not have to replay VLSNs from the
         * prior group and that we have a complete VLSN index on disk.
         */
        repImpl.getCheckpointer().doCheckpoint(ckptConfig,
                                               "Reinit of RepGroup");
        VLSN lastOldVLSN = repImpl.getVLSNIndex().getRange().getLast();

        /* Now create the new rep group on disk. */
        repGroupDB.reinitFirstNode(lastOldVLSN);
        refreshCachedGroup();

View Full Code Here

        if (consistency == null) {
            final int consistencyTimeout =
                getConfigManager().getDuration(ENV_CONSISTENCY_TIMEOUT);
            consistency = new PointConsistencyPolicy
                (new VLSN(replica.getMasterTxnEndVLSN()),
                 consistencyTimeout, TimeUnit.MILLISECONDS);
        }

        /*
         * Wait for the replica to become sufficiently consistent.
View Full Code Here

        throws DatabaseException {

        /* Take the minimum of SyncCleanerBarrier and GlobalCBVLSN. */
        long syncStart = repImpl.getSyncCleanerBarrier().getMinSyncStart();
        if (syncStart != LogChangeSet.NULL_POSITION) {
            VLSN vlsn = new VLSN(syncStart);
            if (vlsn.compareTo(globalCBVLSN.getCBVLSN()) < 0) {
                return repImpl.getVLSNIndex().getLTEFileNumber(vlsn);
            }
        }

        return globalCBVLSN.getCleanerBarrierFile();
View Full Code Here

         * unlogged uncommitted/abort transaction will be aborted during
         * recovery. It's useless to keep track of those VLSNs.
        */
        @Override
        public void run() {
            final VLSN newTxnEndVLSN = repNode.getCurrentTxnEndVLSN();

            /* Do nothing if no updates. */
            if (newTxnEndVLSN == null) {
                return;
            }

            if (lastTxnEndVLSN == null ||
                newTxnEndVLSN.compareTo(lastTxnEndVLSN) == 1) {
                lastTxnEndVLSN = newTxnEndVLSN;
                repNode.getRepImpl().getLogManager().flush();
            }
        }
View Full Code Here

             */
            return;
        }

        try {
            VLSN candidate = nodeCBVLSN;

            if (candidate.isNull()) {
                return;
            }

            if (candidate.compareTo(repNode.getGroupCBVLSN()) < 0) {
                /* Don't let the group CBVLSN regress.*/
                return;
            }

            boolean updated = repNode.repGroupDB.updateLocalCBVLSN(nameIdPair,
View Full Code Here

     * only occur on bucket boundaries.
     */
    void recalculate(RepGroupImpl groupInfo) {

        /* Find the time the highest CBVLSN was computed. */
        VLSN maxCBVLSN = NULL_VLSN;
        long latestBarrierTime = 0;
        for (RepNodeImpl node : groupInfo.getElectableNodes()) {

            BarrierState nodeBarrier = node.getBarrierState();
            VLSN cbvlsn = nodeBarrier.getLastCBVLSN();

            /*
             * Count all nodes, including those that are in the middle of
             * syncup and have not established their low point when finding the
             * max time.
             */
            final long nodeBarrierTime = nodeBarrier.getBarrierTime();

            if (maxCBVLSN.compareTo(cbvlsn) <= 0) {
                /*
                 * Use min, since it represents the real change when they are
                 * equal.
                 */
                latestBarrierTime = cbvlsn.equals(maxCBVLSN) ?
                    Math.min(nodeBarrierTime, latestBarrierTime) :
                    nodeBarrierTime;
                maxCBVLSN = cbvlsn;
            }
        }

        if (latestBarrierTime == 0) {
            /* No cbvlsns entered yet, don't bother to recalculate. */
            return;
        }

        if (maxCBVLSN.isNull()) {
            /* No cbvlsns entered yet, don't bother to recalculate. */
            return;
        }

        /*
         * Now find the min CBVLSN that has not been timed out. This may mean
         * that the min CBVLSN == NULL_VLSN, for nodes that have not yet
         * finished syncup.
         */
        VLSN newGroupCBVLSN = maxCBVLSN;
        for (RepNodeImpl node : groupInfo.getElectableNodes()) {

            BarrierState nodeBarrier = node.getBarrierState();
            VLSN nodeCBVLSN = nodeBarrier.getLastCBVLSN();

            if (((latestBarrierTime - nodeBarrier.getBarrierTime()) <=
                 streamTimeoutMs) &&
                (newGroupCBVLSN.compareTo(nodeCBVLSN) > 0)) {
                newGroupCBVLSN = nodeCBVLSN;
View Full Code Here

TOP

Related Classes of com.sleepycat.je.utilint.VLSN

Copyright © 2018 www.massapicom. 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.