Examples of LSN


Examples of org.chaidb.db.log.Lsn

     */
    public Lsn getLastLsnOfChildTxn() {
        if (lastLsnOfChildTxn == null) {
            return null;
        }
        return new Lsn(lastLsnOfChildTxn);
    }
View Full Code Here

Examples of org.chaidb.db.log.Lsn

     * user interface to add a log record and put it to buffer pool
     */
    public Lsn log() throws ChaiDBException {
        super.log();
        LogManager logMgr = Db.getLogManager();
        Lsn newLsn = logMgr.put(this, LogManager.LOG_CHILD_FLUSH);

        return newLsn;
    }
View Full Code Here

Examples of org.chaidb.db.log.Lsn

    private final String filename; //name of current file
    private final Lsn firstLsn;

    public TxnQueue(Integer txnId, Lsn firstLsn, String path) {
        this.txnId = txnId;
        this.firstLsn = new Lsn(firstLsn);
        this.path = path;
        filename = path + File.separator + "txn_" + Integer.toHexString(txnId.intValue());
    }
View Full Code Here

Examples of org.xtreemfs.babudb.lsmdb.LSN

                return new ReplicationClientAdapter(client, receiver);
            }
        });
       
        hbt = new HeartbeatThread(states, BASIC_PORT);
        hbt.start(new LSN(0,0L));
        hbt.waitForStartup();
    }
View Full Code Here

Examples of org.xtreemfs.babudb.lsmdb.LSN

       
        // infarct the hbt and invalidate the expected lsn
        hbt.infarction();
        Thread.sleep(HeartbeatThread.MAX_DELAY_BETWEEN_HEARTBEATS);
        synchronized (lsn) {
            lsn.set(new LSN(-1, -1L));
            lastHeartbeat.set(0);
        }
       
        // remain a few beats idle, just to make sure the HBT has a flatline
        Thread.sleep(3 * HeartbeatThread.MAX_DELAY_BETWEEN_HEARTBEATS);
       
        // update the hbt and re-animate it too
        lsn.set(new LSN(1, 1L));
        lastHeartbeat.set(Long.MAX_VALUE - MAX_DELAY_BETWEEN_HBS_ALLOWED);
        hbt.updateLSN(new LSN(1, 1L));
       
        // again let it do some work
        Thread.sleep(3 * HeartbeatThread.MAX_DELAY_BETWEEN_HEARTBEATS);
    }
View Full Code Here

Examples of org.xtreemfs.babudb.lsmdb.LSN

        final String fileName = "testFile";
        final long offsetStart = 815L;
        final long offsetEnd = 4711L;
        final String chunkResult = "chunkResult";
        final int port = 12345;
        final LSN lsn = new LSN(345, 1337L);
       
        // registers operations at the handler
        Map<Integer, Operation> ops = new HashMap<Integer, Operation>();
        ops.put(ReplicationServiceConstants.PROC_ID_HEARTBEAT, new Operation() {
                       
            @Override
            public int getProcedureId() {
                return ReplicationServiceConstants.PROC_ID_HEARTBEAT;
            }
           
            @Override
            public Message getDefaultRequest() {
                return HeartbeatMessage.getDefaultInstance();
            }

            @Override
            public void processRequest(Request rq) {
                HeartbeatMessage hbm = (HeartbeatMessage) rq.getRequestMessage();
                assertEquals(port, hbm.getPort());
                assertEquals(lsn.getViewId(), hbm.getLsn().getViewId());
                assertEquals(lsn.getSequenceNo(), hbm.getLsn().getSequenceNo());
               
                rq.sendSuccess(ErrorCodeResponse.getDefaultInstance());
            }
        });
        ops.put(ReplicationServiceConstants.PROC_ID_CHUNK, new Operation() {
View Full Code Here

Examples of org.xtreemfs.babudb.lsmdb.LSN

    @Override
    public LSN checkpoint(boolean incViewId) throws BabuDBException {
        Logging.logMessage(Logging.LEVEL_ERROR, this,
            "Mock tried to create CP. With inc. viewID set %s.", incViewId);
       
        LSN onDisk = txnMan.getLatestOnDiskLSN();
        if (incViewId) {
            txnMan.onDisk.set(new LSN(onDisk.getViewId() + 1, 0L));
        }
        return onDisk;
    }
View Full Code Here

Examples of org.xtreemfs.babudb.lsmdb.LSN

   
        if (lock.get()) {
            throw new BabuDBException(ErrorCode.REPLICATION_FAILURE, "Serivce has been locked!");
        } else {
            synchronized (onDisk) {
                LSN lsn = onDisk.get();
                lsn = new LSN(lsn.getViewId(), lsn.getSequenceNo() + 1L);
                onDisk.set(lsn);
                Logging.logMessage(Logging.LEVEL_ERROR, this, "TxnMan of mock '%s' has " +
                    "retrieved a new transaction to perform (%s) with LSN %s.", name,
                    txn.toString(), lsn.toString());
            }
        }
    }
View Full Code Here

Examples of org.xtreemfs.babudb.lsmdb.LSN

                    if (accessCounter.decrementAndGet() == 0) {
                        accessCounter.notify();
                    }
                }
               
                LSN assignedByDiskLogger = localFuture.getAssignedLSN();
                LogEntry le = new LogEntry(payload, new ListenerWrapper(future, result),
                                           PAYLOAD_TYPE_TRANSACTION);
                le.assignId(assignedByDiskLogger.getViewId(), assignedByDiskLogger.getSequenceNo());
               
                ReplicateResponse rp = replMan.replicate(le);
                if (!rp.hasFailed()) {
                    replMan.subscribeListener(rp);
                }
View Full Code Here

Examples of org.xtreemfs.babudb.lsmdb.LSN

    public ParticipantsStates(int syncN, Set<InetSocketAddress> participants,
            ClientFactory clientFactory) throws UnknownParticipantException {
       
        assert(participants!=null);
       
        latestCommon = new LSN(0,0L);
        this.syncN = ((syncN > 0) ? syncN - 1 : syncN);
        participantsCount = deadSlaves = participants.size();
        availableSlaves = 0;
       
        /*
 
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.