geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstew...@apache.org
Subject [7/8] geode git commit: GEODE-2686: Add more logging to JarDeployer
Date Sun, 16 Apr 2017 16:18:15 GMT
GEODE-2686: Add more logging to JarDeployer


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/8f9624d0
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/8f9624d0
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/8f9624d0

Branch: refs/heads/develop
Commit: 8f9624d05abf6a9dea20a9cf7aee2b6a0b7ccb8b
Parents: ee11b0a
Author: Jared Stewart <jstewart@pivotal.io>
Authored: Mon Apr 10 14:49:09 2017 -0700
Committer: Jared Stewart <jstewart@pivotal.io>
Committed: Sun Apr 16 09:10:01 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/geode/internal/JarDeployer.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/8f9624d0/geode-core/src/main/java/org/apache/geode/internal/JarDeployer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/JarDeployer.java b/geode-core/src/main/java/org/apache/geode/internal/JarDeployer.java
index 669802c..da4c136 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/JarDeployer.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/JarDeployer.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.internal;
 
+import static java.util.stream.Collectors.joining;
 import static java.util.stream.Collectors.toList;
 import static java.util.stream.Collectors.toSet;
 
@@ -89,6 +90,7 @@ public class JarDeployer implements Serializable {
     try {
       boolean shouldDeployNewVersion = shouldDeployNewVersion(jarName, jarBytes);
       if (!shouldDeployNewVersion) {
+        logger.debug("No need to deploy a new version of {}", jarName);
         return null;
       }
 
@@ -146,6 +148,8 @@ public class JarDeployer implements Serializable {
       nextVersionedJarName = removeJarExtension(unversionedJarName) + ".v" + nextVersion
+ ".jar";
     }
 
+    logger.debug("Next versioned jar name for {} is {}", unversionedJarName, nextVersionedJarName);
+
     return new File(deployDirectory, nextVersionedJarName);
   }
 
@@ -274,6 +278,7 @@ public class JarDeployer implements Serializable {
    * @return Sorted array of files that are older versions of the given JAR
    */
   protected File[] findSortedOldVersionsOfJar(final String unversionedJarName) {
+    logger.debug("Finding sorted old versions of {}", unversionedJarName);
     // Find all matching files
     final Pattern pattern = Pattern.compile(
         JAR_PREFIX_FOR_REGEX + removeJarExtension(unversionedJarName) + "\\.v\\d++\\.jar$");
@@ -287,6 +292,8 @@ public class JarDeployer implements Serializable {
       return file2Version - file1Version;
     });
 
+    logger.debug("Found [{}]",
+        Arrays.stream(oldJarFiles).map(File::getAbsolutePath).collect(joining(",")));
     return oldJarFiles;
   }
 
@@ -458,7 +465,7 @@ public class JarDeployer implements Serializable {
     try {
       for (DeployedJar deployedJar : deployedJars) {
         if (deployedJar != null) {
-          logger.info("Registering new version of jar: {}", deployedJar.toString());
+          logger.info("Registering new version of jar: {}", deployedJar);
           DeployedJar oldJar = this.deployedJars.put(deployedJar.getJarName(), deployedJar);
           if (oldJar != null) {
             oldJar.cleanUp();


Mime
View raw message