Refactor storage dir

I propose that we make `StorageDir` the entry point and drop `BlockHandler`.  The core reasons for this are that:

`BlockHandler` is the same thing as java's `Channel`.  Easier to use one std convention than create a new one.
`StorageDir` is the main entry point anyways, since the path is relative to the tier, so `BlockHandler` can't be the gateway since it's path depends on the `StorageDir`.
I'm familiar with that.  That is only done when user is writing to the file
directly since worker needs to know when to move it.

With a network write path, this method no longer makes sense.
On Oct 20, 2014 6:14 PM, "shimingfei" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/worker/hierarchy/StorageDir.java:
>
> > -   * @param blockId Id of the block
> > -   * @return true if success, false otherwise
> > -   * @throws IOException
> > -   */
> > -  public boolean cacheBlock(long userId, long blockId) throws IOException {
> > -    String srcPath = getUserTempFilePath(userId, blockId);
> > -    String dstPath = getBlockFilePath(blockId);
> > -    long blockSize = mFs.getFileSize(srcPath);
> > -    boolean result = mFs.rename(srcPath, dstPath);
> > -    if (result) {
> > -      addBlockId(blockId, blockSize);
> > -    }
> > -    return result;
> > -  }
> > +//  /**
> > +//   * Move the cached block file from user temporary directory to data directory
>
> client use RPC to let worker do it. please refer to the WorkStorage.java
>
>
> https://github.com/amplab/tachyon/blob/master/core/src/main/java/tachyon/worker/WorkerStorage.java
> “cacheBlock” function.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/461/files#r19125092>.
>