falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srik...@apache.org
Subject [41/47] git commit: checkstyle related fixes for prism module.
Date Fri, 26 Apr 2013 15:50:57 GMT
checkstyle related fixes for prism module.


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

Branch: refs/heads/master
Commit: f8b9122243af317905fc60c8555f1514851f96f3
Parents: 12889e2
Author: venkatesh <venkatesh@hortonworks.com>
Authored: Tue Apr 23 13:26:07 2013 -0700
Committer: venkatesh <venkatesh@hortonworks.com>
Committed: Tue Apr 23 13:26:07 2013 -0700

----------------------------------------------------------------------
 .../java/org/apache/falcon/FalconWebException.java |    7 +-
 prism/src/main/java/org/apache/falcon/Prism.java   |   26 +++++++-
 .../falcon/listener/ContextStartupListener.java    |    5 +-
 .../falcon/plugin/ChainableMonitoringPlugin.java   |    4 +
 .../falcon/resource/AbstractEntityManager.java     |   17 +++--
 .../falcon/resource/AbstractInstanceManager.java   |    8 ++-
 .../resource/AbstractSchedulableEntityManager.java |   12 ++--
 .../falcon/resource/admin/AdminResource.java       |   11 +++-
 .../falcon/resource/channel/AbstractChannel.java   |   12 ++--
 .../apache/falcon/resource/channel/Channel.java    |    3 +
 .../falcon/resource/channel/ChannelFactory.java    |   18 ++++--
 .../falcon/resource/channel/HTTPChannel.java       |   49 ++++++---------
 .../apache/falcon/resource/channel/IPCChannel.java |   14 +++--
 .../apache/falcon/resource/channel/MethodKey.java  |   22 ++++---
 .../resource/channel/NullServletRequest.java       |    3 +
 .../resource/provider/JAXBContextResolver.java     |   11 +++-
 .../falcon/resource/proxy/BufferedRequest.java     |    5 +-
 .../resource/proxy/InstanceManagerProxy.java       |    3 +
 .../proxy/SchedulableEntityManagerProxy.java       |    5 +-
 .../apache/falcon/security/BasicAuthFilter.java    |   29 ++++-----
 .../falcon/service/FalconTopicSubscriber.java      |   30 +++------
 .../falcon/service/ProcessSubscriberService.java   |   22 +++---
 .../falcon/service/SLAMonitoringService.java       |   31 +++++-----
 .../org/apache/falcon/util/EmbeddedServer.java     |    3 +
 .../org/apache/falcon/aspect/GenericAlertTest.java |    3 +
 .../apache/falcon/aspect/LoggingAspectTest.java    |   12 ++--
 .../apache/falcon/resource/EntityManagerTest.java  |   12 ++--
 .../falcon/service/FalconTopicSubscriberTest.java  |    6 +-
 28 files changed, 219 insertions(+), 164 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/FalconWebException.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/FalconWebException.java b/prism/src/main/java/org/apache/falcon/FalconWebException.java
index c0d41ca..39340b6 100644
--- a/prism/src/main/java/org/apache/falcon/FalconWebException.java
+++ b/prism/src/main/java/org/apache/falcon/FalconWebException.java
@@ -27,6 +27,9 @@ import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+/**
+ * Exception for REST APIs.
+ */
 public class FalconWebException extends WebApplicationException {
 
     private static final Logger LOG = Logger.getLogger(FalconWebException.class);
@@ -74,8 +77,7 @@ public class FalconWebException extends WebApplicationException {
     private static String getAddnInfo(Throwable e) {
         String addnInfo = "";
         Throwable cause = e.getCause();
-        if (cause != null && cause.getMessage() != null &&
-                !getMessage(e).contains(cause.getMessage())) {
+        if (cause != null && cause.getMessage() != null && !getMessage(e).contains(cause.getMessage())) {
             addnInfo = cause.getMessage();
         }
         return addnInfo;
@@ -84,5 +86,4 @@ public class FalconWebException extends WebApplicationException {
     public FalconWebException(Response response) {
         super(response);
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/Prism.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/Prism.java b/prism/src/main/java/org/apache/falcon/Prism.java
index 9cb2cc9..4c8b43c 100644
--- a/prism/src/main/java/org/apache/falcon/Prism.java
+++ b/prism/src/main/java/org/apache/falcon/Prism.java
@@ -20,10 +20,30 @@ package org.apache.falcon;
 
 import org.apache.falcon.util.EmbeddedServer;
 
-public class Prism {
+/**
+ * Driver for running Prism as a standalone server.
+ */
+public final class Prism {
+
+    /**
+     * Default port number for embedded server.
+     */
+    private static final int PORT = 16000;
+
+    /**
+     * Prevent users from constructing this.
+     */
+    private Prism() {
+    }
 
-    public static void main(String[] args) throws Exception {
-        EmbeddedServer server = new EmbeddedServer(16000,
+    /**
+     * Main method.
+     *
+     * @param args argument array
+     * @throws Exception exception
+     */
+    public static void main(final String[] args) throws Exception {
+        EmbeddedServer server = new EmbeddedServer(PORT,
                 "prism/target/falcon-prism-0.2-SNAPSHOT");
         server.start();
     }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/listener/ContextStartupListener.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/listener/ContextStartupListener.java b/prism/src/main/java/org/apache/falcon/listener/ContextStartupListener.java
index 54a9b4a..f22d831 100644
--- a/prism/src/main/java/org/apache/falcon/listener/ContextStartupListener.java
+++ b/prism/src/main/java/org/apache/falcon/listener/ContextStartupListener.java
@@ -31,9 +31,12 @@ import javax.servlet.ServletContextListener;
 import java.util.Map;
 import java.util.Properties;
 
+/**
+ * Listener for bootstrapping Falcon Services and configuration properties.
+ */
 public class ContextStartupListener implements ServletContextListener {
 
-    private static Logger LOG = Logger.getLogger(ContextStartupListener.class);
+    private static final Logger LOG = Logger.getLogger(ContextStartupListener.class);
 
     private final ServiceInitializer startupServices = new ServiceInitializer();
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/plugin/ChainableMonitoringPlugin.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/plugin/ChainableMonitoringPlugin.java b/prism/src/main/java/org/apache/falcon/plugin/ChainableMonitoringPlugin.java
index 2b99e70..72e0302 100644
--- a/prism/src/main/java/org/apache/falcon/plugin/ChainableMonitoringPlugin.java
+++ b/prism/src/main/java/org/apache/falcon/plugin/ChainableMonitoringPlugin.java
@@ -30,6 +30,10 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+/**
+ * This class implements the chain of responsibility for configured implementations
+ * of {@link MonitoringPlugin}. {@link LoggingPlugin} is the default.
+ */
 @Aspect
 public class ChainableMonitoringPlugin extends AbstractFalconAspect implements MonitoringPlugin {
     private static final Logger LOG = Logger.getLogger(ChainableMonitoringPlugin.class);

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/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 a272957..cad0d68 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
@@ -51,6 +51,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.*;
 
+/**
+ * A base class for managing Entity operations.
+ */
 public abstract class AbstractEntityManager {
     private static final Logger LOG = Logger.getLogger(AbstractEntityManager.class);
     private static final Logger AUDIT = Logger.getLogger("AUDIT");
@@ -67,7 +70,7 @@ public abstract class AbstractEntityManager {
         }
     }
 
-    protected void checkColo(String colo) throws FalconWebException {
+    protected void checkColo(String colo) {
         if (!DeploymentUtil.getCurrentColo().equals(colo)) {
             throw FalconWebException.newException(
                     "Current colo (" + DeploymentUtil.getCurrentColo() + ") is not " + colo,
@@ -93,7 +96,7 @@ public abstract class AbstractEntityManager {
         return colos;
     }
 
-    protected Set<String> getApplicableColos(String type, String name) throws FalconWebException {
+    protected Set<String> getApplicableColos(String type, String name) {
         try {
             if (DeploymentUtil.isEmbeddedMode()) {
                 return DeploymentUtil.getDefaultColos();
@@ -109,7 +112,7 @@ public abstract class AbstractEntityManager {
         }
     }
 
-    protected Set<String> getApplicableColos(String type, Entity entity) throws FalconWebException {
+    protected Set<String> getApplicableColos(String type, Entity entity) {
         try {
             if (DeploymentUtil.isEmbeddedMode()) {
                 return DeploymentUtil.getDefaultColos();
@@ -295,7 +298,7 @@ public abstract class AbstractEntityManager {
     }
 
     protected synchronized Entity submitInternal(HttpServletRequest request, String type)
-            throws IOException, FalconException {
+        throws IOException, FalconException {
 
         EntityType entityType = EntityType.valueOf(type.toUpperCase());
         Entity entity = deserializeEntity(request, entityType);
@@ -318,7 +321,7 @@ public abstract class AbstractEntityManager {
     }
 
     protected Entity deserializeEntity(HttpServletRequest request, EntityType entityType)
-            throws IOException, FalconException {
+        throws IOException, FalconException {
 
         EntityParser<?> entityParser = EntityParserFactory.getParser(entityType);
         InputStream xmlStream = request.getInputStream();
@@ -334,6 +337,7 @@ public abstract class AbstractEntityManager {
                     String xmlData = getAsString(xmlStream);
                     LOG.debug("XML DUMP for (" + entityType + "): " + xmlData, e);
                 } catch (IOException ignore) {
+                    // ignore
                 }
             }
             throw e;
@@ -449,7 +453,7 @@ public abstract class AbstractEntityManager {
     }
 
     /**
-     * Returns the entity definition as an XML based on name
+     * Returns the entity definition as an XML based on name.
      *
      * @param type
      * @param entityName
@@ -473,5 +477,4 @@ public abstract class AbstractEntityManager {
     protected AbstractWorkflowEngine getWorkflowEngine() {
         return this.workflowEngine;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java b/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
index 8097c43..d94e8c5 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
@@ -40,6 +40,9 @@ import java.util.Date;
 import java.util.Properties;
 import java.util.Set;
 
+/**
+ * A base class for managing Entity's Instance operations.
+ */
 public abstract class AbstractInstanceManager extends AbstractEntityManager {
     private static final Logger LOG = Logger.getLogger(AbstractInstanceManager.class);
 
@@ -232,8 +235,7 @@ public abstract class AbstractInstanceManager extends AbstractEntityManager {
         validateDateRange(entityObject, startStr, endStr);
     }
 
-    private void validateDateRange(Entity entity, String start, String end)
-            throws FalconException {
+    private void validateDateRange(Entity entity, String start, String end) throws FalconException {
         Set<String> clusters = EntityUtil.getClustersDefined(entity);
         Pair<Date, String> clusterMinStartDate = null;
         Pair<Date, String> clusterMaxEndDate = null;
@@ -253,7 +255,7 @@ public abstract class AbstractInstanceManager extends AbstractEntityManager {
 
     private void validateDateRangeFor(Entity entity, Pair<Date, String> clusterMinStart,
                                       Pair<Date, String> clusterMaxEnd, String start, String end)
-            throws FalconException {
+        throws FalconException {
 
         Date instStart = EntityUtil.parseDateUTC(start);
         if (instStart.before(clusterMinStart.first)) {

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/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 9a41d33..cc4446c 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractSchedulableEntityManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractSchedulableEntityManager.java
@@ -33,15 +33,15 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 
 /**
- * REST resource of allowed actions on Schedulable Entities Only Process and
- * Feed can have schedulable actions
+ * REST resource of allowed actions on Schedulable Entities, Only Process and
+ * Feed can have schedulable actions.
  */
 public abstract class AbstractSchedulableEntityManager extends AbstractEntityManager {
 
     private static final Logger LOG = Logger.getLogger(AbstractSchedulableEntityManager.class);
 
     /**
-     * Schedules an submitted entity immediately
+     * Schedules an submitted entity immediately.
      *
      * @param type
      * @param entity
@@ -69,7 +69,7 @@ public abstract class AbstractSchedulableEntityManager extends AbstractEntityMan
     }
 
     /**
-     * Submits a new entity and schedules it immediately
+     * Submits a new entity and schedules it immediately.
      *
      * @param type
      * @return
@@ -92,7 +92,7 @@ public abstract class AbstractSchedulableEntityManager extends AbstractEntityMan
     }
 
     /**
-     * Suspends a running entity
+     * Suspends a running entity.
      *
      * @param type
      * @param entity
@@ -120,7 +120,7 @@ public abstract class AbstractSchedulableEntityManager extends AbstractEntityMan
     }
 
     /**
-     * Resumes a suspended entity
+     * Resumes a suspended entity.
      *
      * @param type
      * @param entity

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/admin/AdminResource.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/admin/AdminResource.java b/prism/src/main/java/org/apache/falcon/resource/admin/AdminResource.java
index 93db427..de14547 100644
--- a/prism/src/main/java/org/apache/falcon/resource/admin/AdminResource.java
+++ b/prism/src/main/java/org/apache/falcon/resource/admin/AdminResource.java
@@ -36,6 +36,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
+/**
+ * Jersey Resource for admin operations.
+ */
 @Path("admin")
 public class AdminResource {
 
@@ -68,8 +71,8 @@ public class AdminResource {
     @Produces(MediaType.TEXT_PLAIN)
     public String getVersion() {
         if (version == null) {
-            version = "{Version:\"" + BuildProperties.get().getProperty("build.version") +
-                    "\",Mode:\"" + DeploymentProperties.get().getProperty("deploy.mode") + "\"}";
+            version = "{Version:\"" + BuildProperties.get().getProperty("build.version")
+                    + "\",Mode:\"" + DeploymentProperties.get().getProperty("deploy.mode") + "\"}";
         }
         return version;
     }
@@ -105,16 +108,20 @@ public class AdminResource {
         return propertyList;
     }
 
+    //SUSPEND CHECKSTYLE CHECK VisibilityModifierCheck
     @XmlRootElement(name = "property")
     @XmlAccessorType(XmlAccessType.FIELD)
     private static class Property {
         public String key;
         public String value;
     }
+    //RESUME CHECKSTYLE CHECK VisibilityModifierCheck
 
+    //SUSPEND CHECKSTYLE CHECK VisibilityModifierCheck
     @XmlRootElement(name = "properties")
     @XmlAccessorType(XmlAccessType.FIELD)
     private static class PropertyList {
         public List<Property> properties;
     }
+    //RESUME CHECKSTYLE CHECK VisibilityModifierCheck
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/channel/AbstractChannel.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/channel/AbstractChannel.java b/prism/src/main/java/org/apache/falcon/resource/channel/AbstractChannel.java
index 7b15b96..d9ed6af 100644
--- a/prism/src/main/java/org/apache/falcon/resource/channel/AbstractChannel.java
+++ b/prism/src/main/java/org/apache/falcon/resource/channel/AbstractChannel.java
@@ -23,13 +23,15 @@ import org.apache.falcon.FalconException;
 import java.lang.reflect.Method;
 import java.util.concurrent.ConcurrentHashMap;
 
+/**
+ * A base class for Channel.
+ */
 public abstract class AbstractChannel implements Channel {
 
-    private final ConcurrentHashMap<MethodKey, Method> methods
-            = new ConcurrentHashMap<MethodKey, Method>();
+    private final ConcurrentHashMap<MethodKey, Method> methods = new ConcurrentHashMap<MethodKey, Method>();
 
     protected Method getMethod(Class service, String methodName, Object... args)
-            throws FalconException {
+        throws FalconException {
         MethodKey methodKey = new MethodKey(methodName, args);
         Method method = methods.get(methodKey);
         if (method == null) {
@@ -41,8 +43,8 @@ public abstract class AbstractChannel implements Channel {
                     return item;
                 }
             }
-            throw new FalconException("Lookup for " + methodKey +
-                    " in service " + service.getName() + " found no match");
+            throw new FalconException("Lookup for " + methodKey
+                    + " in service " + service.getName() + " found no match");
         }
         return method;
     }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/channel/Channel.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/channel/Channel.java b/prism/src/main/java/org/apache/falcon/resource/channel/Channel.java
index cafbd88..9dff680 100644
--- a/prism/src/main/java/org/apache/falcon/resource/channel/Channel.java
+++ b/prism/src/main/java/org/apache/falcon/resource/channel/Channel.java
@@ -20,6 +20,9 @@ package org.apache.falcon.resource.channel;
 
 import org.apache.falcon.FalconException;
 
+/**
+ * Interface for a Channel.
+ */
 public interface Channel {
 
     void init(String colo, String serviceName) throws FalconException;

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/channel/ChannelFactory.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/channel/ChannelFactory.java b/prism/src/main/java/org/apache/falcon/resource/channel/ChannelFactory.java
index 24e0b1e..06e234e 100644
--- a/prism/src/main/java/org/apache/falcon/resource/channel/ChannelFactory.java
+++ b/prism/src/main/java/org/apache/falcon/resource/channel/ChannelFactory.java
@@ -24,21 +24,28 @@ import org.apache.falcon.util.DeploymentProperties;
 import java.util.HashMap;
 import java.util.Map;
 
-public class ChannelFactory {
+/**
+ * A factory implementation for doling out {@link Channel} objects.
+ */
+public final class ChannelFactory {
 
     private static Map<String, Channel> channels = new HashMap<String, Channel>();
 
     private static final String EMBEDDED = "embedded";
     private static final String MODE = "deploy.mode";
 
-    public synchronized static Channel get(String serviceName, String colo)
-            throws FalconException {
-        Channel channel;
-        if ((channel = channels.get(colo + "/" + serviceName)) == null) {
+    private ChannelFactory() {
+    }
+
+    public static synchronized Channel get(String serviceName, String colo)
+        throws FalconException {
+        Channel channel = channels.get(colo + "/" + serviceName);
+        if (channel == null) {
             channel = getChannel(DeploymentProperties.get().getProperty(MODE));
             channel.init(colo, serviceName);
             channels.put(colo + "/" + serviceName, channel);
         }
+
         return channel;
     }
 
@@ -49,6 +56,7 @@ public class ChannelFactory {
         } else {
             channel = new HTTPChannel();
         }
+
         return channel;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/channel/HTTPChannel.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/channel/HTTPChannel.java b/prism/src/main/java/org/apache/falcon/resource/channel/HTTPChannel.java
index 9873a96..2ba76a7 100644
--- a/prism/src/main/java/org/apache/falcon/resource/channel/HTTPChannel.java
+++ b/prism/src/main/java/org/apache/falcon/resource/channel/HTTPChannel.java
@@ -38,42 +38,38 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.util.Properties;
 
+/**
+ * A Channel implementation for HTTP.
+ */
 public class HTTPChannel extends AbstractChannel {
     private static final Logger LOG = Logger.getLogger(HTTPChannel.class);
 
     private static final String REMOTE_USER = "Remote-User";
 
-    private static final HttpServletRequest DEFAULT_NULL_REQUEST =
-            new NullServletRequest();
+    private static final HttpServletRequest DEFAULT_NULL_REQUEST = new NullServletRequest();
 
-    private static final Properties deploymentProperties = DeploymentProperties.get();
+    private static final Properties DEPLOYMENT_PROPERTIES = DeploymentProperties.get();
 
     private Class service;
     private String urlPrefix;
 
     public void init(String colo, String serviceName) throws FalconException {
-        String prefixPath = deploymentProperties.
-                getProperty(serviceName + ".path");
-        String falconEndPoint = RuntimeProperties.get().
-                getProperty("falcon." + colo + ".endpoint");
+        String prefixPath = DEPLOYMENT_PROPERTIES.getProperty(serviceName + ".path");
+        String falconEndPoint = RuntimeProperties.get().getProperty("falcon." + colo + ".endpoint");
         urlPrefix = falconEndPoint + "/" + prefixPath;
 
         try {
-            String proxyClassName = deploymentProperties.
-                    getProperty(serviceName + ".proxy");
+            String proxyClassName = DEPLOYMENT_PROPERTIES.getProperty(serviceName + ".proxy");
             service = Class.forName(proxyClassName);
             LOG.info("Service: " + serviceName + ", url = " + urlPrefix);
         } catch (Exception e) {
-            throw new FalconException("Unable to initialize channel for "
-                    + serviceName, e);
+            throw new FalconException("Unable to initialize channel for " + serviceName, e);
         }
     }
 
     @SuppressWarnings("unchecked")
     @Override
-    public <T> T invoke(String methodName, Object... args)
-            throws FalconException {
-
+    public <T> T invoke(String methodName, Object... args) throws FalconException {
         try {
             Method method = getMethod(service, methodName, args);
             String url = urlPrefix + "/" + pathValue(method, args);
@@ -96,8 +92,8 @@ public class HTTPChannel extends AbstractChannel {
             Family status = response.getClientResponseStatus().getFamily();
             if (status == Family.INFORMATIONAL || status == Family.SUCCESSFUL) {
                 return (T) response.getEntity(method.getReturnType());
-            } else if (response.getClientResponseStatus().getStatusCode() ==
-                    Response.Status.BAD_REQUEST.getStatusCode()) {
+            } else if (response.getClientResponseStatus().getStatusCode()
+                    == Response.Status.BAD_REQUEST.getStatusCode()) {
                 LOG.error("Request failed: " + response.getClientResponseStatus().getStatusCode());
                 return (T) response.getEntity(method.getReturnType());
             } else {
@@ -111,14 +107,10 @@ public class HTTPChannel extends AbstractChannel {
     }
 
     private boolean isPost(String httpMethod) {
-        if (httpMethod.equals("POST") || httpMethod.equals("PUT")) {
-            return true;
-        }
-        return false;
+        return httpMethod.equals("POST") || httpMethod.equals("PUT");
     }
 
-    private String pathValue(Method method, Object... args)
-            throws FalconException {
+    private String pathValue(Method method, Object... args) throws FalconException {
 
         Path pathParam = method.getAnnotation(Path.class);
         if (pathParam == null) {
@@ -139,8 +131,8 @@ public class HTTPChannel extends AbstractChannel {
                         queryString.append(getAnnotationValue(paramAnnotation, "value")).
                                 append('=').append(arg).append("&");
                     } else if (annotationClass.equals(PathParam.class.getName())) {
-                        pathValue = pathValue.replace("{" +
-                                getAnnotationValue(paramAnnotation, "value") + "}", arg);
+                        pathValue = pathValue.replace("{"
+                                + getAnnotationValue(paramAnnotation, "value") + "}", arg);
                     }
                 }
             }
@@ -149,15 +141,13 @@ public class HTTPChannel extends AbstractChannel {
     }
 
     private String getAnnotationValue(Annotation paramAnnotation,
-                                      String annotationAttribute)
-            throws FalconException {
-
+                                      String annotationAttribute) throws FalconException {
         try {
             return String.valueOf(paramAnnotation.annotationType().
                     getMethod(annotationAttribute).invoke(paramAnnotation));
         } catch (Exception e) {
-            throw new FalconException("Unable to get attribute value for " +
-                    paramAnnotation + "[" + annotationAttribute + "]");
+            throw new FalconException("Unable to get attribute value for "
+                    + paramAnnotation + "[" + annotationAttribute + "]");
         }
     }
 
@@ -204,5 +194,4 @@ public class HTTPChannel extends AbstractChannel {
         }
         return produces.value()[0];
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/channel/IPCChannel.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/channel/IPCChannel.java b/prism/src/main/java/org/apache/falcon/resource/channel/IPCChannel.java
index b4d88f9..bbdaf40 100644
--- a/prism/src/main/java/org/apache/falcon/resource/channel/IPCChannel.java
+++ b/prism/src/main/java/org/apache/falcon/resource/channel/IPCChannel.java
@@ -27,6 +27,9 @@ import org.apache.log4j.Logger;
 
 import java.lang.reflect.Method;
 
+/**
+ * Inter-process implementation of a Channel.
+ */
 public class IPCChannel extends AbstractChannel {
     private static final Logger LOG = Logger.getLogger(IPCChannel.class);
     private AbstractEntityManager service;
@@ -37,11 +40,10 @@ public class IPCChannel extends AbstractChannel {
 
     @SuppressWarnings("unchecked")
     @Override
-    public <T> T invoke(String methodName, Object... args)
-            throws FalconException {
-        LOG.debug("Invoking method " + methodName + " on service " +
-                service.getClass().getName());
+    public <T> T invoke(String methodName, Object... args) throws FalconException {
+        LOG.debug("Invoking method " + methodName + " on service " + service.getClass().getName());
         Method method = getMethod(service.getClass(), methodName, args);
+
         try {
             return (T) method.invoke(service, args);
         } catch (Exception e) {
@@ -57,8 +59,8 @@ public class IPCChannel extends AbstractChannel {
                     throw (FalconException) cause;
                 }
             }
-            throw new FalconException("Unable to invoke on the channel " + methodName +
-                    " on service : " + service.getClass().getName() + cause);
+            throw new FalconException("Unable to invoke on the channel " + methodName
+                    + " on service : " + service.getClass().getName() + cause);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/channel/MethodKey.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/channel/MethodKey.java b/prism/src/main/java/org/apache/falcon/resource/channel/MethodKey.java
index e4fddc2..446bcc6 100644
--- a/prism/src/main/java/org/apache/falcon/resource/channel/MethodKey.java
+++ b/prism/src/main/java/org/apache/falcon/resource/channel/MethodKey.java
@@ -20,6 +20,9 @@ package org.apache.falcon.resource.channel;
 
 import java.util.Arrays;
 
+/**
+ * This class represents a tuple of method name and class objects.
+ */
 public class MethodKey {
 
     private final String name;
@@ -45,24 +48,25 @@ public class MethodKey {
         if (this == methodRHS) {
             return true;
         }
-        if (methodRHS == null ||
-                getClass() != methodRHS.getClass()) {
+
+        if (methodRHS == null || getClass() != methodRHS.getClass()) {
             return false;
         }
 
         MethodKey methodKey = (MethodKey) methodRHS;
 
-        if (name != null ? !name.equals(methodKey.name) :
-                methodKey.name != null) {
+        if (name != null ? !name.equals(methodKey.name) : methodKey.name != null) {
             return false;
         }
+
         boolean matching = true;
         for (int index = 0; index < argClasses.length; index++) {
-            if (argClasses[index] != null && methodKey.argClasses[index] != null &&
-                    !methodKey.argClasses[index].isAssignableFrom(argClasses[index])) {
+            if (argClasses[index] != null && methodKey.argClasses[index] != null
+                    && !methodKey.argClasses[index].isAssignableFrom(argClasses[index])) {
                 matching = false;
             }
         }
+
         return matching;
     }
 
@@ -75,9 +79,7 @@ public class MethodKey {
 
     @Override
     public String toString() {
-        return "MethodKey{" +
-                "name='" + name + '\'' +
-                ", argClasses=" + (argClasses == null ? null : Arrays.asList(argClasses)) +
-                '}';
+        return "MethodKey{name='" + name + '\'' + ", argClasses="
+                + (argClasses == null ? null : Arrays.asList(argClasses)) + '}';
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/channel/NullServletRequest.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/channel/NullServletRequest.java b/prism/src/main/java/org/apache/falcon/resource/channel/NullServletRequest.java
index 8586644..d90926d 100644
--- a/prism/src/main/java/org/apache/falcon/resource/channel/NullServletRequest.java
+++ b/prism/src/main/java/org/apache/falcon/resource/channel/NullServletRequest.java
@@ -31,6 +31,9 @@ import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
+/**
+ * A null implementation of a ServletRequest.
+ */
 public class NullServletRequest implements HttpServletRequest {
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java b/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
index 11d0882..a58eade 100644
--- a/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
+++ b/prism/src/main/java/org/apache/falcon/resource/provider/JAXBContextResolver.java
@@ -30,12 +30,19 @@ import javax.ws.rs.ext.Provider;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 
+/**
+ * An implementation of Context Resolver for JAXB.
+ */
 @Provider
 @Produces(MediaType.APPLICATION_JSON)
 public class JAXBContextResolver implements ContextResolver<JAXBContext> {
+
     private static JAXBContext context;
-    private static Class<?>[] types = {InstancesResult.class, APIResult.class, InstancesResult.Instance.class,
-                                       InstancesResult.WorkflowStatus.class};
+    private static Class<?>[] types = {
+        InstancesResult.class,
+        APIResult.class,
+        InstancesResult.Instance.class,
+        InstancesResult.WorkflowStatus.class, };
 
     static {
         try {

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/proxy/BufferedRequest.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/BufferedRequest.java b/prism/src/main/java/org/apache/falcon/resource/proxy/BufferedRequest.java
index e797fb6..c667114 100644
--- a/prism/src/main/java/org/apache/falcon/resource/proxy/BufferedRequest.java
+++ b/prism/src/main/java/org/apache/falcon/resource/proxy/BufferedRequest.java
@@ -33,6 +33,9 @@ import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
+/**
+ * A buffered implementation of HttpServletRequest.
+ */
 public class BufferedRequest implements HttpServletRequest {
 
     private final HttpServletRequest request;
@@ -47,7 +50,7 @@ public class BufferedRequest implements HttpServletRequest {
                 }
             };
 
-    public BufferedRequest(HttpServletRequest request) throws FalconWebException {
+    public BufferedRequest(HttpServletRequest request) {
         try {
             this.request = request;
             ByteArrayOutputStream copyBuffer = streams.get();

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java b/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
index c637984..dfc02a1 100644
--- a/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
+++ b/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
@@ -37,6 +37,9 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.util.*;
 
+/**
+ * A proxy implementation of the entity instance operations.
+ */
 @Path("instance")
 public class InstanceManagerProxy extends AbstractInstanceManager {
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java b/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
index aa1ef6d..986291e 100644
--- a/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
+++ b/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
@@ -45,6 +45,9 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
+/**
+ * A proxy implementation of the schedulable entity operations.
+ */
 @Path("entities")
 public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityManager {
     private static final String PRISM_TAG = "prism";
@@ -252,7 +255,7 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana
     @Override
     public APIResult getStatus(@Dimension("entityType") @PathParam("type") final String type,
                                @Dimension("entityName") @PathParam("entity") final String entity,
-                               @Dimension("colo") @QueryParam("colo") final String coloExpr) throws FalconWebException {
+                               @Dimension("colo") @QueryParam("colo") final String coloExpr) {
         return new EntityProxy(type, entity) {
             @Override
             protected Set<String> getColosToApply() {

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/security/BasicAuthFilter.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/security/BasicAuthFilter.java b/prism/src/main/java/org/apache/falcon/security/BasicAuthFilter.java
index e3aedb1..f172e82 100644
--- a/prism/src/main/java/org/apache/falcon/security/BasicAuthFilter.java
+++ b/prism/src/main/java/org/apache/falcon/security/BasicAuthFilter.java
@@ -32,6 +32,9 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.UUID;
 
+/**
+ * This enforces authentication as part of the filter before processing the request.
+ */
 public class BasicAuthFilter implements Filter {
 
     private static final Logger LOG = Logger.getLogger(BasicAuthFilter.class);
@@ -41,27 +44,20 @@ public class BasicAuthFilter implements Filter {
     private static final Set<String> BLACK_LISTED_USER = new HashSet<String>(
             Arrays.asList(new String[]{"hdfs", "mapred", "oozie", "falcon"}));
 
-    private boolean secure;
-
-    private String colo;
+    private boolean isSecure;
 
     @Override
-    public void init(FilterConfig filterConfig)
-            throws ServletException {
-        String secure = StartupProperties.get().getProperty("security.enabled",
-                "true");
-        colo = StartupProperties.get().getProperty("current.colo", "default");
-        this.secure = Boolean.parseBoolean(secure);
+    public void init(FilterConfig filterConfig) throws ServletException {
+        String secure = StartupProperties.get().getProperty("security.enabled", "true");
+        this.isSecure = Boolean.parseBoolean(secure);
     }
 
     @Override
     public void doFilter(ServletRequest request,
                          ServletResponse response,
-                         FilterChain chain)
-            throws IOException, ServletException {
+                         FilterChain chain) throws IOException, ServletException {
 
-        if (!(request instanceof HttpServletRequest) ||
-                !(response instanceof HttpServletResponse)) {
+        if (!(request instanceof HttpServletRequest) || !(response instanceof HttpServletResponse)) {
             throw new IllegalStateException("Invalid request/response object");
         }
         HttpServletRequest httpRequest = (HttpServletRequest) request;
@@ -70,7 +66,7 @@ public class BasicAuthFilter implements Filter {
         String user;
         String requestId = UUID.randomUUID().toString();
 
-        if (!secure) {
+        if (!isSecure) {
             user = GUEST;
         } else {
             user = httpRequest.getHeader("Remote-User");
@@ -87,9 +83,8 @@ public class BasicAuthFilter implements Filter {
             try {
                 NDC.push(user + ":" + httpRequest.getMethod() + "/" + httpRequest.getPathInfo());
                 NDC.push(requestId);
-                LOG.info("Request from user: " + user + ", path=" +
-                        httpRequest.getPathInfo() + ", query=" +
-                        httpRequest.getQueryString());
+                LOG.info("Request from user: " + user + ", path=" + httpRequest.getPathInfo()
+                        + ", query=" + httpRequest.getQueryString());
                 chain.doFilter(request, response);
             } finally {
                 NDC.pop();

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/service/FalconTopicSubscriber.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/service/FalconTopicSubscriber.java b/prism/src/main/java/org/apache/falcon/service/FalconTopicSubscriber.java
index 4e48488..e20f091 100644
--- a/prism/src/main/java/org/apache/falcon/service/FalconTopicSubscriber.java
+++ b/prism/src/main/java/org/apache/falcon/service/FalconTopicSubscriber.java
@@ -34,9 +34,11 @@ import javax.jms.*;
 import java.lang.reflect.InvocationTargetException;
 import java.util.Date;
 
+/**
+ * Subscribes to the falcon topic for handling retries and alerts.
+ */
 public class FalconTopicSubscriber implements MessageListener, ExceptionListener {
-    private static final Logger LOG = Logger
-            .getLogger(FalconTopicSubscriber.class);
+    private static final Logger LOG = Logger.getLogger(FalconTopicSubscriber.class);
 
     private TopicSubscriber subscriber;
     private String implementation;
@@ -46,10 +48,8 @@ public class FalconTopicSubscriber implements MessageListener, ExceptionListener
     private String topicName;
     private Connection connection;
 
-    private AbstractRerunHandler retryHandler = RerunHandlerFactory
-            .getRerunHandler(RerunType.RETRY);
-    private AbstractRerunHandler latedataHandler = RerunHandlerFactory
-            .getRerunHandler(RerunType.LATE);
+    private AbstractRerunHandler retryHandler = RerunHandlerFactory.getRerunHandler(RerunType.RETRY);
+    private AbstractRerunHandler latedataHandler = RerunHandlerFactory.getRerunHandler(RerunType.LATE);
 
     public FalconTopicSubscriber(String implementation, String userName,
                                  String password, String url, String topicName) {
@@ -140,7 +140,7 @@ public class FalconTopicSubscriber implements MessageListener, ExceptionListener
     }
 
     private SLAMonitoringService getSLAMonitoringService() {
-        return (SLAMonitoringService) Services.get().getService(SLAMonitoringService.SERVICE_NAME);
+        return Services.get().getService(SLAMonitoringService.SERVICE_NAME);
     }
 
     private void debug(MapMessage mapMessage) throws JMSException {
@@ -159,9 +159,7 @@ public class FalconTopicSubscriber implements MessageListener, ExceptionListener
 
     @Override
     public void onException(JMSException ignore) {
-        LOG.info(
-                "Error in onException for subscriber of topic: "
-                        + this.toString(), ignore);
+        LOG.info("Error in onException for subscriber of topic: " + this.toString(), ignore);
     }
 
     public void closeSubscriber() throws FalconException {
@@ -177,14 +175,9 @@ public class FalconTopicSubscriber implements MessageListener, ExceptionListener
     }
 
     private static Connection createAndGetConnection(String implementation,
-                                                     String userName, String password, String url) throws JMSException,
-                                                                                                          ClassNotFoundException,
-                                                                                                          IllegalArgumentException,
-                                                                                                          SecurityException,
-                                                                                                          InstantiationException,
-                                                                                                          IllegalAccessException,
-                                                                                                          InvocationTargetException,
-                                                                                                          NoSuchMethodException {
+                                                     String userName, String password, String url)
+        throws JMSException, ClassNotFoundException, InstantiationException,
+            IllegalAccessException, InvocationTargetException, NoSuchMethodException {
 
         @SuppressWarnings("unchecked")
         Class<ConnectionFactory> clazz = (Class<ConnectionFactory>) FalconTopicSubscriber.class
@@ -201,5 +194,4 @@ public class FalconTopicSubscriber implements MessageListener, ExceptionListener
     public String toString() {
         return topicName;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/service/ProcessSubscriberService.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/service/ProcessSubscriberService.java b/prism/src/main/java/org/apache/falcon/service/ProcessSubscriberService.java
index 9d5e78f..63f5a3c 100644
--- a/prism/src/main/java/org/apache/falcon/service/ProcessSubscriberService.java
+++ b/prism/src/main/java/org/apache/falcon/service/ProcessSubscriberService.java
@@ -20,11 +20,14 @@ package org.apache.falcon.service;
 import org.apache.falcon.FalconException;
 import org.apache.falcon.util.StartupProperties;
 
+/**
+ * An Ivory Service that initializes and starts a topic subscriber.
+ */
 public class ProcessSubscriberService implements FalconService {
 
     private FalconTopicSubscriber subscriber;
 
-    private static enum JMSprops {
+    private static enum JMSProps {
         FalconBrokerImplClass("broker.impl.class", "org.apache.activemq.ActiveMQConnectionFactory"),
         FalconBrokerUrl("broker.url", "tcp://localhost:61616?daemon=true"),
         FalconEntityTopic("entity.topic", "FALCON.ENTITY.TOPIC");
@@ -32,11 +35,10 @@ public class ProcessSubscriberService implements FalconService {
         private String propName;
         private String defaultPropValue;
 
-        private JMSprops(String propName, String defaultPropValue) {
+        private JMSProps(String propName, String defaultPropValue) {
             this.propName = propName;
             this.defaultPropValue = defaultPropValue;
         }
-
     }
 
     @Override
@@ -46,18 +48,16 @@ public class ProcessSubscriberService implements FalconService {
 
     @Override
     public void init() throws FalconException {
-        String falconBrokerImplClass = getPropertyValue(JMSprops.FalconBrokerImplClass);
-        String falconBrokerUrl = getPropertyValue(JMSprops.FalconBrokerUrl);
-        String falconEntityTopic = getPropertyValue(JMSprops.FalconEntityTopic);
+        String falconBrokerImplClass = getPropertyValue(JMSProps.FalconBrokerImplClass);
+        String falconBrokerUrl = getPropertyValue(JMSProps.FalconBrokerUrl);
+        String falconEntityTopic = getPropertyValue(JMSProps.FalconEntityTopic);
 
-        subscriber = new FalconTopicSubscriber(falconBrokerImplClass, "", "",
-                falconBrokerUrl, falconEntityTopic);
+        subscriber = new FalconTopicSubscriber(falconBrokerImplClass, "", "", falconBrokerUrl, falconEntityTopic);
         subscriber.startSubscriber();
     }
 
-    private String getPropertyValue(JMSprops prop) {
-        return StartupProperties.get().getProperty(prop.propName,
-                prop.defaultPropValue);
+    private String getPropertyValue(JMSProps prop) {
+        return StartupProperties.get().getProperty(prop.propName, prop.defaultPropValue);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/service/SLAMonitoringService.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/service/SLAMonitoringService.java b/prism/src/main/java/org/apache/falcon/service/SLAMonitoringService.java
index da7887e..947edd8 100644
--- a/prism/src/main/java/org/apache/falcon/service/SLAMonitoringService.java
+++ b/prism/src/main/java/org/apache/falcon/service/SLAMonitoringService.java
@@ -35,15 +35,17 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import java.util.regex.Pattern;
 
+/**
+ * A service implementation for SLA Monitoring.
+ */
 public class SLAMonitoringService implements FalconService, WorkflowEngineActionListener {
     private static final Logger LOG = Logger.getLogger(SLAMonitoringService.class);
     public static final String SERVICE_NAME = "SLAMonitor";
 
-    private ConcurrentMap<String, Long> monitoredEntities =
-            new ConcurrentHashMap<String, Long>();
+    private ConcurrentMap<String, Long> monitoredEntities = new ConcurrentHashMap<String, Long>();
 
-    private ConcurrentMap<String, ConcurrentMap<Date, Date>> pendingJobs =
-            new ConcurrentHashMap<String, ConcurrentMap<Date, Date>>();
+    private ConcurrentMap<String, ConcurrentMap<Date, Date>> pendingJobs
+        = new ConcurrentHashMap<String, ConcurrentMap<Date, Date>>();
 
     private static final long INITIAL_LATENCY_SECS = 12 * 3600;
 
@@ -118,8 +120,8 @@ public class SLAMonitoringService implements FalconService, WorkflowEngineAction
     private void removeFromPendingList(Entity entity, String cluster, Date nominalTime) {
         ConcurrentMap<Date, Date> pendingInstances = pendingJobs.get(getKey(entity, cluster));
         if (pendingInstances != null) {
-            LOG.debug("Removing from pending jobs: " + getKey(entity, cluster) + " ---> " +
-                    SchemaHelper.formatDateUTC(nominalTime));
+            LOG.debug("Removing from pending jobs: " + getKey(entity, cluster) + " ---> "
+                    + SchemaHelper.formatDateUTC(nominalTime));
             pendingInstances.remove(nominalTime);
         }
     }
@@ -155,8 +157,8 @@ public class SLAMonitoringService implements FalconService, WorkflowEngineAction
                         String cluster = getCluster(key);
                         GenericAlert.alertOnLikelySLAMiss(cluster, entity.getEntityType().name(),
                                 entity.getName(), SchemaHelper.formatDateUTC(entry.getKey()));
-                        LOG.debug("Removing from pending jobs: " + key + " ---> " +
-                                SchemaHelper.formatDateUTC(entry.getKey()));
+                        LOG.debug("Removing from pending jobs: " + key + " ---> "
+                                + SchemaHelper.formatDateUTC(entry.getKey()));
                         pendingInstances.remove(entry.getKey());
                     }
                 }
@@ -191,10 +193,9 @@ public class SLAMonitoringService implements FalconService, WorkflowEngineAction
                     if (latency == null) {
                         break;
                     }
-                    pendingInstances.putIfAbsent(nextStart, new Date(nextStart.getTime() +
-                            latency * 1500));  //1.5 times latency is when it is supposed to have breached
-                    LOG.debug("Adding to pending jobs: " + key + " ---> " +
-                            SchemaHelper.formatDateUTC(nextStart));
+                    // 1.5 times latency is when it is supposed to have breached
+                    pendingInstances.putIfAbsent(nextStart, new Date(nextStart.getTime() + latency * 1500));
+                    LOG.debug("Adding to pending jobs: " + key + " ---> " + SchemaHelper.formatDateUTC(nextStart));
                     Calendar startCal = Calendar.getInstance(timeZone);
                     startCal.setTime(nextStart);
                     startCal.add(frequency.getTimeUnit().getCalendarUnit(), frequency.getFrequency());
@@ -204,17 +205,17 @@ public class SLAMonitoringService implements FalconService, WorkflowEngineAction
         }
     }
 
-    private static final Pattern regex = Pattern.compile("[()\\s/]");
+    private static final Pattern PATTERN = Pattern.compile("[()\\s/]");
 
     private Entity getEntity(String key) throws FalconException {
-        String[] parts = regex.split(key);
+        String[] parts = PATTERN.split(key);
         String name = parts[3];
         String type = parts[1];
         return EntityUtil.getEntity(type, name);
     }
 
     private String getCluster(String key) throws FalconException {
-        String[] parts = regex.split(key);
+        String[] parts = PATTERN.split(key);
         return parts[4];
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/main/java/org/apache/falcon/util/EmbeddedServer.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/util/EmbeddedServer.java b/prism/src/main/java/org/apache/falcon/util/EmbeddedServer.java
index 6baeb13..80c6d80 100644
--- a/prism/src/main/java/org/apache/falcon/util/EmbeddedServer.java
+++ b/prism/src/main/java/org/apache/falcon/util/EmbeddedServer.java
@@ -24,6 +24,9 @@ import org.mortbay.jetty.Server;
 import org.mortbay.jetty.bio.SocketConnector;
 import org.mortbay.jetty.webapp.WebAppContext;
 
+/**
+ * This class embeds a Jetty server and a connector.
+ */
 public class EmbeddedServer {
     private Server server = new Server();
     private Connector connector = new SocketConnector();

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/test/java/org/apache/falcon/aspect/GenericAlertTest.java
----------------------------------------------------------------------
diff --git a/prism/src/test/java/org/apache/falcon/aspect/GenericAlertTest.java b/prism/src/test/java/org/apache/falcon/aspect/GenericAlertTest.java
index 979c349..1db71fd 100644
--- a/prism/src/test/java/org/apache/falcon/aspect/GenericAlertTest.java
+++ b/prism/src/test/java/org/apache/falcon/aspect/GenericAlertTest.java
@@ -20,6 +20,9 @@ package org.apache.falcon.aspect;
 import org.aspectj.lang.annotation.Aspect;
 import org.testng.annotations.Test;
 
+/**
+ * Test class for Alerts.
+ */
 @Aspect
 public class GenericAlertTest {
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/test/java/org/apache/falcon/aspect/LoggingAspectTest.java
----------------------------------------------------------------------
diff --git a/prism/src/test/java/org/apache/falcon/aspect/LoggingAspectTest.java b/prism/src/test/java/org/apache/falcon/aspect/LoggingAspectTest.java
index 2e04904..3b5bd87 100644
--- a/prism/src/test/java/org/apache/falcon/aspect/LoggingAspectTest.java
+++ b/prism/src/test/java/org/apache/falcon/aspect/LoggingAspectTest.java
@@ -20,25 +20,24 @@ package org.apache.falcon.aspect;
 
 import junit.framework.Assert;
 import org.apache.falcon.FalconWebException;
-import org.apache.falcon.resource.APIResult;
 import org.apache.falcon.resource.AbstractEntityManager;
 import org.testng.annotations.Test;
 
 import java.util.ArrayList;
 import java.util.List;
 
+/**
+ * Test class for LoggingAspect.
+ */
 public class LoggingAspectTest {
 
-
-    private AbstractEntityManager em = new AbstractEntityManager() {
-    };
+    private AbstractEntityManager em = new AbstractEntityManager() {};
 
     private volatile Exception threadException;
 
     @Test(expectedExceptions = FalconWebException.class)
     public void testBeanLoading() {
-
-        APIResult result = em.getStatus("type", "entity", "colo");
+        em.getStatus("type", "entity", "colo");
     }
 
     @Test
@@ -79,5 +78,4 @@ public class LoggingAspectTest {
             throw threadException;
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/test/java/org/apache/falcon/resource/EntityManagerTest.java
----------------------------------------------------------------------
diff --git a/prism/src/test/java/org/apache/falcon/resource/EntityManagerTest.java b/prism/src/test/java/org/apache/falcon/resource/EntityManagerTest.java
index 24e5a8a..73cf493 100644
--- a/prism/src/test/java/org/apache/falcon/resource/EntityManagerTest.java
+++ b/prism/src/test/java/org/apache/falcon/resource/EntityManagerTest.java
@@ -60,8 +60,7 @@ public class EntityManagerTest extends AbstractEntityManager {
     }
 
     /**
-     * Run this testcase for different types of VALID entity xmls like process,
-     * feed, dataEndPoint
+     * Run this testcase for different types of VALID entity xmls like process, feed, dataEndPoint.
      *
      * @param stream
      * @throws IOException
@@ -84,6 +83,7 @@ public class EntityManagerTest extends AbstractEntityManager {
                     EntityType.PROCESS.name());
             Assert.fail("Invalid entity type was accepted by the system");
         } catch (FalconWebException ignore) {
+            // ignore
         }
     }
 
@@ -98,19 +98,18 @@ public class EntityManagerTest extends AbstractEntityManager {
                     "InvalidEntityType");
             Assert.fail("Invalid entity type was accepted by the system");
         } catch (FalconWebException ignore) {
+            // ignore
         }
     }
 
     /**
-     * Converts a InputStream into ServletInputStream
+     * Converts a InputStream into ServletInputStream.
      *
      * @param resourceName
      * @return ServletInputStream
      */
     private ServletInputStream getServletInputStream(String resourceName) {
-        final InputStream stream = this.getClass().getResourceAsStream(
-                resourceName);
-
+        final InputStream stream = this.getClass().getResourceAsStream(resourceName);
         return new ServletInputStream() {
 
             @Override
@@ -119,5 +118,4 @@ public class EntityManagerTest extends AbstractEntityManager {
             }
         };
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/f8b91222/prism/src/test/java/org/apache/falcon/service/FalconTopicSubscriberTest.java
----------------------------------------------------------------------
diff --git a/prism/src/test/java/org/apache/falcon/service/FalconTopicSubscriberTest.java b/prism/src/test/java/org/apache/falcon/service/FalconTopicSubscriberTest.java
index 50122fe..e390aad 100644
--- a/prism/src/test/java/org/apache/falcon/service/FalconTopicSubscriberTest.java
+++ b/prism/src/test/java/org/apache/falcon/service/FalconTopicSubscriberTest.java
@@ -29,6 +29,9 @@ import org.testng.annotations.Test;
 
 import javax.jms.*;
 
+/**
+ * Test for FalconTopicSubscriber.
+ */
 public class FalconTopicSubscriberTest {
 
     private static final String BROKER_URL = "vm://localhost?broker.useJmx=false&broker.persistent=true";
@@ -73,7 +76,6 @@ public class FalconTopicSubscriberTest {
         message.getKeyValueMap().put(ARG.status, "FAILED");
         TextMessage textMessage = session.createTextMessage(message.toString());
         producer.send(textMessage);
-
     }
 
     private EntityInstanceMessage getMockFalconMessage(int i) {
@@ -104,12 +106,10 @@ public class FalconTopicSubscriberTest {
         subscriber1.startSubscriber();
         sendMessages();
         subscriber1.closeSubscriber();
-
     }
 
     @AfterClass
     public void tearDown() throws Exception {
         broker.stop();
     }
-
 }


Mime
View raw message