[TACHYON-152] Client write refactor

Rewriting how client writes out blocks to make it easier to add remote blocks.

The current design is as follows:

Users requests access to a block for writing.

```java
WritableBlockChannel channel = Blocks.createWritableBlock(tachyonFS, blockId, blockCapacityByte);
channel.write(byteBuffer);
channel.close();
```

When the block is full, write returns -1, so you do this in a loop and create new blocks.

```java
while (buffer.remaining() > 0) {
  int n = mCurrentBlockChannel.write(buffer);
  if (n <= 0) {
    // block full, get new block
    getNextBlock();
  }
}
```
Even that's a old pattern in java which isn't getting traction with new
java APIs.

Bytebuffer has no get/set in name
Java 8 prefers to not use get :
http://docs.oracle.com/javase/8/docs/api/java/util/Collection.html#stream--

Guava tend to exclude get/set unless there is historical reasons:
http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/com/google/common/collect/ForwardingList.html#delegate()
On Sep 19, 2014 11:18 AM, "Henry Saputra" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/client/ForwardingWritableBlockChannel.java:
>
> > +  @Override
> > +  public int write(ByteBuffer src) throws IOException {
> > +    return delegate().write(src);
> > +  }
> > +
> > +  @Override
> > +  public boolean isOpen() {
> > +    return delegate().isOpen();
> > +  }
> > +
> > +  @Override
> > +  public void close() throws IOException {
> > +    delegate().close();
> > +  }
> > +
> > +  public T delegate() {
>
> This is Java so lets use getter and setter format for non side effect
> returning or setting member var.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/427/files#r17800122>.
>