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

Eric Yang edited comment on YARN-8161 at 4/18/18 3:04 AM:
----------------------------------------------------------

[~gsaha] Thank you for filing this issue.  The current REST API performs 
operations such as:

{code}
curl -i --negotiate -u : -X PUT -H "Content-Type: application/json" 
-d@/tmp/flex.json 
http://eyang-2.openstacklocal:8088/app/v1/services/q1/components/ping
{code}

The payload of JSON shows:
{code}
{
    "number_of_containers" : 3,
    "state" : "FLEXING"
}
{code}

The state is in progressive tense.  There is no clear indicator when querying 
GET status API, whether AM is actually performing the operation, or the state 
was set by user who issued the operation request.

It would be nice to enhance the API to be more responsive by separating user 
requested operation and state change. 
 For example, the pay load could be:
{code}
{
    "number_of_containers" : 3,
    "state" : "FLEX"
}
{code}

Application Master code will change to FLEXING when operation is being worked 
on.  GET status API is invoked.
{code}
...
{
    "number_of_containers" : 3,
    "state" : "FLEXING"
}
...
{code}

When operation is finished, it reaches STABLE state:
{code}
...
{
    "number_of_containers" : 3,
    "state" : "STABLE"
}
...
{code}

The state transition provides better user feedback between state being 
triggered, or server is currently working on the operation.  

The original code was written such that -flex operation is in cli code, which 
switch to FLEXING when it reaches REST API.  For third party developer that 
does not rely on cli code base, this can be confusing.  I think more feedback 
from the community, can help to decide to simplify code base by removing 
present tense state transition, or adding present tense transition for better 
user feedback.


was (Author: eyang):
[~gsaha] Thank you for filing this issue.  The current REST API performs 
operations such as:

{code}
curl -i --negotiate -u : -X PUT -H "Content-Type: application/json" 
-d@/tmp/flex.json 
http://eyang-2.openstacklocal:8088/app/v1/services/q1/components/ping
{code}

The payload of JSON shows:
{code}
{
    "name" : "ping",
    "number_of_containers" : 3,
    "run_privileged_container" : false,
    "state" : "FLEXING"
}
{code}

The state is in progressive tense.  There is no clear indicator when querying 
GET status API, whether AM is actually performing the operation, or the state 
was set by user who issued the operation request.

It would be nice to enhance the API to be more responsive by separating user 
requested operation and state change. 
 For example, the pay load could be:
{code}
{
    "name" : "ping",
    "number_of_containers" : 3,
    "run_privileged_container" : false,
    "state" : "FLEX"
}
{code}

Application Master code will change to FLEXING when operation is being worked 
on.  GET status API is invoked.
{code}
...
{
    "name" : "ping",
    "number_of_containers" : 3,
    "run_privileged_container" : false,
    "state" : "FLEXING"
}
...
{code}

When operation is finished, it reaches STABLE state:
{code}
...
{
    "name" : "ping",
    "number_of_containers" : 3,
    "run_privileged_container" : false,
    "state" : "STABLE"
}
...
{code}

The state transition provides better user feedback between state being 
triggered, or server is currently working on the operation.  

The original code was written such that -flex operation is in cli code, which 
switch to FLEXING when it reaches REST API.  For third party developer that 
does not rely on cli code base, this can be confusing.  I think more feedback 
from the community, can help to decide to simplify code base by removing 
present tense state transition, or adding present tense transition for better 
user feedback.

> ServiceState FLEX should be removed
> -----------------------------------
>
>                 Key: YARN-8161
>                 URL: https://issues.apache.org/jira/browse/YARN-8161
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: yarn-native-services
>    Affects Versions: 3.1.0
>            Reporter: Gour Saha
>            Priority: Major
>
> ServiceState FLEX is not required to trigger flex up/down of containers and 
> should be removed



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to