use of alluxio.master.journal.noop.NoopJournalSystem 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);
}
use of alluxio.master.journal.noop.NoopJournalSystem in project alluxio by Alluxio.
the class AlluxioMasterProcessTest method stopAfterStandbyTransition.
@Test
@Ignore
public void stopAfterStandbyTransition() throws Exception {
ControllablePrimarySelector primarySelector = new ControllablePrimarySelector();
primarySelector.setState(PrimarySelector.State.PRIMARY);
ServerConfiguration.set(PropertyKey.MASTER_JOURNAL_EXIT_ON_DEMOTION, true);
FaultTolerantAlluxioMasterProcess master = new FaultTolerantAlluxioMasterProcess(new NoopJournalSystem(), primarySelector);
Thread t = new Thread(() -> {
try {
master.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
});
t.start();
waitForSocketServing(ServiceType.MASTER_RPC);
waitForSocketServing(ServiceType.MASTER_WEB);
assertTrue(isBound(mRpcPort));
assertTrue(isBound(mWebPort));
primarySelector.setState(PrimarySelector.State.STANDBY);
t.join(10000);
CommonUtils.waitFor("Master to be stopped", () -> !master.isRunning(), WaitForOptions.defaults().setTimeoutMs(3 * Constants.MINUTE_MS));
CommonUtils.waitFor("Master to be stopped", () -> !isBound(mRpcPort), WaitForOptions.defaults().setTimeoutMs(Constants.MINUTE_MS));
CommonUtils.waitFor("Master to be stopped", () -> !isBound(mWebPort), WaitForOptions.defaults().setTimeoutMs(Constants.MINUTE_MS));
}
use of alluxio.master.journal.noop.NoopJournalSystem in project alluxio by Alluxio.
the class AlluxioMasterProcessTest method startStopStandby.
@Test
public void startStopStandby() throws Exception {
FaultTolerantAlluxioMasterProcess master = new FaultTolerantAlluxioMasterProcess(new NoopJournalSystem(), new AlwaysStandbyPrimarySelector());
Thread t = new Thread(() -> {
try {
master.start();
} catch (Exception e) {
throw new RuntimeException(e);
}
});
t.start();
startStopTest(master, ServerConfiguration.getBoolean(PropertyKey.STANDBY_MASTER_WEB_ENABLED), ServerConfiguration.getBoolean(PropertyKey.STANDBY_MASTER_METRICS_SINK_ENABLED));
}
use of alluxio.master.journal.noop.NoopJournalSystem 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.journal.noop.NoopJournalSystem in project alluxio by Alluxio.
the class AlluxioMasterProcessTest method startMastersThrowsUnavailableException.
@Test
public void startMastersThrowsUnavailableException() throws InterruptedException, IOException {
ControllablePrimarySelector primarySelector = new ControllablePrimarySelector();
primarySelector.setState(PrimarySelector.State.PRIMARY);
ServerConfiguration.set(PropertyKey.MASTER_JOURNAL_EXIT_ON_DEMOTION, true);
FaultTolerantAlluxioMasterProcess master = new FaultTolerantAlluxioMasterProcess(new NoopJournalSystem(), primarySelector);
FaultTolerantAlluxioMasterProcess spy = PowerMockito.spy(master);
PowerMockito.doAnswer(invocation -> {
throw new UnavailableException("unavailable");
}).when(spy).startMasters(true);
AtomicBoolean success = new AtomicBoolean(true);
Thread t = new Thread(() -> {
try {
spy.start();
} catch (UnavailableException ue) {
success.set(false);
} catch (Exception e) {
throw new RuntimeException(e);
}
});
t.start();
// in ms
final int WAIT_TIME_TO_THROW_EXC = 500;
t.join(WAIT_TIME_TO_THROW_EXC);
t.interrupt();
Assert.assertTrue(success.get());
}
Aggregations