类 RuntimeUtils
java.lang.Object
org.apache.pulsar.functions.runtime.RuntimeUtils
Util class for common runtime functionality.
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明composeCmd(InstanceConfig instanceConfig, String instanceFile, String extraDependenciesDir, String logDirectory, String originalCodeFileName, String originalTransformFunctionFileName, String pulsarServiceUrl, String stateStorageServiceUrl, AuthenticationConfig authConfig, String shardId, Integer grpcPort, Long expectedHealthCheckInterval, String logConfigFile, String secretsProviderClassName, String secretsProviderConfig, Boolean installUserCodeDependencies, String pythonDependencyRepository, String pythonExtraDependencyRepository, String narExtractionDirectory, String functionInstanceClassPath, String pulsarWebServiceUrl) static StringgenFunctionLogFolder(String logDirectory, InstanceConfig instanceConfig) getArgsBeforeCmd(InstanceConfig instanceConfig, String extraDependenciesDir) getCmd(InstanceConfig instanceConfig, String instanceFile, String extraDependenciesDir, String logDirectory, String originalCodeFileName, String originalTransformFunctionFileName, String pulsarServiceUrl, String stateStorageServiceUrl, AuthenticationConfig authConfig, String shardId, Integer grpcPort, Long expectedHealthCheckInterval, String logConfigFile, String secretsProviderClassName, String secretsProviderConfig, Boolean installUserCodeDependencies, String pythonDependencyRepository, String pythonExtraDependencyRepository, String narExtractionDirectory, String functionInstanceClassPath, boolean k8sRuntime, String pulsarWebServiceUrl) getGoInstanceCmd(InstanceConfig instanceConfig, AuthenticationConfig authConfig, String originalCodeFileName, String pulsarServiceUrl, String stateStorageServiceUrl, String pulsarWebServiceUrl, boolean k8sRuntime) Different from python and java function, Go function uploads a complete executable file(including: instance file + user code file).static StringgetPrometheusMetrics(int metricsPort) static <T> TgetRuntimeFunctionConfig(Map<String, Object> configMap, Class<T> functionRuntimeConfigClass) static voidstatic StringsanitizeFileName(String fileName) static String[]splitRuntimeArgs(String input) Regex for splitting a string using space when not surrounded by single or double quotes.
-
字段详细资料
-
FUNCTIONS_INSTANCE_CLASSPATH
- 另请参阅:
-
-
构造器详细资料
-
RuntimeUtils
public RuntimeUtils()
-
-
方法详细资料
-
composeCmd
public static List<String> composeCmd(InstanceConfig instanceConfig, String instanceFile, String extraDependenciesDir, String logDirectory, String originalCodeFileName, String originalTransformFunctionFileName, String pulsarServiceUrl, String stateStorageServiceUrl, AuthenticationConfig authConfig, String shardId, Integer grpcPort, Long expectedHealthCheckInterval, String logConfigFile, String secretsProviderClassName, String secretsProviderConfig, Boolean installUserCodeDependencies, String pythonDependencyRepository, String pythonExtraDependencyRepository, String narExtractionDirectory, String functionInstanceClassPath, String pulsarWebServiceUrl) throws Exception - 抛出:
Exception
-
getArgsBeforeCmd
public static List<String> getArgsBeforeCmd(InstanceConfig instanceConfig, String extraDependenciesDir) -
getGoInstanceCmd
public static List<String> getGoInstanceCmd(InstanceConfig instanceConfig, AuthenticationConfig authConfig, String originalCodeFileName, String pulsarServiceUrl, String stateStorageServiceUrl, String pulsarWebServiceUrl, boolean k8sRuntime) throws IOException Different from python and java function, Go function uploads a complete executable file(including: instance file + user code file). Its parameter list is provided to the broker in the form of a yaml file, the advantage of this approach is that backward compatibility is guaranteed. In Java and Python the instance is managed by broker (or function worker) so the changes in command line is under control; but in Go the instance is compiled with the user function, so pulsar doesn't have the control what instance is used in the function. Hence in order to support BC for go function, we can't dynamically add more commandline arguments. Using an instance config to pass the parameters from function worker to go instance is the best way for maintaining the BC.When we run the go function, we only need to specify the location of the go-function file and the yaml file. The content of the yaml file will be automatically generated according to the content provided by instanceConfig.
- 抛出:
IOException
-
getCmd
public static List<String> getCmd(InstanceConfig instanceConfig, String instanceFile, String extraDependenciesDir, String logDirectory, String originalCodeFileName, String originalTransformFunctionFileName, String pulsarServiceUrl, String stateStorageServiceUrl, AuthenticationConfig authConfig, String shardId, Integer grpcPort, Long expectedHealthCheckInterval, String logConfigFile, String secretsProviderClassName, String secretsProviderConfig, Boolean installUserCodeDependencies, String pythonDependencyRepository, String pythonExtraDependencyRepository, String narExtractionDirectory, String functionInstanceClassPath, boolean k8sRuntime, String pulsarWebServiceUrl) throws Exception - 抛出:
Exception
-
genFunctionLogFolder
-
getPrometheusMetrics
- 抛出:
IOException
-
splitRuntimeArgs
Regex for splitting a string using space when not surrounded by single or double quotes. -
getRuntimeFunctionConfig
-
registerDefaultCollectors
-
sanitizeFileName
-