Class AbstractFunctionType<T extends step.functions.Function>

java.lang.Object
step.functions.type.AbstractFunctionType<T>

public abstract class AbstractFunctionType<T extends step.functions.Function> extends Object
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
    • MISSING_ENV_VARIABLE_MESSAGE

      public static final String MISSING_ENV_VARIABLE_MESSAGE
      See Also:
    • fileResolver

      protected step.attachments.FileResolver fileResolver
    • fileResolverCache

      protected com.google.common.cache.LoadingCache<String,File> fileResolverCache
    • gridFileServices

      protected step.grid.GridFileService gridFileServices
    • functionTypeConfiguration

      protected FunctionTypeConfiguration functionTypeConfiguration
    • handlerPackageVersion

      protected step.grid.filemanager.FileVersion handlerPackageVersion
  • Constructor Details

    • AbstractFunctionType

      public AbstractFunctionType()
  • Method Details

    • setFunctionTypeConfiguration

      protected void setFunctionTypeConfiguration(FunctionTypeConfiguration functionTypeConfiguration)
    • setFileResolver

      protected void setFileResolver(step.attachments.FileResolver fileResolver)
    • setGridFileServices

      protected void setGridFileServices(step.grid.GridFileService gridFileServices)
    • init

      protected void init()
    • getTokenSelectionCriteria

      public Map<String,step.grid.tokenpool.Interest> getTokenSelectionCriteria(T function)
    • getHandlerChain

      public abstract String getHandlerChain(T function)
    • getHandlerPackage

      public step.grid.filemanager.FileVersionId getHandlerPackage(T function)
    • isHandlerCleanable

      public String isHandlerCleanable()
    • closeRegisteredCloseable

      protected static void closeRegisteredCloseable(List<AutoCloseable> registeredCloseable)
    • getHandlerProperties

      public abstract AbstractFunctionType.HandlerProperties getHandlerProperties(T function, step.core.AbstractStepContext executionContext)
    • beforeFunctionCall

      public void beforeFunctionCall(T function, step.functions.io.Input<?> input, Map<String,String> properties) throws FunctionExecutionException
      Throws:
      FunctionExecutionException
    • afterFunctionCall

      public void afterFunctionCall(T function, step.functions.io.Input<?> input, Map<String,String> properties) throws FunctionExecutionException
      Throws:
      FunctionExecutionException
    • newFunction

      public abstract T newFunction()
    • newFunction

      public T newFunction(Map<String,String> configuration)
    • setupFunction

      public void setupFunction(T function) throws SetupFunctionException
      Throws:
      SetupFunctionException
    • updateFunction

      public T updateFunction(T function) throws FunctionTypeException
      Throws:
      FunctionTypeException
    • copyFunction

      public T copyFunction(T function) throws FunctionTypeException
      Throws:
      FunctionTypeException
    • registerFile

      protected AbstractFunctionType<T>.FileVersionCloseable registerFile(step.core.dynamicbeans.DynamicValue<String> dynamicValue, String propertyName, Map<String,String> props, boolean cleanable, step.core.AbstractStepContext executionContext)
      Register the provided file in the grid's file manager for a given property. Enrich the map with the resulting file and version ids.
      Parameters:
      dynamicValue - the DynamicValue of the file's path to be registered
      propertyName - the name of the property for which we register the file
      props - the map will be enriched with the propertyName id and version of the registered file that can be later used to retrieve the file
      cleanable - whether this version of the file can be cleaned-up at runtime
      executionContext - the current execution context (should be defined if the function is executing via ExecutionEngine with execution-scope resource manager)
      Returns:
      a FileVersionCloseable wrapping the FileVersion of the registered file. Closing the wrapper, release the usage on this file version. The FileVersion can be used for later retrieval of this version
      Throws:
      RuntimeException
    • registerFile

      protected AbstractFunctionType<T>.FileVersionCloseable registerFile(File file, String propertyName, Map<String,String> props, boolean cleanable)
      Register the provided file in the grid's file manager for a given property. Enrich the map with the resulting file and version ids.
      Parameters:
      file - the File of the resource to be registered
      propertyName - the name of the property for which we register the file
      props - the Map will be enriched with the propertyName id and version of the registered file that can be later used to retrieve the file
      cleanable - whether this version of the file can be cleaned-up at runtime
      Returns:
      a FileVersionCloseable wrapping the FileVersion of the registered file. Closing the wrapper, release the usage on this file version. The FileVersion can be used for later retrieval of this version
      Throws:
      RuntimeException
    • registerResource

      protected AbstractFunctionType<T>.FileVersionCloseable registerResource(ClassLoader cl, String resourceName, boolean isDirectory, String propertyName, Map<String,String> props, boolean cleanable)
      Register the provided file as resource in the grid's file manager for a given property. Enrich the map with the resulting file and version ids.
      Parameters:
      cl - the ClassLoader containing the file as resource
      resourceName - the name of the file's resource
      isDirectory - whether this resource is a directory
      propertyName - the name of the property for which we register the file
      props - the Map will be enriched with the propertyName id and version of the registered file that can be later used to retrieve the file
      cleanable - whether this version of the file can be cleaned-up at runtime
      Returns:
      the FileVersion of the registered file. The FileVersion can be used for later retrieval of this version
      Throws:
      RuntimeException
    • registerResource

      protected step.grid.filemanager.FileVersion registerResource(ClassLoader cl, String resourceName, boolean isDirectory, boolean cleanable)
      Register the provided file as resource in the grid's file manager.
      Parameters:
      cl - the ClassLoader containing the file as resource
      resourceName - the name of the file's resource
      isDirectory - whether this resource is a directory
      cleanable - whether this version of the file can be cleaned-up at runtime
      Returns:
      the FileVersion of the registered file. The FileVersion can be used for later retrieval of this version
      Throws:
      RuntimeException
    • getResourceManager

      protected step.resources.ResourceManager getResourceManager(step.core.AbstractStepContext executionContext)
    • deleteFunction

      public void deleteFunction(T function) throws FunctionTypeException
      Throws:
      FunctionTypeException