@InterfaceAudience.Private public final class MasterRegion extends Object
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.| Modifier and Type | Field and Description |
|---|---|
private static String |
DEAD_WAL_DIR_SUFFIX |
(package private) MasterRegionFlusherAndCompactor |
flusherAndCompactor |
(package private) static String |
INITIALIZED_FLAG |
(package private) static String |
INITIALIZING_FLAG |
private static org.slf4j.Logger |
LOG |
(package private) HRegion |
region |
private static int |
REGION_ID |
private static String |
REPLAY_EDITS_DIR |
private WALFactory |
walFactory |
private MasterRegionWALRoller |
walRoller |
| Modifier | Constructor and Description |
|---|---|
private |
MasterRegion(HRegion region,
WALFactory walFactory,
MasterRegionFlusherAndCompactor flusherAndCompactor,
MasterRegionWALRoller walRoller) |
| Modifier and Type | Method and Description |
|---|---|
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) |
void |
close(boolean abort) |
private void |
closeRegion(boolean abort) |
static MasterRegion |
create(MasterRegionParams params) |
private static WAL |
createWAL(WALFactory walFactory,
MasterRegionWALRoller walRoller,
String serverName,
org.apache.hadoop.fs.FileSystem walFs,
org.apache.hadoop.fs.Path walRootDir,
RegionInfo regionInfo) |
HRegion.FlushResult |
flush(boolean force) |
Result |
get(Get get)
The design for master region is to only load all the data to memory at once when starting, so
typically you should not use the get method to get a single row of data at runtime.
|
RegionScanner |
getRegionScanner(Scan scan) |
ResultScanner |
getScanner(Scan scan) |
private static RegionInfo |
loadRegionInfo(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path tableDir) |
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) |
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) |
void |
requestRollAll() |
private void |
shutdownWAL() |
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) |
void |
update(UpdateMasterRegion action) |
void |
waitUntilWalRollFinished() |
private static final org.slf4j.Logger LOG
private static final String REPLAY_EDITS_DIR
private static final String DEAD_WAL_DIR_SUFFIX
static final String INITIALIZING_FLAG
static final String INITIALIZED_FLAG
private static final int REGION_ID
private final WALFactory walFactory
final MasterRegionFlusherAndCompactor flusherAndCompactor
private MasterRegionWALRoller walRoller
private MasterRegion(HRegion region, WALFactory walFactory, MasterRegionFlusherAndCompactor flusherAndCompactor, MasterRegionWALRoller walRoller)
private void closeRegion(boolean abort)
private void shutdownWAL()
public void update(UpdateMasterRegion action) throws IOException
IOExceptionpublic Result get(Get get) throws IOException
IOExceptionpublic ResultScanner getScanner(Scan scan) throws IOException
IOExceptionpublic RegionScanner getRegionScanner(Scan scan) throws IOException
IOExceptionpublic HRegion.FlushResult flush(boolean force) throws IOException
IOExceptionpublic void requestRollAll()
public void waitUntilWalRollFinished() throws InterruptedException
InterruptedExceptionpublic void close(boolean abort)
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
IOExceptionprivate 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
IOExceptionprivate static RegionInfo loadRegionInfo(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tableDir) throws IOException
IOExceptionprivate 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
IOExceptionprivate 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
IOExceptionprivate 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
IOExceptionpublic static MasterRegion create(MasterRegionParams params) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.