private void writeLogicalSize(long logicalSize) {
    Path lengthFile = deriveLengthFile();
    try {
      FileUtilRt.doIOOperation(lastAttempt -> {
        try (DataOutputStream stream = new DataOutputStream(Files.newOutputStream(lengthFile))) {
          stream.writeLong(logicalSize);
          return Boolean.TRUE;//useless, but can't return null -- null is interpreted as 'need retry'
        }
        catch (IOException ex) {
          //noinspection InstanceofCatchParameter
          if (ex instanceof NoSuchFileException) {
            ensureParentDirectoryExists();
          }

          if (lastAttempt) {
            throw ex;
          }

          return null;
        }
      });
    }
    catch (IOException e) {
      LOG.error("Can't write logical size to [" + lengthFile.toAbsolutePath() + "]", e);
    }
  }
private void writeLogicalSize(long logicalSize)