Module datarush.library
Package com.pervasive.datarush.operators
Interface MetadataCalculationContext
-
- All Superinterfaces:
MetadataContext
- All Known Subinterfaces:
IterativeMetadataContext
,StreamingMetadataContext
public interface MetadataCalculationContext extends MetadataContext
Base interface for all contexts in which metadata is being computed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompilationLevel
getCompilationLevel()
Returns the compilation level with which the graph is being compiledLogicalOperator
getOperator()
Returns the operator bound to this context.void
setOutputMetadata(LogicalPort logicalPort, PortMetadata metadata)
Sets the metadata associated with the given output portvoid
setOutputMetadataDynamic(AbstractModelPort<?> port, boolean dynamic)
Indicates that the metadata for the given output port is dynamic.void
setRequiredMetadata(LogicalPort logicalPort, PortMetadata metadata)
Sets the required metadata for the given input.void
setStagingForced(LogicalPort inputPort, boolean forced)
Can be used to force staging (writing to disk) of input data.-
Methods inherited from interface com.pervasive.datarush.operators.MetadataContext
getCombinedMetadata, getEngineConfig, getFileClient, getMaxParallelism, getPath, getRequiredMetadata, getSourceMaxParallelism, getSourceMetadata, isParallel, isSourceConnected, isSourceParallel
-
-
-
-
Method Detail
-
getCompilationLevel
CompilationLevel getCompilationLevel()
Returns the compilation level with which the graph is being compiled- Returns:
- the compilation level
-
getOperator
LogicalOperator getOperator()
Returns the operator bound to this context. Typically operators code does not need this method; instead it is used by variousMetadataUtil
methods for convenience.- Returns:
- the operator bound to this context.
-
setOutputMetadata
void setOutputMetadata(LogicalPort logicalPort, PortMetadata metadata)
Sets the metadata associated with the given output port- Parameters:
logicalPort
- the output portmetadata
- the output metadata
-
setRequiredMetadata
void setRequiredMetadata(LogicalPort logicalPort, PortMetadata metadata)
Sets the required metadata for the given input. Note that operators should generally not call this method directly. Rather they should use one of the type-safe/convenience methods on the various subclasses ofLogicalPort
. For example://set the required data ordering for the "input" record port input.
setRequiredDataOrdering
(ctx,ordering)- Parameters:
logicalPort
- the input portmetadata
- the required metadata
-
setStagingForced
void setStagingForced(LogicalPort inputPort, boolean forced)
Can be used to force staging (writing to disk) of input data. Normally input data is streamed from source operator to target operator if possible. In certain scenarios, this can result in dataflow deadlock. The framework automatically handles these scenarios by dynamically writing data to disk as needed in order to alleviate deadlock. This flag can be used those scenarios since staging can be handled much more efficiently if it is declared up-front rather than discovered at runtime.- Parameters:
inputPort
- must be an input portforced
- whether to force staging
-
setOutputMetadataDynamic
void setOutputMetadataDynamic(AbstractModelPort<?> port, boolean dynamic)
Indicates that the metadata for the given output port is dynamic. If metadata is dynamic,outputMetadata
must not be specified. The graph is compiled and executed up until this operator. Following execution of this operator, downstream operators can then be compiled. Note that dynamic metadata should be used sparingly as it causes graph compilation errors to be postponed until after a (potentially) long operation.- Parameters:
port
- the output portdynamic
- a value of true means metadata is dynamic.
-
-