|
@@ -21,6 +21,7 @@ import io.netty.bootstrap.ServerBootstrap;
|
|
import io.netty.channel.ChannelFactory;
|
|
import io.netty.channel.ChannelFactory;
|
|
import io.netty.channel.ChannelFuture;
|
|
import io.netty.channel.ChannelFuture;
|
|
import io.netty.channel.ChannelInitializer;
|
|
import io.netty.channel.ChannelInitializer;
|
|
|
|
+import io.netty.channel.ChannelOption;
|
|
import io.netty.channel.ChannelPipeline;
|
|
import io.netty.channel.ChannelPipeline;
|
|
import io.netty.channel.EventLoopGroup;
|
|
import io.netty.channel.EventLoopGroup;
|
|
import io.netty.channel.nio.NioEventLoopGroup;
|
|
import io.netty.channel.nio.NioEventLoopGroup;
|
|
@@ -30,10 +31,12 @@ import io.netty.handler.codec.http.HttpRequestDecoder;
|
|
import io.netty.handler.codec.http.HttpResponseEncoder;
|
|
import io.netty.handler.codec.http.HttpResponseEncoder;
|
|
import io.netty.handler.ssl.SslHandler;
|
|
import io.netty.handler.ssl.SslHandler;
|
|
import io.netty.handler.stream.ChunkedWriteHandler;
|
|
import io.netty.handler.stream.ChunkedWriteHandler;
|
|
|
|
+
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.fs.permission.FsPermission;
|
|
import org.apache.hadoop.fs.permission.FsPermission;
|
|
|
|
+import org.apache.hadoop.hdfs.DFSConfigKeys;
|
|
import org.apache.hadoop.hdfs.DFSUtil;
|
|
import org.apache.hadoop.hdfs.DFSUtil;
|
|
import org.apache.hadoop.hdfs.server.common.JspHelper;
|
|
import org.apache.hadoop.hdfs.server.common.JspHelper;
|
|
import org.apache.hadoop.hdfs.server.datanode.BlockScanner;
|
|
import org.apache.hadoop.hdfs.server.datanode.BlockScanner;
|
|
@@ -123,6 +126,18 @@ public class DatanodeHttpServer implements Closeable {
|
|
conf, confForCreate));
|
|
conf, confForCreate));
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ this.httpServer.childOption(
|
|
|
|
+ ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK,
|
|
|
|
+ conf.getInt(
|
|
|
|
+ DFSConfigKeys.DFS_WEBHDFS_NETTY_HIGH_WATERMARK,
|
|
|
|
+ DFSConfigKeys.DFS_WEBHDFS_NETTY_HIGH_WATERMARK_DEFAULT));
|
|
|
|
+ this.httpServer.childOption(
|
|
|
|
+ ChannelOption.WRITE_BUFFER_LOW_WATER_MARK,
|
|
|
|
+ conf.getInt(
|
|
|
|
+ DFSConfigKeys.DFS_WEBHDFS_NETTY_LOW_WATERMARK,
|
|
|
|
+ DFSConfigKeys.DFS_WEBHDFS_NETTY_LOW_WATERMARK_DEFAULT));
|
|
|
|
+
|
|
if (externalHttpChannel == null) {
|
|
if (externalHttpChannel == null) {
|
|
httpServer.channel(NioServerSocketChannel.class);
|
|
httpServer.channel(NioServerSocketChannel.class);
|
|
} else {
|
|
} else {
|