Liron Ar has posted comments on this change.
Change subject: core: change iso prefix command to be vds broker command
......................................................................
Patch Set 8:
(3 comments)
....................................................
File
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/IsoPrefixVDSCommand.java
Line 23: }
Line 24:
Line 25: private String getIsoPrefix() {
Line 26: Guid storagePoolId = getParameters().getStoragePoolId();
Line 27: if (!storagePoolIdToIsoPrefix.containsKey(storagePoolId)) {
I'm against having this logic reside here, it can be in a helper class..VDS
command should just execute the vds verb as we do in all the rest of the
commands. It can be extracted to an helper class which will fit better IMO.
Line 28: synchronized(getLockObjForStoragePool(storagePoolId)) {
Line 29: if
(!storagePoolIdToIsoPrefix.containsKey(storagePoolId)) {
Line 30: try {
Line 31: StoragePoolInfoReturnForXmlRpc retVal =
Line 34: storagePoolIdToIsoPrefix.put(storagePoolId,
Line 35:
retVal.mStoragePoolInfo.containsKey(IrsProperties.isoPrefix) ?
Line 36:
retVal.mStoragePoolInfo.get(IrsProperties.isoPrefix).toString()
Line 37: : StringUtils.EMPTY);
Line 38: } catch (Exception ex) {
will we have have an exception here?
Line 39: log.errorFormat("IsoPrefix Failed to get
storage pool info (vds {0}).", getParameters().getVdsId());
Line 40: return StringUtils.EMPTY;
Line 41: }
Line 42: }
Line 44: }
Line 45: return storagePoolIdToIsoPrefix.get(storagePoolId);
Line 46: }
Line 47:
Line 48: static void clearCachedIsoPrefix(Guid storagePoolId) {
possible race with getIsoPrefix(), are you fine with that?
we already have the eventqueue interface/infra for serializing events on a
pool, perhaps you could use it as well,.
Line 49: storagePoolIdToIsoPrefix.remove(storagePoolId);
Line 50: }
Line 51:
Line 52: private static Object getLockObjForStoragePool(Guid storagePoolId)
{
--
To view, visit http://gerrit.ovirt.org/17815
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I272ce7b0407bf83bd47646941630362ecf0b18cc
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches