/** * @param conf the configuration to use * @return whether the configuration describes how to find the job master host, either through * explicit configuration or through zookeeper */ public static boolean jobMasterHostConfigured(AlluxioConfiguration conf) { boolean usingZk = conf.getBoolean(PropertyKey.ZOOKEEPER_ENABLED) && conf.isSet(PropertyKey.ZOOKEEPER_ADDRESS); return conf.isSet(PropertyKey.JOB_MASTER_HOSTNAME) || usingZk || getJobMasterRpcAddresses(conf).size() > 1; }
public static MasterInquireClient createForJobMaster(AlluxioConfiguration conf) { if (conf.getBoolean(PropertyKey.ZOOKEEPER_ENABLED)) { return ZkMasterInquireClient.getClient(conf.get(PropertyKey.ZOOKEEPER_ADDRESS), conf.get(PropertyKey.ZOOKEEPER_JOB_ELECTION_PATH), conf.get(PropertyKey.ZOOKEEPER_JOB_LEADER_PATH), conf.getInt(PropertyKey.ZOOKEEPER_LEADER_INQUIRY_RETRY_COUNT)); } else if (ConfigurationUtils.getJobMasterRpcAddresses(conf) .size() > 1) { return new PollingMasterInquireClient( ConfigurationUtils.getJobMasterRpcAddresses(conf), conf); } else { return new SingleMasterInquireClient( NetworkAddressUtils.getConnectAddress(ServiceType.JOB_MASTER_RPC, conf)); } } /**