Re: ContainerId starts with 1 ?

2024-03-20 Thread 李响
Dear Hadoop/Yarn community,

I still beg your help for the question above.

Additionally, I might have other questions.
The target is to get the driver container id of a Spark app, from Yarn
Aggregation Log. I would like to call
LogAggregationIndexedFileController#readAggregatedLogsMeta()

then get the first ContainLogMeta from the list returned, then call
getContainerId() from it.
The questions are:

   1. Is the first ContainerLogMeta always the driver container?
   2. If the driver failed to get up for the first time somehow, but
   succeed in its second try. The container id will be added by 1 if I
   understand it correctly. Under this case, will the first ContainLogMeta
   returned by that function above be the first failed container, or the
   second successful container? Or the container id gets not changed after a
   failure?

Thanks!


On Fri, Feb 23, 2024 at 4:21 PM 李响  wrote:

> Dear Hadoop/Yarn community,
>
> In Yarn, a container is represented as
> container_e*epoch*_*clusterTimestamp*_*appId*_*attemptId*_*containerId*
>
> Regarding the last section, "containerId", as the sequential number of
> containers, I notice it does not start with 0, but 1.
>
> My question is:
> 1. Is that observation correct?
> 2. Sorry I do not find the code to support that. I read ContainerId.java
> and ContainerIdPBImpl.java but does not find the answer. Could you please
> show me the code path to support it staring with 1?
> 3. It seems counter-intuitive for me, as a programmer ^_^, who thinks the
> index should start with 0, rather than 1. If it is designed to start with
> 1, any background / thought / discussion to share?
>
> Thanks !!!
>
>
>
> --
>
>李响 Xiang Li
>
>
>

-- 

   李响 Xiang Li

手机 cellphone :+86-136-8113-8972
邮件 e-mail  :wate...@gmail.com


ContainerId starts with 1 ?

2024-02-23 Thread 李响
Dear Hadoop/Yarn community,

In Yarn, a container is represented as
container_e*epoch*_*clusterTimestamp*_*appId*_*attemptId*_*containerId*

Regarding the last section, "containerId", as the sequential number of
containers, I notice it does not start with 0, but 1.

My question is:
1. Is that observation correct?
2. Sorry I do not find the code to support that. I read ContainerId.java
and ContainerIdPBImpl.java but does not find the answer. Could you please
show me the code path to support it staring with 1?
3. It seems counter-intuitive for me, as a programmer ^_^, who thinks the
index should start with 0, rather than 1. If it is designed to start with
1, any background / thought / discussion to share?

Thanks !!!



-- 

   李响 Xiang Li