Repository: falcon
Updated Branches:
  refs/heads/0.10 87fbd772b -> a2db9e48e


FALCON-1749 Instance status does not show instances if entity is dele…

…ted from one of the colos

Author: Praveen Adlakha <[email protected]>

Reviewers: @bvellanki, @pallavi-rao

Closes #222 from PraveenAdlakha/1749_V2 and squashes the following commits:

e476a85 [Praveen Adlakha] Pallavi's comment addressed
84e389f [Praveen Adlakha] Comments added for future reference
dbc7e1c [Praveen Adlakha] FALCON-1749 Instance status does not show instances 
if entity is deleted from one of the colos

(cherry picked from commit 37848ed653dbebcee5cbaec546ccc7a9d1fdb4fe)
Signed-off-by: Pallavi Rao <[email protected]>


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

Branch: refs/heads/0.10
Commit: a2db9e48eb465dd12cb81406d17cc651111ffadb
Parents: 87fbd77
Author: Praveen Adlakha <[email protected]>
Authored: Thu Jul 14 15:11:44 2016 +0530
Committer: Pallavi Rao <[email protected]>
Committed: Thu Jul 14 15:12:03 2016 +0530

----------------------------------------------------------------------
 .../apache/falcon/resource/AbstractEntityManager.java  | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/a2db9e48/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 5fa345d..bf47d44 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
@@ -167,13 +167,18 @@ public abstract class AbstractEntityManager extends 
AbstractMetadataResource {
 
             Set<String> clusters = EntityUtil.getClustersDefined(entity);
             Set<String> colos = new HashSet<String>();
-            for (String cluster : clusters) {
-                try{
+            try{
+                // Fix for Falcon-1749
+                EntityType entitytype =  EntityType.getEnum(type);
+                if (entitytype == EntityType.PROCESS || entitytype == 
EntityType.FEED){
+                    EntityUtil.getEntity(entitytype, entity.getName());
+                }
+                for (String cluster : clusters) {
                     Cluster clusterEntity = 
EntityUtil.getEntity(EntityType.CLUSTER, cluster);
                     colos.add(clusterEntity.getColo());
-                } catch (EntityNotRegisteredException e){
-                    LOG.warn(e.getMessage(), e);
                 }
+            }catch (EntityNotRegisteredException e){
+                LOG.warn(e.getMessage(), e);
             }
             if (colos.isEmpty()) {
                 throw new EntityNotRegisteredException(entity.getName()  + " 
(" + type + ") not found");

Reply via email to