Class ResourceHints
- java.lang.Object
-
- org.apache.beam.sdk.transforms.resourcehints.ResourceHints
-
public class ResourceHints extends java.lang.Object
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 viaPTransform#setResourceHints
for parts of the pipeline, or globally viaresourceHints
pipeline option.Interpretation of hints is provided by Beam runners.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResourceHints
create()
Creates aResourceHints
instance with no hints.boolean
equals(@Nullable java.lang.Object other)
static ResourceHints
fromOptions(PipelineOptions options)
Creates aResourceHints
instance with hints supplied in options.int
hashCode()
java.util.Map<java.lang.String,ResourceHint>
hints()
ResourceHints
mergeWithOuter(ResourceHints outer)
ResourceHints
withAccelerator(java.lang.String accelerator)
Declares hardware accelerators that are desired to have in the execution environment.ResourceHints
withHint(java.lang.String urn, ResourceHint hint)
Declares a custom resource hint that has a specified URN.ResourceHints
withMinRam(long ramBytes)
Sets desired minimal available RAM size to have in transform's execution environment.ResourceHints
withMinRam(java.lang.String ramBytes)
Sets desired minimal available RAM size to have in transform's execution environment.
-
-
-
Method Detail
-
create
public static ResourceHints create()
Creates aResourceHints
instance with no hints.
-
fromOptions
public static ResourceHints fromOptions(PipelineOptions options)
Creates aResourceHints
instance with hints supplied in options.
-
withMinRam
public ResourceHints withMinRam(long ramBytes)
Sets desired minimal available RAM size to have in transform's execution environment.
-
withMinRam
public ResourceHints withMinRam(java.lang.String ramBytes)
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
public ResourceHints withAccelerator(java.lang.String accelerator)
Declares hardware accelerators that are desired to have in the execution environment.
-
withHint
public ResourceHints withHint(java.lang.String urn, ResourceHint hint)
Declares a custom resource hint that has a specified URN.
-
hints
public java.util.Map<java.lang.String,ResourceHint> hints()
-
mergeWithOuter
public ResourceHints mergeWithOuter(ResourceHints outer)
-
equals
public boolean equals(@Nullable java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-