|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.migration.nineteen.regionserver.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.
This one has been doctored to be used in migrations. Private and protecteds have been made public, etc.
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 reference 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 |
---|
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.HConstants |
---|
HConstants.Modify |
Field Summary |
---|
Constructor Summary | |
---|---|
HStoreFile(HBaseConfiguration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path basedir,
int encodedName,
byte[] colFamily,
long fileId,
Reference ref)
Constructor that fully initializes the object |
Method Summary | |
---|---|
void |
delete()
Delete store map files. |
static org.apache.hadoop.fs.Path |
getFilterDir(org.apache.hadoop.fs.Path dir,
int encodedRegionName,
byte[] f)
Deprecated. |
static org.apache.hadoop.fs.Path |
getInfoDir(org.apache.hadoop.fs.Path dir,
int encodedRegionName,
byte[] f)
|
static org.apache.hadoop.fs.Path |
getMapDir(org.apache.hadoop.fs.Path dir,
int encodedRegionName,
byte[] f)
|
BloomFilterMapFile.Reader |
getReader(org.apache.hadoop.fs.FileSystem fs,
boolean bloomFilter,
boolean blockCacheEnabled)
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,
boolean bloomFilter,
int nrows)
Get a store file writer. |
long |
indexLength()
|
boolean |
isMajorCompaction()
|
static boolean |
isReference(org.apache.hadoop.fs.Path p)
|
long |
length()
|
long |
loadInfo(org.apache.hadoop.fs.FileSystem filesystem)
Reads in an info file |
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 |
Constructor Detail |
---|
public HStoreFile(HBaseConfiguration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path basedir, int encodedName, byte[] colFamily, long fileId, Reference ref) throws IOException
conf
- Configuration objectbasedir
- qualified path that is parent of region directorycolFamily
- name of the column familyfileId
- file identifierref
- Reference to another HStoreFile.encodedName
- Encoded name.
IOException
Method Detail |
---|
public static boolean isReference(org.apache.hadoop.fs.Path p)
p
- Path to check.
public long loadInfo(org.apache.hadoop.fs.FileSystem filesystem) throws IOException
filesystem
- file system
IOException
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 BloomFilterMapFile.Reader getReader(org.apache.hadoop.fs.FileSystem fs, boolean bloomFilter, boolean blockCacheEnabled) throws IOException
fs
- bloomFilter
- If true, a bloom filter existsblockCacheEnabled
- If true, MapFile blocks should be cached.
IOException
public org.apache.hadoop.io.MapFile.Writer getWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.io.SequenceFile.CompressionType compression, boolean bloomFilter, int nrows) throws IOException
fs
- compression
- Pass SequenceFile.CompressionType.NONE
for none.bloomFilter
- If true, create a bloom filternrows
- number of rows expected. Required if bloomFilter is true.
IOException
public long length() throws IOException
IOException
public long indexLength() throws IOException
IOException
public String toString()
toString
in class Object
public boolean isMajorCompaction()
public static org.apache.hadoop.fs.Path getMapDir(org.apache.hadoop.fs.Path dir, int encodedRegionName, byte[] f)
dir
- Base directoryencodedRegionName
- Encoding of region name.f
- Column family.
public static org.apache.hadoop.fs.Path getInfoDir(org.apache.hadoop.fs.Path dir, int encodedRegionName, byte[] f)
dir
- Base directoryencodedRegionName
- Encoding of region name.f
- Column family.
@Deprecated public static org.apache.hadoop.fs.Path getFilterDir(org.apache.hadoop.fs.Path dir, int encodedRegionName, byte[] f)
dir
- Base directoryencodedRegionName
- Encoding of region name.f
- Column family.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |