[
https://issues.apache.org/jira/browse/FLINK-5133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15882750#comment-15882750
]
ASF GitHub Bot commented on FLINK-5133:
---------------------------------------
Github user StephanEwen commented on a diff in the pull request:
https://github.com/apache/flink/pull/3303#discussion_r102942856
--- Diff:
flink-java/src/main/java/org/apache/flink/api/java/operators/DataSink.java ---
@@ -278,4 +283,60 @@ public int getParallelism() {
return this;
}
+
+ /**
+ * Returns the minimum resource of this data sink. If no minimum
resource has been set,
+ * it returns the default empty resource.
+ *
+ * @return The minimum resource of this data sink.
+ */
+ public ResourceSpec getMinResource() {
+ return this.minResource;
+ }
+
+ /**
+ * Returns the minimum resource of this data sink. If no maximum
resource has been set,
+ * it returns the default empty resource.
+ *
+ * @return The maximum resource of this data sink.
+ */
+ public ResourceSpec getMaxResource() {
+ return this.maxResource;
+ }
+
+ /**
+ * Sets the minimum and maximum resources for this data sink. This
overrides the default empty resource.
+ * The minimum resource must be satisfied and the maximum resource
specifies the upper bound
+ * for dynamic resource resize.
+ *
+ * @param minResource The minimum resource for this data sink.
+ * @param maxResource The maximum resource for this data sink.
+ * @return The data sink with set minimum and maximum resources.
+ */
+ public DataSink<T> setResource(ResourceSpec minResource, ResourceSpec
maxResource) {
+ Preconditions.checkArgument(minResource != null && maxResource
!= null,
--- End diff --
Minor comment: Most places throw `NullPointerException` (checkNotNull) for
null arguments and use `IllegalArgumentException` (checkArgument) for non-null
but invalid parameters.
> Support to set resource for operator in DataStream and DataSet
> --------------------------------------------------------------
>
> Key: FLINK-5133
> URL: https://issues.apache.org/jira/browse/FLINK-5133
> Project: Flink
> Issue Type: Sub-task
> Components: DataSet API, DataStream API
> Reporter: zhijiang
> Assignee: zhijiang
>
> This is part of the fine-grained resource configuration.
> For *DataStream*, the *setResource* API will be setted onto
> *SingleOutputStreamOperator* similar with other existing properties like
> parallelism, name, etc.
> For *DataSet*, the *setResource* API will be setted onto *Operator* in the
> similar way.
> There are two parameters described with minimum *ResourceSpec* and maximum
> *ResourceSpec* separately in the API for considering resource resize in
> future improvements.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)