/** * Sets up all dependencies before a test runs. * * @throws Exception if setting up the meta manager, the lock manager or the evictor fails */ @Before public final void before() throws Exception { File tempFolder = mTestFolder.newFolder(); mMetaManager = TieredBlockStoreTestUtils.defaultMetadataManager(tempFolder.getAbsolutePath()); mManagerView = new BlockMetadataManagerView( mMetaManager, Collections.<Long>emptySet(), Collections.<Long>emptySet()); TachyonConf conf = WorkerContext.getConf(); conf.set(Constants.WORKER_EVICTOR_CLASS, LRFUEvictor.class.getName()); conf.set(Constants.WORKER_ALLOCATOR_CLASS, MaxFreeAllocator.class.getName()); mAllocator = Allocator.Factory.create(conf, mManagerView); mStepFactor = conf.getDouble(Constants.WORKER_EVICTOR_LRFU_STEP_FACTOR); mAttenuationFactor = conf.getDouble(Constants.WORKER_EVICTOR_LRFU_ATTENUATION_FACTOR); mEvictor = Evictor.Factory.create(conf, mManagerView, mAllocator); }