@TestOnly
  public void syncClose() throws ExecutionException {
    logger.info(
        "Sync close file: {}, will firstly async close it",
        tsFileResource.getTsFile().getAbsolutePath());
    if (shouldClose) {
      return;
    }
    try {
      asyncClose().get();
      logger.info("Start to wait until file {} is closed", tsFileResource);
      // if this TsFileProcessor is closing, asyncClose().get() of this thread will return quickly,
      // but the TsFileProcessor may be not closed. Therefore, we need to check whether the writer
      // is null.
      while (writer != null) {
        TimeUnit.MILLISECONDS.sleep(10);
      }
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
    }
    logger.info("File {} is closed synchronously", tsFileResource.getTsFile().getAbsolutePath());
  }
Delete data which belongs to the timeseries `deviceId.measurementId` and the timestamp of which
<= 'timestamp' in the deletion. <br>

<p>Delete data in both working MemTable and flushing MemTables.

@return true if data in MemTable is successfully deleted, false otherwise
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/TsFileProcessor.java