You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/06/03 14:21:56 UTC

[GitHub] [flink] zhijiangW commented on a change in pull request #8529: [FLINK-12603][network] Remove getOwningTaskName method from InputGate

zhijiangW commented on a change in pull request #8529: [FLINK-12603][network] Remove getOwningTaskName method from InputGate
URL: https://github.com/apache/flink/pull/8529#discussion_r289869592
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/TaskInfo.java
 ##########
 @@ -132,11 +122,67 @@ public String getTaskNameWithSubtasks() {
 		return this.taskNameWithSubtasks;
 	}
 
+	/**
+	 * Returns the name of the task, appended with the subtask indicator and execution attempt id.
+	 *
+	 * @return The name of the task, with subtask indicator and execution id.
+	 */
+	public String getTaskNameWithSubtaskAndID() {
+		return taskNameWithSubtaskAndID;
+	}
+
 	/**
 	 * Returns the allocation id for where this task is executed.
 	 * @return the allocation id for where this task is executed.
 	 */
 	public String getAllocationIDAsString() {
 		return allocationIDAsString;
 	}
+
+	// ------------------------------------------------------------------------
+	//  Factory Utilities
+	// ------------------------------------------------------------------------
+
+	public static TaskInfo create(
+		String taskName,
+		int maxNumberOfParallelSubtasks,
+		int numberOfParallelSubtasks,
+		int subtaskIndex,
+		int attemptNumber,
+		String attemptIDAsString,
 
 Review comment:
   Yes, it is because of module dependency.
   I do not think we are abusing a class, because the previous usage of `allocationIDAsString` also has the same issue.
   In the first version I generates the full task name with attempt id in task class and then pass this string full task name into constructor of `TaskInfo` which is not aware of how this name is generated. But Andrey suggests passing the original components as now to make task class simple logic.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services