[
https://issues.apache.org/jira/browse/SLIDER-820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14393726#comment-14393726
]
thomas liu edited comment on SLIDER-820 at 4/7/15 8:11 PM:
-----------------------------------------------------------
Previously, AgentProviderService issues commands for one component like:
INSTALL -> START -> GET_STATUS... -> STOP
now with add on packages, we would like it to issue commands:
INSTALL -> INSTALL_ADDON (for add on pkg 1) -> INSTALL_ADDON (for add on pkg 2)
... -> START -> GET_STATUS... -> STOP
In AgentProviderService, we keep ComponentInstanceState for each Component. In
org.apache.slider.providers.agent.application.metadata.ComponentInstanceState,
we keep a map from package name to org.apache.slider.providers.agent.State. So
besides the component state we keep in ComponentInstanceState, we are also
tracking the state for each add on package.
Metainfo.json for each add on package will be read into Metainfo object in
SliderAM. We've extended the existing Metainfo, Application, Component to hold
those fields for add on packages
We also keep a map from package name to the add on packages' Metainfo object in
AgentProviderService
When the component(master package component is in 'installed' state, this means
the component is installed and now we can install the add on packages for this
component. So We modify ComponentInstanceState.getNextCommand() to check, when
the component is in 'installed' state, we go through the pkg->State map to see
if any package is in 'init' state. If so, it means the package is not installed
yet, and now we issue 'INSTALL_ADDON' command for it. The next heartbeat from
the component can also indicate the component is in 'installing in progress'
state, which means the add on package is still in installation. The way we
distinguish whether it is the component (master pkg) is in 'in progress' state
or it is the add on pkg in the state is: there is a field passed from
SliderAgent to SliderAM 'package'. If it is null, then the heartbeat is for the
master package, if not, the value is the name of the package. In the case when
the add on package is in 'installing in progress' state, getNextCommand() will
issue NOP command.
was (Author: thomas_liu):
In org.apache.slider.providers.agent.application.metadata.Component, we add a
new String List that keeps track of the order in which master and addon
packages should be installed, configured and started
In AgentProviderService, we keep ComponentInstanceState for each
Component+package. (We use component + '-' + package as the identifier in the
map)
And at the moment when previously we call ComponentInstanceState.getCommand()
to determine the next command for the component, now we first query Component
which package comes next, and then we call getCommand() on the package's
ComponentInstanceState to get the next command to run.
So we are issuing commands 'master package INSTALL', 'addon package 1 INSTALL',
... 'master package START', one by one. Only after previous command got
successfully executed on the SliderAgent side, we start to execute the next
command. We still rely on existing ComponentCommandOrder to enforce component
instantiation order. So on the SliderAgent side, it will install packages one
by one and then start the master.
> Enable AgentProviderService issue INSTALL and CONFIGURE command for addon
> packages
> ----------------------------------------------------------------------------------
>
> Key: SLIDER-820
> URL: https://issues.apache.org/jira/browse/SLIDER-820
> Project: Slider
> Issue Type: Sub-task
> Components: agent-provider, core
> Reporter: thomas liu
> Fix For: Slider 0.80
>
>
> Enable AgentProviderService issue INSTALL and CONFIGURE command for addon
> packages, with parameters in the commands to install and configure addon
> packages onto master package directories, for lib, conf, bin...
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)