package tachyon.worker;

/**
 * Where to store a block within a block store. Currently, this is a wrapper on an integer
 * representing the tier to put this block.
 */
public class BlockStoreLocation {
  private static final int sAnyTier = -1;
  private final int mTier;

  public static BlockStoreLocation anyTier() {
    return new BlockStoreLocation(sAnyTier);
  }

  public BlockStoreLocation(int tier) {
    mTier = tier;
  }

  public int tier() {
    return mTier;
  }
}

@@ -251,22 +251,89 @@
 ate 
-final int mTie
+static final int sAnyDir = -2;%0A  private final int mTier;%0A  private final int mDi
 r;%0A%0A
@@ -421,16 +421,25 @@
 sAnyTier
+, sAnyDir
 );%0A  %7D%0A%0A
@@ -447,16 +447,23 @@
  public 
+static 
 BlockSto
@@ -476,16 +476,133 @@
 tion
-(int tie
+ anyDirInTier(int tier) %7B%0A    return new BlockStoreLocation(tier, sAnyDir);%0A  %7D%0A%0A  public BlockStoreLocation(int tier, int di
 r) %7B
@@ -616,24 +616,40 @@
 ier = tier;%0A
+    mDir = dir;%0A
   %7D%0A%0A  publi
@@ -684,11 +684,360 @@
 ier;%0A  %7D
+%0A%0A  public int dir() %7B%0A    return mDir;%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    String result = %22%22;%0A    if (mDir == sAnyDir) %7B%0A      result += %22any dir%22;%0A    %7D else %7B%0A      result += %22dir %22 + mDir;%0A    %7D%0A%0A    if (mTier == sAnyTier) %7B%0A      result += %22, any tier%22%0A    %7D else %7B%0A      result += %22, tier %22 + mTier;%0A    %7D%0A    return result;%0A  %7D
 %0A%7D%0A

Update BlockStoreLocation so it can also represent any dir in a given tier