|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.regionserver.HRegionFileSystem
@InterfaceAudience.Private public class HRegionFileSystem
View to an on-disk Region. Provides the set of methods necessary to interact with the on-disk region data.
Field Summary | |
---|---|
static org.apache.commons.logging.Log |
LOG
|
static String |
REGION_INFO_FILE
Name of the region info file that resides just under the region directory. |
static String |
REGION_MERGES_DIR
Temporary subdirectory of the region directory used for merges. |
static String |
REGION_SPLITS_DIR
Temporary subdirectory of the region directory used for splits. |
Method Summary | |
---|---|
org.apache.hadoop.fs.Path |
commitStoreFile(String familyName,
org.apache.hadoop.fs.Path buildPath)
Move the file from a build/temp location to the main family store directory. |
static HRegionFileSystem |
createRegionOnFileSystem(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path tableDir,
HRegionInfo regionInfo)
Create a new Region on file-system. |
org.apache.hadoop.fs.Path |
createTempName()
Generate a unique temporary Path. |
org.apache.hadoop.fs.Path |
createTempName(String suffix)
Generate a unique temporary Path. |
void |
deleteFamily(String familyName)
Remove the region family from disk, archiving the store files. |
static void |
deleteRegionFromFileSystem(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path tableDir,
HRegionInfo regionInfo)
Remove the region from the table directory, archiving the region's hfiles. |
Collection<String> |
getFamilies()
|
org.apache.hadoop.fs.FileSystem |
getFileSystem()
|
org.apache.hadoop.fs.Path |
getRegionDir()
|
HRegionInfo |
getRegionInfo()
|
Collection<StoreFileInfo> |
getStoreFiles(byte[] familyName)
Returns the store files available for the family. |
Collection<StoreFileInfo> |
getStoreFiles(String familyName)
Returns the store files available for the family. |
org.apache.hadoop.fs.Path |
getTableDir()
|
boolean |
hasReferences(HTableDescriptor htd)
Check whether region has Reference file |
boolean |
hasReferences(String familyName)
Returns true if the specified family has reference files |
static HRegionInfo |
loadRegionInfoFileContent(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path regionDir)
Create a HRegionInfo from the serialized version on-disk. |
static HRegionFileSystem |
openRegionFromFileSystem(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path tableDir,
HRegionInfo regionInfo,
boolean readOnly)
Open Region from file-system. |
void |
removeStoreFile(String familyName,
org.apache.hadoop.fs.Path filePath)
Archives the specified store file from the specified family. |
void |
removeStoreFiles(String familyName,
Collection<StoreFile> storeFiles)
Closes and archives the specified store files from the specified family. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.logging.Log LOG
public static final String REGION_INFO_FILE
public static final String REGION_MERGES_DIR
public static final String REGION_SPLITS_DIR
Method Detail |
---|
public org.apache.hadoop.fs.FileSystem getFileSystem()
FileSystem
public HRegionInfo getRegionInfo()
HRegionInfo
that describe this on-disk region viewpublic org.apache.hadoop.fs.Path getTableDir()
Path
to the region's root directory.public org.apache.hadoop.fs.Path getRegionDir()
Path
to the region directory.public Collection<StoreFileInfo> getStoreFiles(byte[] familyName) throws IOException
familyName
- Column Family Name
StoreFileInfo
for the specified family.
IOException
public Collection<StoreFileInfo> getStoreFiles(String familyName) throws IOException
familyName
- Column Family Name
StoreFileInfo
for the specified family.
IOException
public boolean hasReferences(String familyName) throws IOException
familyName
- Column Family Name
IOException
public boolean hasReferences(HTableDescriptor htd) throws IOException
htd
- table desciptor of the region
IOException
public Collection<String> getFamilies() throws IOException
IOException
public void deleteFamily(String familyName) throws IOException
familyName
- Column Family Name
IOException
- if an error occours during the archivingpublic org.apache.hadoop.fs.Path createTempName()
Path file = fs.createTempName();
...StoreFile.Writer(file)...
fs.commitStoreFile("family", file);
Path
of the temporary filepublic org.apache.hadoop.fs.Path createTempName(String suffix)
Path file = fs.createTempName();
...StoreFile.Writer(file)...
fs.commitStoreFile("family", file);
suffix
- extra information to append to the generated name
Path
of the temporary filepublic org.apache.hadoop.fs.Path commitStoreFile(String familyName, org.apache.hadoop.fs.Path buildPath) throws IOException
familyName
- Family that will gain the filebuildPath
- Path
to the file to commit.
Path
of the committed file
IOException
public void removeStoreFile(String familyName, org.apache.hadoop.fs.Path filePath) throws IOException
familyName
- Family that contains the store filesfilePath
- Path
to the store file to remove
IOException
- if the archiving failspublic void removeStoreFiles(String familyName, Collection<StoreFile> storeFiles) throws IOException
familyName
- Family that contains the store filesstoreFiles
- set of store files to remove
IOException
- if the archiving failspublic static HRegionInfo loadRegionInfoFileContent(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path regionDir) throws IOException
HRegionInfo
from the serialized version on-disk.
fs
- FileSystem
that contains the Region Info fileregionDir
- Path
to the Region Directory that contains the Info file
HRegionInfo
instance gotten from the Region Info file.
IOException
- if an error occurred during file open/read operation.public static HRegionFileSystem createRegionOnFileSystem(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir, HRegionInfo regionInfo) throws IOException
conf
- the Configuration
to usefs
- FileSystem
from which to add the regiontableDir
- Path
to where the table is being storedregionInfo
- HRegionInfo
for region to be added
IOException
- if the region creation fails due to a FileSystem exception.public static HRegionFileSystem openRegionFromFileSystem(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir, HRegionInfo regionInfo, boolean readOnly) throws IOException
conf
- the Configuration
to usefs
- FileSystem
from which to add the regiontableDir
- Path
to where the table is being storedregionInfo
- HRegionInfo
for region to be addedreadOnly
- True if you don't want to edit the region data
IOException
- if the region creation fails due to a FileSystem exception.public static void deleteRegionFromFileSystem(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir, HRegionInfo regionInfo) throws IOException
conf
- the Configuration
to usefs
- FileSystem
from which to remove the regiontableDir
- Path
to where the table is being storedregionInfo
- HRegionInfo
for region to be deleted
IOException
- if the request cannot be completed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |