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 ...
随机推荐
- sqlserver之二进制和字符串sql语句
正常情况下我们对数据库的操作就是如下的写法来操作数据库 ID AS 编号,BookName AS 书名 FROM dbo.books ORDER BY ID; ; 但是在客户正在使用的数据库里,我们开 ...
- ### 学习《C++ Primer》- 9
Part 9: 模板与泛型编程(第16章) // @author: gr // @date: 2016-03-18 // @email: forgerui@gmail.com 1. 模板参数 类型模板 ...
- ios开发:OC对象的内存分析
最近要开始准备找实习单位了,做做笔试题,看看各位大神的面试经历,发现自己要学习的东西真的还有很多,虽然也做过几个的项目,但是真正拿过笔试题一看,才发现自己对基础这方面的东西,确实有点忽视了,所以最近开 ...
- using System.Collections.Generic;
public class CommonClass { public static void ShowInt(int iValue) { //typeof(CommonClass) typeof关键字 ...
- blazeds使用remote访问
欢迎交流转载,请注明出处:http://www.cnblogs.com/shizhongtao/p/3487128.html 1.配置及说明 jar包说明 从官方上下的Blazeds中,默认的配置有 ...
- 总是你 2008-3 (献给L之一)
文/安然 总是你 是梦里的那份最温柔 轻轻碰触 不再敢轻易提及 总是你 是不经意的那份最感动 点点鲜活 从来就没有淡去 时间远走 我轻轻的收起 那段记忆 不再开启 但是 偶尔 偶尔 总是 总是在不经意 ...
- 关键字 explicit
C++中, 一个参数的构造函数(或者除了第一个参数外其余参数都有默认值的多参构造函数), 承担了两个角色. 1 是个构造器 ,2 是个默认且隐含的类型转换操作符. 所以, 有时候在我们写下如 AAA ...
- 完美高仿精仿京东商城手机客户端android版源码
完美高仿精仿京东商城手机客户端android版源码,是从安卓教程网那边转载过来的,这款应用源码非常不错的,也是一个非常优秀的应用源码的,希望能够帮到学习的朋友. _js_op> <igno ...
- ALI OSS RequestTimeTooSkewed
php版阿里oss sdk,请求时抛RequestTimeTooSkewed错误,说时间差距太大,搜了一下发现是服务器的时间设置问题. 我们在安装完Centos Linux操作系统之后,点击系统的时间 ...
- shell curl
最近突然发现了一个有趣的问题:怎样判断日期是工作日还是节假日.(http://www.cnblogs.com/ZXdeveloper/p/4018886.html) 顺便发现了一个有用的网址:http ...