@Override
  public void throwIfNoPrivilege() {
    try {
      if (!isTableModelEvent() || AuthorityChecker.SUPER_USER.equals(userName)) {
        return;
      }
      if (!waitForTsFileClose()) {
        LOGGER.info("Temporary tsFile {} detected, will skip its transfer.", tsFile);
        return;
      }
      for (final IDeviceID deviceID : getDeviceSet()) {
        if (!tablePattern.matchesDatabase(getTableModelDatabaseName())
            || !tablePattern.matchesTable(deviceID.getTableName())) {
          continue;
        }
        if (!Coordinator.getInstance()
            .getAccessControl()
            .checkCanSelectFromTable4Pipe(
                userName,
                new QualifiedObjectName(getTableModelDatabaseName(), deviceID.getTableName()))) {
          if (skipIfNoPrivileges) {
            shouldParse4Privilege = true;
          } else {
            throw new AccessDeniedException(
                String.format(
                    "No privilege for SELECT for user %s at table %s.%s",
                    userName, tableModelDatabaseName, deviceID.getTableName()));
          }
        }
      }
    } catch (final AccessDeniedException e) {
      throw e;
    } catch (final Exception e) {
      if (e instanceof InterruptedException) {
        Thread.currentThread().interrupt();
      }

      final String errorMsg =
          e instanceof InterruptedException
              ? String.format(
                  "Interrupted when waiting for parsing privilege for TsFile %s.",
                  resource.getTsFilePath())
              : String.format(
                  "Parse TsFile %s when checking privilege error. Because: %s",
                  resource.getTsFilePath(), e.getMessage());
      LOGGER.warn(errorMsg, e);
      throw new PipeException(errorMsg, e);
    }
  }
Get ProgressIndex without waiting for tsfile close. Can be used in getting progressIndex when
memTable becomes immutable.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/event/common/tsfile/PipeTsFileInsertionEvent.java