Search in sources :

Example 1 with HostAndPort

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);
                }
            }
        }
    }
}
Also used : HostAndPort(com.chinaunicom.rundocker.bean.HostAndPort) DockerStatus(com.chinaunicom.rundocker.bean.DockerStatus)

Aggregations

DockerStatus (com.chinaunicom.rundocker.bean.DockerStatus)1 HostAndPort (com.chinaunicom.rundocker.bean.HostAndPort)1