use of alluxio.master.metrics.MetricsMasterFactory in project alluxio by Alluxio.
the class ConcurrentBlockMasterTest method before.
/**
* Sets up the dependencies before a test runs.
*/
@Before
public void before() throws Exception {
mRegistry = new MasterRegistry();
mMasterContext = MasterTestUtils.testMasterContext();
mMetricsMaster = new MetricsMasterFactory().create(mRegistry, mMasterContext);
mClock = new ManualClock();
mExecutorService = Executors.newFixedThreadPool(2, ThreadFactoryUtils.build("TestBlockMaster-%d", true));
mClientExecutorService = Executors.newFixedThreadPool(2, ThreadFactoryUtils.build("TestBlockMaster-%d", true));
// No one is listening to this latch, so do any preparation for the test
CountDownLatch voidLatch = new CountDownLatch(1);
mBlockMaster = new SignalBlockMaster(mMetricsMaster, mMasterContext, mClock, ExecutorServiceFactories.constantExecutorServiceFactory(mExecutorService), voidLatch);
mRegistry.add(BlockMaster.class, mBlockMaster);
mRegistry.start(true);
}
use of alluxio.master.metrics.MetricsMasterFactory 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.master.metrics.MetricsMasterFactory in project alluxio by Alluxio.
the class PermissionCheckTest method before.
@Before
public void before() throws Exception {
ServerConfiguration.set(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS, mTestFolder.newFolder());
GroupMappingServiceTestUtils.resetCache();
mRegistry = new MasterRegistry();
mRegistry.add(MetricsMaster.class, mMetricsMaster);
CoreMasterContext masterContext = MasterTestUtils.testMasterContext(new NoopJournalSystem(), new TestUserState(TEST_USER_ADMIN.getUser(), ServerConfiguration.global()));
mMetricsMaster = new MetricsMasterFactory().create(mRegistry, masterContext);
new BlockMasterFactory().create(mRegistry, masterContext);
mFileSystemMaster = new FileSystemMasterFactory().create(mRegistry, masterContext);
mRegistry.start(true);
createDirAndFileForTest();
}
use of alluxio.master.metrics.MetricsMasterFactory in project alluxio by Alluxio.
the class InodeTreeTest method before.
/**
* Sets up all dependencies before a test runs.
*/
@Before
public void before() throws Exception {
mRegistry = new MasterRegistry();
CoreMasterContext context = MasterTestUtils.testMasterContext();
mMetricsMaster = new MetricsMasterFactory().create(mRegistry, context);
mRegistry.add(MetricsMaster.class, mMetricsMaster);
BlockMaster blockMaster = new BlockMasterFactory().create(mRegistry, context);
InodeDirectoryIdGenerator directoryIdGenerator = new InodeDirectoryIdGenerator(blockMaster);
UfsManager ufsManager = mock(UfsManager.class);
MountTable mountTable = new MountTable(ufsManager, mock(MountInfo.class));
InodeLockManager lockManager = new InodeLockManager();
mInodeStore = context.getInodeStoreFactory().apply(lockManager);
mTree = new InodeTree(mInodeStore, blockMaster, directoryIdGenerator, mountTable, lockManager);
mRegistry.start(true);
mTree.initializeRoot(TEST_OWNER, TEST_GROUP, TEST_DIR_MODE, NoopJournalContext.INSTANCE);
}
use of alluxio.master.metrics.MetricsMasterFactory in project alluxio by Alluxio.
the class BlockMasterTest method before.
/**
* Sets up the dependencies before a test runs.
*/
@Before
public void before() throws Exception {
mRegistry = new MasterRegistry();
mMetrics = Lists.newArrayList();
JournalSystem journalSystem = new NoopJournalSystem();
CoreMasterContext masterContext = MasterTestUtils.testMasterContext();
mMetricsMaster = new MetricsMasterFactory().create(mRegistry, masterContext);
mClock = new ManualClock();
mExecutorService = Executors.newFixedThreadPool(2, ThreadFactoryUtils.build("TestBlockMaster-%d", true));
mBlockMaster = new DefaultBlockMaster(mMetricsMaster, masterContext, mClock, ExecutorServiceFactories.constantExecutorServiceFactory(mExecutorService));
mRegistry.add(BlockMaster.class, mBlockMaster);
mRegistry.start(true);
}
Aggregations