Github user rafaelweingartner commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1994#discussion_r105959436
  
    --- Diff: 
engine/schema/src/com/cloud/storage/dao/StoragePoolTagsDaoImpl.java ---
    @@ -77,4 +90,68 @@ public void deleteTags(long poolId) {
             txn.commit();
         }
     
    +    @Override
    +    public List<StoragePoolTagVO> searchByIds(Long... stIds) {
    +        final int detailsBatchSize = getDetailsBatchSize();
    +
    +        // query details by batches
    +        List<StoragePoolTagVO> uvList = new ArrayList<StoragePoolTagVO>();
    +        int curr_index = 0;
    +
    +        if (stIds.length > detailsBatchSize) {
    +            while ((curr_index + detailsBatchSize) <= stIds.length) {
    +                searchForStoragePoolIdsInternal(curr_index, 
detailsBatchSize, stIds, uvList);
    +                curr_index += detailsBatchSize;
    +            }
    +        }
    +
    +        if (curr_index < stIds.length) {
    +            int batch_size = (stIds.length - curr_index);
    +            searchForStoragePoolIdsInternal(curr_index, batch_size, stIds, 
uvList);
    +        }
    +
    +        return uvList;
    +    }
    +
    +    /**
    +     * Search storage pools
    +     * @param currIndex current index
    +     * @param batchSize batch size
    +     * @param stIds storage tags array
    +     * @param uvList
    +     */
    +    protected void searchForStoragePoolIdsInternal(int currIndex, int 
batchSize, Long[] stIds, List<StoragePoolTagVO> uvList) {
    --- End diff --
    
    What about improving this java doc here?
    Something like:
    
    >  Search for storage pools based on their IDs. The search is executed in 
batch, this means that we will load a batch of size #getDetailsBatchSize  
@link{StoragePoolTagVO} at each time. The loaded storage pools are added in the 
uvList parameter.
    
    The links to classes, methods and parameters in the Java doc would have to 
be fixed (I wrote it without using the IDE and I did not know the proper markup)
    
    What do you think about the "@param" notation? I normally prefer not to use 
them if the onyl thing I will write is the parameter name such as `@param 
uvList`



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to