Liran Zelkha has posted comments on this change.

Change subject: core: long query response time while many simultaneously 
queries are running
......................................................................


Patch Set 5:

(5 comments)

http://gerrit.ovirt.org/#/c/27586/5/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageDao.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageDao.java:

Line 22:      * @param requiredDisks
Line 23:      *            The images to load
Line 24:      * @return A Map of the images and their image group ids
Line 25:      */
Line 26:     public Map<Guid, Guid> getImageIdForDisks(List<Guid> 
requiredDisks);
> The name here is a bit challenging.
Done


http://gerrit.ovirt.org/#/c/27586/5/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageDaoDbFacadeImpl.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/ImageDaoDbFacadeImpl.java:

Line 114: 
Line 115:     @Override
Line 116:     public Map<Guid, Guid> getImageIdForDisks(List<Guid> 
requiredDisks) {
Line 117:         try {
Line 118:             Connection c = 
jdbcTemplate.getDataSource().getConnection();
> Connection is AutoClosabele so try(Connection c ...) is preferrable
Done
Line 119:             Array imageArray = c.createArrayOf("uuid", 
requiredDisks.toArray());
Line 120: 
Line 121:             List<ImageAndImageGroupId> disks = 
getCallsHandler().executeReadList("GetImageGroupByImageId",
Line 122:                     ImageAndImageGroupIdMapper.instance,


Line 157:             this.imageGroupId = imageGroupId;
Line 158:         }
Line 159:     }
Line 160: 
Line 161:     private static class ImageAndImageGroupIdMapper implements 
RowMapper<ImageAndImageGroupId> {
> can we just spare the class and create a static instance instead?
Done
Line 162: 
Line 163:         public static ImageAndImageGroupIdMapper instance = new 
ImageAndImageGroupIdMapper();
Line 164: 
Line 165:         private ImageAndImageGroupIdMapper() {


Line 165:         private ImageAndImageGroupIdMapper() {
Line 166:         }
Line 167: 
Line 168:         @Override
Line 169:         public ImageAndImageGroupId mapRow(ResultSet rs, int rowNum) 
throws SQLException {
> looking more closely  why do we need ImageAndImageGroupId? just pass in the
No, we can't - as the only supported return values from CallsHandler are T or 
List<T>. And in the case of <T> - it expects only one row...
Line 170:             ImageAndImageGroupId entity = new ImageAndImageGroupId();
Line 171:             entity.setImageId(getGuidDefaultEmpty(rs, "image_guid"));
Line 172:             entity.setImageGroupId(getGuidDefaultEmpty(rs, 
"image_group_id"));
Line 173:             return entity;


http://gerrit.ovirt.org/#/c/27586/5/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java:

Line 1518:             for (DiskImageDynamic disk : 
vmInternalData.getVmDynamic().getDisks()) {
Line 1519:                 requiredDisks.add(disk.getId());
Line 1520:             }
Line 1521:         }
Line 1522:         Map<Guid, Guid> diskImages = 
getDbFacade().getImageDao().getImageIdForDisks(requiredDisks);
> well i guess it have to be outside of the for loop, as this is a one-time c
Done
Line 1523:         for (VmInternalData vmInternalData : _runningVms.values()) {
Line 1524:             VmDynamic runningVm = vmInternalData.getVmDynamic();
Line 1525:             VM vmToUpdate = _vmDict.get(runningVm.getId());
Line 1526: 


-- 
To view, visit http://gerrit.ovirt.org/27586
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I94e20d782bc4e2befaf4338f51551a2855509769
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liran Zelkha <lzel...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to