use of org.ovirt.engine.core.common.businessentities.gluster.Mempool in project ovirt-engine by oVirt.
the class VolumeBrickListModel method onShowBrickAdvancedDetails.
private void onShowBrickAdvancedDetails(GlusterVolumeEntity volumeEntity) {
final GlusterBrickEntity brickEntity = getSelectedItem();
final BrickAdvancedDetailsModel brickModel = new BrickAdvancedDetailsModel();
setWindow(brickModel);
brickModel.setTitle(ConstantsManager.getInstance().getConstants().advancedDetailsBrickTitle());
brickModel.setHelpTag(HelpTag.brick_advanced);
// $NON-NLS-1$
brickModel.setHashName("brick_advanced");
brickModel.startProgress();
AsyncDataProvider.getInstance().getGlusterVolumeBrickDetails(new AsyncQuery<QueryReturnValue>(returnValue -> {
brickModel.stopProgress();
if (returnValue == null || !returnValue.getSucceeded()) {
brickModel.setMessage(ConstantsManager.getInstance().getConstants().errorInFetchingBrickAdvancedDetails());
return;
}
GlusterVolumeAdvancedDetails advDetails = returnValue.getReturnValue();
brickModel.getBrick().setEntity(brickEntity.getQualifiedName());
if (advDetails != null && advDetails.getBrickDetails() != null && advDetails.getBrickDetails().size() == 1) {
BrickDetails brickDetails = advDetails.getBrickDetails().get(0);
brickModel.getBrickProperties().setProperties(brickDetails.getBrickProperties());
ArrayList<EntityModel<GlusterClientInfo>> clients = new ArrayList<>();
for (GlusterClientInfo client : brickDetails.getClients()) {
clients.add(new EntityModel<>(client));
}
brickModel.getClients().setItems(clients);
brickModel.getMemoryStatistics().updateMemoryStatistics(brickDetails.getMemoryStatus().getMallInfo());
ArrayList<EntityModel<Mempool>> memoryPools = new ArrayList<>();
for (Mempool mempool : brickDetails.getMemoryStatus().getMemPools()) {
memoryPools.add(new EntityModel<>(mempool));
}
brickModel.getMemoryPools().setItems(memoryPools);
}
}, true), volumeEntity.getClusterId(), volumeEntity.getId(), brickEntity.getId());
// $NON-NLS-1$
UICommand command = new UICommand("Cancel", this);
command.setTitle(ConstantsManager.getInstance().getConstants().close());
command.setIsCancel(true);
brickModel.getCommands().add(command);
}
Aggregations