Search in sources :

Example 1 with ByteBufferBackedOutputStream

use of voldemort.common.nio.ByteBufferBackedOutputStream in project voldemort by voldemort.

the class AsyncRequestHandler method initializeStreams.

@Override
protected void initializeStreams(int socketBufferSize, CommBufferSizeStats commBufferStats) {
    ByteBufferContainer inputBufferContainer, outputBufferContainer;
    inputBufferContainer = new ByteBufferContainer(socketBufferSize, resizeThreshold, commBufferStats.getCommReadBufferSizeTracker());
    if (requestHandlerFactory.shareReadWriteBuffer()) {
        outputBufferContainer = inputBufferContainer;
    } else {
        outputBufferContainer = new ByteBufferContainer(socketBufferSize, resizeThreshold, commBufferStats.getCommWriteBufferSizeTracker());
    }
    this.inputStream = new ByteBufferBackedInputStream(inputBufferContainer);
    this.outputStream = new ByteBufferBackedOutputStream(outputBufferContainer);
}
Also used : ByteBufferBackedOutputStream(voldemort.common.nio.ByteBufferBackedOutputStream) ByteBufferContainer(voldemort.common.nio.ByteBufferContainer) ByteBufferBackedInputStream(voldemort.common.nio.ByteBufferBackedInputStream)

Example 2 with ByteBufferBackedOutputStream

use of voldemort.common.nio.ByteBufferBackedOutputStream in project voldemort by voldemort.

the class ClientRequestExecutor method initializeStreams.

@Override
protected void initializeStreams(int socketBufferSize, CommBufferSizeStats commBufferStats) {
    bufferContainer = new ByteBufferContainer(socketBufferSize, resizeThreshold, commBufferStats.getCommReadBufferSizeTracker());
    this.inputStream = new ByteBufferBackedInputStream(bufferContainer);
    this.outputStream = new ByteBufferBackedOutputStream(bufferContainer);
}
Also used : ByteBufferBackedOutputStream(voldemort.common.nio.ByteBufferBackedOutputStream) ByteBufferContainer(voldemort.common.nio.ByteBufferContainer) ByteBufferBackedInputStream(voldemort.common.nio.ByteBufferBackedInputStream)

Aggregations

ByteBufferBackedInputStream (voldemort.common.nio.ByteBufferBackedInputStream)2 ByteBufferBackedOutputStream (voldemort.common.nio.ByteBufferBackedOutputStream)2 ByteBufferContainer (voldemort.common.nio.ByteBufferContainer)2