Search in sources :

Example 1 with OutputBuffer

use of org.apache.hadoop.mapred.nativetask.buffer.OutputBuffer in project hadoop by apache.

the class NativeBatchProcessor method create.

public static INativeHandler create(String nativeHandlerName, Configuration conf, DataChannel channel) throws IOException {
    final int bufferSize = conf.getInt(Constants.NATIVE_PROCESSOR_BUFFER_KB, 1024) * 1024;
    LOG.info("NativeHandler: direct buffer size: " + bufferSize);
    OutputBuffer out = null;
    InputBuffer in = null;
    switch(channel) {
        case IN:
            in = new InputBuffer(BufferType.DIRECT_BUFFER, bufferSize);
            break;
        case OUT:
            out = new OutputBuffer(BufferType.DIRECT_BUFFER, bufferSize);
            break;
        case INOUT:
            in = new InputBuffer(BufferType.DIRECT_BUFFER, bufferSize);
            out = new OutputBuffer(BufferType.DIRECT_BUFFER, bufferSize);
            break;
        case NONE:
    }
    final INativeHandler handler = new NativeBatchProcessor(nativeHandlerName, in, out);
    handler.init(conf);
    return handler;
}
Also used : InputBuffer(org.apache.hadoop.mapred.nativetask.buffer.InputBuffer) OutputBuffer(org.apache.hadoop.mapred.nativetask.buffer.OutputBuffer)

Aggregations

InputBuffer (org.apache.hadoop.mapred.nativetask.buffer.InputBuffer)1 OutputBuffer (org.apache.hadoop.mapred.nativetask.buffer.OutputBuffer)1