cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rafaelweingartner <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1994: CLOUDSTACK-9827: Storage tags stored in multi...
Date Fri, 10 Mar 2017 21:12:15 GMT
Github user rafaelweingartner commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1994#discussion_r105488722
  
    --- Diff: engine/schema/src/com/cloud/storage/dao/StoragePoolTagsDaoImpl.java ---
    @@ -77,4 +90,71 @@ public void deleteTags(long poolId) {
             txn.commit();
         }
     
    +    @Override
    +    public List<StoragePoolTagVO> searchByIds(Long... stIds) {
    +        String batchCfg = _configDao.getValue("detail.batch.query.size");
    +
    +        final int detailsBatchSize = batchCfg != null ? Integer.parseInt(batchCfg) :
2000;
    +
    +        // query details by batches
    +        List<StoragePoolTagVO> uvList = new ArrayList<StoragePoolTagVO>();
    +        int curr_index = 0;
    +
    +        if (stIds.length > detailsBatchSize) {
    +            while ((curr_index + detailsBatchSize) <= stIds.length) {
    +                Long[] ids = new Long[detailsBatchSize];
    +
    +                for (int k = 0, j = curr_index; j < curr_index + detailsBatchSize;
j++, k++) {
    +                    ids[k] = stIds[j];
    +                }
    +
    +                SearchCriteria<StoragePoolTagVO> sc = StoragePoolIdsSearch.create();
    --- End diff --
    
    @nvazquez lines 105-119 are the same as 128-142.
    What about extracting them for a method?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message