private void shutdown(boolean skipDiskFlush) throws StoreException {
    long startTimeInMs = time.milliseconds();
    synchronized (storeWriteLock) {
      checkInitialized();
      try {
        checkStarted();
        logger.info("Store : {} shutting down", dataDir);
        blobStoreStats.close();
        compactor.close(30);
        index.close(skipDiskFlush);
        log.close(skipDiskFlush);
        remoteTokenTracker.close();
        metrics.deregisterMetrics(storeId);
        setCurrentState(ReplicaState.OFFLINE);
        started = false;
      } catch (Exception e) {
        logger.error("Store : {} shutdown of store failed for directory ", dataDir, e);
      } finally {
        try {
          fileLock.destroy();
        } catch (IOException e) {
          logger.error("Store : {} IO Exception while trying to close the file lock", dataDir, e);
        }
        fileStore.shutdown();
        metrics.storeShutdownTimeInMs.update(time.milliseconds() - startTimeInMs);
      }
      initialized = false;
    }
  }
Shuts down the store.
@param skipDiskFlush {@code true} should skip any disk flush operations during shutdown. {@code false} otherwise.
@throws StoreException
ambry-store/src/main/java/com/github/ambry/store/BlobStore.java