public class BasicInetPeer extends Object implements org.apache.hadoop.hdfs.net.Peer
Constructor and Description |
---|
BasicInetPeer(Socket socket) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the peer.
|
org.apache.hadoop.net.unix.DomainSocket |
getDomainSocket() |
InputStream |
getInputStream() |
ReadableByteChannel |
getInputStreamChannel() |
String |
getLocalAddressString() |
OutputStream |
getOutputStream() |
int |
getReceiveBufferSize() |
String |
getRemoteAddressString() |
boolean |
getTcpNoDelay() |
boolean |
hasSecureChannel()
Return true if the channel is secure.
|
boolean |
isClosed() |
boolean |
isLocal() |
void |
setReadTimeout(int timeoutMs)
Set the read timeout on this peer.
|
void |
setWriteTimeout(int timeoutMs)
Set the write timeout on this peer.
|
String |
toString() |
public BasicInetPeer(Socket socket) throws IOException
IOException
public ReadableByteChannel getInputStreamChannel()
getInputStreamChannel
in interface org.apache.hadoop.hdfs.net.Peer
public void setReadTimeout(int timeoutMs) throws IOException
org.apache.hadoop.hdfs.net.Peer
setReadTimeout
in interface org.apache.hadoop.hdfs.net.Peer
timeoutMs
- The timeout in milliseconds.IOException
public int getReceiveBufferSize() throws IOException
getReceiveBufferSize
in interface org.apache.hadoop.hdfs.net.Peer
IOException
public boolean getTcpNoDelay() throws IOException
getTcpNoDelay
in interface org.apache.hadoop.hdfs.net.Peer
IOException
public void setWriteTimeout(int timeoutMs)
org.apache.hadoop.hdfs.net.Peer
setWriteTimeout(int)
for details.setWriteTimeout
in interface org.apache.hadoop.hdfs.net.Peer
timeoutMs
- The timeout in milliseconds.public boolean isClosed()
isClosed
in interface org.apache.hadoop.hdfs.net.Peer
public void close() throws IOException
org.apache.hadoop.hdfs.net.Peer
close
in interface Closeable
close
in interface AutoCloseable
close
in interface org.apache.hadoop.hdfs.net.Peer
IOException
public String getRemoteAddressString()
getRemoteAddressString
in interface org.apache.hadoop.hdfs.net.Peer
public String getLocalAddressString()
getLocalAddressString
in interface org.apache.hadoop.hdfs.net.Peer
public InputStream getInputStream() throws IOException
getInputStream
in interface org.apache.hadoop.hdfs.net.Peer
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface org.apache.hadoop.hdfs.net.Peer
IOException
public boolean isLocal()
isLocal
in interface org.apache.hadoop.hdfs.net.Peer
public org.apache.hadoop.net.unix.DomainSocket getDomainSocket()
getDomainSocket
in interface org.apache.hadoop.hdfs.net.Peer
public boolean hasSecureChannel()
org.apache.hadoop.hdfs.net.Peer
hasSecureChannel
in interface org.apache.hadoop.hdfs.net.Peer
Copyright © 2018 Apache Software Foundation. All Rights Reserved.