You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/12/19 01:05:55 UTC

[iotdb] branch master updated: Fix sonar check fail in IntoOperator

This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 44fcb03428 Fix sonar check fail in IntoOperator
44fcb03428 is described below

commit 44fcb0342835d287e6ca6168061293f9fe4adcf4
Author: liuminghui233 <36...@users.noreply.github.com>
AuthorDate: Mon Dec 19 09:05:48 2022 +0800

    Fix sonar check fail in IntoOperator
---
 .../mpp/execution/operator/process/AbstractIntoOperator.java  | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractIntoOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractIntoOperator.java
index 5f4b8dda34..a975c9608d 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractIntoOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractIntoOperator.java
@@ -130,9 +130,7 @@ public abstract class AbstractIntoOperator implements ProcessOperator {
 
   @Override
   public TsBlock next() {
-    if (!checkLastWriteOperation()) {
-      return null;
-    }
+    checkLastWriteOperation();
 
     if (!processTsBlock(cachedTsBlock)) {
       return null;
@@ -153,12 +151,10 @@ public abstract class AbstractIntoOperator implements ProcessOperator {
   /**
    * Check whether the last write operation was executed successfully, and throw an exception if the
    * execution failed, otherwise continue to execute the operator.
-   *
-   * @return true if the last write operation has been executed successfully.
    */
-  private boolean checkLastWriteOperation() {
+  private void checkLastWriteOperation() {
     if (writeOperationFuture == null) {
-      return true;
+      return;
     }
 
     try {
@@ -182,7 +178,6 @@ public abstract class AbstractIntoOperator implements ProcessOperator {
       }
 
       writeOperationFuture = null;
-      return true;
     } catch (InterruptedException e) {
       LOGGER.warn(
           "{}: interrupted when processing write operation future with exception {}", this, e);