[ 
https://issues.apache.org/jira/browse/BEAM-2085?focusedWorklogId=589947&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-589947
 ]

ASF GitHub Bot logged work on BEAM-2085:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Apr/21 18:40
            Start Date: 27/Apr/21 18:40
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on a change in pull request #14607:
URL: https://github.com/apache/beam/pull/14607#discussion_r621496835



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/PTransform.java
##########
@@ -178,6 +179,34 @@ public String getName() {
     return name != null ? name : getKindString();
   }
 
+  /**
+   * Sets resource hints for the transform.
+   *
+   * @param resourceHints a {@link ResourceHints} instance.
+   * @return a reference to the same transfrom instance.
+   *     <p>For example:
+   *     <pre>{@code
+   * Pipeline p = ...
+   * ...
+   * p.apply(new 
SomeTransform().setResourceHints(ResourceHints.create().withMinRam("6 GiB")))
+   * ...
+   *
+   * }</pre>
+   */
+  public PTransform<InputT, OutputT> setResourceHints(ResourceHints 
resourceHints) {
+    this.resourceHints = resourceHints;
+    return this;
+  }
+
+  /** Returns resource hints set on the transform. */
+  public ResourceHints getResourceHints() {
+    if (resourceHints == null) {

Review comment:
       I think we can make initialization in the field declaration. We needed 
this pattern in Python since Python (unlike Java) does not call superclass 
constructor by default.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 589947)
    Time Spent: 37h 50m  (was: 37h 40m)

> Transforms could give hints to runners on resource requirements
> ---------------------------------------------------------------
>
>                 Key: BEAM-2085
>                 URL: https://issues.apache.org/jira/browse/BEAM-2085
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model, runner-core, sdk-java-core
>    Affects Versions: Not applicable
>            Reporter: Ismaël Mejía
>            Assignee: Valentyn Tymofieiev
>            Priority: P3
>              Labels: Clarified
>          Time Spent: 37h 50m
>  Remaining Estimate: 0h
>
> As discussed in BEAM-673 runners can allocate workers to accomplish their 
> work in a better way if they can take into account some hints from the 
> transforms, e.g. a source can hint data locality and with this information 
> the runner can allocate the workers in an better way, this can also be the 
> case with a particular transform that can suggest to the runner to be 
> executed in a worker with a specific resource, e.g. GPU.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to