Interface SdkHarnessOptions
- All Superinterfaces:
HasDisplayData
,MemoryMonitorOptions
,PipelineOptions
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
static class
The default implementation which detects how much memory to use for a process wide cache.static class
ADefaultValueFactory
which constructs an instance of the class specified bymaxCacheMemoryUsageMbClass
to compute the maximum amount of memory to allocate to the process wide cache within an SDK harness instance.static enum
The set of log levels that can be used in the SDK harness.static interface
Specifies the maximum amount of memory to use within the current SDK harness instance.static class
Defines 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.boolean
This option controls whether logging will be redirected through the FnApi.int
Size (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+.boolean
Whether to include SLF4J MDC in log entries.@org.checkerframework.checker.index.qual.NonNegative int
Size (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 float
Size (in % [0 - 100]) for the process wide cache within the SDK harness.This option controls the log levels for specifically named loggers.void
setBundleProcessorCacheTimeout
(Duration duration) void
void
setEnableLogViaFnApi
(boolean enableLogViaFnApi) void
setGroupingTableMaxSizeMb
(int value) void
setJdkAddOpenModules
(List<String> options) void
setJdkAddRootModules
(List<String> options) void
setLogMdc
(boolean value) void
setMaxCacheMemoryUsageMb
(@org.checkerframework.checker.index.qual.NonNegative int value) void
void
setMaxCacheMemoryUsagePercent
(@org.checkerframework.checker.index.qual.NonNegative float value) void
Methods inherited from interface org.apache.beam.sdk.transforms.display.HasDisplayData
populateDisplayData
Methods inherited from interface org.apache.beam.sdk.options.MemoryMonitorOptions
getGCThrashingPercentagePerPeriod, getGzipCompressHeapDumps, getRemoteHeapDumpLocation, setGCThrashingPercentagePerPeriod, setGzipCompressHeapDumps, setRemoteHeapDumpLocation
Methods inherited from interface org.apache.beam.sdk.options.PipelineOptions
as, getJobName, getOptionsId, getRunner, getStableUniqueNames, getTempLocation, getUserAgent, outputRuntimeOptions, revision, 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.SdkHarnessLogLevelOverrides
for 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.DefaultMaxCacheMemoryUsageMbFactory
for details on howmaxCacheMemoryUsageMb
is 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.DefaultMaxCacheMemoryUsageMb
for details on howmaxCacheMemoryUsageMb
is 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-opens
JVM 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-modules
JVM 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
-