public boolean isEmpty() {
    return pendingQueue.isEmpty();
  }
DO NOT FORGET to set eventCounter to new value after invoking this method.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/connection/BlockingPendingQueue.java