java.io.Closeable, java.lang.AutoCloseable, PeerServer@Private public class TcpPeerServer extends java.lang.Object implements PeerServer
| Constructor | Description |
|---|---|
TcpPeerServer(int socketWriteTimeout,
java.net.InetSocketAddress bindAddr,
int backlogLength) |
Create a non-secure TcpPeerServer.
|
TcpPeerServer(SecureDataNodeStarter.SecureResources secureResources) |
Create a secure TcpPeerServer.
|
| Modifier and Type | Method | Description |
|---|---|---|
org.apache.hadoop.hdfs.net.Peer |
accept() |
Listens for a connection to be made to this server and accepts
it.
|
void |
close() |
Free the resources associated with this peer server.
|
java.lang.String |
getListeningString() |
|
int |
getReceiveBufferSize() |
Get the receive buffer size of the PeerServer.
|
java.net.InetSocketAddress |
getStreamingAddr() |
|
void |
setReceiveBufferSize(int size) |
Set the receive buffer size of the PeerServer.
|
java.lang.String |
toString() |
public TcpPeerServer(int socketWriteTimeout,
java.net.InetSocketAddress bindAddr,
int backlogLength)
throws java.io.IOException
socketWriteTimeout - The Socket write timeout in ms.bindAddr - The address to bind to.backlogLength - The length of the tcp accept backlogjava.io.IOExceptionpublic TcpPeerServer(SecureDataNodeStarter.SecureResources secureResources)
secureResources - Security resources.public java.net.InetSocketAddress getStreamingAddr()
public void setReceiveBufferSize(int size)
throws java.io.IOException
PeerServersetReceiveBufferSize in interface PeerServersize - The receive buffer size.java.io.IOExceptionpublic int getReceiveBufferSize()
throws java.io.IOException
PeerServergetReceiveBufferSize in interface PeerServerjava.io.IOExceptionpublic org.apache.hadoop.hdfs.net.Peer accept()
throws java.io.IOException,
java.net.SocketTimeoutException
PeerServeraccept in interface PeerServerjava.io.IOException - if an I/O error occurs when waiting for a
connection.java.net.SocketTimeoutException - if a timeout was previously set and
the timeout has been reached.public java.lang.String getListeningString()
getListeningString in interface PeerServerpublic void close()
throws java.io.IOException
PeerServerclose in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in interface PeerServerjava.io.IOException - If there is an error closing the PeerServerpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.