简体   繁体   English

应用部署在yarn中时samza如何生成container.id?

[英]How does samza generate the container.id when the application is deployed in yarn?

Can someone let me know how does samza generates the samza.container.id / SAMZA_CONTAINER_ID when the application is deployed in yarn?当应用程序部署在纱线中时,有人可以告诉我 samza 如何生成samza.container.id / SAMZA_CONTAINER_ID吗? I looked around in the samza code base but not able to locate the logic for the generation of the samza.container.id我在 samza 代码库中环顾四周,但找不到生成samza.container.id的逻辑

In YARN environment, Samza uses YARN generated containerIds as environmental variables to set each container process's samza.container.id.在 YARN 环境中,Samza 使用 YARN 生成的 containerIds 作为环境变量来设置每个容器进程的 samza.container.id。 ie when containers are requested by Samza AM process in YARN, YARN RM will reply with a set of allocated container objects, which is of class org.apache.hadoop.yarn.api.records.Container. ie when containers are requested by Samza AM process in YARN, YARN RM will reply with a set of allocated container objects, which is of class org.apache.hadoop.yarn.api.records.Container. That's the resource class to uniquely identify a container in YARN and Container#getId().toString() is the container ID string we set to samza.container.id.这就是资源 class 来唯一标识 YARN 中的容器,Container#getId().toString() 是我们设置为 samza.container.id 的容器 ID 字符串。

The code to get the container Id from YARN RM's response is in YarnClusterResourceManager#onContainersAllocated()从 YARN RM 的响应中获取容器 ID 的代码位于YarnClusterResourceManager#onContainersAllocated()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM