Details
diff --git a/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java b/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java
index a8984ec..53ee640 100644
--- a/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java
+++ b/azkaban-exec-server/src/main/java/azkaban/execapp/FlowRunner.java
@@ -59,7 +59,6 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.io.Files;
import java.io.File;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.security.AccessControlContext;
import java.security.AccessController;
@@ -191,21 +190,6 @@ public class FlowRunner extends EventHandler implements Runnable {
this.azkabanEventReporter = azkabanEventReporter;
}
- private File findPropsFileForJob(final String prefix) {
- final File[] files = this.getExecutionDir().listFiles(new FilenameFilter() {
- @Override
- public boolean accept(final File dir, final String name) {
- return name.startsWith(prefix) && name.endsWith("tmp");
- }
- });
-
- if (files == null || files.length == 0) {
- this.logger.info("Not able to find props file for job " + prefix);
- return null;
- }
- return files[0];
- }
-
public FlowRunner setFlowWatcher(final FlowWatcher watcher) {
this.watcher = watcher;
return this;
@@ -953,21 +937,6 @@ public class FlowRunner extends EventHandler implements Runnable {
private String findValueForJobVariable(final ExecutableNode node, final String jobName, final
String variable) {
- // Get props from job props tmp file
- final File jobPropsFile = findPropsFileForJob(jobName + "_props");
- if (jobPropsFile != null) {
- try {
- final Props jobProps = new Props(null, jobPropsFile);
- if (jobProps.containsKey(variable)) {
- return jobProps.get(variable);
- }
- } catch (final IOException e) {
- this.logger.error("Not able to load props from job props file " + jobPropsFile
- .getAbsolutePath());
- }
- }
-
- // Todo jamiesjc: need to handle condition for embedded flows
// Get job output props
final ExecutableNode target = node.getParentFlow().getExecutableNode(jobName);
if (target == null) {
diff --git a/azkaban-exec-server/src/test/java/azkaban/execapp/FlowRunnerConditionalFlowTest.java b/azkaban-exec-server/src/test/java/azkaban/execapp/FlowRunnerConditionalFlowTest.java
index 077c556..ba22df6 100644
--- a/azkaban-exec-server/src/test/java/azkaban/execapp/FlowRunnerConditionalFlowTest.java
+++ b/azkaban-exec-server/src/test/java/azkaban/execapp/FlowRunnerConditionalFlowTest.java
@@ -33,6 +33,7 @@ import java.security.ProtectionDomain;
import java.util.HashMap;
import org.junit.Assert;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
public class FlowRunnerConditionalFlowTest extends FlowRunnerTestBase {
@@ -64,6 +65,7 @@ public class FlowRunnerConditionalFlowTest extends FlowRunnerTestBase {
}
}
+ @Ignore
@Test
public void runFlowOnJobPropsCondition() throws Exception {
final HashMap<String, String> flowProps = new HashMap<>();
@@ -139,9 +141,11 @@ public class FlowRunnerConditionalFlowTest extends FlowRunnerTestBase {
@Test
public void runFlowOnBothJobStatusAndPropsCondition() throws Exception {
final HashMap<String, String> flowProps = new HashMap<>();
- flowProps.put("azkaban.server.name", "foo");
setUp(CONDITIONAL_FLOW_6, flowProps);
final ExecutableFlow flow = this.runner.getExecutableFlow();
+ final Props generatedProperties = new Props();
+ generatedProperties.put("props", "foo");
+ InteractiveTestJob.getTestJob("jobA").succeedJob(generatedProperties);
assertStatus(flow, "jobA", Status.SUCCEEDED);
assertStatus(flow, "jobB", Status.SUCCEEDED);
assertStatus(flow, "jobC", Status.CANCELLED);
diff --git a/test/execution-test-data/conditionalflowyamltest/conditional_flow6.flow b/test/execution-test-data/conditionalflowyamltest/conditional_flow6.flow
index 327a879..22739ac 100644
--- a/test/execution-test-data/conditionalflowyamltest/conditional_flow6.flow
+++ b/test/execution-test-data/conditionalflowyamltest/conditional_flow6.flow
@@ -8,7 +8,7 @@ nodes:
config:
fail: false
seconds: 0
- condition: one_success && ${jobA:azkaban.server.name} == 'foo'
+ condition: one_success && ${jobA:props} == 'foo'
dependsOn:
- jobB
@@ -17,7 +17,6 @@ nodes:
- name: jobA
type: test
config:
- fail: false
seconds: 0
- name: jobB
@@ -25,7 +24,7 @@ nodes:
config:
fail: false
seconds: 0
- condition: ${jobA:azkaban.server.name} == 'foo'
+ condition: ${jobA:props} == 'foo'
dependsOn:
- jobA
@@ -35,7 +34,7 @@ nodes:
config:
fail: false
seconds: 0
- condition: ${jobA:azkaban.server.name} == 'bar'
+ condition: ${jobA:props} == 'bar'
dependsOn:
- jobA