use of alluxio.util.executor.ControllableScheduler in project alluxio by Alluxio.
the class AccessTimeUpdaterTest method before.
@Before
public final void before() throws Exception {
mFileSystemMaster = Mockito.mock(FileSystemMaster.class);
when(mFileSystemMaster.getName()).thenReturn(Constants.FILE_SYSTEM_MASTER_NAME);
ServerConfiguration.set(PropertyKey.MASTER_JOURNAL_TYPE, "UFS");
MasterRegistry registry = new MasterRegistry();
JournalSystem journalSystem = JournalTestUtils.createJournalSystem(mTestFolder);
mContext = MasterTestUtils.testMasterContext(journalSystem);
new MetricsMasterFactory().create(registry, mContext);
mBlockMaster = new BlockMasterFactory().create(registry, mContext);
InodeDirectoryIdGenerator directoryIdGenerator = new InodeDirectoryIdGenerator(mBlockMaster);
UfsManager manager = mock(UfsManager.class);
MountTable mountTable = new MountTable(manager, mock(MountInfo.class));
InodeLockManager lockManager = new InodeLockManager();
mInodeStore = mContext.getInodeStoreFactory().apply(lockManager);
mInodeTree = new InodeTree(mInodeStore, mBlockMaster, directoryIdGenerator, mountTable, lockManager);
journalSystem.start();
journalSystem.gainPrimacy();
mBlockMaster.start(true);
ServerConfiguration.set(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_ENABLED, true);
ServerConfiguration.set(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_SUPERGROUP, "test-supergroup");
mInodeTree.initializeRoot(TEST_OWNER, TEST_GROUP, TEST_MODE, NoopJournalContext.INSTANCE);
mScheduler = new ControllableScheduler();
}
use of alluxio.util.executor.ControllableScheduler in project alluxio by Alluxio.
the class DailyMetadataBackupTest method before.
@Before
public void before() throws Exception {
mRandom = new Random();
mBackupDir = "/tmp/test/alluxio_backups";
mMetaMaster = Mockito.mock(MetaMaster.class);
when(mMetaMaster.backup(any(), any())).thenReturn(BackupStatus.fromProto(BackupPStatus.newBuilder().setBackupId(UUID.randomUUID().toString()).setBackupState(BackupState.Completed).setBackupUri(PathUtils.concatPath(mBackupDir, generateBackupFileName())).setBackupHost("localhost").build()));
mUfs = Mockito.mock(UnderFileSystem.class);
when(mUfs.getUnderFSType()).thenReturn("local");
when(mUfs.deleteFile(any())).thenReturn(true);
mUfsClient = Mockito.mock(UfsManager.UfsClient.class);
when(mUfsClient.acquireUfsResource()).thenReturn(new CloseableResource<UnderFileSystem>(mUfs) {
@Override
public void closeResource() {
// Noop
}
});
mUfsManager = Mockito.mock(UfsManager.class);
when(mUfsManager.getRoot()).thenReturn(mUfsClient);
mScheduler = new ControllableScheduler();
}
Aggregations