[TACHYON-62] Netty

Netty implementation of the data server.

This patch is not done yet.  Its intent is to show the work I have right now for commenting.

This PR should not be merged until performance results come in.
In the happy path, there should be no more data.  This protects us from bad
clients that send more data.

Also, on all events all handlers get called.  Removing this from the
pipeline just means Netty doesn't call unneeded code.
On Sep 7, 2014 6:01 PM, "Haoyuan Li" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/worker/netty/BlockRequest.java:
>
> > +    protected void decode(final ChannelHandlerContext ctx, final ByteBuf in, final List<Object> out)
> > +        throws Exception {
> > +      if (in.readableBytes() < MESSAGE_LENGTH) {
> > +        return;
> > +      }
> > +
> > +      // read the type and ignore it. Currently only one type exists
> > +      in.readShort(); // == DataServerMessage.DATA_SERVER_REQUEST_MESSAGE;
> > +      long blockId = in.readLong();
> > +      long offset = in.readLong();
> > +      long length = in.readLong();
> > +
> > +      out.add(new BlockRequest(blockId, offset, length));
> > +
> > +      // remove this from the pipeline so it won't be called again for this connection
> > +      ctx.channel().pipeline().remove(this);
>
> Even without this line, will this Decoder be called again? There shouldn't
> be any other byte left, right?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/333/files#r17218983>.
>