/*
 * Licensed to the University of California, Berkeley under one or more contributor license
 * agreements. See the NOTICE file distributed with this work for additional information regarding
 * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the License. You may obtain a
 * copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package tachyon.worker.block.allocator;

import com.google.common.base.Optional;

import tachyon.worker.block.meta.BlockMeta;

/**
 * Interface for the allocation policy of Tachyon managed data.
 */
public interface Allocator {
  Optional<BlockMeta> allocateBlock(long userId, long blockId, long blockSize, int tierHint);
}

@@ -413,18 +413,17 @@
 se at%0A *
- 
 %0A
+
  * http:
@@ -462,17 +462,16 @@
 E-2.0%0A *
- 
 %0A * Unle
@@ -868,16 +868,58 @@
 ional;%0A%0A
+import tachyon.worker.BlockStoreLocation;%0A
 import t
@@ -1056,16 +1056,488 @@
 cator %7B%0A
+  /**%0A   * Allocates a block from the given block store location. The location can be a specific location,%0A   * or %7B@link BlockStoreLocation#anyTier()%7D or %7B@link BlockStoreLocation#anyDirInTier(int)%7D .%0A   *%0A   * @param userId the ID of user to apply for the block allocation%0A   * @param blockId the ID of the block%0A   * @param blockSize the size of block in bytes%0A   * @param location the location in block store%0A   * @return block meta if success, absent otherwise%0A   */%0A
   Option
@@ -1610,21 +1610,42 @@
 ize,
- int tierHint
+%0A      BlockStoreLocation location
 );%0A%7D

Update Allocator to use BlockStoreLocation