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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
access
(long accessCount) void
close()
Decreases the reference of the underlying reader for the mob file.int
compareTo
(CachedMobFile that) static CachedMobFile
create
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf, StoreFileTracker sft) boolean
long
Gets the reference of the current mob file.int
hashCode()
void
open()
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, StoreFileTracker sft) throws IOException - Throws:
IOException
-
access
-
compareTo
- Specified by:
compareTo
in 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:
open
in 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:
close
in 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.
-