|
@@ -58,6 +58,8 @@ import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_CLIENT_SOCK
|
|
|
import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_CLIENT_SOCKET_CACHE_EXPIRY_MSEC_KEY;
|
|
|
import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_CLIENT_SOCKET_SEND_BUFFER_SIZE_DEFAULT;
|
|
|
import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_CLIENT_SOCKET_SEND_BUFFER_SIZE_KEY;
|
|
|
+import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_DATA_TRANSFER_CLIENT_TCPNODELAY_DEFAULT;
|
|
|
+import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_DATA_TRANSFER_CLIENT_TCPNODELAY_KEY;
|
|
|
import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_CLIENT_SOCKET_TIMEOUT_KEY;
|
|
|
import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_CLIENT_USE_DN_HOSTNAME;
|
|
|
import static org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.DFS_CLIENT_USE_DN_HOSTNAME_DEFAULT;
|
|
@@ -135,6 +137,7 @@ public class DfsClientConf {
|
|
|
|
|
|
private final int stripedReadThreadpoolSize;
|
|
|
|
|
|
+ private final boolean dataTransferTcpNoDelay;
|
|
|
|
|
|
public DfsClientConf(Configuration conf) {
|
|
|
// The hdfsTimeout is currently the same as the ipc timeout
|
|
@@ -173,6 +176,9 @@ public class DfsClientConf {
|
|
|
CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_KEY,
|
|
|
CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_DEFAULT);
|
|
|
defaultChecksumOpt = getChecksumOptFromConf(conf);
|
|
|
+ dataTransferTcpNoDelay = conf.getBoolean(
|
|
|
+ DFS_DATA_TRANSFER_CLIENT_TCPNODELAY_KEY,
|
|
|
+ DFS_DATA_TRANSFER_CLIENT_TCPNODELAY_DEFAULT);
|
|
|
socketTimeout = conf.getInt(DFS_CLIENT_SOCKET_TIMEOUT_KEY,
|
|
|
HdfsConstants.READ_TIMEOUT);
|
|
|
socketSendBufferSize = conf.getInt(DFS_CLIENT_SOCKET_SEND_BUFFER_SIZE_KEY,
|
|
@@ -405,6 +411,13 @@ public class DfsClientConf {
|
|
|
return writeByteArrayManagerConf;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @return whether TCP_NODELAY should be set on client sockets
|
|
|
+ */
|
|
|
+ public boolean getDataTransferTcpNoDelay() {
|
|
|
+ return dataTransferTcpNoDelay;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @return the socketTimeout
|
|
|
*/
|