Moti Asayag has posted comments on this change. Change subject: core: macPool per DC, add db column ......................................................................
Patch Set 2: (6 comments) http://gerrit.ovirt.org/#/c/26795/2/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StoragePool.java File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StoragePool.java: Line 52: could you use the other javadoc format ? /** * ... **/ Line 49: Line 50: private QuotaEnforcementTypeEnum quotaEnforcementType; Line 51: Line 52: //ranges of macs; two macs joined by '-' forms range, multiple ranges can be joined using ','. Line 53: //String mac = "[a-fA-F0-9][02468aAcCeE](:[a-fA-F0-9]{2}){5}$"; NetworkInterface.UNICAST_MAC_ADDRESS_FORMAT describe the same pattern of a single mac address and should be reused. Line 54: //String macRange = mac2 + "-" + mac2; Line 55: //String macRanges = macRange + "(," + macRange + ")*"; Line 56: @Pattern(regexp = "^[a-fA-F0-9][02468aAcCeE](:[a-fA-F0-9]{2}){5}-[a-fA-F0-9][02468aAcCeE](:[a-fA-F0-9]{2}){5}" + Line 57: "(,[a-fA-F0-9][02468aAcCeE](:[a-fA-F0-9]{2}){5}-[a-fA-F0-9][02468aAcCeE](:[a-fA-F0-9]{2}){5})*$", Line 86: Override these annotations are related to this patch. http://gerrit.ovirt.org/#/c/26795/2/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/StoragePoolDAODbFacadeImpl.java: Line 40: entity.setQuotaEnforcementType(QuotaEnforcementTypeEnum.forValue(rs.getInt("quota_enforcement_type"))); Line 41: entity.setStoragePoolFormatType(getStorageFormatTypeForPool(rs)); Line 42: Line 43: try { Line 44: entity.setMacPoolRanges(rs.getString("mac_pool_ranges")); i don't think swallowing an exception is a good practice: If from some reason the column is missing - it means a required upgrade script wasn't executed for that specific environment which the user must be aware of. Line 45: } catch (SQLException e) { Line 46: //that columns not there. Line 47: } Line 48: return entity; Line 177: Override the javadoc of updatePartial states only a certain fields should be updated in this context. Please update the javadoc of StoragePoolDAO.updatePartial() to reduce confusion (the javadoc is already not precise) http://gerrit.ovirt.org/#/c/26795/2/packaging/dbscripts/upgrade/03_05_0300_add_mac_pool_ranges_to_storage_pool.sql File packaging/dbscripts/upgrade/03_05_0300_add_mac_pool_ranges_to_storage_pool.sql: Line 1: select fn_db_add_column('storage_pool', 'mac_pool_ranges', 'character varying(255)'); by defining a limit to the range field you actually limit the amount of ranges per data-center. I have no anticipation nor the knowledge whether users might define more than 7 ranges per data-center, but i wouldn't limit it without a good reason. -- To view, visit http://gerrit.ovirt.org/26795 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id30f3c384ecf933daaacdbdd6542e88afb98f7ca Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: 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