Package org.apache.hadoop.hbase.mob
Class CachedMobFile
java.lang.Object
org.apache.hadoop.hbase.mob.MobFile
org.apache.hadoop.hbase.mob.CachedMobFile
- All Implemented Interfaces:
Comparable<CachedMobFile>
Cached mob file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccess(long accessCount) voidclose()Decreases the reference of the underlying reader for the mob file.intcompareTo(CachedMobFile that) static CachedMobFilecreate(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf) booleanlongGets the reference of the current mob file.inthashCode()voidopen()Opens the mob file if it's not opened yet and increases the reference.Methods inherited from class org.apache.hadoop.hbase.mob.MobFile
getFileName, getScanner, readCell, readCell
-
Field Details
-
accessCount
-
referenceCount
-
-
Constructor Details
-
CachedMobFile
-
-
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
-
compareTo
- Specified by:
compareToin interfaceComparable<CachedMobFile>
-
equals
-
hashCode
-
open
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:
openin classMobFile- Throws:
IOException
-
close
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:
closein classMobFile- Throws:
IOException
-
getReferenceCount
Gets the reference of the current mob file. Internal usage, currently it's for testing.- Returns:
- The reference of the current mob file.
-