Search in sources :

Example 1 with HostPoller

use of org.ovirt.engine.core.bll.network.host.HostPoller in project ovirt-engine by oVirt.

the class HostConnectivityChecker method check.

public boolean check(final VDS host) {
    PollTechnique pollTechnique = FeatureSupported.isPing2SupportedByVdsm(host.getClusterCompatibilityVersion()) ? POLL2 : POLL;
    HostPoller poller = new HostPoller(new TimeBoundPollVDSCommandParameters(host.getId(), pollTechnique));
    final long startTime = System.nanoTime();
    while (System.nanoTime() - startTime < VDSM_RESPONSIVENESS_PERIOD_IN_NANOS) {
        if (poller.poll()) {
            log.info("Engine managed to communicate with VDSM agent on host '{}' with address '{}' ('{}')", host.getName(), host.getHostName(), host.getId());
            return true;
        }
    }
    return false;
}
Also used : HostPoller(org.ovirt.engine.core.bll.network.host.HostPoller) PollTechnique(org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters.PollTechnique) TimeBoundPollVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters)

Aggregations

HostPoller (org.ovirt.engine.core.bll.network.host.HostPoller)1 TimeBoundPollVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters)1 PollTechnique (org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters.PollTechnique)1