Liran Zelkha has uploaded a new change for review. Change subject: engine: Move anonymousHugeParge to VdsStatistics ......................................................................
engine: Move anonymousHugeParge to VdsStatistics anonymousHugePages is a rapidly changing parameter, recieved from VDSM Since we want to minimize VdsDynamic updates, this patch will move this parameter to VdsStatistics. Change-Id: I20dba0ba8beaac916f8af5f49456593077176efa Bug-Url: https://bugzilla.redhat.com/?????? Signed-off-by: [email protected] <[email protected]> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatistics.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStatisticsDAODbFacadeImpl.java 5 files changed, 19 insertions(+), 20 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/34/21934/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java index 7f7be68..280c2f0 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java @@ -1090,11 +1090,11 @@ } public int getAnonymousHugePages() { - return this.mVdsDynamic.getAnonymousHugePages(); + return this.mVdsStatistics.getAnonymousHugePages(); } public void setAnonymousHugePages(int value) { - this.mVdsDynamic.setAnonymousHugePages(value); + this.mVdsStatistics.setAnonymousHugePages(value); } public VdsStatic getStaticData() { diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java index 8c36f2a..1593e1a 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsDynamic.java @@ -98,8 +98,6 @@ this.HBAs = HBAs; } - private int anonymousHugePages; - private String hooksStr; @Size(max = BusinessEntitiesDefinitions.GENERAL_NAME_SIZE) @@ -549,14 +547,6 @@ this.transparentHugePagesState = value; } - public int getAnonymousHugePages() { - return this.anonymousHugePages; - } - - public void setAnonymousHugePages(int value) { - this.anonymousHugePages = value; - } - public void setHooksStr(String hooksStr) { this.hooksStr = hooksStr; } @@ -580,7 +570,6 @@ result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((_supportedClusterVersionsSet == null) ? 0 : _supportedClusterVersionsSet.hashCode()); result = prime * result + ((_supportedENGINESVersionsSet == null) ? 0 : _supportedENGINESVersionsSet.hashCode()); - result = prime * result + anonymousHugePages; result = prime * result + ((buildName == null) ? 0 : buildName.hashCode()); result = prime * result + ((cpu_cores == null) ? 0 : cpu_cores.hashCode()); result = prime * result + ((cpuThreads == null) ? 0 : cpuThreads.hashCode()); @@ -644,7 +633,6 @@ return (ObjectUtils.objectsEqual(id, other.id) && ObjectUtils.objectsEqual(_supportedClusterVersionsSet, other._supportedClusterVersionsSet) && ObjectUtils.objectsEqual(_supportedENGINESVersionsSet, other._supportedENGINESVersionsSet) - && anonymousHugePages == other.anonymousHugePages && ObjectUtils.objectsEqual(buildName, other.buildName) && ObjectUtils.objectsEqual(cpu_cores, other.cpu_cores) && ObjectUtils.objectsEqual(cpuThreads, other.cpuThreads) diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatistics.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatistics.java index 457377e..92158e9 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatistics.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VdsStatistics.java @@ -28,6 +28,7 @@ // Score 0 means no HA agents are on this host // Positive score means there is an agent private Integer highlyAvailableScore; + private int anonymousHugePages; public VdsStatistics() { this.cpu_idle = BigDecimal.ZERO; @@ -41,6 +42,14 @@ swap_total = 0L; ksm_pages = 0L; highlyAvailableScore = 0; + } + + public int getAnonymousHugePages() { + return this.anonymousHugePages; + } + + public void setAnonymousHugePages(int value) { + this.anonymousHugePages = value; } @Override @@ -63,6 +72,7 @@ result = prime * result + ((swap_total == null) ? 0 : swap_total.hashCode()); result = prime * result + ((swap_free == null) ? 0 : swap_free.hashCode()); result = prime * result + ((highlyAvailableScore == null) ? 0 : highlyAvailableScore.hashCode()); + result = prime * result + anonymousHugePages; return result; } @@ -93,7 +103,8 @@ && ObjectUtils.objectsEqual(ksm_cpu_percent, other.ksm_cpu_percent) && ObjectUtils.objectsEqual(swap_total, other.swap_total) && ObjectUtils.objectsEqual(swap_free, other.swap_free) - && ObjectUtils.objectsEqual(highlyAvailableScore, other.highlyAvailableScore)); + && ObjectUtils.objectsEqual(highlyAvailableScore, other.highlyAvailableScore) + && ObjectUtils.objectsEqual(anonymousHugePages, other.anonymousHugePages)); } public Double getcpu_idle() { diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java index 171ab20..3606106 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDynamicDAODbFacadeImpl.java @@ -77,7 +77,6 @@ .getString("iscsi_initiator_name")); entity.setTransparentHugePagesState(VdsTransparentHugePagesState .forValue(rs.getInt("transparent_hugepages_state"))); - entity.setAnonymousHugePages(rs.getInt("anonymous_hugepages")); entity.setHooksStr(rs.getString("hooks")); entity.setNonOperationalReason(NonOperationalReason.forValue(rs .getInt("non_operational_reason"))); @@ -143,7 +142,6 @@ .addValue("iscsi_initiator_name", vds.getIScsiInitiatorName()) .addValue("transparent_hugepages_state", vds.getTransparentHugePagesState().getValue()) - .addValue("anonymous_hugepages", vds.getAnonymousHugePages()) .addValue("hooks", vds.getHooksStr()) .addValue("non_operational_reason", vds.getNonOperationalReason().getValue()) @@ -202,7 +200,6 @@ .addValue("iscsi_initiator_name", vds.getIScsiInitiatorName()) .addValue("transparent_hugepages_state", vds.getTransparentHugePagesState().getValue()) - .addValue("anonymous_hugepages", vds.getAnonymousHugePages()) .addValue("hooks", vds.getHooksStr()) .addValue("non_operational_reason", vds.getNonOperationalReason().getValue()) diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStatisticsDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStatisticsDAODbFacadeImpl.java index a1244a8..dff3d1e 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStatisticsDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsStatisticsDAODbFacadeImpl.java @@ -45,6 +45,7 @@ .getObject("ksm_cpu_percent")); entity.setksm_pages(rs.getLong("ksm_pages")); entity.setksm_state((Boolean) rs.getObject("ksm_state")); + entity.setAnonymousHugePages(rs.getInt("anonymousHugePages")); return entity; } } @@ -79,7 +80,8 @@ .addValue("ksm_cpu_percent", stats.getksm_cpu_percent()) .addValue("ksm_pages", stats.getksm_pages()) .addValue("ksm_state", stats.getksm_state()) - .addValue("ha_score", stats.getHighlyAvailableScore()); + .addValue("ha_score", stats.getHighlyAvailableScore()) + .addValue("anonymousHugePages", stats.getAnonymousHugePages()); getCallsHandler().executeModification("InsertVdsStatistics", parameterSource); } @@ -104,7 +106,8 @@ .addValue("ksm_cpu_percent", stats.getksm_cpu_percent()) .addValue("ksm_pages", stats.getksm_pages()) .addValue("ksm_state", stats.getksm_state()) - .addValue("ha_score", stats.getHighlyAvailableScore()); + .addValue("ha_score", stats.getHighlyAvailableScore()) + .addValue("anonymousHugePages", stats.getAnonymousHugePages()); getCallsHandler().executeModification("UpdateVdsStatistics", parameterSource); } -- To view, visit http://gerrit.ovirt.org/21934 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20dba0ba8beaac916f8af5f49456593077176efa Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liran Zelkha <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
