Samza的ApplicationMaster
当Samza ApplicationMaster启动时,它做以下的事情:
- 通过STREAMING_CONFIG环境变量从YARN获取配置信息(configuration)
- 在随机端口上 启动一个JMX server
- 实例化一个metrics registry和reporter来追踪计量信息
- 将AM向YARN的RM注册
- 使用每个stream的PartitionManager来获取总共的partition数量
- 从Samza的job configuration里获取总的container数量
- 将partition分给container(在Samza AM的dashboard里,称为Task Group)
- 为每个container向YARN发送一个ResourceRequest
- 每秒向YARN RM poll一次,检查allocated and released containers
AMRMClientAsync handles communication with the ResourceManager and provides asynchronous updates on events such as container allocations and completions. It contains a thread that sends periodic heartbeats to the ResourceManager. It should be used by implementing a CallbackHandler:
class MyCallbackHandler implements AMRMClientAsync.CallbackHandler {
public void onContainersAllocated(List<Container> containers) {
[run tasks on the containers]
}
public void onContainersCompleted(List<ContainerStatus> statuses) {
[update progress, check whether app is done]
}
public void onNodesUpdated(List<NodeReport> updated) {}
public void onReboot() {}
}
The client's lifecycle should be managed similarly to the following:
AMRMClientAsync asyncClient =
createAMRMClientAsync(appAttId, 1000, new MyCallbackhandler());
asyncClient.init(conf);
asyncClient.start();
RegisterApplicationMasterResponse response = asyncClient
.registerApplicationMaster(appMasterHostname, appMasterRpcPort,
appMasterTrackingUrl);
asyncClient.addContainerRequest(containerRequest);
[... wait for application to complete]
asyncClient.unregisterApplicationMaster(status, appMsg, trackingUrl);
asyncClient.stop();
这个类是用来做为一个Client和RM进行通信,并且注册一个用于回调的对象来处理container 的allocation和completion事件。它启动一个线程,周期性地发送hearbeat至ResourceManager
Samza的ApplicationMaster的更多相关文章
- Samza文档翻译 : Architecture
http://samza.incubator.apache.org/learn/documentation/0.7.0/introduction/architecture.html Samza由三层组 ...
- Samza在YARN上的启动过程 =》 之二 submitApplication
首先,来看怎么构造一个org.apache.hadoop.yarn.client.api.YarnClient class ClientHelper(conf: Configuration) exte ...
- Samza在YARN上的启动过程 =》 之一
运行脚本,提交job 往YARN提交Samza job要使用run-job.sh这个脚本. samza-example/target/bin/run-job.sh --config-factory= ...
- Samza/KafkaAnalysizing
Apache Samza is a distributed stream processing framework. It uses Apache Kafka for messaging, and A ...
- Apache Samza - Reliable Stream Processing atop Apache Kafka and Hadoop YARN
http://engineering.linkedin.com/data-streams/apache-samza-linkedins-real-time-stream-processing-fram ...
- 流式大数据处理的三种框架:Storm,Spark和Samza
许多分布式计算系统都可以实时或接近实时地处理大数据流.本文将对三种Apache框架分别进行简单介绍,然后尝试快速.高度概述其异同. Apache Storm 在Storm中,先要设计一个用于实时计算的 ...
- [转载]流式大数据处理的三种框架:Storm,Spark和Samza
许多分布式计算系统都可以实时或接近实时地处理大数据流.本文将对三种Apache框架分别进行简单介绍,然后尝试快速.高度概述其异同. Apache Storm 在Storm中,先要设计一个用于实时计算的 ...
- 如何设置Samza的metrics
参考这个里边对API的调用 http://samza.incubator.apache.org/learn/documentation/0.7.0/container/metrics.html 参考这 ...
- Samza文档翻译 : Comparison Introduction
http://samza.incubator.apache.org/learn/documentation/0.7.0/comparisons/introduction.html 这里有一些使得Sam ...
随机推荐
- Android drawable xml 各种小知识
摘抄自网络. 圆角或者各种变种背景, <?xml version="1.0" encoding="utf-8"?> <shape xmlns: ...
- Java Servlet-入门
配置 servlet <servlet> <servlet-name>one</servlet-name> <servlet-class>servlet ...
- ubuntu(16.04.01)学习-day2--高级命令
1.查找命令 find -name "hello.c" grep "test" grep "usb" -c -r /drivers/usb ...
- SQL Server 编程入门经典(3)之T-SQL基本语句
本章内容简介: 如何从数据库检索数据(SELECT) 如何向表中插入数据(INSERT) 如何适当更新数据(UPDATE) 如何删除表中数据(DELETE) 3.1 基本SELECT语句 如果你在此 ...
- CF下的BackgroudWorker组件优化.
.net compact framwork(2.0/3.5)下没有Backgroundworder组件,在网上找了一个类 经过使用发现了一些问题,主要有一个问题:在一个Dowork事件中对Report ...
- CentOS安装Node.js简单教程
记录一下自己安装过程 先安装gcc-c++编译环境和openssl 代码如下 复制代码 yum install gcc-c++ openssl-devel wget http://nodejs.or ...
- Swift扩展(Extension)
在现有类和结构体的类型基础上,扩展新的功能. 语法: extension SomeType{ // new functionality to add to SomeType goes here } A ...
- jvmstat监控jvm内存
1.下载jvmstat-3_0.zip: 2.配置环境变量JVMSTAT_JAVA_HOME为jdk目录E:\Program Files\Java\jdk1.5.0_12 3.监控本机: jps查看 ...
- Windows 右键添加「cmd 打开」
1. 2. 3. 参考: 1.Windows右键添加"使用CMD打开" 2.WIN7.WIN8 右键在目录当前打开命令行Cmd窗口(图文)
- HTML5之 Microdata微数据
- 为何需要微数据 长篇加累版牍,不好理解 微标记来标注其中内容,让其容易识辨 - RDFa Resource Description Framework http://www.w3.org/TR/m ...