Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhangxin10 2015-12-23 17:02:34 +08:00
commit fd2cbc4398
1 changed files with 3 additions and 1 deletions

View File

@ -4,13 +4,15 @@ import com.ai.cloud.skywalking.reciever.buffer.DataBufferThreadContainer;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import static com.ai.cloud.skywalking.reciever.conf.Config.Persistence.*;
public class CollectionServerDataHandler extends SimpleChannelInboundHandler<byte[]> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, byte[] msg) throws Exception {
Thread.currentThread().setName("ServerReceiver");
// 当接受到这条消息的是空则忽略
if (msg != null && msg.length >= 0) {
if (msg != null && msg.length >= 0 && msg.length < MAX_STORAGE_SIZE_PER_TIME) {
DataBufferThreadContainer.getDataBufferThread().saveTemporarily(msg);
}
}