incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1555101 - in /sling/trunk/bundles/extensions/healthcheck/core/src: main/java/org/apache/sling/hc/core/impl/executor/ test/java/org/apache/sling/hc/core/impl/executor/
Date Fri, 03 Jan 2014 14:11:06 GMT
Author: bdelacretaz
Date: Fri Jan  3 14:11:06 2014
New Revision: 1555101

URL: http://svn.apache.org/r1555101
Log:
HealthCheckMetaData -> HealthCheckMetadata

Modified:
    sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckDescriptor.java
    sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java
    sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckFuture.java
    sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckResultCache.java
    sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java

Modified: sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckDescriptor.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckDescriptor.java?rev=1555101&r1=1555100&r2=1555101&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckDescriptor.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckDescriptor.java
Fri Jan  3 14:11:06 2014
@@ -25,7 +25,7 @@ import org.osgi.framework.ServiceReferen
  */
 public class HealthCheckDescriptor {
 
-    private final HealthCheckMetadata metaData;
+    private final HealthCheckMetadata metadata;
     private final transient ServiceReference serviceReference;
 
     public HealthCheckDescriptor(final ServiceReference healthCheckRef) {
@@ -33,16 +33,16 @@ public class HealthCheckDescriptor {
             throw new IllegalArgumentException("HealthCheck reference must not be null");
         }
         this.serviceReference = healthCheckRef;
-        this.metaData = new HealthCheckMetadata(healthCheckRef);
+        this.metadata = new HealthCheckMetadata(healthCheckRef);
     }
 
     @Override
     public String toString() {
-        return "HealthCheck '" + this.metaData.getTitle() + "'";
+        return "HealthCheck '" + this.metadata.getTitle() + "'";
     }
 
-    public HealthCheckMetadata getMetaData() {
-        return this.metaData;
+    public HealthCheckMetadata getMetadata() {
+        return this.metadata;
     }
 
     public ServiceReference getServiceReference() {
@@ -51,7 +51,7 @@ public class HealthCheckDescriptor {
 
     @Override
     public int hashCode() {
-        return this.metaData.hashCode();
+        return this.metadata.hashCode();
     }
 
     @Override
@@ -60,6 +60,6 @@ public class HealthCheckDescriptor {
             return false;
         }
         final HealthCheckDescriptor other = (HealthCheckDescriptor) obj;
-        return this.metaData.equals(other.metaData);
+        return this.metadata.equals(other.metadata);
     }
 }

Modified: sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java?rev=1555101&r1=1555100&r2=1555101&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java
Fri Jan  3 14:11:06 2014
@@ -250,7 +250,7 @@ public class HealthCheckExecutorImpl imp
                     result = future.get();
                 } catch (Exception e) {
                     logger.warn("Unexpected Exception during future.get(): " + e, e);
-                    result = new ExecutionResult(future.getHealthCheckDescriptor().getMetaData(),
Result.Status.HEALTH_CHECK_ERROR,
+                    result = new ExecutionResult(future.getHealthCheckDescriptor().getMetadata(),
Result.Status.HEALTH_CHECK_ERROR,
                             "Unexpected Exception during future.get(): " + e);
                 }
 
@@ -270,11 +270,11 @@ public class HealthCheckExecutorImpl imp
                 // future we turn the result CRITICAL
                 long futureElapsedTimeMs = new Date().getTime() - future.getCreatedTime().getTime();
                 if (futureElapsedTimeMs < this.longRunningFutureThresholdForRedMs) {
-                    result = new ExecutionResult(future.getHealthCheckDescriptor().getMetaData(),
Result.Status.WARN,
+                    result = new ExecutionResult(future.getHealthCheckDescriptor().getMetadata(),
Result.Status.WARN,
                             "Timeout: Check still running after " + msHumanReadable(futureElapsedTimeMs),
futureElapsedTimeMs);
 
                 } else {
-                    result = new ExecutionResult(future.getHealthCheckDescriptor().getMetaData(),
Result.Status.CRITICAL,
+                    result = new ExecutionResult(future.getHealthCheckDescriptor().getMetadata(),
Result.Status.CRITICAL,
                             "Timeout: Check still running after " + msHumanReadable(futureElapsedTimeMs)
                                     + " (exceeding the configured threshold for CRITICAL:
"
                                     + msHumanReadable(this.longRunningFutureThresholdForRedMs)
+ ")", futureElapsedTimeMs);

Modified: sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckFuture.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckFuture.java?rev=1555101&r1=1555100&r2=1555101&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckFuture.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckFuture.java
Fri Jan  3 14:11:06 2014
@@ -44,7 +44,7 @@ class HealthCheckFuture extends FutureTa
             @Override
             public ExecutionResult call() throws Exception {
                 Thread.currentThread().setName(
-                        "Health-Check-" + StringUtils.substringAfterLast(healthCheckDescriptor.getMetaData().getTitle(),
"."));
+                        "Health-Check-" + StringUtils.substringAfterLast(healthCheckDescriptor.getMetadata().getTitle(),
"."));
                 LOG.debug("Starting check {}", healthCheckDescriptor);
 
                 StopWatch stopWatch = new StopWatch();
@@ -73,7 +73,7 @@ class HealthCheckFuture extends FutureTa
                     long elapsedTime = stopWatch.getTime();
                     if (resultFromHealthCheck != null) {
                         // wrap the result in an execution result
-                        executionResult = new ExecutionResult(healthCheckDescriptor.getMetaData(),
resultFromHealthCheck, elapsedTime);
+                        executionResult = new ExecutionResult(healthCheckDescriptor.getMetadata(),
resultFromHealthCheck, elapsedTime);
                     }
                     LOG.debug("Time consumed for {}: {}", healthCheckDescriptor, HealthCheckExecutorImpl.msHumanReadable(elapsedTime));
                 }
@@ -100,4 +100,4 @@ class HealthCheckFuture extends FutureTa
         return "[Future for " + this.healthCheckDescriptor + ", createdTime=" + this.createdTime
+ "]";
     }
 
-}
\ No newline at end of file
+}

Modified: sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckResultCache.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckResultCache.java?rev=1555101&r1=1555100&r2=1555101&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckResultCache.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckResultCache.java
Fri Jan  3 14:11:06 2014
@@ -72,7 +72,7 @@ public class HealthCheckResultCache {
     }
 
     private HealthCheckExecutionResult get(final HealthCheckDescriptor healthCheckDescriptor,
final long resultCacheTtlInMs) {
-        final Long key = healthCheckDescriptor.getMetaData().getServiceId();
+        final Long key = healthCheckDescriptor.getMetadata().getServiceId();
         final HealthCheckExecutionResult cachedResult = cache.get(key);
         if (cachedResult != null) {
             Date finishedAt = cachedResult.getFinishedAt();
@@ -98,4 +98,4 @@ public class HealthCheckResultCache {
         return null;
     }
 
-}
\ No newline at end of file
+}

Modified: sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java?rev=1555101&r1=1555100&r2=1555101&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java
(original)
+++ sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImplTest.java
Fri Jan  3 14:11:06 2014
@@ -39,7 +39,7 @@ public class HealthCheckExecutorImplTest
         MockitoAnnotations.initMocks(this);
 
         when(future.getHealthCheckDescriptor()).thenReturn(healthCheckDescriptor);
-        when(healthCheckDescriptor.getMetaData()).thenReturn(this.HealthCheckMetadata);
+        when(healthCheckDescriptor.getMetadata()).thenReturn(this.HealthCheckMetadata);
         when(HealthCheckMetadata.getTitle()).thenReturn("Test Check");
 
         healthCheckExecutorImpl = new HealthCheckExecutorImpl();
@@ -57,7 +57,7 @@ public class HealthCheckExecutorImplTest
         Collection<HealthCheckExecutionResult> results = new TreeSet<HealthCheckExecutionResult>();
 
         when(future.isDone()).thenReturn(true);
-        ExecutionResult testResult = new ExecutionResult(healthCheckDescriptor.getMetaData(),
new Result(Result.Status.OK, "test"), 10L);
+        ExecutionResult testResult = new ExecutionResult(healthCheckDescriptor.getMetadata(),
new Result(Result.Status.OK, "test"), 10L);
         when(future.get()).thenReturn(testResult);
 
         healthCheckExecutorImpl.collectResultsFromFutures(futures, results);



Mime
View raw message