reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julia (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (REEF-1404) IMRU task state Maintenance and Preservation in Evaluator for fault tolerant
Date Wed, 21 Sep 2016 20:12:20 GMT

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

Julia commented on REEF-1404:
-----------------------------

To summaries, there are two ways to do the State management. 

Use empty interface
* Define an empty interface IStateManager at Evaluator.Context so that both context and task
can inject from it and share the same singleton
* Client like IMRU can define UpdateTaskState and MapTaskState which implement IStateManager
and wraps the data.e.g.
{noformat}
       internal class UpdateTaskState<TMapInput, TResult> : IStateManager
    {
        private static readonly Logger Logger = Logger.GetLogger(typeof(UpdateTaskState<TMapInput,
TResult>));

        /// <summary>
        /// The state that needs to be reserved
        /// </summary>
        internal UpdateResult<TMapInput, TResult> State { get; set; }

        [Inject]
        private UpdateTaskState()
        {
            Logger.Log(Level.Info, "UpdateTaskState constructor");
        }
    }
{noformat}
* pros - The injection at context is easier as there is no T involved. 
* cons - There is no API defined. It is up to the user how to defined the State method. Gives
user flexibility but also no constrains. 

Define APIs in the interface
* IStatemanager<T> has well defined interface 
{noformat}
        void AddState(T stateObject);
        T GetLatestState();
{noformat}
* Client like IMRU can have its own implementation for the interface
* Client can replace T with any class which contains the data they want to reserve.
* pros - As the API mostly will end up as get and set data, fixed API signature is clear.
* corns - The client needs to specify the type T for the injection in context. 

ICodec<IStateManager> can be implemented/injected if serialization is needed. 

> IMRU task state Maintenance and Preservation in Evaluator for fault tolerant
> ----------------------------------------------------------------------------
>
>                 Key: REEF-1404
>                 URL: https://issues.apache.org/jira/browse/REEF-1404
>             Project: REEF
>          Issue Type: Task
>            Reporter: Julia
>              Labels: FT
>
> IMRU task should be able to 
> * Maintenance and preservation the state
> * When restart, able to recover from the previous sate



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

Mime
View raw message