Make optional Peon "stdin" check (#4760)

This commit is contained in:
Egor Riashin 2017-09-12 00:37:01 +03:00 committed by Roman Leventov
parent 23c0357816
commit 6f3e52b3db
2 changed files with 37 additions and 20 deletions

View File

@ -139,6 +139,7 @@ public class ExecutorLifecycle
throw Throwables.propagate(e);
}
if (taskExecutorConfig.isParentStreamDefined()) {
// Spawn monitor thread to keep a watch on parent's stdin
// If stdin reaches eof, the parent is gone, and we should shut down
parentMonitorExec.submit(
@ -162,6 +163,7 @@ public class ExecutorLifecycle
}
}
);
}
// Won't hurt in remote mode, and is required for setting up locks in local mode:
try {

View File

@ -20,7 +20,6 @@
package io.druid.indexing.worker.executor;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.druid.java.util.common.ISE;
import javax.validation.constraints.NotNull;
@ -43,6 +42,22 @@ public class ExecutorLifecycleConfig
@JsonProperty
@Pattern(regexp = "\\{stdin\\}")
private String parentStreamName = "stdin";
@JsonProperty
private boolean parentStreamDefined = true;
/**
* Should parent stream be monitored.
*/
public boolean isParentStreamDefined()
{
return parentStreamDefined;
}
public ExecutorLifecycleConfig setParentStreamDefined(boolean parentStreamDefined)
{
this.parentStreamDefined = parentStreamDefined;
return this;
}
public File getTaskFile()
{