> On Jan. 25, 2016, 5:12 p.m., Jie Yu wrote:
> > I am wondering if you do see performance issue regarding this? We typically
> > don't optimize the code too much until it becomes a problem. Also, we try
> > to avoid global variable dependencies (i.e., static bool isCreateError in
> > this case).
>
> Jojy Varghese wrote:
> Jie, thanks for looking at this.
>
> This change is two parts - one is simply replacing the initialization of
> `creators` hashmap. Initialization using universal `{` initialization is the
> preferred way in c++11 that calling `put`.
>
> The second change is to optimize the creation. I thought this was
> necessary because we will be calling `create` for every URI fetch in a image
> pull and its dependencies(or layers). As the information to create the
> fetcher does not change for each of that `create` call, I thought it would be
> better to reuse the initialized structures.
>
> We can remove the 2nd part (optimization) if you like.
>
> Jojy Varghese wrote:
> I could make the static flag `isCreateError` as atomic_flag if you prefer.
>
> Jie Yu wrote:
> > The second change is to optimize the creation. I thought this was
> necessary because we will be calling create for every URI fetch in a image
> pull and its dependencies(or layers). As the information to create the
> fetcher does not change for each of that create call, I thought it would be
> better to reuse the initialized structures.
>
> Why we will be calling create for every URI fetch in a image pull? Can we
> save the uri::Fetcher instance? Eventually, there'll be only one uri::Fetcher
> at the top level (similar to the Fetcher right now).
>
> Jojy Varghese wrote:
> One reason I can think of is to allow operaters to install missing
> plugings (say hdfs) without having to restart. Let me know if that use case
> is invalid.
Even though, i would rather add interfaces to allow us to update an existing
Fetcher, instead of creating a Fetcher each time we pull an image.
- Jie
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41959/#review116115
-----------------------------------------------------------
On Jan. 25, 2016, 9:19 p.m., Jojy Varghese wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41959/
> -----------------------------------------------------------
>
> (Updated Jan. 25, 2016, 9:19 p.m.)
>
>
> Review request for mesos and Jie Yu.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Since fetcher plugins are not dynamically pluggable today, simplified the
> factory method to use the statically intitalized plugins. This would be
> useful when Fetchers are created multiple times.
>
>
> Diffs
> -----
>
> src/uri/fetcher.cpp dfda732348fec3b686cf82b55ad94fda4829469b
>
> Diff: https://reviews.apache.org/r/41959/diff/
>
>
> Testing
> -------
>
> make check.
>
>
> Thanks,
>
> Jojy Varghese
>
>