Roy Golan has posted comments on this change.
Change subject: core: change iso prefix command to be vds broker command
......................................................................
Patch Set 6:
(2 comments)
....................................................
File
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/IsoPrefixVDSCommand.java
Line 10: import
org.ovirt.engine.core.vdsbroker.irsbroker.StoragePoolInfoReturnForXmlRpc;
Line 11:
Line 12: public class IsoPrefixVDSCommand<T extends
VdsAndPoolIDVDSParametersBase> extends VdsBrokerCommand<T> {
Line 13:
Line 14: private static Map<Guid, String> storagePoolId2IsoPrefix = new
ConcurrentHashMap<Guid, String>();
minor
please don't use 2 in the name
you declare a Map and then new ConcurrentHashMap while in the member below
you declare it ConcurrentHashMap and new ConcurrentHashMap
so be it either Map to new Map or ConcurrentHashMap to new ConcurrentHashMap
I don't care just make them same
Line 15: private static ConcurrentHashMap<Guid, Object>
storagePoolId2LockObj = new ConcurrentHashMap<Guid, Object>();
Line 16:
Line 17: public IsoPrefixVDSCommand(T parameters) {
Line 18: super(parameters);
Line 24: }
Line 25:
Line 26: private String getIsoPrefix() {
Line 27: Guid storagePoolId = getParameters().getStoragePoolId();
Line 28: synchronized(getLockObjForStoragePool(storagePoolId)) {
lets avoid the context switch and locking.
either we
1. totally remove the synchronized - and go to VDSM if don't have the answer,
taking into account that a mass run vm could result some redundant getIsoPrefix
queries
2. go into the synchronised only as long as the cache is missed.
3. take 1 and add eager initialization when the pool has active iso in another
patch
I vote for 3
Line 29: if (!storagePoolId2IsoPrefix.containsKey(storagePoolId)) {
Line 30: try {
Line 31: StoragePoolInfoReturnForXmlRpc returnValue =
Line 32:
getBroker().getStoragePoolInfo(storagePoolId.toString());
--
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: 6
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: 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