public void validateStoreFile(Path path, boolean isCompaction) throws IOException {
    HStoreFile storeFile = null;
    try {
      storeFile = createStoreFileAndReader(path);
      if (conf.getBoolean(READ_FULLY_ON_VALIDATE_KEY, DEFAULT_READ_FULLY_ON_VALIDATE)) {
        if (storeFile.getFirstKey().isEmpty()) {
          LOG.debug("'{}=true' but storefile does not contain any data. skipping validation.",
            READ_FULLY_ON_VALIDATE_KEY);
          return;
        }
        LOG.debug("Validating the store file by reading the first cell from each block : {}", path);
        StoreFileReader reader = storeFile.getReader();
        try (StoreFileScanner scanner =
          reader.getStoreFileScanner(false, false, isCompaction, Long.MAX_VALUE, 0, false)) {
          boolean hasNext = scanner.seek(KeyValue.LOWESTKEY);
          assert hasNext : "StoreFile contains no data";
          for (ExtendedCell cell = scanner.next(); cell != null; cell = scanner.next()) {
            ExtendedCell nextIndexedKey = scanner.getNextIndexedKey();
            if (nextIndexedKey == null) {
              break;
            }
            scanner.seek(nextIndexedKey);
          }
        }
      }
    } catch (IOException e) {
      LOG.error("Failed to open store file : {}, keeping it in tmp location", path, e);
      throw e;
    } finally {
      if (storeFile != null) {
        storeFile.closeStoreFile(false);
      }
    }
  }
Validates a store file by opening and closing it. In HFileV2 this should not be an expensive
operation.
@param path         the path to the store file
@param isCompaction whether this is called from the context of a compaction
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreEngine.java