Examples of BarrierState


Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

         */
        final int firstNodeId = nodeIdSequenceStart + 1;
        nameIdPair.setId(firstNodeId);

        RepNodeImpl firstNode = new RepNodeImpl(nodeName, hostname, port);
        final BarrierState barrierState = new BarrierState(lastOldVLSN,
                                                   System.currentTimeMillis());
        firstNode.setBarrierState(barrierState);

        txn = new MasterTxn(repImpl, txnConfig, nameIdPair);

View Full Code Here

Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

                                  NodeType.values()[input.readByte()],
                                  input.readBoolean(),
                                  input.readBoolean(),
                                  input.readString(),
                                  input.readInt(),
                                  new BarrierState(new VLSN(input.readLong()),
                                                  input.readLong()),
                                                  input.readInt());
            return mi;
        }
View Full Code Here

Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

            return mi;
        }

        @Override
        public void objectToEntry(RepNodeImpl mi, TupleOutput output) {
            final BarrierState syncState = mi.getBarrierState();
            mi.getNameIdPair().serialize(output);
            output.writeByte(mi.getType().ordinal());
            output.writeBoolean(mi.isQuorumAck());
            output.writeBoolean(mi.isRemoved());
            output.writeString(mi.getHostName());
            output.writeInt(mi.getPort());
            output.writeLong(syncState.getLastCBVLSN().getSequence());
            output.writeLong(syncState.getBarrierTime());
            output.writeInt(mi.getChangeVersion());
        }
View Full Code Here

Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

                       boolean isRemoved,
                       String hostName,
                       int port,
                       int changeVersion) {
        this(nameIdPair, type, quorumAck, isRemoved, hostName, port,
             new BarrierState(VLSN.NULL_VLSN,
                              System.currentTimeMillis()), changeVersion);
    }
View Full Code Here

Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

        /* 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

Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

                       boolean isRemoved,
                       String hostName,
                       int port,
                       int changeVersion) {
        this(nameIdPair, type, quorumAck, isRemoved, hostName, port,
             new BarrierState(VLSN.NULL_VLSN,
                              System.currentTimeMillis()), changeVersion);
    }
View Full Code Here

Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

                                  NodeType.values()[input.readByte()],
                                  input.readBoolean(),
                                  input.readBoolean(),
                                  input.readString(),
                                  input.readInt(),
                                  new BarrierState(new VLSN(input.readLong()),
                                                  input.readLong()),
                                                  input.readInt());
            return mi;
        }
View Full Code Here

Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

            return mi;
        }

        @Override
        public void objectToEntry(RepNodeImpl mi, TupleOutput output) {
            final BarrierState syncState = mi.getBarrierState();
            mi.getNameIdPair().serialize(output);
            output.writeByte(mi.getType().ordinal());
            output.writeBoolean(mi.isQuorumAck());
            output.writeBoolean(mi.isRemoved());
            output.writeString(mi.getHostName());
            output.writeInt(mi.getPort());
            output.writeLong(syncState.getLastCBVLSN().getSequence());
            output.writeLong(syncState.getBarrierTime());
            output.writeInt(mi.getChangeVersion());
        }
View Full Code Here

Examples of com.sleepycat.je.rep.impl.RepGroupImpl.BarrierState

        /* 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
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.