Add storage dir and eviction strategy [TACHYON-33][SubTask 2 & 3]

resubmitted for PR361, rebase to current master.
Please add the docs to the code
On Sep 4, 2014 7:48 PM, "shimingfei" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/worker/eviction/EvictLRU.java:
>
> > +/**
> > + * Used to evict old blocks among several StorageDirs by LRU strategy.
> > + */
> > +public final class EvictLRU extends EvictLRUBase {
> > +
> > +  public EvictLRU(boolean lastTier) {
> > +    super(lastTier);
> > +  }
> > +
> > +  @Override
> > +  public StorageDir getDirCandidate(List<BlockInfo> blockInfoList, StorageDir[] storageDirs,
> > +      Set<Integer> pinList, long requestSize) {
> > +    Map<StorageDir, Pair<Long, Long>> dir2LRUBlocks = new HashMap<StorageDir, Pair<Long, Long>>();
> > +    HashMultimap<StorageDir, Long> dir2BlocksToEvict = HashMultimap.create();
> > +    Map<StorageDir, Long> sizeToEvict = new HashMap<StorageDir, Long>();
> > +    while (true) {
>
> @hsaputra <https://github.com/hsaputra>
> the while loop here means : if no StorageDir has enough space for the
> request size, continue the loop. in the loop, first check if there is any
> block that can be evicted among all StorageDir candidates. if there is no
> block can be evicted, return null which means it fails to allocate space,
> else adding the block into eviction list, and check if the StorageDir has
> enough space, return if true, else continue.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/411/files#r17154811>.
>