Package org.jscsi.initiator.connection.state

Examples of org.jscsi.initiator.connection.state.ReadRequestState


        if (LOGGER.isInfoEnabled()) {
            LOGGER.info("Now reading sequences of length " + blocks + " blocks.");
        }

        connection.nextState(new ReadRequestState(connection, dst, TaskAttributes.SIMPLE, (int) Math.min(bytes2Process, blocks * blockSize), startAddress, blocks));
        startAddress += blocks;
        totalBlocks -= blocks;
        bytes2Process -= blocks * blockSize;

        // second stage
        blocks = (short) Math.min(READ_SECOND_STAGE_BLOCKS, totalBlocks);

        if (blocks > 0) {

            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Now reading sequences of length " + blocks + " blocks.");
            }
            connection.nextState(new ReadRequestState(connection, dst, TaskAttributes.SIMPLE, (int) Math.min(bytes2Process, blocks * blockSize), startAddress, blocks));
            startAddress += blocks;
            totalBlocks -= blocks;
            bytes2Process -= blocks * blockSize;
        }

        // third stage
        blocks = (short) Math.min(READ_THIRD_STAGE_BLOCKS, totalBlocks);

        while (blocks > 0) {

            if (LOGGER.isInfoEnabled()) {
                LOGGER.info("Now reading sequences of length " + blocks + " blocks.");
            }

            connection.nextState(new ReadRequestState(connection, dst, TaskAttributes.SIMPLE, (int) Math.min(bytes2Process, blocks * blockSize), startAddress, blocks));
            startAddress += blocks;
            totalBlocks -= blocks;
            blocks = (short) Math.min(READ_THIRD_STAGE_BLOCKS, totalBlocks);
        }
        return true;
View Full Code Here

TOP

Related Classes of org.jscsi.initiator.connection.state.ReadRequestState

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.