falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject falcon git commit: FALCON-1514 Incorrect logging while submitting cluster(Sandeep Samudrala)
Date Thu, 08 Oct 2015 05:36:20 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 4bc38989d -> d69591ad1


FALCON-1514 Incorrect logging while submitting cluster(Sandeep Samudrala)


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

Branch: refs/heads/master
Commit: d69591ad171a87222a1cc32513d6c909e3fc8d24
Parents: 4bc3898
Author: Pallavi Rao <pallavi.rao@inmobi.com>
Authored: Thu Oct 8 10:42:14 2015 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Thu Oct 8 10:42:14 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                               |  4 +++-
 .../java/org/apache/falcon/entity/lock/MemoryLocks.java   |  8 ++++----
 .../org/apache/falcon/entity/lock/MemoryLocksTest.java    | 10 +++++-----
 .../org/apache/falcon/resource/AbstractEntityManager.java | 10 +++++-----
 .../falcon/resource/AbstractSchedulableEntityManager.java |  2 +-
 5 files changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/d69591ad/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b7fd6a1..7f66a44 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -15,7 +15,7 @@ Trunk (Unreleased)
     FALCON-1027 Falcon proxy user support(Sowmya Ramesh)
 
   IMPROVEMENTS
-    FALCON-1477 Adding "-debug" option to Falcon CLI for debug statements to stdout(Narayan
Periwal)
+    FALCON-1477 Adding "-debug" option to Falcon CLI for debug statements to stdout(Narayan
Periwal via Pallavi Rao)
 
     FALCON-1476 Maintaining threshold on monitoring entities for SLA service(Ajay Yadava)
 
@@ -51,6 +51,8 @@ Trunk (Unreleased)
     FALCON-1403 Revisit IT cleanup and teardown(Narayan Periwal via Pallavi Rao)
 
   BUG FIXES
+    FALCON-1514 Incorrect logging while submitting cluster(Sandeep Samudrala via Pallavi
Rao)
+
     FALCON-1509 Auto generation of REST API does not work in distributed mode(Narayan Periwal
via Sowmya Ramesh).
 
     FALCON-1491 Update ActiveMQ version to 5.12(Peeyush Bishnoi via Sowmya Ramesh).

http://git-wip-us.apache.org/repos/asf/falcon/blob/d69591ad/common/src/main/java/org/apache/falcon/entity/lock/MemoryLocks.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/lock/MemoryLocks.java b/common/src/main/java/org/apache/falcon/entity/lock/MemoryLocks.java
index a91b5d2..0cf2722 100644
--- a/common/src/main/java/org/apache/falcon/entity/lock/MemoryLocks.java
+++ b/common/src/main/java/org/apache/falcon/entity/lock/MemoryLocks.java
@@ -45,14 +45,14 @@ public final class MemoryLocks {
      * @param entity entity object.
      * @return the lock token for the resource, or <code>null</code> if the lock
could not be obtained.
      */
-    public boolean acquireLock(Entity entity) {
+    public boolean acquireLock(Entity entity, String command) {
         boolean lockObtained = false;
         String entityName = getLockKey(entity);
 
         Boolean putResponse = locks.putIfAbsent(entityName, true);
         if (putResponse == null || !putResponse) {
-            LOG.info("Lock obtained for schedule/update of {} by {}",
-                    entity.toShortString(), Thread.currentThread().getName());
+            LOG.info("Lock acquired for {} on {} by {}",
+                    command, entity.toShortString(), Thread.currentThread().getName());
             lockObtained = true;
         }
         return lockObtained;
@@ -67,7 +67,7 @@ public final class MemoryLocks {
         String entityName = getLockKey(entity);
 
         locks.remove(entityName);
-        LOG.info("Successfully released lock for {} by {}",
+        LOG.info("Successfully released lock on {} by {}",
                 entity.toShortString(), Thread.currentThread().getName());
     }
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/d69591ad/common/src/test/java/org/apache/falcon/entity/lock/MemoryLocksTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/lock/MemoryLocksTest.java b/common/src/test/java/org/apache/falcon/entity/lock/MemoryLocksTest.java
index 66746f1..d4cf82c 100644
--- a/common/src/test/java/org/apache/falcon/entity/lock/MemoryLocksTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/lock/MemoryLocksTest.java
@@ -36,7 +36,7 @@ public class MemoryLocksTest {
     public void testSuccessfulMemoryLockAcquisition() throws Exception {
         MemoryLocks memoryLocks = MemoryLocks.getInstance();
         Entity feed = (Entity) EntityType.FEED.getUnmarshaller().unmarshal(this.getClass().getResource(FEED_XML));
-        Assert.assertEquals(memoryLocks.acquireLock(feed), true);
+        Assert.assertEquals(memoryLocks.acquireLock(feed, "test"), true);
         memoryLocks.releaseLock(feed);
     }
 
@@ -44,8 +44,8 @@ public class MemoryLocksTest {
     public void testUnsuccessfulMemoryLockAcquisition() throws Exception {
         MemoryLocks memoryLocks = MemoryLocks.getInstance();
         Entity feed = (Entity) EntityType.FEED.getUnmarshaller().unmarshal(this.getClass().getResource(FEED_XML));
-        Assert.assertEquals(memoryLocks.acquireLock(feed), true);
-        Assert.assertEquals(memoryLocks.acquireLock(feed), false);
+        Assert.assertEquals(memoryLocks.acquireLock(feed, "test"), true);
+        Assert.assertEquals(memoryLocks.acquireLock(feed, "test"), false);
         memoryLocks.releaseLock(feed);
     }
 
@@ -57,8 +57,8 @@ public class MemoryLocksTest {
         org.apache.falcon.entity.v0.process.Process process = (Process) EntityType.PROCESS.getUnmarshaller().
                 unmarshal(this.getClass().getResource(PROCESS_XML));
         process.setName(feed.getName());
-        Assert.assertEquals(memoryLocks.acquireLock(feed), true);
-        Assert.assertEquals(memoryLocks.acquireLock(process), true);
+        Assert.assertEquals(memoryLocks.acquireLock(feed, "test"), true);
+        Assert.assertEquals(memoryLocks.acquireLock(process, "test"), true);
         memoryLocks.releaseLock(feed);
     }
 }

http://git-wip-us.apache.org/repos/asf/falcon/blob/d69591ad/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java b/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
index a6a0e4c..3323dd1 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
@@ -326,7 +326,7 @@ public abstract class AbstractEntityManager {
             tokenList = new ArrayList<>();
         }
         //first obtain lock for the entity for which update is issued.
-        if (memoryLocks.acquireLock(entity)) {
+        if (memoryLocks.acquireLock(entity, command)) {
             tokenList.add(entity);
         } else {
             throw new FalconException(command + " command is already issued for " + entity.toShortString());
@@ -336,11 +336,11 @@ public abstract class AbstractEntityManager {
         Set<Entity> affectedEntities = EntityGraph.get().getDependents(entity);
         if (affectedEntities != null) {
             for (Entity e : affectedEntities) {
-                if (memoryLocks.acquireLock(e)) {
+                if (memoryLocks.acquireLock(e, command)) {
                     tokenList.add(e);
                     LOG.debug("{} on entity {} has acquired lock on {}", command, entity,
e);
                 } else {
-                    LOG.error("Error while trying to acquire lock for {}. Releasing already
obtained locks",
+                    LOG.error("Error while trying to acquire lock on {}. Releasing already
obtained locks",
                             e.toShortString());
                     throw new FalconException("There are multiple update commands running
for dependent entity "
                             + e.toShortString());
@@ -354,9 +354,9 @@ public abstract class AbstractEntityManager {
             for (Entity entity : tokenList) {
                 memoryLocks.releaseLock(entity);
             }
-            LOG.info("All update locks released for {}", entityName);
+            LOG.info("All locks released on {}", entityName);
         } else {
-            LOG.info("No locks to release for " + entityName);
+            LOG.info("No locks to release on " + entityName);
         }
 
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/d69591ad/prism/src/main/java/org/apache/falcon/resource/AbstractSchedulableEntityManager.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/AbstractSchedulableEntityManager.java
b/prism/src/main/java/org/apache/falcon/resource/AbstractSchedulableEntityManager.java
index 63e0647..0db55df 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractSchedulableEntityManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractSchedulableEntityManager.java
@@ -90,7 +90,7 @@ public abstract class AbstractSchedulableEntityManager extends AbstractInstanceM
         try {
             entityObj = EntityUtil.getEntity(type, entity);
             //first acquire lock on entity before scheduling
-            if (!memoryLocks.acquireLock(entityObj)) {
+            if (!memoryLocks.acquireLock(entityObj, "schedule")) {
                 throw new FalconException("Looks like an schedule/update command is already
running for "
                         + entityObj.toShortString());
             }


Mime
View raw message