feat(emr): run the YARN timeline server and the Tez UI on a cluster's primary node in the docker runner mode (#8804)

With runner-mode docker, a cluster with Hadoop now runs the YARN
timeline server on its primary node, and one with Tez too the Tez UI
("Tez | http://master-public-dns-name:8080/tez-ui"), and
GetOnClusterAppUIPresignedURL opens both for real, on their own hosts,
as the cluster's other interfaces open (YarnTimelineService, TezUI).

The timeline server is Hadoop's own on its default port, 8188, its
store on the primary node's volume; the ResourceManager publishes its
applications to it, and, as no source gives how EMR's Tez reaches it, a
Hive step's Tez logs its DAGs to it through its REST interface
(ATSHistoryLoggingService). The Tez UI is Tez's own page, served on
8080, whose configuration (/etc/tez-ui/conf/configs.js, which the
image's page links to and lacks) names the timeline server and the
ResourceManager by the node's name, which Floci makes the link's hosts;
both answer cross-origin requests from the Tez UI's host. Both start
with the node's other daemons, the timeline server before the
ResourceManager, and the node is ready once both answer. The Tez UI runs
where the cluster's image has Tez, one with Hive or Floci's Pig, and an
image without its files serves none rather than keep the node from being
ready. Neither runs
for a release of the AWS runtime for Apache Spark, as their persistent
interfaces are not there.

EmrAppUiNightlyIntegrationTest runs them for real: after a Hive step,
the timeline server holds its Tez DAG and its application history, and
the Tez UI's page and configuration open, the timeline server answering
a request from the Tez UI's host.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-17 22:23:59 -04:00
1 parent 77565a9c60
commit 3210ee0263
11 files changed
+321 -43

No files matched your search

@@ -118,19 +118,21 @@ public interface ClusterStorage {
* the primary node too when it {@code primaryWorks}, each offering its containers {@code memoryMb} of memory and
* {@code vcores} virtual cores, which run its steps' Spark executors; the folder of the nodes' image holding the
* Hadoop their daemons run from, or null for the image's own; the copies of a block its HDFS keeps; the S3
* folder its applications' logs go in, or null; and whether its primary node runs a Spark History Server, as on a
* cluster with Spark. A primary node that works runs a DataNode as well.
* folder its applications' logs go in, or null; whether its primary node runs a Spark History Server, as on a
* cluster with Spark; and whether it runs the YARN timeline server, as on a cluster with Hadoop, and the Tez UI, as
* on one with Tez. A primary node that works runs a DataNode as well.
*/
record Yarn(int memoryMb, int vcores, String hadoopFolder, List<Node> nodes, int replication, String logFolder,
boolean primaryWorks, boolean sparkHistory) {
boolean primaryWorks, boolean sparkHistory, boolean timelineServer, boolean tezUi) {
Yarn(int memoryMb, int vcores) {
this(memoryMb, vcores, null, List.of(), 1, null, true, false);
this(memoryMb, vcores, null, List.of(), 1, null, true, false, false, false);
}
/** This YARN with its daemons run from the Hadoop in {@code folder}. */
Yarn withHadoopFolder(String folder) {
return new Yarn(memoryMb, vcores, folder, nodes, replication, logFolder, primaryWorks, sparkHistory);
return new Yarn(memoryMb, vcores, folder, nodes, replication, logFolder, primaryWorks, sparkHistory,
timelineServer, tezUi);
}
/**
@@ -139,17 +141,25 @@ public interface ClusterStorage {
*/
Yarn onNodes(List<Node> workers, int copies, String folder) {
return new Yarn(memoryMb, vcores, hadoopFolder, List.copyOf(workers), copies, folder,
workers.stream().noneMatch(Node::core), sparkHistory);
workers.stream().noneMatch(Node::core), sparkHistory, timelineServer, tezUi);
}
/** This YARN with its primary node running a DataNode and a NodeManager, or not. */
Yarn withPrimaryWorking(boolean works) {
return new Yarn(memoryMb, vcores, hadoopFolder, nodes, replication, logFolder, works, sparkHistory);
return new Yarn(memoryMb, vcores, hadoopFolder, nodes, replication, logFolder, works, sparkHistory,
timelineServer, tezUi);
}
/** This YARN with its primary node running the YARN timeline server, and the Tez UI, or not. */
Yarn withHistories(boolean timeline, boolean tez) {
return new Yarn(memoryMb, vcores, hadoopFolder, nodes, replication, logFolder, primaryWorks, sparkHistory,
timeline, tez);
}
/** This YARN with its primary node running a Spark History Server, or not. */
Yarn withSparkHistory(boolean runs) {
return new Yarn(memoryMb, vcores, hadoopFolder, nodes, replication, logFolder, primaryWorks, runs);
return new Yarn(memoryMb, vcores, hadoopFolder, nodes, replication, logFolder, primaryWorks, runs,
timelineServer, tezUi);
}
}
@@ -39,12 +39,12 @@ import java.util.regex.Pattern;
* A cluster's application user interfaces: the persistent ones "hosted off-cluster" (Amazon EMR Management Guide, "View
* persistent application user interfaces in Amazon EMR") and the on-cluster ones, both reached through presigned URLs.
* In the docker runner mode, an on-cluster UI that runs on the cluster's primary node, its ResourceManager, an
* application master through it, its MapReduce JobHistory server, the NodeManager of a primary node that works, or the
* Spark History Server of a cluster with Spark, opens for real through {@link EmrAppUiProxy}, on a host of its own
* under {@link #UI_HOST}, as AWS's are under "emrappui-prod.us-east-1.amazonaws.com" (Management Guide, "View Amazon
* EMR application history"). Floci keeps a persistent application UI's record, but serves no persistent UI, Tez UI or
* YARN timeline server: a link to one of those, and to any on-cluster UI elsewhere, opens a page of Floci's own about
* the cluster
* application master through it, its MapReduce JobHistory server, the NodeManager of a primary node that works, the
* Spark History Server of a cluster with Spark, or the YARN timeline server and the Tez UI of one with Hadoop and Tez,
* opens for real through {@link EmrAppUiProxy}, on a host of its own under {@link #UI_HOST}, as AWS's are under
* "emrappui-prod.us-east-1.amazonaws.com" (Management Guide, "View Amazon EMR application history"). Floci keeps a
* persistent application UI's record, but serves no persistent UI: a link to one, and to any on-cluster UI elsewhere,
* opens a page of Floci's own about the cluster
* ({@link EmrAppUiController}). Either link is valid for {@link #VALIDITY}: the page's is signed with a key of this
* process, and a proxied interface's host holds a secret this process gave it.
*/
@@ -74,6 +74,8 @@ public class EmrAppUiService {
static final String APPLICATION_MASTER = "ApplicationMaster";
static final String JOB_HISTORY_SERVER = "JobHistoryServer";
static final String SPARK_HISTORY_SERVER = "SparkHistoryServer";
static final String YARN_TIMELINE_SERVICE = "YarnTimelineService";
static final String TEZ_UI = "TezUI";
// No source gives AWS's wording for these; they are Floci's.
static final String NO_SUCH_INTERFACE = "This link opens none of the cluster's interfaces on that port.";
static final String CLUSTER_ENDED = "Cluster %s is no longer running, and its on-cluster application UIs are"
@@ -270,6 +272,8 @@ public class EmrAppUiService {
case RESOURCE_MANAGER, APPLICATION_MASTER -> EmrClusterStorage.RESOURCE_MANAGER_WEB_PORT;
case JOB_HISTORY_SERVER -> EmrServerlessSparkRunner.JOB_HISTORY_WEB_PORT;
case SPARK_HISTORY_SERVER -> EmrServerlessSparkRunner.SPARK_HISTORY_WEB_PORT;
case YARN_TIMELINE_SERVICE -> EmrClusterStorage.TIMELINE_WEB_PORT;
case TEZ_UI -> EmrClusterStorage.TEZ_UI_PORT;
default -> 0;
};
return interfaces.ports().contains(port) ? port : null;
@@ -286,6 +290,9 @@ public class EmrAppUiService {
yield matcher != null && matcher.matches() ? "/jobhistory/job/job_" + matcher.group(1) : "/jobhistory";
}
case SPARK_HISTORY_SERVER -> application != null ? "/history/" + application + "/" : "/";
case YARN_TIMELINE_SERVICE -> application != null ? "/applicationhistory/app/" + application
: "/applicationhistory";
case TEZ_UI -> EmrClusterStorage.TEZ_UI_PATH + (application != null ? "#/app/" + application : "");
default -> application != null ? "/cluster/app/" + application : "/cluster";
};
}
@@ -143,6 +143,22 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
// The MapReduce JobHistory server's information on its web port, which says it has started.
private static final String JOB_HISTORY_INFO = "http://" + BIND + ":"
+ EmrServerlessSparkRunner.JOB_HISTORY_WEB_PORT + "/ws/v1/history/info";
/** The YARN timeline server's web port, Hadoop's default {@code yarn.timeline-service.webapp.address}'s. */
static final int TIMELINE_WEB_PORT = 8188;
/** The port the Tez UI is served on, at {@link #TEZ_UI_PATH}: "Tez | http://master-public-dns-name:8080/tez-ui". */
static final int TEZ_UI_PORT = 8080;
static final String TEZ_UI_PATH = "/tez-ui/";
// Set on a primary node that runs the YARN timeline server, as on a cluster with Hadoop, and the Tez UI, as on one
// with Tez; what each answers on its web port says it has started. The Tez UI's configuration, which its page
// reads, names the timeline server and the ResourceManager by the node's name, whose links Floci makes the
// browser's.
private static final String TIMELINE_VARIABLE = "FLOCI_YARN_TIMELINE";
private static final String TEZ_UI_VARIABLE = "FLOCI_TEZ_UI";
private static final String TIMELINE_ABOUT = "http://" + BIND + ":" + TIMELINE_WEB_PORT + "/ws/v1/timeline";
private static final String TEZ_UI_PAGE = "http://" + BIND + ":" + TEZ_UI_PORT + TEZ_UI_PATH;
private static final String TEZ_UI_CONFIG = "/etc/tez-ui/conf/configs.js";
// The Tez UI's files, which an image with Tez has, one with Hive or Floci's Pig.
private static final String TEZ_UI_FILES = "/usr/lib/tez/tez-ui";
// Set on a primary node that runs a Spark History Server, as on a cluster with Spark; its version on its web port
// says it has started.
private static final String SPARK_HISTORY_VARIABLE = "FLOCI_SPARK_HISTORY";
@@ -217,6 +233,23 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
+ " \"<property><name>dfs.datanode.ipc.address</name>"
+ "<value>$FLOCI_HDFS_BIND:9867</value></property>\""
+ " '</configuration>' > " + HDFS_CONF + "/hdfs-site.xml",
"timeline=; [ -z \"$" + TIMELINE_VARIABLE + "\" ] || timeline=\"" + String.join("", List.of(
property("yarn.timeline-service.enabled", "true"),
property("yarn.timeline-service.hostname", "$FLOCI_HDFS_HOST"),
property("yarn.timeline-service.bind-host", "$FLOCI_HDFS_BIND"),
property("yarn.timeline-service.leveldb-timeline-store.path", "/mnt/yarn/timeline"),
property("yarn.timeline-service.http-cross-origin.enabled", "true"),
property("yarn.resourcemanager.webapp.cross-origin.enabled", "true"),
// The ResourceManager publishes its applications there: Hadoop 3.4 reads the first, which
// deprecates the second that earlier releases' Hadoop may still read.
property("yarn.system-metrics-publisher.enabled", "true"),
property("yarn.resourcemanager.system-metrics-publisher.enabled", "true"))) + "\"",
"if [ -n \"$" + TEZ_UI_VARIABLE + "\" ]; then",
" mkdir -p " + TEZ_UI_CONFIG.substring(0, TEZ_UI_CONFIG.lastIndexOf('/')) + " && printf '%s\\n' 'ENV = {'"
+ " ' hosts: {' \" timeline: 'http://$FLOCI_HDFS_HOST:" + TIMELINE_WEB_PORT + "',\""
+ " \" rm: 'http://$FLOCI_HDFS_HOST:" + RESOURCE_MANAGER_WEB_PORT + "',\" ' },' '};'"
+ " > " + TEZ_UI_CONFIG + " || exit",
"fi",
"if [ -n \"$" + YARN_MEMORY_VARIABLE + "\" ]; then",
" printf '%s\\n' '<configuration>'" + yarnProperties(List.of(
"yarn.resourcemanager.hostname", "$FLOCI_HDFS_HOST",
@@ -235,7 +268,7 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
"yarn.nodemanager.aux-services", "mapreduce_shuffle",
"yarn.resourcemanager.nodes.exclude-path", YARN_EXCLUDE,
"yarn.resourcemanager.decommissioning-nodes-watcher.poll-interval-secs", "3"))
+ " '</configuration>' > " + HDFS_CONF + "/yarn-site.xml || exit",
+ " \"$timeline\" '</configuration>' > " + HDFS_CONF + "/yarn-site.xml || exit",
" printf '%s\\n' '<configuration>'" + yarnProperties(List.of(
"yarn.scheduler.capacity.root.queues", "default",
"yarn.scheduler.capacity.root.default.capacity", "100",
@@ -335,6 +368,14 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
+ " \"${site[@]}\" & n=$((n + 1)); "
+ "fi; "
+ "if [ -n \"$" + YARN_MEMORY_VARIABLE + "\" ]; then "
+ "if [ -n \"$" + TIMELINE_VARIABLE + "\" ]; then "
+ "JDK_JAVA_OPTIONS=\"" + yarnOpens() + "\" yarn timelineserver & n=$((n + 1)); fi; "
+ "tez_ui=; if [ -n \"$" + TEZ_UI_VARIABLE + "\" ]; then "
+ "if [ -d " + TEZ_UI_FILES + " ]; then tez_ui=1; "
+ "else echo \"Floci: no Tez UI in this image, at " + TEZ_UI_FILES + "\" >&2; fi; fi; "
+ "if [ -n \"$tez_ui\" ]; then "
+ "python3 -m http.server " + TEZ_UI_PORT + " --bind $FLOCI_HDFS_BIND --directory /usr/lib/tez"
+ " > /dev/null 2>&1 & n=$((n + 1)); fi; "
+ "JDK_JAVA_OPTIONS=\"" + yarnOpens() + "\" yarn resourcemanager & n=$((n + 1)); "
+ "if [ -z \"$" + NODE_WORKERS_VARIABLE + "\" ]; then "
+ "JDK_JAVA_OPTIONS=\"" + yarnOpens() + "\" yarn nodemanager & n=$((n + 1)); fi; "
@@ -367,6 +408,12 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
+ "if [ -n \"$" + SPARK_HISTORY_VARIABLE + "\" ]; then "
+ untilReady("curl -sf -m 5 " + SPARK_HISTORY_VERSION + " > /dev/null")
+ "fi; "
+ "if [ -n \"$" + TIMELINE_VARIABLE + "\" ]; then "
+ untilReady("curl -sf -m 5 " + TIMELINE_ABOUT + " > /dev/null")
+ "fi; "
+ "if [ -n \"$tez_ui\" ]; then "
+ untilReady("curl -sf -m 5 " + TEZ_UI_PAGE + " > /dev/null")
+ "fi; "
+ "touch " + HDFS_READY + "; "
// Not wait -n: an emr-6.x image's bash, 4.2, does not have it.
+ "while [ \"$(jobs -rp | wc -l)\" = $n ]; do sleep 1; done; rm -f " + HDFS_READY
@@ -765,6 +812,9 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
if (yarn.sparkHistory()) {
storage = storage.withSparkHistoryServer(host);
}
if (yarn.timelineServer()) {
storage = storage.withTimelineServer(host);
}
return yarn.nodes().stream().anyMatch(Node::core) ? storage.withReplication(yarn.replication()) : storage;
}
}
@@ -1253,6 +1303,11 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
return properties.toString();
}
// A Hadoop property, as a line of a site file.
private static String property(String name, String value) {
return "<property><name>" + name + "</name><value>" + value + "</value></property>";
}
// A node script's wait until condition holds, polled; one of its n daemons exiting meanwhile ends the node.
private static String untilReady(String condition) {
return "until " + condition + "; do [ \"$(jobs -rp | wc -l)\" = $n ] || exit 1; sleep 0.2; done; ";
@@ -1337,6 +1392,12 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
if (yarn.sparkHistory()) {
spec.withLoopbackPortBinding(EmrServerlessSparkRunner.SPARK_HISTORY_WEB_PORT, 0);
}
if (yarn.timelineServer()) {
spec.withLoopbackPortBinding(TIMELINE_WEB_PORT, 0);
}
if (yarn.tezUi()) {
spec.withLoopbackPortBinding(TEZ_UI_PORT, 0);
}
}
if (yarn != null) {
spec.withEnv(YARN_MEMORY_VARIABLE, String.valueOf(yarn.memoryMb()))
@@ -1351,6 +1412,12 @@ public class EmrClusterStorage implements ClusterStorage, ContainerTeardown {
if (yarn.sparkHistory()) {
spec.withEnv(SPARK_HISTORY_VARIABLE, "1");
}
if (yarn.timelineServer()) {
spec.withEnv(TIMELINE_VARIABLE, "1");
}
if (yarn.tezUi()) {
spec.withEnv(TEZ_UI_VARIABLE, "1");
}
}
// The metastore and the executors YARN runs reach Floci, Floci on the host by its address, Floci's own
// certificate trusted when it serves TLS.
@@ -977,8 +977,9 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
/**
* The web interfaces Floci serves of a cluster's primary node, where it runs YARN there, in the docker runner
* mode: its ResourceManager, its MapReduce JobHistory server, where the node works its NodeManager, and on a
* cluster with Spark its Spark History Server; empty elsewhere.
* mode: its ResourceManager, its MapReduce JobHistory server, where the node works its NodeManager, on a cluster
* with Spark its Spark History Server, and on one with Hadoop its YARN timeline server, and with Tez its Tez UI;
* empty elsewhere.
*/
public Optional<WebInterfaces> webInterfaces(EmrCluster cluster) {
if (!runsOnClusters() || !runsYarn(cluster)) {
@@ -993,6 +994,12 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
if (yarn.sparkHistory()) {
ports.add(EmrServerlessSparkRunner.SPARK_HISTORY_WEB_PORT);
}
if (yarn.timelineServer()) {
ports.add(EmrClusterStorage.TIMELINE_WEB_PORT);
}
if (yarn.tezUi()) {
ports.add(EmrClusterStorage.TEZ_UI_PORT);
}
return Optional.of(new WebInterfaces(masterPrivateDnsName(cluster), Set.copyOf(ports)));
}
@@ -2876,14 +2883,24 @@ public class EmrService implements Resettable, StoredResourceArns, ContainerTear
* primary node holds a DataNode and a NodeManager unless the cluster was created with core nodes that run, so one
* created without keeps both as core nodes are added, the blocks it holds staying in reach.
*/
// The YARN timeline server runs on a cluster with Hadoop, and the Tez UI on one with Tez too, as their persistent
// interfaces are there (EmrAppUiService), but for a release of the AWS runtime for Apache Spark; the Tez UI only
// where the cluster's image has Tez, which one with Hive or Floci's Pig has (releaseImage).
private ClusterStorage.Yarn yarnOf(EmrCluster cluster) {
List<ClusterStorage.Node> nodes = workerNodes(cluster);
boolean timeline = EmrSparkSteps.names(cluster.getApplications(), SNAPSHOT_MAPPER, "Hadoop")
&& !(cluster.getReleaseLabel() != null
&& EmrServerlessSparkRunner.sparkRuntime(cluster.getReleaseLabel()));
boolean tezImage = EmrSparkSteps.installsHive(cluster.getReleaseLabel(), cluster.getApplications(),
SNAPSHOT_MAPPER) || withPig(cluster);
long coreNodes = nodes.stream().filter(ClusterStorage.Node::core).count();
return nodeManager.withHadoopFolder(EmrReleaseImages.hadoopFolder(cluster.getReleaseLabel()))
.onNodes(nodes, (int) Math.max(1, Math.min(replication(cluster), coreNodes)),
EmrSparkSteps.containerLogFolder(cluster))
.withPrimaryWorking(cluster.getProvisionedCoreNodes() == 0 || coreNodes == 0)
.withSparkHistory(EmrSparkSteps.names(cluster.getApplications(), SNAPSHOT_MAPPER, "Spark"));
.withSparkHistory(EmrSparkSteps.names(cluster.getApplications(), SNAPSHOT_MAPPER, "Spark"))
.withHistories(timeline, timeline && tezImage
&& EmrSparkSteps.names(cluster.getApplications(), SNAPSHOT_MAPPER, "Tez"));
}
// What a cluster asks of YARN when it is read, which may be later than now; what it asks now, if it has gone by then.
@@ -1358,7 +1358,9 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
// jars, named here as Tez's own defaults are; its port ranges and addresses are placeholders EMR Serverless fills,
// and its compression needs a native library the image lacks. An application master says where it is by
// ${env.NM_HOST}, which is left for its own node to fill in: the settings are read on the step's side first, and
// $NM_HOST or an env of the step's would be filled in there.
// $NM_HOST or an env of the step's would be filled in there. Where the cluster's primary node runs the YARN
// timeline server, the application master logs its DAGs there, through the timeline server's REST interface, which
// the Tez UI reads.
private static List<SparkSetting> tezOnYarnSettings(Job job, List<String> executorEnvironment,
List<String> classPath, String... variables) {
String root = hadoopRoot(job);
@@ -1369,7 +1371,7 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
List<String> containerVariables = new ArrayList<>(List.of(variables));
containerVariables.add("TEZ_HOME=" + root + "/tez");
String environment = containerEnvironment(executorEnvironment, containerVariables.toArray(String[]::new));
return List.of(
List<SparkSetting> settings = new ArrayList<>(List.of(
new SparkSetting("yarn.resourcemanager.hostname", job.storage().resourceManager()),
new SparkSetting("tez.local.mode", "false"),
new SparkSetting("tez.framework.client", "org.apache.tez.client.TezYarnClient"),
@@ -1394,7 +1396,15 @@ public class EmrServerlessSparkRunner implements SparkJobRunner, ContainerTeardo
new SparkSetting("tez.task.launch.env", environment),
new SparkSetting("tez.am.resource.memory.mb", "1024"),
new SparkSetting("tez.runtime.intermediate-output.should-compress", "false"),
new SparkSetting("tez.runtime.intermediate-input.is-compressed", "false"));
new SparkSetting("tez.runtime.intermediate-input.is-compressed", "false")));
String timeline = job.storage().timelineServer();
if (timeline != null) {
settings.add(new SparkSetting("tez.history.logging.service.class",
"org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService"));
settings.add(new SparkSetting("yarn.timeline-service.enabled", "true"));
settings.add(new SparkSetting("yarn.timeline-service.hostname", timeline));
}
return settings;
}
// The folders holding Hadoop on a cluster's nodes, as a class path's entries; the LZO codec's beside them.
@@ -212,12 +212,13 @@ public interface SparkJobRunner {
* {@code hdfsNetwork}, the cluster's own, which the container joins (all three null until it runs, the network
* also on the host's own network, which steps share with it); and, on a cluster with Hive or HCatalog, the URI of
* the Hive metastore service on that node, or null; how many copies of a block its HDFS keeps, when its core
* nodes hold it, else 0; and the host of the Spark History Server on that node, which reads its Spark applications'
* event logs, or null where it runs none.
* nodes hold it, else 0; the host of the Spark History Server on that node, which reads its Spark applications'
* event logs, or null where it runs none; and the host of the YARN timeline server on that node, which Tez logs its
* DAGs to, or null where it runs none.
*/
record Storage(String home, String mnt, String hdfsHost, String hdfsAddress, String hdfsNetwork,
String hiveMetastore, String resourceManager, String flociEndpoint, int replication,
String metadataAddress, String sparkHistoryServer) {
String metadataAddress, String sparkHistoryServer, String timelineServer) {
/**
* The component label of an EMR cluster's HDFS container, which carries its service's labels as a driver
@@ -230,19 +231,21 @@ public interface SparkJobRunner {
/** A cluster's volumes, before its HDFS runs. */
public Storage(String home, String mnt) {
this(home, mnt, null, null, null, null, null, null, 0, null, null);
this(home, mnt, null, null, null, null, null, null, 0, null, null, null);
}
/** This storage, its HDFS's NameNode on {@code host}, at {@code address} on {@code network}. */
public Storage withHdfs(String host, String address, String network) {
return new Storage(home, mnt, host, address, network, hiveMetastore, resourceManager, flociEndpoint,
replication, metadataAddress, sparkHistoryServer);
replication, metadataAddress, sparkHistoryServer,
timelineServer);
}
/** This storage, its Hive metastore service at {@code uri}. */
public Storage withHiveMetastore(String uri) {
return new Storage(home, mnt, hdfsHost, hdfsAddress, hdfsNetwork, uri, resourceManager, flociEndpoint,
replication, metadataAddress, sparkHistoryServer);
replication, metadataAddress, sparkHistoryServer,
timelineServer);
}
/**
@@ -251,13 +254,15 @@ public interface SparkJobRunner {
*/
public Storage withYarn(String host, String flociEndpoint) {
return new Storage(home, mnt, hdfsHost, hdfsAddress, hdfsNetwork, hiveMetastore, host, flociEndpoint,
replication, metadataAddress, sparkHistoryServer);
replication, metadataAddress, sparkHistoryServer,
timelineServer);
}
/** This storage, its HDFS keeping {@code copies} copies of a block on its core nodes. */
public Storage withReplication(int copies) {
return new Storage(home, mnt, hdfsHost, hdfsAddress, hdfsNetwork, hiveMetastore, resourceManager,
flociEndpoint, copies, metadataAddress, sparkHistoryServer);
flociEndpoint, copies, metadataAddress, sparkHistoryServer,
timelineServer);
}
/**
@@ -265,7 +270,13 @@ public interface SparkJobRunner {
*/
public Storage withSparkHistoryServer(String host) {
return new Storage(home, mnt, hdfsHost, hdfsAddress, hdfsNetwork, hiveMetastore, resourceManager,
flociEndpoint, replication, metadataAddress, host);
flociEndpoint, replication, metadataAddress, host, timelineServer);
}
/** This storage, YARN's timeline server on {@code host}, which Tez's application masters log their DAGs to. */
public Storage withTimelineServer(String host) {
return new Storage(home, mnt, hdfsHost, hdfsAddress, hdfsNetwork, hiveMetastore, resourceManager,
flociEndpoint, replication, metadataAddress, sparkHistoryServer, host);
}
/**
@@ -274,7 +285,8 @@ public interface SparkJobRunner {
*/
public Storage withMetadataAddress(String address) {
return new Storage(home, mnt, hdfsHost, hdfsAddress, hdfsNetwork, hiveMetastore, resourceManager,
flociEndpoint, replication, address, sparkHistoryServer);
flociEndpoint, replication, address, sparkHistoryServer,
timelineServer);
}
}