You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@twill.apache.org by ch...@apache.org on 2018/03/19 05:59:22 UTC

[3/3] twill git commit: Added logs for debugging.

Added logs for debugging.

Project: http://git-wip-us.apache.org/repos/asf/twill/repo
Commit: http://git-wip-us.apache.org/repos/asf/twill/commit/01f8123c
Tree: http://git-wip-us.apache.org/repos/asf/twill/tree/01f8123c
Diff: http://git-wip-us.apache.org/repos/asf/twill/diff/01f8123c

Branch: refs/heads/feature/zk-localhost
Commit: 01f8123c93b47509845b4cc4d4d2fb3dcf093d68
Parents: f3025f5
Author: Terence Yim <ch...@apache.org>
Authored: Sun Mar 18 22:59:14 2018 -0700
Committer: Terence Yim <ch...@apache.org>
Committed: Sun Mar 18 22:59:14 2018 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/twill/yarn/LocationCacheCleaner.java   | 5 ++++-
 .../src/test/java/org/apache/twill/yarn/LocationCacheTest.java  | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/twill/blob/01f8123c/twill-yarn/src/main/java/org/apache/twill/yarn/LocationCacheCleaner.java
----------------------------------------------------------------------
diff --git a/twill-yarn/src/main/java/org/apache/twill/yarn/LocationCacheCleaner.java b/twill-yarn/src/main/java/org/apache/twill/yarn/LocationCacheCleaner.java
index 0738218..870823f 100644
--- a/twill-yarn/src/main/java/org/apache/twill/yarn/LocationCacheCleaner.java
+++ b/twill-yarn/src/main/java/org/apache/twill/yarn/LocationCacheCleaner.java
@@ -113,6 +113,7 @@ final class LocationCacheCleaner extends AbstractIdleService {
 
       // If rejected by the predicate, it means it is being used, hence remove it from the pending cleanup list.
       if (!cleanupPredicate.apply(pendingCleanup.getLocation())) {
+        LOG.debug("Rejected deletion of location {}", pendingCleanup.getLocation());
         iterator.remove();
       } else {
         try {
@@ -144,7 +145,9 @@ final class LocationCacheCleaner extends AbstractIdleService {
               }
               // If the location is already pending for cleanup, this won't update the expire time as
               // the comparison of PendingCleanup is only by location.
-              pendingCleanups.add(new PendingCleanup(location, expireTime));
+              if (pendingCleanups.add(new PendingCleanup(location, expireTime))) {
+                LOG.debug("Pending deletion of location {} with expiration time at {}", location, expireTime);
+              }
             }
           }
         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/twill/blob/01f8123c/twill-yarn/src/test/java/org/apache/twill/yarn/LocationCacheTest.java
----------------------------------------------------------------------
diff --git a/twill-yarn/src/test/java/org/apache/twill/yarn/LocationCacheTest.java b/twill-yarn/src/test/java/org/apache/twill/yarn/LocationCacheTest.java
index 8ed9ae4..f7c9e27 100644
--- a/twill-yarn/src/test/java/org/apache/twill/yarn/LocationCacheTest.java
+++ b/twill-yarn/src/test/java/org/apache/twill/yarn/LocationCacheTest.java
@@ -114,7 +114,8 @@ public class LocationCacheTest {
       .forceLocationCacheCleanup(System.currentTimeMillis() + Configs.Defaults.LOCATION_CACHE_ANTIQUE_EXPIRY_MS);
 
     // Now there shouldn't be any file under the current session cache directory
-    Assert.assertTrue(currentSessionCache.list().isEmpty());
+    List<Location> locations = currentSessionCache.list();
+    Assert.assertTrue("Location is not empty " + locations, locations.isEmpty());
   }
 
   /**