Class NativeBatchProcessor
java.lang.Object
org.apache.hadoop.mapred.nativetask.NativeBatchProcessor
- All Implemented Interfaces:
INativeHandler,NativeDataSource,NativeDataTarget
used to create channel, transfer data and command between Java and native
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNativeBatchProcessor(String nativeHandlerName, InputBuffer input, OutputBuffer output) -
Method Summary
Modifier and TypeMethodDescriptioncall(Command command, ReadWriteBuffer parameter) call command to downstreamvoidclose()close the native handlerstatic INativeHandlercreate(String nativeHandlerName, org.apache.hadoop.conf.Configuration conf, DataChannel channel) protected voidvoidSends a signal that there is no more dataget input bufferlongGets the output buffer.voidinit(org.apache.hadoop.conf.Configuration conf) init the native handlervoidloadData()load data from upstreamname()voidsendData()Sends a signal to indicate that the data has been stored in output buffervoidsetCommandDispatcher(CommandDispatcher handler) voidsetDataReceiver(DataReceiver handler) set listener.
-
Constructor Details
-
NativeBatchProcessor
protected NativeBatchProcessor(String nativeHandlerName, InputBuffer input, OutputBuffer output) throws IOException - Throws:
IOException
-
-
Method Details
-
create
public static INativeHandler create(String nativeHandlerName, org.apache.hadoop.conf.Configuration conf, DataChannel channel) throws IOException - Throws:
IOException
-
setCommandDispatcher
- Specified by:
setCommandDispatcherin interfaceINativeHandler
-
init
Description copied from interface:INativeHandlerinit the native handler- Specified by:
initin interfaceINativeHandler- Throws:
IOException
-
close
Description copied from interface:INativeHandlerclose the native handler- Specified by:
closein interfaceINativeHandler- Throws:
IOException
-
getNativeHandler
public long getNativeHandler()- Specified by:
getNativeHandlerin interfaceINativeHandler
-
call
Description copied from interface:INativeHandlercall command to downstream- Specified by:
callin interfaceINativeHandler- Throws:
IOException
-
sendData
Description copied from interface:NativeDataTargetSends a signal to indicate that the data has been stored in output buffer- Specified by:
sendDatain interfaceNativeDataTarget- Throws:
IOException
-
finishSendData
Description copied from interface:NativeDataTargetSends a signal that there is no more data- Specified by:
finishSendDatain interfaceNativeDataTarget- Throws:
IOException
-
finishOutput
protected void finishOutput() -
getInputBuffer
Description copied from interface:NativeDataSourceget input buffer- Specified by:
getInputBufferin interfaceNativeDataSource
-
getOutputBuffer
Description copied from interface:NativeDataTargetGets the output buffer.- Specified by:
getOutputBufferin interfaceNativeDataTarget
-
loadData
Description copied from interface:NativeDataSourceload data from upstream- Specified by:
loadDatain interfaceNativeDataSource- Throws:
IOException
-
setDataReceiver
Description copied from interface:NativeDataSourceset listener. When data from upstream arrives, the listener will be activated.- Specified by:
setDataReceiverin interfaceNativeDataSource
-
name
- Specified by:
namein interfaceINativeHandler
-