@Override
  public void cleanLogFile(String path, String storeId) throws IOException {
    try {
      // Verify service is running.
      validateIfFileStoreIsRunning();

      // Validate inputs.
      Objects.requireNonNull(path, "target file must not be null");

      // throw error if the file does not exist
      File file = new File(path);
      if (!file.exists()) {
        throw new IOException("File doesn't exist in " + path);
      }

      // free space for the file
      synchronized (storeWriteLock) {
        diskSpaceAllocator.free(file, segmentSize, storeId, false);
      }
    } catch (Exception e) {
      logger.error("Unexpected error while freeing file in path {} for store {}", path, storeId, e);
      throw new FileStoreException("Error while freeing file in path " + path + " for store: " + storeId,
          FileStoreErrorCode.FileStoreFileFailedCleanUp);
    }

    logger.info("Disk Space Allocator has free-ed space for file in {}", path);
  }
Cleans up the specified file.
@param path The path of the file to clean
@throws IOException if an I/O error occurs during the cleanup
ambry-store/src/main/java/com/github/ambry/store/FileStore.java