Re: Can I use ChannelTrafficShapingHandler to control the network read/write speed in shuffle?

2017-06-14 Thread Niu Zhaojie
Hi Shixiong: Thanks for the reply. You are right. It seems it only supports the following two types. I will retry by adding FileRegion type. protected long calculateSize(Object msg) { if (msg instanceof ByteBuf) { return ((ByteBuf) msg).readableBytes(); } if (msg instanceof

Re: Can I use ChannelTrafficShapingHandler to control the network read/write speed in shuffle?

2017-06-13 Thread Shixiong(Ryan) Zhu
I took a look at ChannelTrafficShapingHandler. Looks like it's because it doesn't support FileRegion. Spark's messages use this interface. See org.apache.spark.network.protocol.MessageWithHeader. On Tue, Jun 13, 2017 at 4:17 AM, Niu Zhaojie wrote: > Hi All: > > I am trying

Can I use ChannelTrafficShapingHandler to control the network read/write speed in shuffle?

2017-06-13 Thread Niu Zhaojie
Hi All: I am trying to control the network read/write speed with ChannelTrafficShapingHandler provided by Netty. In TransportContext.java I modify it as below: public TransportChannelHandler initializePipeline( SocketChannel channel, RpcHandler channelRpcHandler) { try {