public void deleteStoreFiles() throws StoreException, IOException {
    // Step 0: ensure the store has been shut down
    if (started || initialized) {
      throw new IllegalStateException("Store is still started. Deleting store files is not allowed.");
    }
    // Step 1: return occupied swap segments (if any) to reserve pool
    if (compactor != null) {
      String[] swapSegmentsInUse = compactor.getSwapSegmentsInUse();
      for (String fileName : swapSegmentsInUse) {
        logger.info("Returning swap segment {} to reserve pool", fileName);
        File swapSegmentTempFile = new File(dataDir, fileName);
        diskSpaceAllocator.free(swapSegmentTempFile, config.storeSegmentSizeInBytes, storeId, true);
      }
    }

    // Step 2: if segmented, delete remaining store segments in reserve pool
    if (log != null) {
      logger.info("Deleting remaining segments associated with store {} in reserve pool", storeId);
      diskSpaceAllocator.deleteAllSegmentsForStoreIds(
          Collections.singletonList(replicaId.getPartitionId().toPathString()));
    }
    // Step 3: delete all files in current store directory
    logger.info("Deleting store {} directory", storeId);
    File storeDir = new File(dataDir);
    try {
      Utils.deleteFileOrDirectory(storeDir);
    } catch (Exception e) {
      throw new IOException("Couldn't delete store directory " + dataDir, e);
    }
    logger.info("All files of store {} are deleted", storeId);
  }
Delete files of this store.
This is the last step to remove store from this node. Return swap segments (if any) to reserve pool and delete all
files/dirs associated with this store. This method is invoked by transition in AmbryStateModel (OFFLINE -> DROPPED)
ambry-store/src/main/java/com/github/ambry/store/BlobStore.java