use of com.chinaunicom.rundocker.bean.HostAndPort in project mesosFramework by zhizuqiu.
the class Tools method initPortsUsed.
/**
* 初始化PORTSUSED
*/
public static void initPortsUsed() {
for (String idKey : AppDataStore.statusKeySet()) {
DockerStatus dockerStatus = AppDataStore.statusGet(idKey);
if (dockerStatus.getStatus() == RUNNING) {
Map<String, String> portNeed = dockerStatus.get_portNeed();
if (portNeed != null) {
for (String port : portNeed.values()) {
HostAndPort hostAndPort = new HostAndPort(dockerStatus.getHostname(), port);
AppDataStore.portsPut(hostAndPort, idKey);
}
}
}
}
}
Aggregations