Class MasterRegion
java.lang.Object
org.apache.hadoop.hbase.master.region.MasterRegion
A region that stores data in a separated directory, which can be used to store master local data.
FileSystem layout:
hbase
|
--<region dir>
|
--data
| |
| --/<ns>/<table>/<encoded-region-name> <---- The region data
| |
| --replay <---- The edits to replay
|
--WALs
|
--<master-server-name> <---- The WAL dir for active master
|
--<master-server-name>-dead <---- The WAL dir for dead master
Notice that, you can use different root file system and WAL file system. Then the above directory
will be on two file systems, the root file system will have the data directory while the WAL
filesystem will have the WALs directory. The archived HFile will be moved to the global HFile
archived directory with the MasterRegionParams.archivedWalSuffix() suffix. The archived
WAL will be moved to the global WAL archived directory with the
MasterRegionParams.archivedHFileSuffix() suffix.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String(package private) final MasterRegionFlusherAndCompactor(package private) static final String(package private) static final Stringprivate static final org.slf4j.Logger(package private) final HRegionprivate static final intprivate static final Stringprivate final WALFactoryprivate MasterRegionWALRoller -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMasterRegion(HRegion region, WALFactory walFactory, MasterRegionFlusherAndCompactor flusherAndCompactor, MasterRegionWALRoller walRoller) -
Method Summary
Modifier and TypeMethodDescriptionprivate static HRegionbootstrap(org.apache.hadoop.conf.Configuration conf, TableDescriptor td, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walRootDir, WALFactory walFactory, MasterRegionWALRoller walRoller, String serverName, boolean touchInitializingFlag) voidclose(boolean abort) private voidcloseRegion(boolean abort) static MasterRegioncreate(MasterRegionParams params) private static WALcreateWAL(WALFactory walFactory, MasterRegionWALRoller walRoller, String serverName, org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walRootDir, RegionInfo regionInfo) flush(boolean force) getRegionScanner(Scan scan) getScanner(Scan scan) private static RegionInfoloadRegionInfo(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir) private static HRegionopen(org.apache.hadoop.conf.Configuration conf, TableDescriptor td, RegionInfo regionInfo, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walRootDir, WALFactory walFactory, MasterRegionWALRoller walRoller, String serverName) private static voidreplayWALs(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walRootDir, org.apache.hadoop.fs.Path walsDir, RegionInfo regionInfo, String serverName, org.apache.hadoop.fs.Path replayEditsDir) voidprivate voidprivate static voidtryMigrate(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir, RegionInfo regionInfo, TableDescriptor oldTd, TableDescriptor newTd) voidupdate(UpdateMasterRegion action) void
-
Field Details
-
LOG
-
REPLAY_EDITS_DIR
- See Also:
-
DEAD_WAL_DIR_SUFFIX
- See Also:
-
INITIALIZING_FLAG
- See Also:
-
INITIALIZED_FLAG
- See Also:
-
REGION_ID
- See Also:
-
walFactory
-
region
-
flusherAndCompactor
-
walRoller
-
-
Constructor Details
-
MasterRegion
private MasterRegion(HRegion region, WALFactory walFactory, MasterRegionFlusherAndCompactor flusherAndCompactor, MasterRegionWALRoller walRoller)
-
-
Method Details
-
closeRegion
-
shutdownWAL
-
update
- Throws:
IOException
-
get
- Throws:
IOException
-
getScanner
- Throws:
IOException
-
getRegionScanner
- Throws:
IOException
-
flush
- Throws:
IOException
-
requestRollAll
-
waitUntilWalRollFinished
- Throws:
InterruptedException
-
close
-
createWAL
private static WAL createWAL(WALFactory walFactory, MasterRegionWALRoller walRoller, String serverName, org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walRootDir, RegionInfo regionInfo) throws IOException - Throws:
IOException
-
bootstrap
private static HRegion bootstrap(org.apache.hadoop.conf.Configuration conf, TableDescriptor td, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walRootDir, WALFactory walFactory, MasterRegionWALRoller walRoller, String serverName, boolean touchInitializingFlag) throws IOException - Throws:
IOException
-
loadRegionInfo
private static RegionInfo loadRegionInfo(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir) throws IOException - Throws:
IOException
-
open
private static HRegion open(org.apache.hadoop.conf.Configuration conf, TableDescriptor td, RegionInfo regionInfo, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walRootDir, WALFactory walFactory, MasterRegionWALRoller walRoller, String serverName) throws IOException - Throws:
IOException
-
replayWALs
private static void replayWALs(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem walFs, org.apache.hadoop.fs.Path walRootDir, org.apache.hadoop.fs.Path walsDir, RegionInfo regionInfo, String serverName, org.apache.hadoop.fs.Path replayEditsDir) throws IOException - Throws:
IOException
-
tryMigrate
private static void tryMigrate(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir, RegionInfo regionInfo, TableDescriptor oldTd, TableDescriptor newTd) throws IOException - Throws:
IOException
-
create
- Throws:
IOException
-