Skip to content

Commit

Permalink
Rename NaiveAllocator to GreedyAllocator
Browse files Browse the repository at this point in the history
  • Loading branch information
apc999 committed Jun 30, 2015
1 parent e87bfa5 commit f3039b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import tachyon.thrift.InvalidPathException;
import tachyon.util.CommonUtils;
import tachyon.worker.block.allocator.Allocator;
import tachyon.worker.block.allocator.NaiveAllocator;
import tachyon.worker.block.allocator.GreedyAllocator;
import tachyon.worker.block.evictor.EvictionPlan;
import tachyon.worker.block.evictor.Evictor;
import tachyon.worker.block.evictor.EvictorType;
Expand Down Expand Up @@ -75,7 +75,7 @@ public TieredBlockStore(TachyonConf tachyonConf) throws IOException {
mLockManager = new BlockLockManager(mMetaManager);

// TODO: create Allocator according to tachyonConf.
mAllocator = new NaiveAllocator(mMetaManager);
mAllocator = new GreedyAllocator(mMetaManager);

EvictorType evictorType =
mTachyonConf.getEnum(Constants.WORKER_EVICT_STRATEGY_TYPE, EvictorType.DEFAULT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
import tachyon.worker.block.meta.TempBlockMeta;

/**
* A naive allocator that returns the first Storage dir fitting the size of block to allocate.
* A greedy allocator that returns the first Storage dir fitting the size of block to allocate.
* This class serves as an example how to implement an allocator.
*/
public class NaiveAllocator implements Allocator {
public class GreedyAllocator implements Allocator {
private final BlockMetadataManager mMetaManager;

public NaiveAllocator(BlockMetadataManager metadata) {
public GreedyAllocator(BlockMetadataManager metadata) {
mMetaManager = Preconditions.checkNotNull(metadata);
}

Expand Down

0 comments on commit f3039b0

Please sign in to comment.