boolean removeBlobStore(PartitionId id) throws IOException, StoreException {
    rwLock.writeLock().lock();
    boolean succeed = false;
    try {
      BlobStore store = stores.get(id);
      if (store == null) {
        logger.error("Store {} is not found in disk manager", id);
      } else if (!running || store.isInitialized()) {
        logger.error("Removing store {} failed. Disk running = {}, store initialized = {}", id, running, store.isInitialized());
      } else if (!compactionManager.removeBlobStore(store)) {
        logger.error("Fail to remove store {} from compaction manager.", id);
      } else {
        stores.remove(id);
        stoppedReplicas.remove(id.toPathString());
        ReplicaId replicaId = partitionToReplicaMap.remove(id);
        logger.info("Store {} is successfully removed from disk manager", id);
        store.deleteStoreFiles();
        // Since all the files are either deleted or returned to reserve pool, increase available space in the disk
        disk.increaseAvailableSpaceInBytes(replicaId.getCapacityInBytes());
        succeed = true;
      }
    } finally {
      rwLock.writeLock().unlock();
    }
    return succeed;
  }
Given partition id, remove the corresponding blob store in disk manager
@param id the {@link PartitionId} of the {@link BlobStore} which should be removed.
@return {@code true} if store removal was successful. {@code false} if not.
ambry-store/src/main/java/com/github/ambry/store/DiskManager.java