You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datafu.apache.org by "Philip (flip) Kromer (JIRA)" <ji...@apache.org> on 2014/05/20 11:24:38 UTC

[jira] [Updated] (DATAFU-50) SimpleEvalFunc should extend ContextualEvalFunc, have good lifecycle hooks

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

Philip (flip) Kromer updated DATAFU-50:
---------------------------------------

    Attachment: 0001-DATAFU-50-SimpleEvalFunc-should-extend-ContextualEva.patch

Decided to call the method 'onReady', because I don't think the user should be any more interested in when or why it's called than "OK here's your chance".

* SimpleEvalFunc now extends ContextualEvalFunc (rather than plain-old-EvalFunc), letting front end talk to back end
* ContextualEvalFunc has a hook method onReady(in_schema, out_schema) -- this is sugar for UDFs that simply want an opportunity to capture or set values once for a job, rather than legitimately wanting to override outputSchema().
* Updates AliasableEvalFunc to use onReady



> SimpleEvalFunc should extend ContextualEvalFunc, have good lifecycle hooks
> --------------------------------------------------------------------------
>
>                 Key: DATAFU-50
>                 URL: https://issues.apache.org/jira/browse/DATAFU-50
>             Project: DataFu
>          Issue Type: Improvement
>            Reporter: Philip (flip) Kromer
>              Labels: Utils
>         Attachments: 0001-DATAFU-50-SimpleEvalFunc-should-extend-ContextualEva.patch
>
>
> Being able to squirrel away values frozen at frontend-launch-time is very handy. 
> This does two things:
> * makes SimpleEvalFunc extend ContextualEvalFunc rather than plain-old-EvalFunc. This seems harmless and gains you all that power of Contextualism.
> * Adds a hook method "void schemaReadyHook(inputSchema,outputSchema)" to ContextualEvalFunc, called once the schemata are prepared. This acts as sugar for classes that want to set properties at front-end time to be used at later points but which, like most SimpleEvalFunc's, want nothing to do with schema calculation. In ContextualEvalFunc it does nothing; subclasses may override it and if so must call super. schemaReadyHook().



--
This message was sent by Atlassian JIRA
(v6.2#6252)