use of org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase in project ovirt-engine by oVirt.
the class GlusterHookSyncJob method refreshHooksInCluster.
/**
* @param cluster - the Cluster for which the gluster hook data is refreshed
* @param throwError - set to true if this method should throw exception.
*/
public void refreshHooksInCluster(Cluster cluster, boolean throwError) {
if (!cluster.supportsGlusterService()) {
return;
}
log.debug("Syncing hooks for cluster {}", cluster.getName());
List<VDS> upServers = glusterUtil.getAllUpServers(cluster.getId());
if (upServers == null || upServers.isEmpty()) {
return;
}
List<Callable<Pair<VDS, VDSReturnValue>>> taskList = new ArrayList<>();
for (final VDS upServer : upServers) {
taskList.add(() -> {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GlusterHooksList, new VdsIdVDSCommandParametersBase(upServer.getId()));
return new Pair<>(upServer, returnValue);
});
}
List<Pair<VDS, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(taskList);
try {
addOrUpdateHooks(cluster.getId(), pairResults);
} catch (EngineException e) {
if (throwError) {
// propogate error to calling application.
throw e;
}
}
}
use of org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase in project ovirt-engine by oVirt.
the class SPMGetAllTasksInfoVDSCommand method executeIrsBrokerCommand.
@Override
protected void executeIrsBrokerCommand() {
log.info("-- executeIrsBrokerCommand: Attempting on storage pool '{}'", getParameters().getStoragePoolId());
setReturnValue(resourceManager.runVdsCommand(VDSCommandType.HSMGetAllTasksInfo, new VdsIdVDSCommandParametersBase(getCurrentIrsProxy().getCurrentVdsId())).getReturnValue());
}
Aggregations