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/05/16 08:08:47 UTC

[GitHub] [flink] sunhaibotb commented on a change in pull request #8409: [FLINK-12478] Decompose monolithic run-loops in StreamTask implementa…

sunhaibotb commented on a change in pull request #8409: [FLINK-12478] Decompose monolithic run-loops in StreamTask implementa…
URL: https://github.com/apache/flink/pull/8409#discussion_r284585030
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OneInputStreamTask.java
 ##########
 @@ -98,13 +96,8 @@ public void init() throws Exception {
 	}
 
 	@Override
-	protected void run() throws Exception {
-		// cache processor reference on the stack, to make the code more JIT friendly
-		final StreamInputProcessor<IN> inputProcessor = this.inputProcessor;
-
-		while (running && inputProcessor.processInput()) {
-			// all the work happens in the "processInput" method
-		}
+	protected boolean performDefaultAction() throws Exception {
 
 Review comment:
   === TwoInputXStreamTask.java ===
   @Override
   protected void run() throws Exception {
   	// cache processor reference on the stack, to make the code more JIT friendly
   	final StreamTwoInputXProcessor<IN1, IN2> inputProcessor = this.inputProcessor;
   	...
   	inputProcessor.processInput();
   	...
   }
   
   
   === StreamTwoInputXProcessor.java ===
   public boolean processInput() throws Exception {
   	while (running) {
   		...
   		if (element.isRecord()) {
   			continue;
   		}
   		...
   	}
   	return true;
   }
   
   
   === TwoInputXStreamTask.java ===
   
   @Override
   protected void run() throws Exception {
   	// cache processor reference on the stack, to make the code more JIT friendly
   	final StreamTwoInputXProcessor<IN1, IN2> inputProcessor = this.inputProcessor;
   	...
   	while (running && inputProcessor.processInput()) {
   		// all the work happens in the "processInput" method
   	}
   	...
   }
   
   @Override
   protected void cancelTask() {
   	running = false;
   }
   
   === StreamTwoInputXProcessor.java ===
   public boolean processInput() throws Exception {
   	while (true) {
   		...
   		if (element.isRecord()) {
   			return true;
   		}
   		...
   	}
   }

----------------------------------------------------------------
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