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-2080 Exceptions in the log
Date Mon, 29 Aug 2016 03:17:30 GMT
Repository: falcon
Updated Branches:
  refs/heads/master 07427f626 -> 9655d7410


FALCON-2080 Exceptions in the log

Author: Praveen Adlakha <adlakha.praveen@gmail.com>

Reviewers: @pallavi-rao, @peeyushb

Closes #227 from PraveenAdlakha/2080 and squashes the following commits:

2ac9ead [Praveen Adlakha] comments addressed
458a669 [Praveen Adlakha] comments addressed
ed6f7fe [Praveen Adlakha] FALCON-2080 Exceptions in the log


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

Branch: refs/heads/master
Commit: 9655d74106433d35a7601ec67a07485db497cdea
Parents: 07427f6
Author: Praveen Adlakha <adlakha.praveen@gmail.com>
Authored: Mon Aug 29 08:45:03 2016 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Mon Aug 29 08:45:03 2016 +0530

----------------------------------------------------------------------
 .../falcon/service/EntitySLAMonitoringService.java   | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/9655d741/prism/src/main/java/org/apache/falcon/service/EntitySLAMonitoringService.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/service/EntitySLAMonitoringService.java
b/prism/src/main/java/org/apache/falcon/service/EntitySLAMonitoringService.java
index 6616f8b..185e087 100644
--- a/prism/src/main/java/org/apache/falcon/service/EntitySLAMonitoringService.java
+++ b/prism/src/main/java/org/apache/falcon/service/EntitySLAMonitoringService.java
@@ -28,6 +28,7 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.falcon.FalconException;
 import org.apache.falcon.Pair;
 import org.apache.falcon.entity.FeedInstanceStatus;
@@ -50,6 +51,7 @@ import org.apache.falcon.persistence.PendingInstanceBean;
 import org.apache.falcon.resource.APIResult;
 import org.apache.falcon.resource.InstancesResult;
 import org.apache.falcon.resource.SchedulableEntityInstance;
+import org.apache.falcon.security.CurrentUser;
 import org.apache.falcon.util.DateUtil;
 import org.apache.falcon.util.DeploymentUtil;
 import org.apache.falcon.util.StartupProperties;
@@ -439,10 +441,9 @@ public final class EntitySLAMonitoringService implements ConfigurationChangeList
 
     // checks whether a given feed instance is available or not
     private boolean checkEntityInstanceAvailability(String entityName, String clusterName,
Date nominalTime,
-                                                    String entityType) throws
-        FalconException {
+                                                    String entityType) throws FalconException
{
         Entity entity = EntityUtil.getEntity(entityType, entityName);
-
+        authenticateUser(entity);
         try {
             if (entityType.equals(EntityType.PROCESS.toString())){
                 LOG.debug("Checking instance availability status for entity:{}, cluster:{},
"
@@ -649,4 +650,12 @@ public final class EntitySLAMonitoringService implements ConfigurationChangeList
             }
         }
     }
+
+    private void authenticateUser(Entity entity){
+        if (StringUtils.isNotBlank(entity.getACL().getOwner())) {
+            CurrentUser.authenticate(entity.getACL().getOwner());
+        } else {
+            CurrentUser.authenticate(System.getProperty("user.name"));
+        }
+    }
 }


Mime
View raw message