Class ResourceHints
java.lang.Object
org.apache.beam.sdk.transforms.resourcehints.ResourceHints
Pipeline authors can use resource hints to provide additional information to runners about the
desired aspects of the execution environment. Resource hints can be specified via
PTransform#setResourceHints
for parts of the pipeline,
or globally via resourceHints
pipeline option.
Interpretation of hints is provided by Beam runners.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceHints
create()
Creates aResourceHints
instance with no hints.boolean
static ResourceHints
fromOptions
(PipelineOptions options) Creates aResourceHints
instance with hints supplied in options.int
hashCode()
hints()
mergeWithOuter
(ResourceHints outer) withAccelerator
(String accelerator) Declares hardware accelerators that are desired to have in the execution environment.withCPUCount
(int cpuCount) Sets desired minimal CPU or vCPU count to have in transform's execution environment.withHint
(String urn, ResourceHint hint) Declares a custom resource hint that has a specified URN.withMaxActiveBundlesPerWorker
(int maxActiveBundlesPerWorker) withMinRam
(long ramBytes) Sets desired minimal available RAM size to have in transform's execution environment.withMinRam
(String ramBytes) Sets desired minimal available RAM size to have in transform's execution environment.
-
Method Details
-
create
Creates aResourceHints
instance with no hints. -
fromOptions
Creates aResourceHints
instance with hints supplied in options. -
withMinRam
Sets desired minimal available RAM size to have in transform's execution environment.- Parameters:
ramBytes
- specifies a positive RAM size in bytes. A number greater than 2G (Integer.MAX_VALUE) is typical.
-
withMinRam
Sets desired minimal available RAM size to have in transform's execution environment.- Parameters:
ramBytes
- specifies a human-friendly size string, for example: '10.5 GiB', '4096 MiB', etc.
-
withAccelerator
Declares hardware accelerators that are desired to have in the execution environment. -
withHint
Declares a custom resource hint that has a specified URN. -
withCPUCount
Sets desired minimal CPU or vCPU count to have in transform's execution environment.- Parameters:
cpuCount
- specifies a positive CPU count.
-
withMaxActiveBundlesPerWorker
-
hints
-
mergeWithOuter
-
equals
-
hashCode
public int hashCode()
-