use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters in project ovirt-engine by oVirt.
the class VolumeListModel method startVolumeProfiling.
private void startVolumeProfiling() {
if (getSelectedItems() == null) {
return;
}
List<GlusterVolumeEntity> selectedVolumesList = getSelectedItems();
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (GlusterVolumeEntity currentSelectedVolume : selectedVolumesList) {
GlusterVolumeParameters parameter = new GlusterVolumeParameters(currentSelectedVolume.getId());
parameters.add(parameter);
}
Frontend.getInstance().runMultipleAction(ActionType.StartGlusterVolumeProfile, parameters);
}
use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters in project ovirt-engine by oVirt.
the class VolumeListModel method stopVolumeProfiling.
private void stopVolumeProfiling() {
if (getSelectedItems() == null) {
return;
}
List<GlusterVolumeEntity> selectedVolumesList = getSelectedItems();
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
for (GlusterVolumeEntity currentSelectedVolume : selectedVolumesList) {
GlusterVolumeParameters parameter = new GlusterVolumeParameters(currentSelectedVolume.getId());
parameters.add(parameter);
}
Frontend.getInstance().runMultipleAction(ActionType.StopGlusterVolumeProfile, parameters);
}
use of org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters in project ovirt-engine by oVirt.
the class GlusterBrickEventSubscriber method processEvent.
@Override
public void processEvent(GlusterEvent event) {
if (event == null) {
log.debug("No event to process!");
return;
}
GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid(Guid.createGuidFromString(event.getNodeId()));
if (glusterServer == null) {
log.debug("Could not determine gluster server from event '{}'", event);
return;
}
VdsStatic host = vdsStaticDao.get(glusterServer.getId());
if (host == null) {
log.debug("No host corresponding to gluster server in '{}'", event);
return;
}
GlusterVolumeEntity vol = glusterVolumeDao.getByName(host.getClusterId(), (String) event.getMessage().get("volume"));
if (vol == null) {
return;
}
if (event.getEvent().equalsIgnoreCase(EVENT_BRICK_DISCONNECTED) || event.getEvent().equalsIgnoreCase(EVENT_BRICK_CONNECTED)) {
// get brick
GlusterStatus status = event.getEvent().equalsIgnoreCase(EVENT_BRICK_DISCONNECTED) ? GlusterStatus.DOWN : GlusterStatus.UP;
String path = (String) event.getMessage().get(BRICK);
String peer = (String) event.getMessage().get(PEER);
List<VdsStatic> vdsList = vdsStaticDao.getAllForCluster(host.getClusterId());
VdsStatic vds = vdsList.stream().filter(v -> v.getName().equals(peer) || interfaceDao.getAllInterfacesForVds(v.getId()).stream().anyMatch(iface -> iface.getIpv4Address().equals(peer))).findFirst().orElse(null);
GlusterBrickEntity brick = vds != null ? glusterBrickDao.getBrickByServerIdAndDirectory(vds.getId(), path) : null;
if (brick != null) {
glusterBrickDao.updateBrickStatus(brick.getId(), status);
logBrickStatusChange(vol, status, brick);
} else {
// call sync to force updation
log.debug("Forcing sync as brick event '{}' received that could not be resolved to brick", event);
backend.runInternalAction(ActionType.RefreshGlusterVolumeDetails, new GlusterVolumeParameters(vol.getId()));
}
}
}
Aggregations