You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Jake Maes (JIRA)" <ji...@apache.org> on 2019/02/26 00:52:02 UTC

[jira] [Updated] (SAMZA-1714) Creating shared context factory for shared context objects

     [ https://issues.apache.org/jira/browse/SAMZA-1714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Maes updated SAMZA-1714:
-----------------------------
    Fix Version/s: 1.0.1
                   1.0.1

> Creating shared context factory for shared context objects
> ----------------------------------------------------------
>
>                 Key: SAMZA-1714
>                 URL: https://issues.apache.org/jira/browse/SAMZA-1714
>             Project: Samza
>          Issue Type: Improvement
>            Reporter: Yi Pan (Data Infrastructure)
>            Assignee: Cameron Lee
>            Priority: Major
>             Fix For: 1.0.1
>
>
> Currently, ContextManager only provides a single scope, single object shared context in the high-level API:
> {code:java}
> public interface ContextManager {
>    public void init(Config config, TaskContext context);
> }{code}
> It is not sufficient to address the following requirements:
> 1) different scope of shared objects (i.e. operator-scope, task-scope, container-scope)
> 2) different shared objects instantiated and shared in the same scope (i.e. user program has task-level shared objects for remote-http-client vs in-mem cache that needs to managed independently)
> An initial idea to implement the SharedContextFactory is the following:
> {code}
> public interface SharedContextFactory {
>     <T extends SharedContext> T createSharedContext(Config config, Scope scope, final SystemContext sysContext, String id);
> }
> public interface SharedContext {
>   void init(Config, final SystemContext sysContext);
>   void close();
> }
> public interface SystemContext {
>   <T extends SharedContext> T getSharedContext(Scope scope, String id);
> }
> public interface SamzaContainerContext extends SystemContext {
> }
> public interface TaskContext extends SystemContext {
> }
> {code}
> Note that this is also needed to serialize operator functions used in high-level API that depends on non-serializable third-party libraries (e.g. Calcite runtime objects used in Samza SQL).



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