Package org.xtreemfs.babudb.lsmdb

Examples of org.xtreemfs.babudb.lsmdb.LSN.compareTo()


                latest = values.get(0);
            }
       
            // synchronize with the most up-to-date slave, if necessary
            LSN localState = babuDB.getState();
            if (localState.compareTo(latest) < 0) {
                for (Entry<ClientInterface, LSN> entry : states.entrySet()) {
                    if (entry.getValue().equals(latest)) {  
                               
                        Logging.logMessage(Logging.LEVEL_INFO, this,
                                "Starting synchronization from '%s' to '%s'.",
View Full Code Here


    private void finished(boolean loaded) {
        LSN actual = stage.getBabuDB().getState();
        LSN next = new LSN (actual.getViewId(), actual.getSequenceNo() + 1L);

        if (stage.missing != null &&
            next.compareTo(stage.missing.end) < 0) {
           
            stage.missing = new Range(actual, stage.missing.end);
           
            stage.setLogic(REQUEST, "There are still some logEntries " +
                    "missing after loading the database.");
View Full Code Here

        LSN actual = stage.getBabuDB().getState();
        LSN next = new LSN (actual.getViewId(), actual.getSequenceNo() + 1L);
       
        // we are still missing some entries (the request was too large)
        // update the missing entries
        if (next.compareTo(stage.missing.end) < 0) {
            stage.missing = new Range(actual, stage.missing.end);

         // all went fine --> back to basic
        } else {
            stage.missing = null;
View Full Code Here

        Logging.logMessage(Logging.LEVEL_DEBUG, this, "Replicate requested: %s",
                lsn.toString());
       
        LSN lastAsync = lastAsyncInserted.get();
        LSN actual = stage.getBabuDB().getState();
        actual = (lastAsync == null || actual.compareTo(lastAsync) >= 0) ? actual : lastAsync;
        LSN expected = new LSN(actual.getViewId(), actual.getSequenceNo() + 1L);
       
        // check the LSN of the logEntry to write
        if (lsn.compareTo(actual) <= 0) {
            // entry was already inserted
View Full Code Here

        }
       
        final LSN firstEntry = new LSN(start.getViewId(),
                                       start.getSequenceNo() + 1L);
       
        assert (firstEntry.compareTo(end) < 0) :
            "At least one LogEntry has to be requested!";
       
        DiskLogIterator it = null;
        LogEntry le = null;
        synchronized (babuInterface.getCheckpointerLock()) {
View Full Code Here

        assertEquals(expResult, result);
       
        one = new LSN(1,100);
        two = new LSN(2,100);
        expResult = 1;
        result = two.compareTo(one);
        assertEquals(expResult, result);
       
        one = new LSN(1,100);
        two = new LSN(1,100);
        expResult = 0;
View Full Code Here

        assertEquals(expResult, result);
       
        one = new LSN(1,100);
        two = new LSN(1,100);
        expResult = 0;
        result = two.compareTo(one);
        assertEquals(expResult, result);
       
        one = new LSN(1,99);
        two = new LSN(1,100);
        expResult = -1;
View Full Code Here

        assertEquals(expResult, result);
       
        one = new LSN(1,99);
        two = new LSN(1,100);
        expResult = 1;
        result = two.compareTo(one);
        assertEquals(expResult, result);

    }

}
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.