Package org.apache.activemq.store.kahadb.disk.journal

Examples of org.apache.activemq.store.kahadb.disk.journal.Location


        journal.close();
        journal = null;
    }

    private void recoverPendingLocalTransactions() throws IOException {
        Location location = journal.getNextLocation(null);
        while (location != null) {
            process(load(location));
            location = journal.getNextLocation(location);
        }
        recoveredPendingCommit.addAll(inflightTransactions.keySet());
View Full Code Here


            final String key = identity.toProducerKey();

            // Hopefully one day the page file supports concurrent read
            // operations... but for now we must
            // externally synchronize...
            Location location;
            indexLock.writeLock().lock();
            try {
                location = findMessageLocation(key, dest);
            }finally {
                indexLock.writeLock().unlock();
View Full Code Here

            time += delay;
        } else {
            time += period;
        }

        Location location = this.store.write(payload, false);
        JobLocation jobLocation = new JobLocation(location);
        this.store.incrementJournalCount(tx, location);
        jobLocation.setJobId(jobId);
        jobLocation.setStartTime(startTime);
        jobLocation.setCronEntry(cronEntry);
View Full Code Here

public class LocationMarshaller implements Marshaller<Location> {
    public final static LocationMarshaller INSTANCE = new LocationMarshaller();

    public Location readPayload(DataInput dataIn) throws IOException {
        Location rc = new Location();
        rc.setDataFileId(dataIn.readInt());
        rc.setOffset(dataIn.readInt());
        return rc;
    }
View Full Code Here

    public int getFixedSize() {
        return 8;
    }

    public Location deepCopy(Location source) {
        return new Location(source);
    }
View Full Code Here

        }
    }

    @Override
    public Object addLast(final String id, final ByteSequence bs) throws IOException {
        final Location location = this.store.write(bs, false);
        synchronized (indexLock) {
            this.store.getPageFile().tx().execute(new Transaction.Closure<IOException>() {
                public void execute(Transaction tx) throws IOException {
                    add(tx, id, location);
                }
View Full Code Here

        return new Locator(id);
    }

    @Override
    public Object addFirst(final String id, final ByteSequence bs) throws IOException {
        final Location location = this.store.write(bs, false);
        synchronized (indexLock) {
            this.store.getPageFile().tx().execute(new Transaction.Closure<IOException>() {
                public void execute(Transaction tx) throws IOException {
                    addFirst(tx, id, location);
                }
View Full Code Here

            if (loaded.get()) {
                this.store.getPageFile().tx().execute(new Transaction.Closure<IOException>() {
                    public void execute(Transaction tx) throws IOException {
                        Iterator<Map.Entry<String,Location>> iterator = iterator(tx);
                        while (iterator.hasNext()) {
                            Location location = iterator.next().getValue();
                            candidates.remove(location.getDataFileId());
                        }
                    }
                });
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.activemq.store.kahadb.disk.journal.Location

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.