long getStoreFileSize(HStoreFile file) {
    long length = 0;
    try {
      file.initReader();
      length = file.getReader().length();
    } catch (IOException e) {
      LOG.trace("Failed to open reader when trying to compute store file size for {}, ignoring",
        file, e);
    } finally {
      try {
        file.closeStoreFile(
          file.getCacheConf() != null ? file.getCacheConf().shouldEvictOnClose() : true);
      } catch (IOException e) {
        LOG.trace("Failed to close reader after computing store file size for {}, ignoring", file,
          e);
      }
    }
    return length;
  }
Computes the length of a store file without succumbing to any errors along the way. If an error
is encountered, the implementation returns {@code 0} instead of the actual size.
@param file The file to compute the size of.
@return The size in bytes of the provided {@code file}.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java