flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StephanEwen <...@git.apache.org>
Subject [GitHub] flink pull request #3303: [FLINK-5133][core] Support to set resource for ope...
Date Fri, 24 Feb 2017 14:07:39 GMT
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3303#discussion_r102946397
  
    --- Diff: flink-scala/src/main/scala/org/apache/flink/api/scala/DataSet.scala ---
    @@ -178,6 +178,60 @@ class DataSet[T: ClassTag](set: JavaDataSet[T]) {
       }
     
       /**
    +   * Sets the minimum and maximum resources of this operation.
    +   */
    +  def setResource(minResource: ResourceSpec, maxResource: ResourceSpec) = {
    +    javaSet match {
    +      case ds: DataSource[_] => ds.setResource(minResource, maxResource)
    +      case op: Operator[_, _] => op.setResource(minResource, maxResource)
    +      case di: DeltaIterationResultSet[_, _] =>
    +        di.getIterationHead.setResource(minResource, maxResource)
    +      case _ =>
    +        throw new UnsupportedOperationException("Operator " + javaSet.toString + " cannot
have " +
    +          "resource.")
    +    }
    +    this
    +  }
    +
    +  /**
    +   * Sets the resource of this operation.
    +   */
    +  def setResource(resource: ResourceSpec) = {
    +    javaSet match {
    --- End diff --
    
    May be easier to just call `setResource(resource, resource)` in this function.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message