Class CachedMobFile

java.lang.Object
org.apache.hadoop.hbase.mob.MobFile
org.apache.hadoop.hbase.mob.CachedMobFile
All Implemented Interfaces:
Comparable<CachedMobFile>

@Private public class CachedMobFile extends MobFile implements Comparable<CachedMobFile>
Cached mob file.
  • Field Details

  • Constructor Details

  • Method Details

    • create

      public static CachedMobFile create(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf) throws IOException
      Throws:
      IOException
    • access

      public void access(long accessCount)
    • compareTo

      public int compareTo(CachedMobFile that)
      Specified by:
      compareTo in interface Comparable<CachedMobFile>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • open

      public void open() throws IOException
      Opens the mob file if it's not opened yet and increases the reference. It's not thread-safe. Use MobFileCache.openFile() instead. The reader of the mob file is just opened when it's not opened no matter how many times this open() method is invoked. The reference is a counter that how many times this reader is referenced. When the reference is 0, this reader is closed.
      Overrides:
      open in class MobFile
      Throws:
      IOException
    • close

      public void close() throws IOException
      Decreases the reference of the underlying reader for the mob file. It's not thread-safe. Use MobFileCache.closeFile() instead. This underlying reader isn't closed until the reference is 0.
      Overrides:
      close in class MobFile
      Throws:
      IOException
    • getReferenceCount

      public long getReferenceCount()
      Gets the reference of the current mob file. Internal usage, currently it's for testing.
      Returns:
      The reference of the current mob file.