Search in sources :

Example 1 with Master

use of alluxio.master.Master in project alluxio by Alluxio.

the class KeyValueMasterFactory method create.

@Override
public KeyValueMaster create(List<? extends Master> masters, JournalFactory journalFactory) {
    if (!isEnabled()) {
        return null;
    }
    Preconditions.checkArgument(journalFactory != null, "journal factory may not be null");
    LOG.info("Creating {} ", KeyValueMaster.class.getName());
    Journal journal = journalFactory.get(getName());
    for (Master master : masters) {
        if (master instanceof FileSystemMaster) {
            LOG.info("{} is created", KeyValueMaster.class.getName());
            return new KeyValueMaster((FileSystemMaster) master, journal);
        }
    }
    LOG.error("Fail to create {} due to missing {}", KeyValueMaster.class.getName(), FileSystemMaster.class.getName());
    return null;
}
Also used : Master(alluxio.master.Master) FileSystemMaster(alluxio.master.file.FileSystemMaster) FileSystemMaster(alluxio.master.file.FileSystemMaster) Journal(alluxio.master.journal.Journal)

Aggregations

Master (alluxio.master.Master)1 FileSystemMaster (alluxio.master.file.FileSystemMaster)1 Journal (alluxio.master.journal.Journal)1