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
IOExceptionpublic ReadableByteChannel getInputStreamChannel()
getInputStreamChannel in interface org.apache.hadoop.hdfs.net.Peerpublic void setReadTimeout(int timeoutMs)
throws IOException
org.apache.hadoop.hdfs.net.PeersetReadTimeout in interface org.apache.hadoop.hdfs.net.PeertimeoutMs - The timeout in milliseconds.IOExceptionpublic int getReceiveBufferSize()
throws IOException
getReceiveBufferSize in interface org.apache.hadoop.hdfs.net.PeerIOExceptionpublic boolean getTcpNoDelay()
throws IOException
getTcpNoDelay in interface org.apache.hadoop.hdfs.net.PeerIOExceptionpublic void setWriteTimeout(int timeoutMs)
org.apache.hadoop.hdfs.net.PeersetWriteTimeout(int) for details.setWriteTimeout in interface org.apache.hadoop.hdfs.net.PeertimeoutMs - The timeout in milliseconds.public boolean isClosed()
isClosed in interface org.apache.hadoop.hdfs.net.Peerpublic void close()
throws IOException
org.apache.hadoop.hdfs.net.Peerclose in interface Closeableclose in interface AutoCloseableclose in interface org.apache.hadoop.hdfs.net.PeerIOExceptionpublic String getRemoteAddressString()
getRemoteAddressString in interface org.apache.hadoop.hdfs.net.Peerpublic String getLocalAddressString()
getLocalAddressString in interface org.apache.hadoop.hdfs.net.Peerpublic InputStream getInputStream() throws IOException
getInputStream in interface org.apache.hadoop.hdfs.net.PeerIOExceptionpublic OutputStream getOutputStream() throws IOException
getOutputStream in interface org.apache.hadoop.hdfs.net.PeerIOExceptionpublic boolean isLocal()
isLocal in interface org.apache.hadoop.hdfs.net.Peerpublic org.apache.hadoop.net.unix.DomainSocket getDomainSocket()
getDomainSocket in interface org.apache.hadoop.hdfs.net.Peerpublic boolean hasSecureChannel()
org.apache.hadoop.hdfs.net.PeerhasSecureChannel in interface org.apache.hadoop.hdfs.net.PeerCopyright © 2008–2024 Apache Software Foundation. All rights reserved.