[ 
https://issues.apache.org/jira/browse/SLIDER-1079?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15329035#comment-15329035
 ] 

Gour Saha commented on SLIDER-1079:
-----------------------------------

[~shanyu] this patch is causing a functional issue when slider-core is consumed 
as a library in a long-running process, like say a rest api service for slider. 
The following code creates a cache across all requests -
{code}
+  protected static Map<String, Metainfo> metaInfoMap = new 
ConcurrentHashMap<String, Metainfo>();
{code}

So if an app creation request is received for an app named "abc" say, and then 
subsequently the app is deleted and a new app with the same name "abc" is 
created again, this time with a slightly modified metainfo, it throws an 
exception like this -
{code}
Create application failed
org.apache.slider.core.exceptions.BadConfigException: Component REGIONSERVER is 
not a member of application.
        at 
org.apache.slider.providers.agent.AgentClientProvider.validateInstanceDefinition(AgentClientProvider.java:189)
{code}

Please evaluate if metaInfoMap needs to be static OR if there is a better 
solution. If an alternate solution is not provided, we might have to revert 
this commit.

> Cache MetaInfo for AgentClientProvider
> --------------------------------------
>
>                 Key: SLIDER-1079
>                 URL: https://issues.apache.org/jira/browse/SLIDER-1079
>             Project: Slider
>          Issue Type: Bug
>          Components: client
>    Affects Versions: Slider 0.81, Slider 0.90.2
>            Reporter: shanyu zhao
>            Assignee: shanyu zhao
>             Fix For: Slider 0.91
>
>         Attachments: SLIDER-1079.1.patch, SLIDER-1079.patch
>
>
> During app creation, the slider client calls 
> AgentUtils.getApplicationMetainfo() 3 times. Each time this function actually 
> download the whole app package from HDFS. If the app package is big, this is 
> rather inefficient.
> The 3 places are:
> 1) SliderClient.actionBuild() -> 
> AgentClientProvider.validateInstanceDefinition()
> 2) AgentClientProvider.getApplicagionTags()
> 3) AgentClientProvider.validateInstanceDefinition()
> We should cache the metainfo object in AgentClientProvider.
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to