in modules/mesos-ext/src/main/java/org/apache/ignite/mesos/ClusterProperties.java [478:547]
public static ClusterProperties from(String cfg) {
try {
Properties props = null;
if (cfg != null) {
props = new Properties();
try (FileInputStream in = new FileInputStream(cfg)) {
props.load(in);
}
}
ClusterProperties prop = new ClusterProperties();
prop.mesosUrl = getStringProperty(MESOS_MASTER_URL, props, DEFAULT_MESOS_MASTER_URL);
prop.httpSrvHost = getStringProperty(IGNITE_HTTP_SERVER_HOST, props, getNonLoopbackAddress());
String port = System.getProperty("PORT0");
if (port != null && !port.isEmpty())
prop.httpSrvPort = Integer.valueOf(port);
else
prop.httpSrvPort = Integer.valueOf(getStringProperty(IGNITE_HTTP_SERVER_PORT, props,
DEFAULT_HTTP_SERVER_PORT));
prop.clusterName = getStringProperty(IGNITE_CLUSTER_NAME, props, DEFAULT_CLUSTER_NAME);
prop.userLibsUrl = getStringProperty(IGNITE_USERS_LIBS_URL, props, null);
prop.ignitePkgUrl = getStringProperty(IGNITE_PACKAGE_URL, props, null);
prop.ignitePkgPath = getStringProperty(IGNITE_PACKAGE_PATH, props, null);
prop.licenceUrl = getStringProperty(LICENCE_URL, props, null);
prop.igniteCfgUrl = getStringProperty(IGNITE_CONFIG_XML_URL, props, null);
prop.cpu = getDoubleProperty(IGNITE_TOTAL_CPU, props, UNLIMITED);
prop.cpuPerNode = getDoubleProperty(IGNITE_RUN_CPU_PER_NODE, props, UNLIMITED);
prop.mem = getDoubleProperty(IGNITE_TOTAL_MEMORY, props, UNLIMITED);
prop.memPerNode = getDoubleProperty(IGNITE_MEMORY_PER_NODE, props, UNLIMITED);
prop.disk = getDoubleProperty(IGNITE_TOTAL_DISK_SPACE, props, UNLIMITED);
prop.diskPerNode = getDoubleProperty(IGNITE_DISK_SPACE_PER_NODE, props, 1024.0);
prop.nodeCnt = getDoubleProperty(IGNITE_NODE_COUNT, props, UNLIMITED);
prop.minCpu = getDoubleProperty(IGNITE_MIN_CPU_PER_NODE, props, DEFAULT_RESOURCE_MIN_CPU);
prop.minMemory = getDoubleProperty(IGNITE_MIN_MEMORY_PER_NODE, props, DEFAULT_RESOURCE_MIN_MEM);
prop.jvmOpts = getStringProperty(IGNITE_JVM_OPTS, props, "");
prop.igniteVer = getStringProperty(IGNITE_VERSION, props, DEFAULT_IGNITE_VERSION);
prop.igniteWorkDir = getStringProperty(IGNITE_WORK_DIR, props, DEFAULT_IGNITE_WORK_DIR);
prop.igniteCfg = getStringProperty(IGNITE_CONFIG_XML, props, null);
prop.userLibs = getStringProperty(IGNITE_USERS_LIBS, props, null);
String ptrn = getStringProperty(IGNITE_HOSTNAME_CONSTRAINT, props, null);
prop.idleTimeout = getLongProperty(IGNITE_HTTP_SERVER_IDLE_TIMEOUT, props, IGNITE_HTTP_SERVER_IDLE_TIMEOUT_DEFAULT);
if (ptrn != null) {
try {
prop.hostnameConstraint = Pattern.compile(ptrn);
}
catch (PatternSyntaxException e) {
log.log(Level.WARNING, "IGNITE_HOSTNAME_CONSTRAINT has invalid pattern. It will be ignore.", e);
}
}
return prop;
}
catch (IOException e) {
throw new RuntimeException(e);
}
}