Search in sources :

Example 6 with JournalFactory

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;
}
Also used : JournalFactory(alluxio.master.journal.JournalFactory) BlockMaster(alluxio.master.block.BlockMaster) FileSystemMaster(alluxio.master.file.FileSystemMaster)

Example 7 with JournalFactory

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;
}
Also used : JournalFactory(alluxio.master.journal.JournalFactory) BlockMaster(alluxio.master.block.BlockMaster) FileSystemMaster(alluxio.master.file.FileSystemMaster)

Example 8 with JournalFactory

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>>());
}
Also used : JournalFactory(alluxio.master.journal.JournalFactory) BlockMaster(alluxio.master.block.BlockMaster) WorkerNetAddress(alluxio.wire.WorkerNetAddress) List(java.util.List) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList)

Example 9 with JournalFactory

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"));
}
Also used : JournalFactory(alluxio.master.journal.JournalFactory) ThreadFactory(java.util.concurrent.ThreadFactory) FileSystemMaster(alluxio.master.file.FileSystemMaster) CommandLineJob(alluxio.job.CommandLineJob) JobConf(alluxio.job.JobConf) Before(org.junit.Before)

Aggregations

JournalFactory (alluxio.master.journal.JournalFactory)9 BlockMaster (alluxio.master.block.BlockMaster)7 Before (org.junit.Before)5 FileSystemMaster (alluxio.master.file.FileSystemMaster)3 ManualClock (alluxio.clock.ManualClock)2 InodeTree (alluxio.master.file.meta.InodeTree)2 CommandLineJob (alluxio.job.CommandLineJob)1 JobConf (alluxio.job.JobConf)1 InodeDirectoryIdGenerator (alluxio.master.file.meta.InodeDirectoryIdGenerator)1 MountTable (alluxio.master.file.meta.MountTable)1 WorkerNetAddress (alluxio.wire.WorkerNetAddress)1 ImmutableList (com.google.common.collect.ImmutableList)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ThreadFactory (java.util.concurrent.ThreadFactory)1 ServletContext (javax.servlet.ServletContext)1 BeforeClass (org.junit.BeforeClass)1 Matchers.anyString (org.mockito.Matchers.anyString)1