Moti Asayag has posted comments on this change.

Change subject: core: Extract common NetworkStatistics DAO code
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.ovirt.org/#/c/36461/4/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/VmNetworkStatisticsDaoDbFacadeImpl.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/VmNetworkStatisticsDaoDbFacadeImpl.java:

Line 27:     }
Line 28: 
Line 29:     @Override
Line 30:     protected RowMapper<VmNetworkStatistics> createEntityRowMapper() {
Line 31:         return new VmNetworkStatisticsRowMapper();
Instead of instantiating this class each DAO call, it can be saved into a 
static local member of it (same goes to the other class which extends 
NetworkStatisticsRowMapper).

See VnicProfileRowMapperBase and VnicProfileRowMapper for example:

    private static class VnicProfileRowMapper extends 
VnicProfileRowMapperBase<VnicProfile> {

        public static final VnicProfileRowMapper INSTANCE = new 
VnicProfileRowMapper();

        @Override
        protected VnicProfile createVnicProfileEntity() {
            return new VnicProfile();
        }
    }
Line 32:     }
Line 33: 
Line 34:     public static class VmNetworkStatisticsRowMapper extends 
NetworkStatisticsRowMapper<VmNetworkStatistics> {
Line 35: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifc60a5b80d7ef042b1b81200bb8542081b42acc0
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@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