Interface SdkHarnessOptions
- All Superinterfaces:
HasDisplayData,MemoryMonitorOptions,PipelineOptions
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classThe default implementation which detects how much memory to use for a process wide cache.static classADefaultValueFactorywhich constructs an instance of the class specified bymaxCacheMemoryUsageMbClassto compute the maximum amount of memory to allocate to the process wide cache within an SDK harness instance.static enumThe set of log levels that can be used in the SDK harness.static interfaceSpecifies the maximum amount of memory to use within the current SDK harness instance.static classDefines a log level override for a specific class, package, or name.Nested classes/interfaces inherited from interface org.apache.beam.sdk.options.PipelineOptions
PipelineOptions.AtomicLongFactory, PipelineOptions.CheckEnabled, PipelineOptions.DirectRunner, PipelineOptions.JobNameFactory, PipelineOptions.UserAgentFactory -
Method Summary
Modifier and TypeMethodDescriptiongetConfiguredLoggerFromOptions(SdkHarnessOptions loggingOptions) Configure log manager's default log level and log level overrides from the sdk harness options, and return the list of configured loggers.This option controls the default log level of all loggers without a log level override.@org.checkerframework.checker.index.qual.NonNegative intThe time limit (in minute) that an SDK worker allows for a PTransform operation before signaling the runner harness to restart the SDK worker.booleanThis option controls whether logging will be redirected through the FnApi.intSize (in MB) of each grouping table used to pre-combine elements.Open modules needed for reflection that access JDK internals with Java 9+.Add modules to the default root set with Java 11+.booleanWhether to include SLF4J MDC in log entries.@org.checkerframework.checker.index.qual.NonNegative intSize (in MB) for the process wide cache within the SDK harness.Class<? extends SdkHarnessOptions.MaxCacheMemoryUsageMb> An instance of this class will be used to specify the maximum amount of memory to allocate to a cache within an SDK harness instance.@org.checkerframework.checker.index.qual.NonNegative floatSize (in % [0 - 100]) for the process wide cache within the SDK harness.This option controls the log levels for specifically named loggers.voidsetBundleProcessorCacheTimeout(Duration duration) voidvoidsetElementProcessingTimeoutMinutes(int value) voidsetEnableLogViaFnApi(boolean enableLogViaFnApi) voidsetGroupingTableMaxSizeMb(int value) voidsetJdkAddOpenModules(List<String> options) voidsetJdkAddRootModules(List<String> options) voidsetLogMdc(boolean value) voidsetMaxCacheMemoryUsageMb(@org.checkerframework.checker.index.qual.NonNegative int value) voidvoidsetMaxCacheMemoryUsagePercent(@org.checkerframework.checker.index.qual.NonNegative float value) voidMethods inherited from interface org.apache.beam.sdk.transforms.display.HasDisplayData
populateDisplayDataMethods inherited from interface org.apache.beam.sdk.options.MemoryMonitorOptions
getGCThrashingPercentagePerPeriod, getGzipCompressHeapDumps, getRemoteHeapDumpLocation, setGCThrashingPercentagePerPeriod, setGzipCompressHeapDumps, setRemoteHeapDumpLocationMethods inherited from interface org.apache.beam.sdk.options.PipelineOptions
as, getGbek, getJobName, getOptionsId, getRunner, getStableUniqueNames, getTempLocation, getUserAgent, outputRuntimeOptions, revision, setGbek, setJobName, setOptionsId, setRunner, setStableUniqueNames, setTempLocation, setUserAgent
-
Method Details
-
getDefaultSdkHarnessLogLevel
This option controls the default log level of all loggers without a log level override. -
setDefaultSdkHarnessLogLevel
-
getSdkHarnessLogLevelOverrides
SdkHarnessOptions.SdkHarnessLogLevelOverrides getSdkHarnessLogLevelOverrides()This option controls the log levels for specifically named loggers.Later options with equivalent names override earlier options.
See
SdkHarnessOptions.SdkHarnessLogLevelOverridesfor more information on how to configure logging on a perClass,Package, or name basis. If used from the command line, the expected format is {"Name":"LogLevel",...}, further details onSdkHarnessOptions.SdkHarnessLogLevelOverrides.from(java.util.Map<java.lang.String, java.lang.String>). -
setSdkHarnessLogLevelOverrides
-
getLogMdc
Whether to include SLF4J MDC in log entries. -
setLogMdc
void setLogMdc(boolean value) -
getEnableLogViaFnApi
This option controls whether logging will be redirected through the FnApi. -
setEnableLogViaFnApi
void setEnableLogViaFnApi(boolean enableLogViaFnApi) -
getGroupingTableMaxSizeMb
Size (in MB) of each grouping table used to pre-combine elements. Larger values may reduce the amount of data shuffled. If unset, defaults to 100 MB.CAUTION: If set too large, workers may run into OOM conditions more easily, each worker may have many grouping tables in-memory concurrently.
CAUTION: This option does not apply to portable runners such as Dataflow Prime. See
setMaxCacheMemoryUsageMb(int),setMaxCacheMemoryUsagePercent(float), orsetMaxCacheMemoryUsageMbClass(java.lang.Class<? extends org.apache.beam.sdk.options.SdkHarnessOptions.MaxCacheMemoryUsageMb>)to configure memory thresholds that apply to the grouping table and other cached objects. -
setGroupingTableMaxSizeMb
void setGroupingTableMaxSizeMb(int value) -
getMaxCacheMemoryUsageMb
@InstanceFactory(DefaultMaxCacheMemoryUsageMbFactory.class) @org.checkerframework.checker.index.qual.NonNegative int getMaxCacheMemoryUsageMb()Size (in MB) for the process wide cache within the SDK harness. The cache is responsible for storing all values which are cached within a bundle and across bundles such as side inputs and user state.CAUTION: If set too large, SDK harness instances may run into OOM conditions more easily.
See
SdkHarnessOptions.DefaultMaxCacheMemoryUsageMbFactoryfor details on howmaxCacheMemoryUsageMbis computed if this parameter is unspecified. -
setMaxCacheMemoryUsageMb
void setMaxCacheMemoryUsageMb(@org.checkerframework.checker.index.qual.NonNegative int value) -
getMaxCacheMemoryUsagePercent
@Float(20.0f) @org.checkerframework.checker.index.qual.NonNegative float getMaxCacheMemoryUsagePercent()Size (in % [0 - 100]) for the process wide cache within the SDK harness. The cache is responsible for storing all values which are cached within a bundle and across bundles such as side inputs and user state.This parameter will only be used if an explicit value was not specified for
maxCacheMemoryUsageMb. -
setMaxCacheMemoryUsagePercent
void setMaxCacheMemoryUsagePercent(@org.checkerframework.checker.index.qual.NonNegative float value) -
getMaxCacheMemoryUsageMbClass
@Class(DefaultMaxCacheMemoryUsageMb.class) Class<? extends SdkHarnessOptions.MaxCacheMemoryUsageMb> getMaxCacheMemoryUsageMbClass()An instance of this class will be used to specify the maximum amount of memory to allocate to a cache within an SDK harness instance.This parameter will only be used if an explicit value was not specified for
maxCacheMemoryUsageMb.See
SdkHarnessOptions.DefaultMaxCacheMemoryUsageMbfor details on howmaxCacheMemoryUsageMbis computed if this parameter is unspecified. -
setMaxCacheMemoryUsageMbClass
-
getJdkAddOpenModules
Open modules needed for reflection that access JDK internals with Java 9+.With JDK 16+, JDK internals are strongly encapsulated and can result in an InaccessibleObjectException being thrown if a tool or library uses reflection that access JDK internals. If you see these errors in your worker logs, you can pass in modules to open using the format
module/package=target-module[,module2/package2=another-target-module]to allow access to the library. E.g.--jdkAddOpenModules=java.base/java.lang=jamm. This will set--add-opensJVM flag in SDK Harness invocation.You may see warnings that jamm, a library used to more accurately size objects, is unable to make a private field accessible. To resolve the warning, open the specified module/package to jamm.
-
setJdkAddOpenModules
-
getJdkAddRootModules
Add modules to the default root set with Java 11+.Set
--add-modulesJVM flag in SDK Harness invocation. E.g.--jdkAddModules=module1,module2. -
setJdkAddRootModules
-
getConfiguredLoggerFromOptions
Configure log manager's default log level and log level overrides from the sdk harness options, and return the list of configured loggers. -
getBundleProcessorCacheTimeout
@Hidden @InstanceFactory(BundleProcessorCacheTimeoutFactory.class) Duration getBundleProcessorCacheTimeout() -
setBundleProcessorCacheTimeout
-
getElementProcessingTimeoutMinutes
@org.checkerframework.checker.index.qual.NonNegative int getElementProcessingTimeoutMinutes()The time limit (in minute) that an SDK worker allows for a PTransform operation before signaling the runner harness to restart the SDK worker. -
setElementProcessingTimeoutMinutes
void setElementProcessingTimeoutMinutes(int value)
-