Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 833200 Details for
Bug 1033913
Consider changing implementation of MeasurementScheduleRequest and ScheduledMeasurementInfo
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Possible patch
BZ_1033913_-_compact_MeasurementScheduleRequests.patch (text/plain), 7.99 KB, created by
Heiko W. Rupp
on 2013-12-05 15:33:01 UTC
(
hide
)
Description:
Possible patch
Filename:
MIME Type:
Creator:
Heiko W. Rupp
Created:
2013-12-05 15:33:01 UTC
Size:
7.99 KB
patch
obsolete
>Index: modules/core/domain/src/test/java/org/rhq/core/domain/measurement/test/MeasurementTest.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>ISO-8859-1 >=================================================================== >--- modules/core/domain/src/test/java/org/rhq/core/domain/measurement/test/MeasurementTest.java (revision ec67bac995a335960f2d5d4a39070bc5d408f08b) >+++ modules/core/domain/src/test/java/org/rhq/core/domain/measurement/test/MeasurementTest.java (revision ) >@@ -42,11 +42,13 @@ > > import org.rhq.core.domain.measurement.Availability; > import org.rhq.core.domain.measurement.AvailabilityType; >+import org.rhq.core.domain.measurement.DataType; > import org.rhq.core.domain.measurement.MeasurementBaseline; > import org.rhq.core.domain.measurement.MeasurementDataPK; > import org.rhq.core.domain.measurement.MeasurementDataTrait; > import org.rhq.core.domain.measurement.MeasurementDefinition; > import org.rhq.core.domain.measurement.MeasurementSchedule; >+import org.rhq.core.domain.measurement.MeasurementScheduleRequest; > import org.rhq.core.domain.measurement.NumericType; > import org.rhq.core.domain.resource.Resource; > import org.rhq.core.domain.resource.ResourceCategory; >\ No newline at end of file >Index: modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementScheduleRequest.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>ISO-8859-1 >=================================================================== >--- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementScheduleRequest.java (revision ec67bac995a335960f2d5d4a39070bc5d408f08b) >+++ modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementScheduleRequest.java (revision ) >@@ -1,6 +1,6 @@ > /* > * RHQ Management Platform >- * Copyright (C) 2005-2008 Red Hat, Inc. >+ * Copyright (C) 2005-2013 Red Hat, Inc. > * All rights reserved. > * > * This program is free software; you can redistribute it and/or modify >@@ -40,67 +40,55 @@ > */ > public static final int NO_SCHEDULE_ID = 1; > >- private int scheduleId; >- private String name; >- private long interval; >+ private final int scheduleId; >+ private final String name; >+ private int interval; > private boolean enabled; >- private DataType dataType; >- private NumericType rawNumericType; >+ byte dataNumType; > > public MeasurementScheduleRequest(MeasurementSchedule schedule) { >- this.scheduleId = schedule.getId(); >- this.name = schedule.getDefinition().getName(); >- this.interval = schedule.getInterval(); >- this.enabled = schedule.isEnabled(); >- this.dataType = schedule.getDefinition().getDataType(); >- this.rawNumericType = schedule.getDefinition().getRawNumericType(); >+ this(schedule.getId(),schedule.getDefinition().getName(),schedule.getInterval(), >+ schedule.isEnabled(),schedule.getDefinition().getDataType(),schedule.getDefinition().getRawNumericType()); > } > > public MeasurementScheduleRequest(int scheduleId, String name, long interval, boolean enabled, DataType dataType) { > this(scheduleId, name, interval, enabled, dataType, null); > } > >+ public MeasurementScheduleRequest(MeasurementScheduleRequest scheduleRequest) { >+ this(scheduleRequest.getScheduleId(),scheduleRequest.getName(),scheduleRequest.getInterval(), >+ scheduleRequest.isEnabled(),scheduleRequest.getDataType(), >+ scheduleRequest.getRawNumericType()); >+ } >+ > public MeasurementScheduleRequest(int scheduleId, String name, long interval, boolean enabled, DataType dataType, > NumericType rawNumericType) { > this.scheduleId = scheduleId; >- this.name = name; >- this.interval = interval; >+ if (name!=null) { >+ this.name = name.intern(); >+ } >+ else >+ this.name = null; >+ this.interval = (int) (interval/1000); > this.enabled = enabled; >- this.dataType = dataType; >- this.rawNumericType = rawNumericType; >+ this.dataNumType = toDataNumType(dataType,rawNumericType); > } > >- public MeasurementScheduleRequest(MeasurementScheduleRequest scheduleRequest) { >- this.scheduleId = scheduleRequest.scheduleId; >- this.name = scheduleRequest.name; >- this.interval = scheduleRequest.interval; >- this.enabled = scheduleRequest.enabled; >- this.dataType = scheduleRequest.dataType; >- this.rawNumericType = scheduleRequest.rawNumericType; >- } > > public String getName() { > return name; > } > >- public void setName(String name) { >- this.name = name; >- } >- > public int getScheduleId() { > return scheduleId; > } > >- public void setScheduleId(int scheduleId) { >- this.scheduleId = scheduleId; >- } >- > public long getInterval() { >- return interval; >+ return interval*1000L; > } > > public void setInterval(long interval) { >- this.interval = interval; >+ this.interval = (int) (interval/1000); > } > > public boolean isEnabled() { >@@ -112,21 +100,21 @@ > } > > public DataType getDataType() { >- return dataType; >+ return DataType.values()[dataNumType/16 -1]; > } > >- public boolean isPerMinute() { >- return rawNumericType != null; >- } >- > public NumericType getRawNumericType() { >- return rawNumericType; >+ byte tmp = (byte) (dataNumType & 0x0f); >+ if (tmp==0) >+ return null; >+ return NumericType.values()[tmp-1]; >+// return rawNumericType; > } > > @Override > public String toString() { >- return "MeasurementScheduleRequest[scheduleId=" + scheduleId + ", name=" + name + ", interval=" + interval >- + ", enabled=" + enabled + ", dataType=" + dataType + ", rawNumericType=" + rawNumericType + "]"; >+ return "MeasurementScheduleRequest[scheduleId=" + scheduleId + ", name=" + name + ", interval=" + interval*1000L >+ + ", enabled=" + enabled + /*", dataType=" + dataType + ", rawNumericType=" + rawNumericType +*/ "]"; > } > > @Override >@@ -160,8 +148,13 @@ > } else if (!name.equals(other.name)) { > return false; > } >- >+ > return true; > } > >+ private byte toDataNumType(DataType dataType, NumericType numericType) { >+ byte dTmp = (byte) (dataType != null ? dataType.ordinal()+1 : 0); >+ byte nTmp = (byte) (numericType != null ? numericType.ordinal()+1 : 0); >+ return (byte) (dTmp * 16 + nTmp); >+ } > } >\ No newline at end of file >Index: modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/ScheduledMeasurementInfo.java >IDEA additional info: >Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP ><+>ISO-8859-1 >=================================================================== >--- modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/ScheduledMeasurementInfo.java (revision ec67bac995a335960f2d5d4a39070bc5d408f08b) >+++ modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/ScheduledMeasurementInfo.java (revision ) >@@ -1,6 +1,6 @@ > /* > * RHQ Management Platform >- * Copyright (C) 2005-2008 Red Hat, Inc. >+ * Copyright (C) 2005-2013 Red Hat, Inc. > * All rights reserved. > * > * This program is free software; you can redistribute it and/or modify >@@ -36,7 +36,6 @@ > public class ScheduledMeasurementInfo extends MeasurementScheduleRequest implements > Comparable<ScheduledMeasurementInfo> { > private int resourceId; >- private long lastCollection; > private long nextCollection; > > public ScheduledMeasurementInfo(MeasurementScheduleRequest scheduleRequest, Integer resourceId) { >@@ -48,13 +47,6 @@ > return resourceId; > } > >- public long getLastCollection() { >- return lastCollection; >- } >- >- public void setLastCollection(long lastCollection) { >- this.lastCollection = lastCollection; >- } > > public long getNextCollection() { > return nextCollection; >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1033913
: 833200