Examples of WriteCommand


Examples of journal.io.api.Journal.WriteCommand

                            canBatch = currentBatch.canBatch(writeRecord, journal.getMaxWriteBatchSize(), journal.getMaxFileLength());
                            if (!canBatch) {
                                file = journal.rotateWriteFile();
                                currentBatch = new WriteBatch(file, 0);
                            }
                            WriteCommand controlRecord = currentBatch.prepareBatch();
                            writeRecord.getLocation().setDataFileId(file.getDataFileId());
                            writeRecord.getLocation().setPointer(currentBatch.incrementAndGetPointer());
                            writeRecord.getLocation().setLatch(currentBatch.getLatch());
                            currentBatch.appendBatch(writeRecord);
                            if (!writeRecord.isSync()) {
                                journal.getInflightWrites().put(controlRecord.getLocation(), controlRecord);
                                journal.getInflightWrites().put(writeRecord.getLocation(), writeRecord);
                                nextWriteBatch = currentBatch;
                            } else {
                                batchQueue.offer(currentBatch);
                                hasNewBatch = true;
View Full Code Here

Examples of journal.io.api.Journal.WriteCommand

        Location location = new Location();
        location.setSize(size);
        location.setType(type);
        location.setWriteCallback(callback);
        WriteCommand write = new WriteCommand(location, data, sync);
        location = enqueueBatch(write);

        if (sync) {
            try {
                location.getLatch().await();
View Full Code Here

Examples of journal.io.api.Journal.WriteCommand

                            canBatch = currentBatch.canBatch(writeRecord, journal.getMaxWriteBatchSize(), journal.getMaxFileLength());
                            if (!canBatch) {
                                file = journal.newDataFile();
                                currentBatch = new WriteBatch(file, 0);
                            }
                            WriteCommand controlRecord = currentBatch.prepareBatch();
                            writeRecord.getLocation().setDataFileId(file.getDataFileId());
                            writeRecord.getLocation().setPointer(currentBatch.incrementAndGetPointer());
                            writeRecord.getLocation().setLatch(currentBatch.getLatch());
                            currentBatch.appendBatch(writeRecord);
                            if (!writeRecord.isSync()) {
                                journal.getInflightWrites().put(controlRecord.getLocation(), controlRecord);
                                journal.getInflightWrites().put(writeRecord.getLocation(), writeRecord);
                                nextWriteBatch = currentBatch;
                            } else {
                                batchQueue.offer(currentBatch);
                                hasNewBatch = true;
View Full Code Here

Examples of org.apache.activemq.kaha.impl.async.DataFileAppender.WriteCommand

        if (!location.isValid()) {
            throw new IOException("Invalid location: " + location);
        }

        WriteCommand asyncWrite = (WriteCommand)inflightWrites.get(new WriteKey(location));
        if (asyncWrite != null) {
            return asyncWrite.data;
        }

        try {
View Full Code Here

Examples of org.apache.activemq.kaha.impl.async.DataFileAppender.WriteCommand

            throw new IOException("Invalid location: " + location + ", : " + e);
        }
    }

    public void readLocationDetails(Location location) throws IOException {
        WriteCommand asyncWrite = (WriteCommand)inflightWrites.get(new WriteKey(location));
        if (asyncWrite != null) {
            location.setSize(asyncWrite.location.getSize());
            location.setType(asyncWrite.location.getType());
        } else {
            file.seek(location.getOffset());
View Full Code Here

Examples of org.apache.activemq.kaha.impl.async.DataFileAppender.WriteCommand

        }
    }

    public boolean readLocationDetailsAndValidate(Location location) {
        try {
            WriteCommand asyncWrite = (WriteCommand)inflightWrites.get(new WriteKey(location));
            if (asyncWrite != null) {
                location.setSize(asyncWrite.location.getSize());
                location.setType(asyncWrite.location.getType());
            } else {
                file.seek(location.getOffset());
View Full Code Here

Examples of org.apache.activemq.kaha.impl.async.DataFileAppender.WriteCommand

        if (!location.isValid()) {
            throw new IOException("Invalid location: " + location);
        }

        WriteCommand asyncWrite = (WriteCommand)inflightWrites.get(new WriteKey(location));
        if (asyncWrite != null) {
            return asyncWrite.data;
        }

        try {
View Full Code Here

Examples of org.apache.activemq.kaha.impl.async.DataFileAppender.WriteCommand

            throw new IOException("Invalid location: " + location + ", : " + e);
        }
    }

    public void readLocationDetails(Location location) throws IOException {
        WriteCommand asyncWrite = (WriteCommand)inflightWrites.get(new WriteKey(location));
        if (asyncWrite != null) {
            location.setSize(asyncWrite.location.getSize());
            location.setType(asyncWrite.location.getType());
        } else {
            file.seek(location.getOffset());
View Full Code Here

Examples of org.apache.activemq.kaha.impl.async.DataFileAppender.WriteCommand

        }
    }

    public boolean readLocationDetailsAndValidate(Location location) {
        try {
            WriteCommand asyncWrite = (WriteCommand)inflightWrites.get(new WriteKey(location));
            if (asyncWrite != null) {
                location.setSize(asyncWrite.location.getSize());
                location.setType(asyncWrite.location.getType());
            } else {
                file.seek(location.getOffset());
View Full Code Here

Examples of org.apache.kahadb.journal.DataFileAppender.WriteCommand

        if (!location.isValid()) {
            throw new IOException("Invalid location: " + location);
        }

        WriteCommand asyncWrite = (WriteCommand)inflightWrites.get(new WriteKey(location));
        if (asyncWrite != null) {
            return asyncWrite.data;
        }

        try {
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.