public static AlluxioJobMasterProcess create(ServerSocket rpcBindSocket,
ServerSocket webBindSocket) {
URI journalLocation = JournalUtils.getJournalLocation();
JournalSystem journalSystem = new JournalSystem.Builder()
.setLocation(URIUtils.appendPathOrDie(journalLocation, Constants.JOB_JOURNAL_NAME))
.build();
if (ServerConfiguration.getBoolean(PropertyKey.ZOOKEEPER_ENABLED)) {
Preconditions.checkState(!(journalSystem instanceof RaftJournalSystem),
"Raft journal cannot be used with Zookeeper enabled");
PrimarySelector primarySelector = PrimarySelector.Factory.createZkJobPrimarySelector();
return new FaultTolerantAlluxioJobMasterProcess(journalSystem, primarySelector,
rpcBindSocket, webBindSocket);
} else if (journalSystem instanceof RaftJournalSystem) {
PrimarySelector primarySelector = ((RaftJournalSystem) journalSystem).getPrimarySelector();
return new FaultTolerantAlluxioJobMasterProcess(journalSystem, primarySelector,
rpcBindSocket, webBindSocket);
}
return new AlluxioJobMasterProcess(journalSystem, rpcBindSocket, webBindSocket);
}