Storing Function State in the Planning Contract - Aster Execution Engine

Teradata Aster® Developer Guide

Product
Aster Execution Engine
Release Number
7.00.02
Published
July 2017
Language
English (United States)
Last Update
2018-04-13
dita:mapPath
xnl1494366523182.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
ffu1489104705746
lifecycle
previous
Product Category
Software

During planning contract negotiation, the function has an opportunity to cache any of its state or computation in the planning reply. The data to be cached may or may not be dependent on the information in the planning request. The data cache is in the form of a byteA variable called functionState in the planning reply. The Queen caches the functionState until execution time.

During execution, an instance of the function is created on all the vWorkers. The chosen completed planning contract is sent by the planner to all the function instances at execution time. The function receives the completed planning contract in the method receiveCompletedPlanningContract(). If any functionState was cached in the planning reply in this particular planning request by the function during compilation time, it is now made available to the function. Thus, this mechanism provides a way for the function to cache its state on one vWorker during planning time and have that state be available to the function on all vWorkers at execution.

You can obtain the maximum allowable size in bytes of the function state by calling PlanningContract.getMaxSizeOfFunctionState().