Package org.apache.activeio.journal

Examples of org.apache.activeio.journal.RecordLocation


        ack.setMessageId(messageId);
        ack.setMessageSequenceId(messageId.getBrokerSequenceId());
        ack.setSubscritionName(subscriptionName);
        ack.setClientId(clientId);
        ack.setTransactionId(context.getTransaction()!=null?context.getTransaction().getTransactionId():null);
        final RecordLocation location=peristenceAdapter.writeCommand(ack,false);
        final SubscriptionKey key=new SubscriptionKey(clientId,subscriptionName);
        if(!context.isInTransaction()){
            if(debug)
                log.debug("Journalled acknowledge for: "+messageId+", at: "+location);
            acknowledge(messageId,location,key);
View Full Code Here


        // swap out the hash maps..
        synchronized(this){
            cpAckedLastAckLocations=new ArrayList(this.ackedLastAckLocations.values());
            this.ackedLastAckLocations=new HashMap();
        }
        RecordLocation rc=super.checkpoint();
        if(!cpAckedLastAckLocations.isEmpty()){
            Collections.sort(cpAckedLastAckLocations);
            RecordLocation t=(RecordLocation)cpAckedLastAckLocations.get(0);
            if(rc==null||t.compareTo(rc)<0){
                rc=t;
            }
        }
        return rc;
    }
View Full Code Here

        ack.setMessageId(messageId);
        ack.setMessageSequenceId(messageId.getBrokerSequenceId());
        ack.setSubscritionName(subscriptionName);
        ack.setClientId(clientId);
        ack.setTransactionId( context.getTransaction()!=null ? context.getTransaction().getTransactionId():null);
        final RecordLocation location = peristenceAdapter.writeCommand(ack, false);
       
        final SubscriptionKey key = new SubscriptionKey(clientId, subscriptionName);       
        if( !context.isInTransaction() ) {
            if( debug )
                log.debug("Journalled acknowledge for: "+messageId+", at: "+location);
View Full Code Here

        // checkpoint tx operations in to long term store until they are committed.

        // But we keep track of the first location of an operation
        // that was associated with an active tx. The journal can not
        // roll over active tx records.       
        RecordLocation rc = null;
        for (Iterator iter = inflightTransactions.values().iterator(); iter.hasNext();) {
            Tx tx = (Tx) iter.next();
            RecordLocation location = tx.location;
            if (rc == null || rc.compareTo(location) < 0) {
                rc = location;
            }
        }
        for (Iterator iter = preparedTransactions.values().iterator(); iter.hasNext();) {
            Tx tx = (Tx) iter.next();
            RecordLocation location = tx.location;
            if (rc == null || rc.compareTo(location) < 0) {
                rc = location;
            }
        }
        return rc;
View Full Code Here

        // checkpoint tx operations in to long term store until they are committed.

        // But we keep track of the first location of an operation
        // that was associated with an active tx. The journal can not
        // roll over active tx records.       
        RecordLocation rc = null;
        for (Iterator iter = inflightTransactions.values().iterator(); iter.hasNext();) {
            Tx tx = (Tx) iter.next();
            RecordLocation location = tx.location;
            if (rc == null || rc.compareTo(location) < 0) {
                rc = location;
            }
        }
        for (Iterator iter = preparedTransactions.values().iterator(); iter.hasNext();) {
            Tx tx = (Tx) iter.next();
            RecordLocation location = tx.location;
            if (rc == null || rc.compareTo(location) < 0) {
                rc = location;
            }
        }
        return rc;
View Full Code Here

        longTermStore.recoverSubscription(clientId, subscriptionName, new MessageRecoveryListener() {
            public void recoverMessage(Message message) throws Exception {
                throw new IOException("Should not get called.");
            }
            public void recoverMessageReference(String messageReference) throws Exception {
                RecordLocation loc = toRecordLocation(messageReference);
                Message message = (Message) peristenceAdapter.readCommand(loc);
                listener.recoverMessage(message);
            }
           
            public void finished(){
View Full Code Here

        longTermStore.recoverNextMessages(clientId, subscriptionName, lastMessageId,maxReturned,new MessageRecoveryListener() {
            public void recoverMessage(Message message) throws Exception {
                throw new IOException("Should not get called.");
            }
            public void recoverMessageReference(String messageReference) throws Exception {
                RecordLocation loc = toRecordLocation(messageReference);
                Message message = (Message) peristenceAdapter.readCommand(loc);
                listener.recoverMessage(message);
            }
           
            public void finished(){
View Full Code Here

        ack.setMessageId(messageId);
        ack.setMessageSequenceId(messageId.getBrokerSequenceId());
        ack.setSubscritionName(subscriptionName);
        ack.setClientId(clientId);
        ack.setTransactionId( context.getTransaction()!=null ? context.getTransaction().getTransactionId():null);
        final RecordLocation location = peristenceAdapter.writeCommand(ack, false);
       
        final SubscriptionKey key = new SubscriptionKey(clientId, subscriptionName);       
        if( !context.isInTransaction() ) {
            if( debug )
                log.debug("Journalled acknowledge for: "+messageId+", at: "+location);
View Full Code Here

    public void addMessage(ConnectionContext context, final Message message) throws IOException {
       
        final MessageId id = message.getMessageId();
       
        final boolean debug = log.isDebugEnabled();       
        final RecordLocation location = peristenceAdapter.writeCommand(message, message.isResponseRequired());
        final QuickJournalMessageData md = new QuickJournalMessageData(message, location);
       
        if( !context.isInTransaction() ) {
            if( debug )
                log.debug("Journalled message add for: "+id+", at: "+location);
View Full Code Here

        final boolean debug = log.isDebugEnabled();
        JournalQueueAck remove = new JournalQueueAck();
        remove.setDestination(destination);
        remove.setMessageAck(ack);
       
        final RecordLocation location = peristenceAdapter.writeCommand(remove, ack.isResponseRequired());
        if( !context.isInTransaction() ) {
            if( debug )
                log.debug("Journalled message remove for: "+ack.getLastMessageId()+", at: "+location);
            removeMessage(ack, location);
        } else {
View Full Code Here

TOP

Related Classes of org.apache.activeio.journal.RecordLocation

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.