use of alluxio.master.journal.JournalFactory in project alluxio by Alluxio.
the class MasterTestUtils method createLeaderFileSystemMasterFromJournal.
/**
* Creates a new {@link FileSystemMaster} from journal.
*
* @return a new FileSystemMaster
* @throws IOException
*/
public static FileSystemMaster createLeaderFileSystemMasterFromJournal() throws IOException {
String masterJournal = Configuration.get(PropertyKey.MASTER_JOURNAL_FOLDER);
JournalFactory journalFactory = new JournalFactory.ReadWrite(masterJournal);
BlockMaster blockMaster = new BlockMaster(journalFactory);
FileSystemMaster fsMaster = new FileSystemMaster(blockMaster, journalFactory);
blockMaster.start(true);
fsMaster.start(true);
return fsMaster;
}
use of alluxio.master.journal.JournalFactory in project alluxio by Alluxio.
the class MasterTestUtils method createStandbyFileSystemMasterFromJournal.
/**
* Creates a new standby {@link FileSystemMaster} from journal.
*
* @return a new FileSystemMaster
* @throws IOException
*/
public static FileSystemMaster createStandbyFileSystemMasterFromJournal() throws IOException {
String masterJournal = Configuration.get(PropertyKey.MASTER_JOURNAL_FOLDER);
JournalFactory journalFactory = new JournalFactory.ReadWrite(masterJournal);
BlockMaster blockMaster = new BlockMaster(journalFactory);
FileSystemMaster fsMaster = new FileSystemMaster(blockMaster, journalFactory);
blockMaster.start(false);
fsMaster.start(false);
return fsMaster;
}
use of alluxio.master.journal.JournalFactory in project alluxio by Alluxio.
the class FileSystemMasterTest method startServices.
private void startServices() throws Exception {
JournalFactory journalFactory = new JournalFactory.ReadWrite(mJournalFolder);
mBlockMaster = new BlockMaster(journalFactory);
mExecutorService = Executors.newFixedThreadPool(2, ThreadFactoryUtils.build("FileSystemMasterTest-%d", true));
mFileSystemMaster = new FileSystemMaster(mBlockMaster, journalFactory, ExecutorServiceFactories.constantExecutorServiceFactory(mExecutorService));
mBlockMaster.start(true);
mFileSystemMaster.start(true);
// set up workers
mWorkerId1 = mBlockMaster.getWorkerId(new WorkerNetAddress().setHost("localhost").setRpcPort(80).setDataPort(81).setWebPort(82));
mBlockMaster.workerRegister(mWorkerId1, Arrays.asList("MEM", "SSD"), ImmutableMap.of("MEM", (long) Constants.MB, "SSD", (long) Constants.MB), ImmutableMap.of("MEM", (long) Constants.KB, "SSD", (long) Constants.KB), new HashMap<String, List<Long>>());
mWorkerId2 = mBlockMaster.getWorkerId(new WorkerNetAddress().setHost("remote").setRpcPort(80).setDataPort(81).setWebPort(82));
mBlockMaster.workerRegister(mWorkerId2, Arrays.asList("MEM", "SSD"), ImmutableMap.of("MEM", (long) Constants.MB, "SSD", (long) Constants.MB), ImmutableMap.of("MEM", (long) Constants.KB, "SSD", (long) Constants.KB), new HashMap<String, List<Long>>());
}
use of alluxio.master.journal.JournalFactory in project alluxio by Alluxio.
the class LineageMasterTest method before.
/**
* Sets up all dependencies before a test runs.
*/
@Before
public void before() throws Exception {
JournalFactory journalFactory = new JournalFactory.ReadWrite(mTestFolder.newFolder().getAbsolutePath());
mFileSystemMaster = Mockito.mock(FileSystemMaster.class);
ThreadFactory threadPool = ThreadFactoryUtils.build("LineageMasterTest-%d", true);
mExecutorService = Executors.newFixedThreadPool(2, threadPool);
mLineageMaster = new LineageMaster(mFileSystemMaster, journalFactory, ExecutorServiceFactories.constantExecutorServiceFactory(mExecutorService));
mJob = new CommandLineJob("test", new JobConf("output"));
}
Aggregations