GabrielBrascher commented on a change in pull request #4978:
URL: https://github.com/apache/cloudstack/pull/4978#discussion_r678264556
##########
File path:
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/kvm/ha/KVMHostActivityChecker.java
##########
@@ -213,6 +270,17 @@ protected boolean
verifyActivityOfStorageOnHost(HashMap<StoragePool, List<Volume
return poolVolMap;
}
+ private boolean isHostServedByNfsPool(Host agent) {
+ List<StoragePoolHostVO> storagesOnHost =
storagePoolHostDao.listByHostId(agent.getId());
+ for (StoragePoolHostVO storagePoolHostRef : storagesOnHost) {
+ StoragePoolVO storagePool =
this.storagePool.findById(storagePoolHostRef.getPoolId());
+ if (NFS_POOL_TYPE.contains(storagePool.getPoolType())) {
+ return true;
+ }
+ }
+ return false;
Review comment:
@GutoVeronezi here I think that it is a bit trickier than a normal loop
interation with a simple if.
Such as the other one:
```
for (StoragePoolVO pool : zonePools) {
if (pool.getPoolType() == StoragePoolType.NetworkFilesystem) {
return true;
}
}
```
Here the list does not store the object that is being used in the
conditional, but instead just an object (`StoragePoolHostVO`) that will serve
to link to the object in quesiton (`StoragePoolVO`). Thus the stream .anyMatch
would not serve here.
Please correct me if I am wrong in this one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]