Interface MetadataCalculationContext

    • 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 various MetadataUtil 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 port
        metadata - 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 of LogicalPort. For example:
            //set the required data ordering for the "input" record port
            input.setRequiredDataOrdering(ctx,ordering)
         
        Parameters:
        logicalPort - the input port
        metadata - 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 port
        forced - 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 port
        dynamic - a value of true means metadata is dynamic.