reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julia (JIRA)" <>
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


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.
       internal class UpdateTaskState<TMapInput, TResult> : IStateManager
        private static readonly Logger Logger = Logger.GetLogger(typeof(UpdateTaskState<TMapInput,

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

        private UpdateTaskState()
            Logger.Log(Level.Info, "UpdateTaskState constructor");
* 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 
        void AddState(T stateObject);
        T GetLatestState();
* 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:
>             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

View raw message