-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discard messages from Agent when protocol version is incorrect instea…
…d of closing the connection (#20)
- Loading branch information
1 parent
b364218
commit 63f891f
Showing
3 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
forwarder/src/main/java/com/criteo/hadoop/garmadon/forwarder/handler/Discarder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.criteo.hadoop.garmadon.forwarder.handler; | ||
|
||
import io.netty.buffer.ByteBuf; | ||
import io.netty.channel.ChannelHandlerContext; | ||
import io.netty.channel.ChannelInboundHandlerAdapter; | ||
|
||
//TODO the following class has to be removed when no more agent suffering | ||
//https://github.com/criteo/garmadon/issues/17 run on the cluster | ||
public class Discarder extends ChannelInboundHandlerAdapter { | ||
|
||
@Override | ||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { | ||
//release the bytebuffer just acts as reading and dropping the data | ||
((ByteBuf) msg).release(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters