Class ExternalResourceOptions


  • @PublicEvolving
    public class ExternalResourceOptions
    extends Object
    Configuration options for external resources and external resource drivers.
    • Field Detail

      • EXTERNAL_RESOURCE_AMOUNT_SUFFIX

        public static final String EXTERNAL_RESOURCE_AMOUNT_SUFFIX
        The amount of the external resource per task executor. This is used as a suffix in an actual config.
        See Also:
        Constant Field Values
      • EXTERNAL_RESOURCE_DRIVER_FACTORY_SUFFIX

        public static final String EXTERNAL_RESOURCE_DRIVER_FACTORY_SUFFIX
        The driver factory class of the external resource to use. This is used as a suffix in an actual config.
        See Also:
        Constant Field Values
      • EXTERNAL_RESOURCE_DRIVER_PARAM_SUFFIX

        public static final String EXTERNAL_RESOURCE_DRIVER_PARAM_SUFFIX
        The suffix of custom config options' prefix for the external resource.
        See Also:
        Constant Field Values
      • EXTERNAL_RESOURCE_LIST

        public static final ConfigOption<List<String>> EXTERNAL_RESOURCE_LIST
        List of the resource_name of all external resources with delimiter ";", e.g. "gpu;fpga" for two external resource gpu and fpga. The resource_name will be used to splice related config options for external resource. Only the resource_name defined here will go into effect in external resource framework.

        Example:

        
         external-resources = gpu;fpga
        
         external-resource.gpu.driver-factory.class: org.apache.flink.externalresource.gpu.GPUDriverFactory
         external-resource.gpu.amount: 2
         external-resource.gpu.param.type: nvidia
        
         external-resource.fpga.driver-factory.class: org.apache.flink.externalresource.fpga.FPGADriverFactory
         external-resource.fpga.amount: 1
         
      • EXTERNAL_RESOURCE_DRIVER_FACTORY_CLASS

        public static final ConfigOption<String> EXTERNAL_RESOURCE_DRIVER_FACTORY_CLASS
        Defines the factory class name for the external resource identified by >resource_name<. The factory will be used to instantiate the ExternalResourceDriver at the TaskExecutor side.

        It is intentionally included into user docs while unused.

      • EXTERNAL_RESOURCE_AMOUNT

        public static final ConfigOption<Long> EXTERNAL_RESOURCE_AMOUNT
        The amount for the external resource specified by >resource_name< per TaskExecutor.

        It is intentionally included into user docs while unused.

      • EXTERNAL_RESOURCE_DRIVER_PARAM

        public static final ConfigOption<String> EXTERNAL_RESOURCE_DRIVER_PARAM
        The naming pattern of custom config options for the external resource specified by >resource_name<. Only the configurations that follow this pattern would be passed into the driver factory of that external resource.

        It is intentionally included into user docs while unused.

    • Constructor Detail

      • ExternalResourceOptions

        public ExternalResourceOptions()
    • Method Detail

      • genericKeyWithSuffix

        public static String genericKeyWithSuffix​(String suffix)
      • getAmountConfigOptionForResource

        public static String getAmountConfigOptionForResource​(String resourceName)
        Generate the config option key for the amount of external resource with resource_name.
      • getSystemConfigKeyConfigOptionForResource

        public static String getSystemConfigKeyConfigOptionForResource​(String resourceName,
                                                                       String suffix)
        Generate the config option key for the configuration key of external resource in the deploying system.
      • getExternalResourceDriverFactoryConfigOptionForResource

        public static String getExternalResourceDriverFactoryConfigOptionForResource​(String resourceName)
        Generate the config option key for the factory class name of ExternalResourceDriver.
      • getExternalResourceParamConfigPrefixForResource

        public static String getExternalResourceParamConfigPrefixForResource​(String resourceName)
        Generate the suffix option key prefix for the user-defined params for external resources.