Interface DfsReader.PackLoadListener

Enclosing class:
DfsReader

protected static interface DfsReader.PackLoadListener
Announces when data is loaded by reader
  • Method Details

    • onIndexLoad

      void onIndexLoad(String packName, DfsObjDatabase.PackSource src, PackExt ext, long size, Object loadedIdx)
      This is called when an index reference (e.g. primary index, reverse index, ...) is set in the reader, regarless if loaded from scratch or copied from cache. During the lifetime of the reader, the reference for an index should be set only once.
      Parameters:
      packName - Name of the pack
      src - Source of the pack (e.g. GC, COMPACT, ...)
      ext - Extension in the pack (e.g. IDX, RIDX, ...)
      size - Size of the data loaded (usually as bytes in disk)
      loadedIdx - reference to the loaded index
    • onBlockLoad

      void onBlockLoad(String packName, DfsObjDatabase.PackSource src, PackExt ext, long position, DfsReader.PackLoadListener.DfsBlockData dfsBlockData)
      This is called when a dfs block is loaded into the reader. The reader keeps only one block at a time in memory, so during a request the same block could be loaded multiple times.
      Parameters:
      packName - Name of the pack this block belongs to
      src - Source of the pack (e.g. GC, COMPACT, ...)
      ext - Extension in the pack (e.g. PACK or REFTABLE)
      position - Offset in the file requested by caller
      dfsBlockData - Metadata of the block