You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@falcon.apache.org by sr...@apache.org on 2013/04/26 17:50:41 UTC
[25/47] Check style fixes relating to common module
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/util/BuildProperties.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/util/BuildProperties.java b/common/src/main/java/org/apache/falcon/util/BuildProperties.java
index 898daee..339dcb5 100644
--- a/common/src/main/java/org/apache/falcon/util/BuildProperties.java
+++ b/common/src/main/java/org/apache/falcon/util/BuildProperties.java
@@ -23,10 +23,13 @@ import org.apache.falcon.FalconException;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;
-public class BuildProperties extends ApplicationProperties {
+/**
+ * Application build info properties are exposed through this.
+ */
+public final class BuildProperties extends ApplicationProperties {
private static final String PROPERTY_FILE = "falcon-buildinfo.properties";
- private static final AtomicReference<BuildProperties> instance =
+ private static final AtomicReference<BuildProperties> INSTANCE =
new AtomicReference<BuildProperties>();
private BuildProperties() throws FalconException {
@@ -40,13 +43,13 @@ public class BuildProperties extends ApplicationProperties {
public static Properties get() {
try {
- if (instance.get() == null) {
- instance.compareAndSet(null, new BuildProperties());
+ if (INSTANCE.get() == null) {
+ INSTANCE.compareAndSet(null, new BuildProperties());
}
- return instance.get();
+ return INSTANCE.get();
} catch (FalconException e) {
- throw new RuntimeException("Unable to read application " +
- "falcon build information properties", e);
+ throw new RuntimeException("Unable to read application "
+ + "falcon build information properties", e);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/util/DeploymentProperties.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/util/DeploymentProperties.java b/common/src/main/java/org/apache/falcon/util/DeploymentProperties.java
index 4e2f7db..715b7ba 100644
--- a/common/src/main/java/org/apache/falcon/util/DeploymentProperties.java
+++ b/common/src/main/java/org/apache/falcon/util/DeploymentProperties.java
@@ -23,10 +23,14 @@ import org.apache.falcon.FalconException;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;
-public class DeploymentProperties extends ApplicationProperties {
+/**
+ * Application deployment properties. particularly relating to
+ * whether the server is in embedded mode or distributed mode.
+ */
+public final class DeploymentProperties extends ApplicationProperties {
private static final String PROPERTY_FILE = "deploy.properties";
- private static final AtomicReference<DeploymentProperties> instance =
+ private static final AtomicReference<DeploymentProperties> INSTANCE =
new AtomicReference<DeploymentProperties>();
private DeploymentProperties() throws FalconException {
@@ -40,13 +44,12 @@ public class DeploymentProperties extends ApplicationProperties {
public static Properties get() {
try {
- if (instance.get() == null) {
- instance.compareAndSet(null, new DeploymentProperties());
+ if (INSTANCE.get() == null) {
+ INSTANCE.compareAndSet(null, new DeploymentProperties());
}
- return instance.get();
+ return INSTANCE.get();
} catch (FalconException e) {
- throw new RuntimeException("Unable to read application " +
- "startup properties", e);
+ throw new RuntimeException("Unable to read application " + "startup properties", e);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/util/DeploymentUtil.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/util/DeploymentUtil.java b/common/src/main/java/org/apache/falcon/util/DeploymentUtil.java
index 9aeb3ab..8909c17 100644
--- a/common/src/main/java/org/apache/falcon/util/DeploymentUtil.java
+++ b/common/src/main/java/org/apache/falcon/util/DeploymentUtil.java
@@ -24,7 +24,10 @@ import org.apache.log4j.Logger;
import java.util.HashSet;
import java.util.Set;
-public class DeploymentUtil {
+/**
+ * Helper methods to deployment properties.
+ */
+public final class DeploymentUtil {
private static final Logger LOG = Logger.getLogger(DeploymentUtil.class);
protected static final String DEFAULT_COLO = "default";
@@ -32,34 +35,36 @@ public class DeploymentUtil {
protected static final String DEPLOY_MODE = "deploy.mode";
private static final Set<String> DEFAULT_ALL_COLOS = new HashSet<String>();
- protected final static String currentColo;
- protected final static boolean embeddedMode;
+ protected static final String CURRENT_COLO;
+ protected static final boolean EMBEDDED_MODE;
protected static boolean prism = false;
static {
DEFAULT_ALL_COLOS.add(DEFAULT_COLO);
- embeddedMode = DeploymentProperties.get().
+ EMBEDDED_MODE = DeploymentProperties.get().
getProperty(DEPLOY_MODE, EMBEDDED).equals(EMBEDDED);
- if (embeddedMode) {
- currentColo = DEFAULT_COLO;
+ if (EMBEDDED_MODE) {
+ CURRENT_COLO = DEFAULT_COLO;
} else {
- currentColo = StartupProperties.get().
+ CURRENT_COLO = StartupProperties.get().
getProperty("current.colo", DEFAULT_COLO);
}
- LOG.info("Running in embedded mode? " + embeddedMode);
- LOG.info("Current colo: " + currentColo);
+ LOG.info("Running in embedded mode? " + EMBEDDED_MODE);
+ LOG.info("Current colo: " + CURRENT_COLO);
}
+ private DeploymentUtil() {}
+
public static void setPrismMode() {
prism = true;
}
public static boolean isPrism() {
- return !embeddedMode && prism;
+ return !EMBEDDED_MODE && prism;
}
public static String getCurrentColo() {
- return currentColo;
+ return CURRENT_COLO;
}
public static Set<String> getCurrentClusters() {
@@ -68,7 +73,7 @@ public class DeploymentUtil {
}
public static boolean isEmbeddedMode() {
- return embeddedMode;
+ return EMBEDDED_MODE;
}
public static String getDefaultColo() {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/util/ReflectionUtils.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/util/ReflectionUtils.java b/common/src/main/java/org/apache/falcon/util/ReflectionUtils.java
index d1bed8e..4a00fa9 100644
--- a/common/src/main/java/org/apache/falcon/util/ReflectionUtils.java
+++ b/common/src/main/java/org/apache/falcon/util/ReflectionUtils.java
@@ -22,8 +22,13 @@ import org.apache.falcon.FalconException;
import java.lang.reflect.Method;
+/**
+ * Helper methods for class instantiation through reflection.
+ */
public final class ReflectionUtils {
+ private ReflectionUtils() {}
+
public static <T> T getInstance(String classKey) throws FalconException {
String clazzName = StartupProperties.get().getProperty(classKey);
try {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/util/RuntimeProperties.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/util/RuntimeProperties.java b/common/src/main/java/org/apache/falcon/util/RuntimeProperties.java
index 86a54f8..cc87c8c 100644
--- a/common/src/main/java/org/apache/falcon/util/RuntimeProperties.java
+++ b/common/src/main/java/org/apache/falcon/util/RuntimeProperties.java
@@ -24,13 +24,16 @@ import org.apache.log4j.Logger;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;
-public class RuntimeProperties extends ApplicationProperties {
+/**
+ * Dynamic properties that may be modified while the server is running.
+ */
+public final class RuntimeProperties extends ApplicationProperties {
- private static Logger LOG = Logger.getLogger(RuntimeProperties.class);
+ private static final Logger LOG = Logger.getLogger(RuntimeProperties.class);
private static final String PROPERTY_FILE = "runtime.properties";
- private static final AtomicReference<RuntimeProperties> instance =
+ private static final AtomicReference<RuntimeProperties> INSTANCE =
new AtomicReference<RuntimeProperties>();
private RuntimeProperties() throws FalconException {
@@ -46,17 +49,19 @@ public class RuntimeProperties extends ApplicationProperties {
public static Properties get() {
try {
- if (instance.get() == null) {
- instance.compareAndSet(null, new RuntimeProperties());
+ if (INSTANCE.get() == null) {
+ INSTANCE.compareAndSet(null, new RuntimeProperties());
}
- return instance.get();
+ return INSTANCE.get();
} catch (FalconException e) {
- throw new RuntimeException("Unable to read application " +
- "runtime properties", e);
+ throw new RuntimeException("Unable to read application " + "runtime properties", e);
}
}
- private class DynamicLoader implements Runnable {
+ /**
+ * Thread for loading properties periodically.
+ */
+ private final class DynamicLoader implements Runnable {
private static final long REFRESH_DELAY = 300000L;
private static final int MAX_ITER = 20; //1hr
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/util/StartupProperties.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/util/StartupProperties.java b/common/src/main/java/org/apache/falcon/util/StartupProperties.java
index 4a19df4..7522b0d 100644
--- a/common/src/main/java/org/apache/falcon/util/StartupProperties.java
+++ b/common/src/main/java/org/apache/falcon/util/StartupProperties.java
@@ -23,11 +23,14 @@ import org.apache.falcon.FalconException;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;
-public class StartupProperties extends ApplicationProperties {
+/**
+ * Properties read during application startup.
+ */
+public final class StartupProperties extends ApplicationProperties {
private static final String PROPERTY_FILE = "startup.properties";
- private static final AtomicReference<StartupProperties> instance =
+ private static final AtomicReference<StartupProperties> INSTANCE =
new AtomicReference<StartupProperties>();
private StartupProperties() throws FalconException {
@@ -41,13 +44,12 @@ public class StartupProperties extends ApplicationProperties {
public static Properties get() {
try {
- if (instance.get() == null) {
- instance.compareAndSet(null, new StartupProperties());
+ if (INSTANCE.get() == null) {
+ INSTANCE.compareAndSet(null, new StartupProperties());
}
- return instance.get();
+ return INSTANCE.get();
} catch (FalconException e) {
- throw new RuntimeException("Unable to read application " +
- "startup properties", e);
+ throw new RuntimeException("Unable to read application " + "startup properties", e);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/workflow/WorkflowBuilder.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/workflow/WorkflowBuilder.java b/common/src/main/java/org/apache/falcon/workflow/WorkflowBuilder.java
index 76a9edc..26243e7 100644
--- a/common/src/main/java/org/apache/falcon/workflow/WorkflowBuilder.java
+++ b/common/src/main/java/org/apache/falcon/workflow/WorkflowBuilder.java
@@ -27,6 +27,10 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
+/**
+ * Builder for building workflow definition for the underlying scheduler.
+ * @param <T>
+ */
public abstract class WorkflowBuilder<T extends Entity> {
public static WorkflowBuilder<Entity> getBuilder(String engine, Entity entity) throws FalconException {
@@ -37,7 +41,7 @@ public abstract class WorkflowBuilder<T extends Entity> {
public abstract Map<String, Properties> newWorkflowSchedule(T entity, List<String> clusters) throws FalconException;
public abstract Properties newWorkflowSchedule(T entity, Date startDate, String clusterName, String user)
- throws FalconException;
+ throws FalconException;
public abstract String[] getWorkflowNames(T entity);
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java b/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java
index a267e39..756c6b8 100644
--- a/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java
+++ b/common/src/main/java/org/apache/falcon/workflow/WorkflowEngineFactory.java
@@ -22,16 +22,18 @@ import org.apache.falcon.FalconException;
import org.apache.falcon.util.ReflectionUtils;
import org.apache.falcon.workflow.engine.AbstractWorkflowEngine;
+/**
+ * Factory for providing appropriate workflow engine to the falcon service.
+ */
@SuppressWarnings("unchecked")
-public class WorkflowEngineFactory {
+public final class WorkflowEngineFactory {
private static final String WORKFLOW_ENGINE = "workflow.engine.impl";
private WorkflowEngineFactory() {
}
- public static AbstractWorkflowEngine getWorkflowEngine()
- throws FalconException {
+ public static AbstractWorkflowEngine getWorkflowEngine() throws FalconException {
return ReflectionUtils.getInstance(WORKFLOW_ENGINE);
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java b/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java
index 0e0dcd0..f7526e4 100644
--- a/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java
+++ b/common/src/main/java/org/apache/falcon/workflow/engine/AbstractWorkflowEngine.java
@@ -29,7 +29,7 @@ import java.util.Set;
/**
* Workflow engine should minimally support the
- * following operations
+ * following operations.
*/
public abstract class AbstractWorkflowEngine {
@@ -61,16 +61,16 @@ public abstract class AbstractWorkflowEngine {
public abstract InstancesResult getRunningInstances(Entity entity) throws FalconException;
public abstract InstancesResult killInstances(Entity entity, Date start, Date end, Properties props)
- throws FalconException;
+ throws FalconException;
public abstract InstancesResult reRunInstances(Entity entity, Date start, Date end, Properties props)
- throws FalconException;
+ throws FalconException;
public abstract InstancesResult suspendInstances(Entity entity, Date start, Date end, Properties props)
- throws FalconException;
+ throws FalconException;
public abstract InstancesResult resumeInstances(Entity entity, Date start, Date end, Properties props)
- throws FalconException;
+ throws FalconException;
public abstract InstancesResult getStatus(Entity entity, Date start, Date end) throws FalconException;
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/main/java/org/apache/falcon/workflow/engine/WorkflowEngineActionListener.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/workflow/engine/WorkflowEngineActionListener.java b/common/src/main/java/org/apache/falcon/workflow/engine/WorkflowEngineActionListener.java
index 11916ec..2a1cbd4 100644
--- a/common/src/main/java/org/apache/falcon/workflow/engine/WorkflowEngineActionListener.java
+++ b/common/src/main/java/org/apache/falcon/workflow/engine/WorkflowEngineActionListener.java
@@ -21,6 +21,10 @@ package org.apache.falcon.workflow.engine;
import org.apache.falcon.FalconException;
import org.apache.falcon.entity.v0.Entity;
+/**
+ * Listener that will be notified before and after
+ * workflow life cycle operations are performed.
+ */
public interface WorkflowEngineActionListener {
void beforeSchedule(Entity entity, String cluster) throws FalconException;
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java b/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java
index 101f987..6324448 100644
--- a/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java
+++ b/common/src/test/java/org/apache/falcon/cleanup/LogCleanupServiceTest.java
@@ -33,34 +33,28 @@ import org.testng.annotations.Test;
import java.io.IOException;
+/**
+ * Test for log cleanup service.
+ */
public class LogCleanupServiceTest extends AbstractTestBase {
private FileSystem fs;
private FileSystem tfs;
private EmbeddedCluster targetDfsCluster;
- Path instanceLogPath = new Path(
- "/projects/falcon/staging/falcon/workflows/process/" + "sample"
- + "/logs/job-2010-01-01-01-00/000");
- Path instanceLogPath1 = new Path(
- "/projects/falcon/staging/falcon/workflows/process/" + "sample"
- + "/logs/job-2010-01-01-01-00/001");
- Path instanceLogPath2 = new Path(
- "/projects/falcon/staging/falcon/workflows/process/" + "sample"
- + "/logs/job-2010-01-01-02-00/001");
- Path instanceLogPath3 = new Path(
- "/projects/falcon/staging/falcon/workflows/process/" + "sample2"
- + "/logs/job-2010-01-01-01-00/000");
- Path instanceLogPath4 = new Path(
- "/projects/falcon/staging/falcon/workflows/process/" + "sample"
- + "/logs/latedata/2010-01-01-01-00");
- Path feedInstanceLogPath = new Path(
- "/projects/falcon/staging/falcon/workflows/feed/"
- + "impressionFeed"
- + "/logs/job-2010-01-01-01-00/testCluster/000");
- Path feedInstanceLogPath1 = new Path(
- "/projects/falcon/staging/falcon/workflows/feed/"
- + "impressionFeed2"
- + "/logs/job-2010-01-01-01-00/testCluster/000");
+ private Path instanceLogPath = new Path("/projects/falcon/staging/falcon/workflows/process/"
+ + "sample" + "/logs/job-2010-01-01-01-00/000");
+ private Path instanceLogPath1 = new Path("/projects/falcon/staging/falcon/workflows/process/"
+ + "sample" + "/logs/job-2010-01-01-01-00/001");
+ private Path instanceLogPath2 = new Path("/projects/falcon/staging/falcon/workflows/process/"
+ + "sample" + "/logs/job-2010-01-01-02-00/001");
+ private Path instanceLogPath3 = new Path("/projects/falcon/staging/falcon/workflows/process/"
+ + "sample2" + "/logs/job-2010-01-01-01-00/000");
+ private Path instanceLogPath4 = new Path("/projects/falcon/staging/falcon/workflows/process/"
+ + "sample" + "/logs/latedata/2010-01-01-01-00");
+ private Path feedInstanceLogPath = new Path("/projects/falcon/staging/falcon/workflows/feed/"
+ + "impressionFeed" + "/logs/job-2010-01-01-01-00/testCluster/000");
+ private Path feedInstanceLogPath1 = new Path("/projects/falcon/staging/falcon/workflows/feed/"
+ + "impressionFeed2" + "/logs/job-2010-01-01-01-00/testCluster/000");
@AfterClass
@@ -76,8 +70,7 @@ public class LogCleanupServiceTest extends AbstractTestBase {
fs = dfsCluster.getFileSystem();
storeEntity(EntityType.CLUSTER, "testCluster");
- System.setProperty("test.build.data",
- "target/tdfs/data" + System.currentTimeMillis());
+ System.setProperty("test.build.data", "target/tdfs/data" + System.currentTimeMillis());
this.targetDfsCluster = EmbeddedCluster.newCluster("backupCluster", false);
conf = targetDfsCluster.getConf();
@@ -87,9 +80,8 @@ public class LogCleanupServiceTest extends AbstractTestBase {
storeEntity(EntityType.FEED, "imp-click-join1");
storeEntity(EntityType.FEED, "imp-click-join2");
storeEntity(EntityType.PROCESS, "sample");
- Process process = ConfigurationStore.get().get(EntityType.PROCESS,
- "sample");
- Process otherProcess = (Process) process.clone();
+ Process process = ConfigurationStore.get().get(EntityType.PROCESS, "sample");
+ Process otherProcess = (Process) process.copy();
otherProcess.setName("sample2");
otherProcess.setFrequency(new Frequency("days(1)"));
ConfigurationStore.get().remove(EntityType.PROCESS,
@@ -115,13 +107,10 @@ public class LogCleanupServiceTest extends AbstractTestBase {
tfs.createNewFile(new Path(feedInstanceLogPath, "oozie.log"));
Thread.sleep(61000);
-
-
}
@Test
- public void testProcessLogs() throws IOException, FalconException,
- InterruptedException {
+ public void testProcessLogs() throws IOException, FalconException, InterruptedException {
AbstractCleanupHandler processCleanupHandler = new ProcessCleanupHandler();
processCleanupHandler.cleanup();
@@ -134,8 +123,7 @@ public class LogCleanupServiceTest extends AbstractTestBase {
}
@Test
- public void testFeedLogs() throws IOException, FalconException,
- InterruptedException {
+ public void testFeedLogs() throws IOException, FalconException, InterruptedException {
AbstractCleanupHandler feedCleanupHandler = new FeedCleanupHandler();
feedCleanupHandler.cleanup();
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java b/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java
index 394fa70..f08c6ac 100644
--- a/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java
+++ b/common/src/test/java/org/apache/falcon/entity/AbstractTestBase.java
@@ -40,6 +40,9 @@ import javax.xml.bind.Unmarshaller;
import java.io.StringWriter;
import java.util.Collection;
+/**
+ * Base class for config store test.
+ */
public class AbstractTestBase {
protected static final String PROCESS_XML = "/config/process/process-0.1.xml";
protected static final String FEED_XML = "/config/feed/feed-0.1.xml";
@@ -71,29 +74,30 @@ public class AbstractTestBase {
ConfigurationStore store = ConfigurationStore.get();
store.remove(type, name);
switch (type) {
- case CLUSTER:
- Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
- cluster.setName(name);
- ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(conf.get("fs.default.name"));
- store.publish(type, cluster);
- break;
+ case CLUSTER:
+ Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
+ cluster.setName(name);
+ ClusterHelper.getInterface(cluster, Interfacetype.WRITE).setEndpoint(conf.get("fs.default.name"));
+ store.publish(type, cluster);
+ break;
- case FEED:
- Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
- feed.setName(name);
- store.publish(type, feed);
- break;
+ case FEED:
+ Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
+ feed.setName(name);
+ store.publish(type, feed);
+ break;
- case PROCESS:
- Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML));
- process.setName(name);
- FileSystem fs = dfsCluster.getFileSystem();
- fs.mkdirs(new Path(process.getWorkflow().getPath()));
- if (!fs.exists(new Path(process.getWorkflow() + "/lib"))) {
- fs.mkdirs(new Path(process.getWorkflow() + "/lib"));
- }
- store.publish(type, process);
- break;
+ case PROCESS:
+ Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML));
+ process.setName(name);
+ FileSystem fs = dfsCluster.getFileSystem();
+ fs.mkdirs(new Path(process.getWorkflow().getPath()));
+ if (!fs.exists(new Path(process.getWorkflow() + "/lib"))) {
+ fs.mkdirs(new Path(process.getWorkflow() + "/lib"));
+ }
+ store.publish(type, process);
+ break;
+ default:
}
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java b/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java
index d60126e..936b478 100644
--- a/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/ColoClusterRelationTest.java
@@ -26,6 +26,9 @@ import org.testng.annotations.Test;
import java.util.Set;
+/**
+ * Tests for validating relationship between cluster to data center/co-location.
+ */
@Test
public class ColoClusterRelationTest extends AbstractTestBase {
private Cluster newCluster(String name, String colo) {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java b/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java
index 509fce8..e947f69 100644
--- a/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/EntityTypeTest.java
@@ -22,6 +22,9 @@ import org.apache.falcon.entity.v0.EntityType;
import org.testng.Assert;
import org.testng.annotations.Test;
+/**
+ * Test for validating entity types.
+ */
public class EntityTypeTest {
@Test
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java b/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java
index 622fe48..d8a44ea 100644
--- a/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/EntityUtilTest.java
@@ -32,6 +32,9 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
+/**
+ * Test for validating Entity util helper methods.
+ */
public class EntityUtilTest extends AbstractTestBase {
private static TimeZone tz = TimeZone.getTimeZone("UTC");
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java b/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java
index 100fb63..f6994fc 100644
--- a/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/FeedHelperTest.java
@@ -24,6 +24,9 @@ import org.apache.falcon.entity.v0.cluster.Property;
import org.testng.Assert;
import org.testng.annotations.Test;
+/**
+ * Test for feed helper methods.
+ */
public class FeedHelperTest {
@Test
public void testPartitionExpression() {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java b/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java
index 6486397..6060731 100644
--- a/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java
+++ b/common/src/test/java/org/apache/falcon/entity/TestWorkflowNameBuilder.java
@@ -25,6 +25,9 @@ import org.testng.annotations.Test;
import java.util.Arrays;
+/**
+ * Test for workflow name builder.
+ */
public class TestWorkflowNameBuilder {
@Test
@@ -60,7 +63,7 @@ public class TestWorkflowNameBuilder {
}
@Test
- public void WorkflowNameTest() {
+ public void workflowNameTest() {
Feed feed = new Feed();
feed.setName("raw-logs");
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java b/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java
index b54ca63..1b34141 100644
--- a/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/parser/ClusterEntityParserTest.java
@@ -39,6 +39,9 @@ import java.io.StringWriter;
import static org.testng.AssertJUnit.assertEquals;
+/**
+ * Test for validating cluster entity parsing.
+ */
public class ClusterEntityParserTest extends AbstractTestBase {
private final ClusterEntityParser parser = (ClusterEntityParser) EntityParserFactory.getParser(EntityType.CLUSTER);
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java b/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java
index c461ee5..ff8cc46 100644
--- a/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/parser/FeedEntityParserTest.java
@@ -18,10 +18,6 @@
package org.apache.falcon.entity.parser;
-/**
- * Test Cases for ProcessEntityParser
- */
-
import org.apache.falcon.FalconException;
import org.apache.falcon.entity.AbstractTestBase;
import org.apache.falcon.entity.FeedHelper;
@@ -44,6 +40,9 @@ import java.io.StringWriter;
import static org.testng.AssertJUnit.assertEquals;
+/**
+ * Test Cases for Feed entity parser.
+ */
public class FeedEntityParserTest extends AbstractTestBase {
private final FeedEntityParser parser = (FeedEntityParser) EntityParserFactory
@@ -146,6 +145,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
}
+ //SUSPEND CHECKSTYLE CHECK
@Test
public void testPartitionExpression() throws FalconException {
Feed feed = (Feed) parser.parseAndValidate(ProcessEntityParserTest.class
@@ -160,7 +160,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
try {
parser.validate(feed);
Assert.fail("Expected ValidationException");
- } catch (ValidationException e) {
+ } catch (ValidationException ignore) {
}
//When there are more than 1 src clusters, the partition expression should contain cluster variable
@@ -168,7 +168,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
try {
parser.validate(feed);
Assert.fail("Expected ValidationException");
- } catch (ValidationException e) {
+ } catch (ValidationException ignore) {
}
//When there are more than 1 target cluster, there should be partition expre
@@ -176,7 +176,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
try {
parser.validate(feed);
Assert.fail("Expected ValidationException");
- } catch (ValidationException e) {
+ } catch (ValidationException ignore) {
}
//When there are more than 1 target clusters, the partition expression should contain cluster variable
@@ -184,7 +184,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
try {
parser.validate(feed);
Assert.fail("Expected ValidationException");
- } catch (ValidationException e) {
+ } catch (ValidationException ignore) {
}
//Number of parts in partition expression < number of partitions defined for feed
@@ -192,7 +192,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
try {
parser.validate(feed);
Assert.fail("Expected ValidationException");
- } catch (ValidationException e) {
+ } catch (ValidationException ignore) {
}
feed.getClusters().getClusters().get(0).setPartition(null);
@@ -201,6 +201,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
feed.setPartitions(null);
parser.validate(feed);
}
+ //RESUME CHECKSTYLE CHECK
@Test
public void testInvalidClusterValidityTime() {
@@ -332,6 +333,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
ConfigurationStore.get().publish(EntityType.FEED, feed1);
}
+ //SUSPEND CHECKSTYLE CHECK
@Test
public void testInvalidGroupNames() throws FalconException, JAXBException {
Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
@@ -361,6 +363,7 @@ public class FeedEntityParserTest extends AbstractTestBase {
}
}
+ //RESUME CHECKSTYLE CHECK
@Test
public void testClusterPartitionExp() throws FalconException {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java b/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java
index 4f62431..35ca217 100644
--- a/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/parser/FeedUpdateTest.java
@@ -30,6 +30,9 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+/**
+ * Test for feed update helper methods.
+ */
public class FeedUpdateTest extends AbstractTestBase {
private final FeedEntityParser parser = (FeedEntityParser)
@@ -81,8 +84,7 @@ public class FeedUpdateTest extends AbstractTestBase {
storeEntity(EntityType.PROCESS, "sample");
//Try parsing the same feed xml
- parser.parseAndValidate(this.getClass()
- .getResourceAsStream(FEED_XML));
+ parser.parseAndValidate(this.getClass().getResourceAsStream(FEED_XML));
} catch (Exception e) {
Assert.fail("Didn't expect feed parsing to fail", e);
}
@@ -110,6 +112,7 @@ public class FeedUpdateTest extends AbstractTestBase {
}
}
+ //SUSPEND CHECKSTYLE CHECK
@Test
public void testFeedUpdateWithViolations() throws Exception {
ConfigurationStore.get().remove(EntityType.FEED, "clicks");
@@ -124,7 +127,7 @@ public class FeedUpdateTest extends AbstractTestBase {
Process process = processParser.parseAndValidate(this.getClass()
.getResourceAsStream(PROCESS1_XML));
ConfigurationStore.get().publish(EntityType.PROCESS, process);
- Process p1 = (Process) process.clone();
+ Process p1 = (Process) process.copy();
p1.setName("sample2");
ConfigurationStore.get().publish(EntityType.PROCESS, p1);
@@ -136,4 +139,5 @@ public class FeedUpdateTest extends AbstractTestBase {
} catch (ValidationException ignore) {
}
}
+ //RESUME CHECKSTYLE CHECK
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java b/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java
index 88e9968..af9fddd 100644
--- a/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/parser/ProcessEntityParserTest.java
@@ -40,14 +40,16 @@ import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
+/**
+ * Tests for validating process entity parser.
+ */
public class ProcessEntityParserTest extends AbstractTestBase {
private final ProcessEntityParser parser = (ProcessEntityParser) EntityParserFactory.getParser(EntityType.PROCESS);
- private String INVALID_PROCESS_XML = "/config/process/process-invalid.xml";
@Test
public void testNotNullgetUnmarshaller() throws Exception {
- final Unmarshaller unmarshaller = EntityType.PROCESS.getUnmarshaller();
+ Unmarshaller unmarshaller = EntityType.PROCESS.getUnmarshaller();
Assert.assertNotNull(unmarshaller);
}
@@ -115,6 +117,7 @@ public class ProcessEntityParserTest extends AbstractTestBase {
// TODO for retry and late policy
}
+ //SUSPEND CHECKSTYLE CHECK
@Test
public void testELExpressions() throws Exception {
Process process = parser.parseAndValidate(getClass().getResourceAsStream(PROCESS_XML));
@@ -140,13 +143,14 @@ public class ProcessEntityParserTest extends AbstractTestBase {
throw new AssertionError("Expected ValidationException!");
} catch (ValidationException e) {
}
-
}
+ //RESUME CHECKSTYLE CHECK
@Test(expectedExceptions = FalconException.class)
public void doParseInvalidXML() throws IOException, FalconException {
- parser.parseAndValidate(this.getClass().getResourceAsStream(INVALID_PROCESS_XML));
+ String invalidProcessXml = "/config/process/process-invalid.xml";
+ parser.parseAndValidate(this.getClass().getResourceAsStream(invalidProcessXml));
}
@Test(expectedExceptions = ValidationException.class)
@@ -161,6 +165,7 @@ public class ProcessEntityParserTest extends AbstractTestBase {
parser.parseAndValidate("<process></process>");
}
+ //SUSPEND CHECKSTYLE CHECK
@Test
public void testConcurrentParsing() throws Exception {
List<Thread> threadList = new ArrayList<Thread>();
@@ -184,6 +189,7 @@ public class ProcessEntityParserTest extends AbstractTestBase {
thread.join();
}
}
+ //RESUME CHECKSTYLE CHECK
@Test(expectedExceptions = ValidationException.class)
public void testInvalidProcessValidity() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/store/ConfigurationStoreTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/store/ConfigurationStoreTest.java b/common/src/test/java/org/apache/falcon/entity/store/ConfigurationStoreTest.java
index e58184e..86298cc 100644
--- a/common/src/test/java/org/apache/falcon/entity/store/ConfigurationStoreTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/store/ConfigurationStoreTest.java
@@ -32,9 +32,12 @@ import org.testng.annotations.Test;
import java.io.IOException;
+/**
+ * Tests for validating configuration store.
+ */
public class ConfigurationStoreTest {
- private static Logger LOG = Logger.getLogger(ConfigurationStoreTest.class);
+ private static final Logger LOG = Logger.getLogger(ConfigurationStoreTest.class);
private ConfigurationStore store = ConfigurationStore.get();
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java b/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java
index 9b4bffc..a8c5eb1 100644
--- a/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java
+++ b/common/src/test/java/org/apache/falcon/entity/v0/EntityGraphTest.java
@@ -30,6 +30,9 @@ import org.testng.annotations.Test;
import java.util.Set;
+/**
+ * Entity graph tests.
+ */
public class EntityGraphTest extends AbstractTestBase {
private ConfigurationStore store = ConfigurationStore.get();
@@ -130,10 +133,10 @@ public class EntityGraphTest extends AbstractTestBase {
if (process.getOutputs() == null) {
process.setOutputs(new Outputs());
}
- Outputs Outputs = process.getOutputs();
- Output Output = new Output();
- Output.setFeed(feed);
- Outputs.getOutputs().add(Output);
+ Outputs outputs = process.getOutputs();
+ Output output = new Output();
+ output.setFeed(feed);
+ outputs.getOutputs().add(output);
Feed f1 = new Feed();
f1.setName(feed);
Clusters clusters = new Clusters();
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/group/FeedGroupMapTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/group/FeedGroupMapTest.java b/common/src/test/java/org/apache/falcon/group/FeedGroupMapTest.java
index f7812b9..a2087c0 100644
--- a/common/src/test/java/org/apache/falcon/group/FeedGroupMapTest.java
+++ b/common/src/test/java/org/apache/falcon/group/FeedGroupMapTest.java
@@ -34,6 +34,9 @@ import org.testng.annotations.Test;
import javax.xml.bind.JAXBException;
import java.util.Map;
+/**
+ * Feed group map tests.
+ */
public class FeedGroupMapTest extends AbstractTestBase {
private ConfigurationStore store = ConfigurationStore.get();
private static Cluster cluster;
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/security/CurrentUserTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/security/CurrentUserTest.java b/common/src/test/java/org/apache/falcon/security/CurrentUserTest.java
index b31e3cc..fe7155b 100644
--- a/common/src/test/java/org/apache/falcon/security/CurrentUserTest.java
+++ b/common/src/test/java/org/apache/falcon/security/CurrentUserTest.java
@@ -21,6 +21,9 @@ package org.apache.falcon.security;
import org.testng.Assert;
import org.testng.annotations.Test;
+/**
+ * Test for current user's thread safety.
+ */
public class CurrentUserTest {
@Test(threadPoolSize = 10, invocationCount = 10, timeOut = 10000)
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/update/UpdateHelperTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/update/UpdateHelperTest.java b/common/src/test/java/org/apache/falcon/update/UpdateHelperTest.java
index 11e5d06..23fa148 100644
--- a/common/src/test/java/org/apache/falcon/update/UpdateHelperTest.java
+++ b/common/src/test/java/org/apache/falcon/update/UpdateHelperTest.java
@@ -36,6 +36,9 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+/**
+ * Test for Update helper methods.
+ */
public class UpdateHelperTest extends AbstractTestBase {
private final FeedEntityParser parser = (FeedEntityParser)
EntityParserFactory.getParser(EntityType.FEED);
@@ -69,7 +72,7 @@ public class UpdateHelperTest extends AbstractTestBase {
Feed oldFeed = parser.parseAndValidate(this.getClass()
.getResourceAsStream(FEED_XML));
String cluster = "testCluster";
- Feed newFeed = (Feed) oldFeed.clone();
+ Feed newFeed = (Feed) oldFeed.copy();
Assert.assertFalse(UpdateHelper.shouldUpdate(oldFeed, newFeed, cluster));
newFeed.setGroups("newgroups");
@@ -81,7 +84,7 @@ public class UpdateHelperTest extends AbstractTestBase {
Process oldProcess = processParser.parseAndValidate(this.getClass().
getResourceAsStream(PROCESS_XML));
- Process newProcess = (Process) oldProcess.clone();
+ Process newProcess = (Process) oldProcess.copy();
newProcess.getRetry().setPolicy(PolicyType.FINAL);
Assert.assertFalse(UpdateHelper.shouldUpdate(oldProcess, newProcess, cluster));
@@ -98,7 +101,7 @@ public class UpdateHelperTest extends AbstractTestBase {
Feed oldFeed = parser.parseAndValidate(this.getClass()
.getResourceAsStream(FEED_XML));
- Feed newFeed = (Feed) oldFeed.clone();
+ Feed newFeed = (Feed) oldFeed.copy();
Process process = processParser.parseAndValidate(this.getClass().
getResourceAsStream(PROCESS_XML));
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/common/src/test/java/org/apache/falcon/util/StartupPropertiesTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/falcon/util/StartupPropertiesTest.java b/common/src/test/java/org/apache/falcon/util/StartupPropertiesTest.java
index fc3d604..6b2ec06 100644
--- a/common/src/test/java/org/apache/falcon/util/StartupPropertiesTest.java
+++ b/common/src/test/java/org/apache/falcon/util/StartupPropertiesTest.java
@@ -23,6 +23,9 @@ import org.testng.annotations.Test;
import static org.testng.AssertJUnit.assertEquals;
+/**
+ * Test for startup properties test.
+ */
@Test
public class StartupPropertiesTest {
@BeforeClass
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/oozie/src/main/java/org/apache/falcon/logging/LogProvider.java
----------------------------------------------------------------------
diff --git a/oozie/src/main/java/org/apache/falcon/logging/LogProvider.java b/oozie/src/main/java/org/apache/falcon/logging/LogProvider.java
index 11eeadd..8eec0d4 100644
--- a/oozie/src/main/java/org/apache/falcon/logging/LogProvider.java
+++ b/oozie/src/main/java/org/apache/falcon/logging/LogProvider.java
@@ -76,7 +76,7 @@ public final class LogProvider {
if (StringUtils.isEmpty(runId)) {
Path jobPath = new Path(ClusterHelper.getStorageUrl(cluster),
EntityUtil.getLogPath(cluster, entity) + "/job-"
- + EntityUtil.UTCtoURIDate(instance.instance) + "/*");
+ + EntityUtil.fromUTCtoURIDate(instance.instance) + "/*");
FileStatus[] runs = fs.globStatus(jobPath);
if (runs.length > 0) {
@@ -90,7 +90,7 @@ public final class LogProvider {
} else {
Path jobPath = new Path(ClusterHelper.getStorageUrl(cluster),
EntityUtil.getLogPath(cluster, entity) + "/job-"
- + EntityUtil.UTCtoURIDate(instance.instance) + "/"
+ + EntityUtil.fromUTCtoURIDate(instance.instance) + "/"
+ getFormatedRunId(runId));
if (fs.exists(jobPath)) {
return getFormatedRunId(runId);
@@ -108,7 +108,7 @@ public final class LogProvider {
Path actionPaths = new Path(ClusterHelper.getStorageUrl(cluster),
EntityUtil.getLogPath(cluster, entity) + "/job-"
- + EntityUtil.UTCtoURIDate(instance.instance) + "/"
+ + EntityUtil.fromUTCtoURIDate(instance.instance) + "/"
+ formatedRunId + "/*");
FileStatus[] actions = fs.globStatus(actionPaths);
InstanceAction[] instanceActions = new InstanceAction[actions.length - 1];
@@ -119,7 +119,7 @@ public final class LogProvider {
String dfsBrowserUrl = getDFSbrowserUrl(
ClusterHelper.getStorageUrl(cluster),
EntityUtil.getLogPath(cluster, entity) + "/job-"
- + EntityUtil.UTCtoURIDate(instance.instance) + "/"
+ + EntityUtil.fromUTCtoURIDate(instance.instance) + "/"
+ formatedRunId, file.getPath().getName());
if (filePath.getName().equals("oozie.log")) {
instance.logFile = dfsBrowserUrl;
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/process/src/test/java/org/apache/falcon/converter/AbstractTestBase.java
----------------------------------------------------------------------
diff --git a/process/src/test/java/org/apache/falcon/converter/AbstractTestBase.java b/process/src/test/java/org/apache/falcon/converter/AbstractTestBase.java
index bd2d6ac..4a0f7c4 100644
--- a/process/src/test/java/org/apache/falcon/converter/AbstractTestBase.java
+++ b/process/src/test/java/org/apache/falcon/converter/AbstractTestBase.java
@@ -26,6 +26,9 @@ import org.apache.falcon.entity.v0.process.Process;
import javax.xml.bind.Unmarshaller;
+/**
+ * Base for falcon unit tests involving configuration store.
+ */
public class AbstractTestBase {
private static final String PROCESS_XML = "/config/process/process-0.1.xml";
private static final String FEED_XML = "/config/feed/feed-0.1.xml";
@@ -37,23 +40,24 @@ public class AbstractTestBase {
ConfigurationStore store = ConfigurationStore.get();
store.remove(type, name);
switch (type) {
- case CLUSTER:
- Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
- cluster.setName(name);
- store.publish(type, cluster);
- break;
+ case CLUSTER:
+ Cluster cluster = (Cluster) unmarshaller.unmarshal(this.getClass().getResource(CLUSTER_XML));
+ cluster.setName(name);
+ store.publish(type, cluster);
+ break;
- case FEED:
- Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
- feed.setName(name);
- store.publish(type, feed);
- break;
+ case FEED:
+ Feed feed = (Feed) unmarshaller.unmarshal(this.getClass().getResource(FEED_XML));
+ feed.setName(name);
+ store.publish(type, feed);
+ break;
- case PROCESS:
- Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML));
- process.setName(name);
- store.publish(type, process);
- break;
+ case PROCESS:
+ Process process = (Process) unmarshaller.unmarshal(this.getClass().getResource(PROCESS_XML));
+ process.setName(name);
+ store.publish(type, process);
+ break;
+ default:
}
}
http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/bdadf2ed/rerun/src/main/java/org/apache/falcon/rerun/handler/LateRerunHandler.java
----------------------------------------------------------------------
diff --git a/rerun/src/main/java/org/apache/falcon/rerun/handler/LateRerunHandler.java b/rerun/src/main/java/org/apache/falcon/rerun/handler/LateRerunHandler.java
index ad19157..e24cc69 100644
--- a/rerun/src/main/java/org/apache/falcon/rerun/handler/LateRerunHandler.java
+++ b/rerun/src/main/java/org/apache/falcon/rerun/handler/LateRerunHandler.java
@@ -72,7 +72,7 @@ public class LateRerunHandler<M extends DelayedQueue<LaterunEvent>> extends
String srcClusterName = this.getWfEngine().getWorkflowProperty(
cluster, wfId, "srcClusterName");
Path lateLogPath = this.getLateLogPath(logDir,
- EntityUtil.UTCtoURIDate(nominalTime), srcClusterName);
+ EntityUtil.fromUTCtoURIDate(nominalTime), srcClusterName);
LOG.info("Going to delete path:" + lateLogPath);
FileSystem fs = FileSystem.get(getConfiguration(cluster,
wfId));