public class GridGgfsHadoopIpcIo extends Object implements GridGgfsHadoopIo
| Constructor and Description |
|---|
GridGgfsHadoopIpcIo(String endpointAddr,
GridGgfsMarshaller marsh,
org.apache.commons.logging.Log log) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(GridGgfsHadoopIpcIoListener lsnr)
Adds event listener that will be invoked when connection with server is lost or remote error has occurred.
|
void |
forceClose()
Closes this IO instance, removing it from cache.
|
static GridGgfsHadoopIpcIo |
get(org.apache.commons.logging.Log log,
String endpoint)
Returns a started and valid instance of this class
for a given endpoint.
|
void |
release()
Releases this instance, decrementing usage count.
|
void |
removeEventListener(GridGgfsHadoopIpcIoListener lsnr)
Removes event listener that will be invoked when connection with server is lost or remote error has occurred.
|
org.gridgain.grid.util.lang.GridPlainFuture<GridGgfsMessage> |
send(GridGgfsMessage msg)
Sends given GGFS client message and asynchronously awaits for response.
|
<T> org.gridgain.grid.util.lang.GridPlainFuture<T> |
send(GridGgfsMessage msg,
byte[] outBuf,
int outOff,
int outLen)
Sends given GGFS client message and asynchronously awaits for response.
|
void |
sendPlain(GridGgfsMessage msg)
Sends given message and does not wait for response.
|
String |
toString() |
public GridGgfsHadoopIpcIo(String endpointAddr, GridGgfsMarshaller marsh, org.apache.commons.logging.Log log)
endpointAddr - Endpoint.marsh - Protocol.log - Logger to use.public static GridGgfsHadoopIpcIo get(org.apache.commons.logging.Log log, String endpoint) throws IOException
log - Logger to use for new instance.endpoint - Endpoint string.IOException - If new instance was created but failed to start.public void release()
If usage count becomes zero, the instance is stopped and removed from cache.
public void forceClose()
public void addEventListener(GridGgfsHadoopIpcIoListener lsnr)
addEventListener in interface GridGgfsHadoopIolsnr - Event listener.public void removeEventListener(GridGgfsHadoopIpcIoListener lsnr)
removeEventListener in interface GridGgfsHadoopIolsnr - Event listener.public org.gridgain.grid.util.lang.GridPlainFuture<GridGgfsMessage> send(GridGgfsMessage msg) throws org.gridgain.grid.GridException
send in interface GridGgfsHadoopIomsg - Message to send.org.gridgain.grid.GridException - If a message cannot be sent (connection is broken or client was closed).public <T> org.gridgain.grid.util.lang.GridPlainFuture<T> send(GridGgfsMessage msg, @Nullable byte[] outBuf, int outOff, int outLen) throws org.gridgain.grid.GridException
send in interface GridGgfsHadoopIomsg - Message to send.outBuf - Output buffer. If null, the output buffer is not used.outOff - Output buffer offset.outLen - Output buffer length.org.gridgain.grid.GridException - If a message cannot be sent (connection is broken or client was closed).public void sendPlain(GridGgfsMessage msg) throws org.gridgain.grid.GridException
sendPlain in interface GridGgfsHadoopIomsg - Message to send.org.gridgain.grid.GridException - If send failed.Copyright © 2014. All rights reserved.