Package com.sleepycat.je.rep.impl.node

Examples of com.sleepycat.je.rep.impl.node.NameIdPair


    public MasterValue(String valueString) {
        super(valueString);
        String[] tokens = valueString.split(DELIMITER_REGEXP);
        hostname = tokens[0];
        port = Integer.parseInt(tokens[1]);
        nameIdPair = new NameIdPair(tokens[2], Integer.parseInt(tokens[3]));
    }
View Full Code Here


    public Monitor(MonitorConfig monitorConfig) {
        String groupName = monitorConfig.getGroupName();
        if (groupName == null) {
            throw new IllegalArgumentException("Missing group name");
        }
        nameIdPair = new NameIdPair(monitorConfig.getNodeName());
        String nodeHost = monitorConfig.getNodeHostPort();
        if (nodeHost == null) {
            throw new IllegalArgumentException("Missing nodeHost");
        }
        this.monitorConfig = monitorConfig.clone();
View Full Code Here

            }

            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;
View Full Code Here

         */
        TransactionConfig txnConfig = new TransactionConfig();
        txnConfig.setDurability(NO_ACK.getDurability());
        txnConfig.setConsistencyPolicy(NO_CONSISTENCY);

        NameIdPair nameIdPair = repImpl.getRepNode().getNameIdPair();
        nameIdPair.revertToNull(); /* read transaction, so null id is ok. */

        /* Now delete old nodes and the group, and establish a new group */
        Txn txn = new MasterTxn(repImpl, txnConfig, nameIdPair);
        RepGroupImpl prevRepGroup = fetchGroupObject(txn, dbImpl);
        txn.commit();

        final int nodeIdSequenceStart = prevRepGroup.getNodeIdSequence();

        final DatabaseEntry keyEntry = new DatabaseEntry();
        final DatabaseEntry value = new DatabaseEntry();

        /*
         * We have the "predicted" real node id, so set it and it will be used
         * in the commit lns that will be written in future.
         */
        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);
View Full Code Here

        public void run() {
            final Protocol protocol;

            try {
                env = repImpl.makeEnvironment();
                protocol = new Protocol(new NameIdPair("Ldiff", -1), repImpl);
                try {
                    channel.configureBlocking(true);
                    Message msg = protocol.read(channel);
                    if (msg.getOp() == Protocol.DB_BLOCKS) {
                        runLDiff((DbBlocks)msg, protocol);
View Full Code Here

         * The nameIdPair field is assigned here rather than in the constructor
         * because of base class/subclass dependencies. initFormatter() is
         * called by the base class constructor, and nameIdPair must be
         * available at that time.
         */
        nameIdPair = new NameIdPair(configManager.get(NODE_NAME));
        return new ReplicationFormatter(nameIdPair);
    }
View Full Code Here

        /*
         * Our local nameIdPair field isn't set yet because we haven't finished
         * our initialization, so get it from the config manager.
         */
        NameIdPair useNameIdPair =
            new NameIdPair(configManager.get(NODE_NAME));

        vlsnIndex = new VLSNIndex(this, DbType.VLSN_MAP.getInternalName(),
                                  useNameIdPair, stride, maxMappings, maxDist,
                                  recoveryInfo);
        replay.preRecoveryCheckpointInit(recoveryInfo);
View Full Code Here

                 VLSNIndex vlsnIndex,
                 long startLsn,
                 int readBufferSize) {

        this(envImpl, vlsnIndex, startLsn, readBufferSize,
             new NameIdPair("test Node", 0),
             true /*bypassCache*/);
    }
View Full Code Here

        boolean ret = true;

        SocketChannel channel = connect(addr);

        final Protocol protocol = new Protocol(
                new NameIdPair("Ldiff", -1),
                DbInternal.getEnvironmentImpl(env));
        protocol.write(protocol.new EnvDiff(), channel);

        /*
         * Check that the number of local databases matches the number of
View Full Code Here

    private boolean diff(Database db, SocketChannel channel)
        throws IOException, ProtocolException, Exception {

        final Protocol protocol = new Protocol(
                new NameIdPair("Ldiff", -1),
                DbInternal.getEnvironmentImpl(db.getEnvironment()));
        protocol.write(protocol.new DbBlocks
                       (db.getDatabaseName(), cfg.getBlockSize()), channel);

        /*
 
View Full Code Here

TOP

Related Classes of com.sleepycat.je.rep.impl.node.NameIdPair

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.