|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.HStoreFile
public class HStoreFile
A HStore data file. HStores usually have one or more of these files. They are produced by flushing the memcache to disk.
Each HStore maintains a bunch of different data files. The filename is a mix of the parent dir, the region name, the column name, and a file identifier. The name may also be a reference to a store file located elsewhere. This class handles all that path-building stuff for you.
An HStoreFile usually tracks 4 things: its parent dir, the region identifier, the column family, and the file identifier. If you know those four things, you know how to obtain the right HStoreFile. HStoreFiles may also refernce store files in another region serving either from the top-half of the remote file or from the bottom-half. Such references are made fast splitting regions.
Plain HStoreFiles are named for a randomly generated id as in:
1278437856009925445
A file by this name is made in both the
mapfiles
and info
subdirectories of a
HStore columnfamily directoy: E.g. If the column family is 'anchor:', then
under the region directory there is a subdirectory named 'anchor' within
which is a 'mapfiles' and 'info' subdirectory. In each will be found a
file named something like 1278437856009925445
, one to hold the
data in 'mapfiles' and one under 'info' that holds the sequence id for this
store file.
References to store files located over in some other region look like
this:
1278437856009925445.hbaserepository,qAReLZD-OyQORZWq_vqR1k==,959247014679548184
:
i.e. an id followed by the name of the referenced region. The data
('mapfiles') of HStoreFile references are empty. The accompanying
info
file contains the
midkey, the id of the remote store we're referencing and whether we're
to serve the top or bottom region of the remote store file. Note, a region
is not splitable if it has instances of store file references (References
are cleaned up by compactions).
When merging or splitting HRegions, we might want to modify one of the params for an HStoreFile (effectively moving it elsewhere).
Nested Class Summary | |
---|---|
static class |
HStoreFile.Range
For split HStoreFiles, specifies if the file covers the lower half or the upper half of the key range |
Field Summary |
---|
Method Summary | |
---|---|
void |
delete()
Delete store map files. |
org.apache.hadoop.io.MapFile.Reader |
getReader(org.apache.hadoop.fs.FileSystem fs,
org.onelab.filter.Filter bloomFilter)
Get reader for the store file map file. |
org.apache.hadoop.io.MapFile.Writer |
getWriter(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.io.SequenceFile.CompressionType compression,
org.onelab.filter.Filter bloomFilter)
Get a store file writer. |
long |
length()
|
boolean |
rename(org.apache.hadoop.fs.FileSystem fs,
HStoreFile hsf)
Renames the mapfiles and info directories under the passed hsf directory. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void delete() throws IOException
IOException
public boolean rename(org.apache.hadoop.fs.FileSystem fs, HStoreFile hsf) throws IOException
hsf
directory.
fs
- hsf
-
IOException
public org.apache.hadoop.io.MapFile.Reader getReader(org.apache.hadoop.fs.FileSystem fs, org.onelab.filter.Filter bloomFilter) throws IOException
fs
- bloomFilter
- If null, no filtering is done.
IOException
public org.apache.hadoop.io.MapFile.Writer getWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.io.SequenceFile.CompressionType compression, org.onelab.filter.Filter bloomFilter) throws IOException
fs
- compression
- Pass SequenceFile.CompressionType.NONE
for none.bloomFilter
- If null, no filtering is done.
IOException
public long length() throws IOException
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |