use of org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters 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;
}
use of org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters in project ovirt-engine by oVirt.
the class HostSetupNetworksCommand method invokeSetupNetworksCommand.
private FutureVDSCall<VDSReturnValue> invokeSetupNetworksCommand(int timeout) {
final HostSetupNetworksVdsCommandParameters parameters = createSetupNetworksParameters(timeout);
FutureVDSCall<VDSReturnValue> setupNetworksTask = getVdsBroker().runFutureVdsCommand(FutureVDSCommandType.HostSetupNetworks, parameters);
if (parameters.isRollbackOnFailure()) {
PollTechnique pollTechnique = FeatureSupported.isConfirmConnectivitySupportedByVdsm(getVds().getClusterCompatibilityVersion()) ? CONFIRM_CONNECTIVITY : POLL;
HostPoller poller = new HostPoller(new TimeBoundPollVDSCommandParameters(getVdsId(), pollTechnique));
while (!setupNetworksTask.isDone()) {
poller.poll();
}
}
return setupNetworksTask;
}
Aggregations