Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/bz1069606-r…
Browse files Browse the repository at this point in the history
…ebase-eap-63
  • Loading branch information
jmazzitelli committed May 22, 2014
2 parents ae80968 + 5cbf420 commit 4d2b802
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<!-- Flag that protects user without any assigned role to log in to web UI -->
<data ID="65" PROPERTY_KEY="ENABLE_LOGIN_WITHOUT_ROLES" PROPERTY_VALUE="false" DEFAULT_PROPERTY_VALUE="false" />

<data ID="66" PROPERTY_KEY="METRICS_CACHE_ACTIVATION_TIME" FREAD_ONLY="FALSE"/>
<data ID="66" PROPERTY_KEY="METRICS_CACHE_ACTIVATION_TIME" DEFAULT_PROPERTY_VALUE="-1" FREAD_ONLY="FALSE"/>
</table>

</dbsetup>
Original file line number Diff line number Diff line change
Expand Up @@ -2367,11 +2367,11 @@
<schema-directSQL>
<statement targetDBVendor="postgresql" desc="Adding metrics cache table activation time">
INSERT INTO rhq_system_config (id, property_key, property_value, default_property_value, fread_only)
VALUES (66, 'METRICS_CACHE_ACTIVATION_TIME', null, null, false)
VALUES (66, 'METRICS_CACHE_ACTIVATION_TIME', '-1', null, false)
</statement>
<statement targetDBVendor="oracle" desc="Adding metrics cache table activation time">
INSERT INTO rhq_system_config (id, property_key, property_value, default_property_value, fread_only)
VALUES (66, 'METRICS_CACHE_ACTIVATION_TIME', null, null, 0)
VALUES (66, 'METRICS_CACHE_ACTIVATION_TIME', '-1', null, 0)
</statement>
</schema-directSQL>
</schemaSpec>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ private void initMetricsServer() {
metricsServer.init();
}

private Long getCacheActivationTime() {
private long getCacheActivationTime() {
SystemSettings settings = systemManager.getSystemSettings(subjectManager.getOverlord());
return Long.parseLong(settings.get(SystemSetting.METRICS_CACHE_ACTIVATION_TIME));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class MetricsServer {

private int cacheBatchSize = Integer.parseInt(System.getProperty("rhq.metrics.cache.batch-size", "5"));

private Long cacheActivationTime;
private long cacheActivationTime;

public void setDAO(MetricsDAO dao) {
this.dao = dao;
Expand Down Expand Up @@ -130,7 +130,7 @@ ListeningExecutorService getAggregationWorkers() {
return aggregationWorkers;
}

public void setCacheActivationTime(Long cacheActivationTime) {
public void setCacheActivationTime(long cacheActivationTime) {
this.cacheActivationTime = cacheActivationTime;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public int compare(AggregateNumericMetric left, AggregateNumericMetric right) {

private Semaphore permits;

private Long cacheActivationTime;
private long cacheActivationTime;

public AggregationManager(ListeningExecutorService aggregationTasks, MetricsDAO dao, DateTimeService dtService,
DateTime startTime, int batchSize, int parallelism, int cacheBatchSize) {
Expand Down Expand Up @@ -82,7 +82,7 @@ private boolean is24HourTimeSliceFinished() {
*
* @param cacheActivationTime The time to reactivate metrics_cache
*/
public void setCacheActivationTime(Long cacheActivationTime) {
public void setCacheActivationTime(long cacheActivationTime) {
this.cacheActivationTime = cacheActivationTime;
}

Expand Down Expand Up @@ -199,7 +199,7 @@ private CacheAggregator create6HourAggregator(PersistFunctions persistFunctions)
}

private boolean isCacheActive() {
return cacheActivationTime == null || startTime.getMillis() >= cacheActivationTime;
return startTime.getMillis() >= cacheActivationTime;
}

}

0 comments on commit 4d2b802

Please sign in to comment.