private void startPersistenceRetriever(int[] bucketSizes, long capacity) {
    Runnable persistentCacheRetriever = () -> {
      try {
        retrieveFromFile(bucketSizes);
        LOG.info("Persistent bucket cache recovery from {} is complete.", persistencePath);
      } catch (Throwable ex) {
        LOG.warn("Can't restore from file[{}]. The bucket cache will be reset and rebuilt."
          + " Exception seen: ", persistencePath, ex);
        backingMap.clear();
        fullyCachedFiles.clear();
        backingMapValidated.set(true);
        regionCachedSize.clear();
        try {
          bucketAllocator = new BucketAllocator(capacity, bucketSizes);
        } catch (BucketAllocatorException allocatorException) {
          LOG.error("Exception during Bucket Allocation", allocatorException);
        }
      } finally {
        this.cacheState = CacheState.ENABLED;
        startWriterThreads();
      }
    };
    Thread t = new Thread(persistentCacheRetriever);
    t.start();
  }
Use {@link java.security.MessageDigest} class's encryption algorithms to check persistent file
integrity, default algorithm is MD5
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java