Examples of StageRequest


Examples of org.xtreemfs.babudb.replication.service.StageRequest

     */
    @Override
    public void run() throws InterruptedException {    
        assert (stage.missing == null) : "PROGRAMATICAL ERROR!";
       
        final StageRequest op = stage.getQueue().take();
       
        // filter dummy stage request
        if (op == StageRequest.NOOP_REQUEST) return;
       
        final LSN lsn = op.getLSN();
        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
            stage.finalizeRequest(op);
            return;
        } else if(!lsn.equals(expected)){
            // we missed one or more entries
            stage.getQueue().add(op);
            stage.missing = new Range(actual, lsn);
            stage.setLogic(REQUEST, "We missed some LogEntries from " +
                    actual.toString() + " to "+ lsn.toString() + ".");
            return;
        }
       
        // try to finish the request
        try {    
            // perform the operation
            stage.getBabuDB().appendToLocalPersistenceManager(((LogEntry) op.getArgs()[1]).clone(),
                    new DatabaseRequestListener<Object>() {
                       
                        @Override
                        public void finished(Object result, Object context) {
                            stage.finalizeRequest(op);
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.