Package com.sleepycat.je.utilint

Examples of com.sleepycat.je.utilint.VLSN


    /**"
     * @see Loggable#readFromLog
     */
    public void readFromLog(ByteBuffer buffer, int entryVersion) {
        matchpointVLSN = new VLSN(LogUtils.readPackedLong(buffer));
        matchpointLSN = LogUtils.readPackedLong(buffer);
        /* the timestamp is packed -- double negative, unpacked == false */
        time = LogUtils.readTimestamp(buffer, false /* unpacked. */);
        int setSize = LogUtils.readPackedInt(buffer);
        activeTxnIds = new HashSet<Long>(setSize);
View Full Code Here


     * Assumes this is called directly after the constructor, and that the
     * entryBuffer is positioned right before the VLSN.
     */
    public void readVariablePortion(ByteBuffer entryBuffer) {
        if (vlsnPresent) {
            vlsn = new VLSN();
            vlsn.readFromLog(entryBuffer, entryVersion);
        }
    }
View Full Code Here

                envImpl.getConfigManager().getInt
                (EnvironmentParams.LOG_ITERATOR_READ_SIZE);
            FeederReader feederReader = null;
            FeederSyncupReader backwardsReader = null;

            VLSN scanVLSN = startVLSN;
            if (startVLSN.equals(VLSN.NULL_VLSN)) {
                RepImpl repImpl = RepInternal.getRepImpl(rep);
                VLSNRange range = repImpl.getVLSNIndex().getRange();
                if (forward) {
                    scanVLSN = range.getFirst();
                } else {
                    scanVLSN = range.getLast();
                }
            }
            if (scanVLSN.equals(VLSN.NULL_VLSN)) {
                /* Give up, no VLSN entries in the index. */
                System.out.println("<DbPrintLog>");
                System.out.println("</DbPrintLog>");
                return;
            }

            if (forward) {
                feederReader = new FeederReader(envImpl, vlsnIndex, startLsn,
                                                readBufferSize,
                                                new NameIdPair("n0", 0));
                feederReader.initScan(scanVLSN);
            } else {
                backwardsReader = new FeederSyncupReader
                    (envImpl, vlsnIndex,
                     startLsn, readBufferSize,
                     new NameIdPair("n0", 0),
                     scanVLSN,
                     DbLsn.NULL_LSN);
            }

            OutputWireRecord record = null;
            System.out.println("<DbPrintLog>");
            long lastLsn = 0;
            do  {
                if (forward) {
                    record = feederReader.scanForwards(scanVLSN, 0);
                    scanVLSN = scanVLSN.getNext();
                    lastLsn = feederReader.getLastLsn();
                } else {
                    record = backwardsReader.scanBackwards(scanVLSN);
                    scanVLSN = scanVLSN.getPrev();
                    lastLsn = backwardsReader.getLastLsn();
                }
                if (record != null) {
                    System.out.println
                    ("lsn=" + DbLsn.getNoFormatString(lastLsn) + " " + record);
View Full Code Here

            int whichArg = 0;
            String groupName = "repGroup";
            String host = "localHost";
            String nodeName = "node8";
            long startLsn = DbLsn.NULL_LSN;
            VLSN startVLSN = VLSN.NULL_VLSN;
            boolean verbose = true;
            boolean forward = true;

            /* Default to looking in current directory. */
            File envHome = new File(".");
            Key.DUMP_TYPE = DumpType.BINARY;

            while (whichArg < argv.length) {
                String nextArg = argv[whichArg];
                if (nextArg.equals("-h")) {
                    whichArg++;
                    envHome = new File(CmdUtil.getArg(argv, whichArg));
                } else if (nextArg.equals("-s")) {
                    whichArg++;
                    String arg = CmdUtil.getArg(argv, whichArg);
                    int slashOff = arg.indexOf("/");
                    if (slashOff < 0) {
                        long startFileNum = CmdUtil.readLongNumber(arg);
                        startLsn = DbLsn.makeLsn(startFileNum, 0);
                    } else {
                        long startFileNum =
                            CmdUtil.readLongNumber(arg.substring(0, slashOff));
                        long startOffset = CmdUtil.readLongNumber
                            (arg.substring(slashOff + 1));
                        startLsn = DbLsn.makeLsn(startFileNum, startOffset);
                    }
                } else if (nextArg.equals("-e")) {
                    whichArg++;
                    String arg = CmdUtil.getArg(argv, whichArg);
                    int slashOff = arg.indexOf("/");
                    /* SuppressWarnings because -e is not yet implemented.*/
                    if (slashOff < 0) {
                        @SuppressWarnings("unused")
                        long endFileNum = CmdUtil.readLongNumber(arg);
                    } else {
                        @SuppressWarnings("unused")
                        long endFileNum =
                            CmdUtil.readLongNumber(arg.substring(0, slashOff));
                        @SuppressWarnings("unused")
                        long endOffset = CmdUtil.readLongNumber
                            (arg.substring(slashOff + 1));
                    }
                } else if (nextArg.equals("-q")) {
                    verbose = false;
                } else if (nextArg.equals("-backward")) {
                    forward = false;
                } else if (nextArg.equals("-vlsn")) {
                    whichArg++;
                    String arg = CmdUtil.getArg(argv, whichArg);
                    startVLSN = new VLSN(CmdUtil.readLongNumber(arg));
                } else {
                    System.err.println
                        (nextArg + " is not a supported option.");
                    usage();
                    System.exit(-1);
View Full Code Here

    /**
     * Ideally, this would be a constructor, but we have to read several
     * items off the tuple input first before calling super();
     */
    static GhostBucket makeNewInstance(TupleInput ti) {
        VLSN ghostVLSN = new VLSN(ti.readPackedLong());
        long firstLsn = ti.readPackedLong();
        long lastLsn = ti.readPackedLong();
        return new GhostBucket(ghostVLSN, firstLsn, lastLsn);
    }
View Full Code Here

                             LogEntry targetLogEntry) {

        if (currentEntryHeader.getReplicated() &&
            !currentEntryHeader.isInvisible()) {

            VLSN vlsn = currentEntryHeader.getVLSN();
            track(vlsn, lsn,  currentEntryHeader.getType());
        } else if (currentEntryHeader.getType() == rollbackType) {
            RollbackStart rb =
               (RollbackStart) ((SingleItemEntry) targetLogEntry).getMainItem();
View Full Code Here

             * Truncate VLSNIndex for the highest numbered file with a VLSN. We
             * search from high to low because some files may not contain a
             * VLSN. If the truncate does have to do work, the VLSNIndex will
             * ensure that the change is fsynced to disk. [#20702]
             */
            VLSN lastVlsn = fileSelector.getLastVLSN(fileNum);
            if ((lastVlsn != null) && !lastVlsn.isNull()) {
                env.vlsnHeadTruncate(lastVlsn, fileNum);
                break;
            }
        }

View Full Code Here

    static ReplicationContext getMigrationRepContext(LN ln) {
        long vlsnSeq = ln.getVLSNSequence();
        if (vlsnSeq <= 0) {
            return ReplicationContext.NO_REPLICATE;
        }
        return new ReplicationContext(new VLSN(vlsnSeq),
                                      false /*inReplicationStream*/);
    }
View Full Code Here

                     */
                    long txnId = ((Ack) response).getTxnId();
                    if (logger.isLoggable(Level.FINE)) {
                        LoggerUtils.fine(logger, repImpl, "Ack for: " + txnId);
                    }
                    final VLSN commitVLSN =
                    repNode.getFeederTxns().noteReplicaAck(txnId);
                    if ((commitVLSN != null) &&
                        (commitVLSN.compareTo(replicaACKVLSN) > 0)) {
                        replicaACKVLSN = commitVLSN;
                    }
                    continue;
                } else if (response.getOp() == Protocol.SHUTDOWN_RESPONSE) {
                    LoggerUtils.info(logger, repImpl,
View Full Code Here

                    ("Node ID: " + nameIdPair + " not present in group db");
            }

            /* Let's see if the entry needs updating. */
            RepNodeImpl node = mib.entryToObject(value);
            final VLSN lastCBVLSN = node.getBarrierState().getLastCBVLSN();
            if (lastCBVLSN.equals(newCBVLSN)) {
                ok = true;
                return true;
            }

            node.setBarrierState(barrierState);
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.