Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2EE04200B89 for ; Wed, 21 Sep 2016 22:12:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2D818160ADB; Wed, 21 Sep 2016 20:12:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 69FE7160ABC for ; Wed, 21 Sep 2016 22:12:21 +0200 (CEST) Received: (qmail 31113 invoked by uid 500); 21 Sep 2016 20:12:20 -0000 Mailing-List: contact dev-help@reef.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@reef.apache.org Delivered-To: mailing list dev@reef.apache.org Received: (qmail 31096 invoked by uid 99); 21 Sep 2016 20:12:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Sep 2016 20:12:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6EDE02C0050 for ; Wed, 21 Sep 2016 20:12:20 +0000 (UTC) Date: Wed, 21 Sep 2016 20:12:20 +0000 (UTC) From: "Julia (JIRA)" To: dev@reef.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (REEF-1404) IMRU task state Maintenance and Preservation in Evaluator for fault tolerant MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 21 Sep 2016 20:12:22 -0000 [ 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 : IStateManager { private static readonly Logger Logger = Logger.GetLogger(typeof(UpdateTaskState)); /// /// The state that needs to be reserved /// internal UpdateResult 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 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 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)