@InterfaceAudience.Private public class CatalogJanitor extends ScheduledChore
hbase:meta
catalog
table on a period looking for unused regions to garbage collect.Modifier and Type | Class and Description |
---|---|
(package private) static class |
CatalogJanitor.SplitParentFirstComparator
Compare HRegionInfos in a way that has split parents sort BEFORE their
daughters.
|
Modifier and Type | Field and Description |
---|---|
private AtomicBoolean |
alreadyRunning |
private Connection |
connection |
private AtomicBoolean |
enabled |
private static org.apache.commons.logging.Log |
LOG |
private Server |
server |
private MasterServices |
services |
Constructor and Description |
---|
CatalogJanitor(Server server,
MasterServices services) |
Modifier and Type | Method and Description |
---|---|
(package private) Pair<Boolean,Boolean> |
checkDaughterInFs(HRegionInfo parent,
HRegionInfo daughter)
Checks if a daughter region -- either splitA or splitB -- still holds
references to parent.
|
protected void |
chore()
The task to execute on each scheduled execution of the Chore
|
boolean |
cleanMergeQualifier(HRegionInfo region)
Checks if the specified region has merge qualifiers, if so, try to clean
them
|
(package private) boolean |
cleanMergeRegion(HRegionInfo mergedRegion,
HRegionInfo regionA,
HRegionInfo regionB)
If merged region no longer holds reference to the merge regions, archive
merge region on hdfs and perform deleting references in hbase:meta
|
(package private) boolean |
cleanParent(HRegionInfo parent,
Result rowContent)
If daughters no longer hold reference to the parents, delete the parent.
|
(package private) boolean |
getEnabled() |
(package private) Triple<Integer,Map<HRegionInfo,Result>,Map<HRegionInfo,Result>> |
getMergedRegionsAndSplitParents()
Scans hbase:meta and returns a number of scanned rows, and a map of merged
regions, and an ordered map of split parents.
|
(package private) Triple<Integer,Map<HRegionInfo,Result>,Map<HRegionInfo,Result>> |
getMergedRegionsAndSplitParents(TableName tableName)
Scans hbase:meta and returns a number of scanned rows, and a map of merged
regions, and an ordered map of split parents.
|
private HTableDescriptor |
getTableDescriptor(TableName tableName) |
private boolean |
hasNoReferences(Pair<Boolean,Boolean> p) |
protected boolean |
initialChore()
Override to run a task before we start looping.
|
(package private) int |
scan()
Run janitorial scan of catalog
hbase:meta table looking for
garbage to collect. |
boolean |
setEnabled(boolean enabled) |
cancel, cancel, choreForTesting, cleanup, getInitialDelay, getName, getPeriod, getStopper, getTimeUnit, isInitialChoreComplete, isScheduled, run, toString, triggerNow
private static final org.apache.commons.logging.Log LOG
private final Server server
private final MasterServices services
private AtomicBoolean enabled
private AtomicBoolean alreadyRunning
private final Connection connection
CatalogJanitor(Server server, MasterServices services)
protected boolean initialChore()
ScheduledChore
initialChore
in class ScheduledChore
public boolean setEnabled(boolean enabled)
enabled
- boolean getEnabled()
protected void chore()
ScheduledChore
chore
in class ScheduledChore
Triple<Integer,Map<HRegionInfo,Result>,Map<HRegionInfo,Result>> getMergedRegionsAndSplitParents() throws IOException
IOException
Triple<Integer,Map<HRegionInfo,Result>,Map<HRegionInfo,Result>> getMergedRegionsAndSplitParents(TableName tableName) throws IOException
tableName
- null represents all tablesIOException
boolean cleanMergeRegion(HRegionInfo mergedRegion, HRegionInfo regionA, HRegionInfo regionB) throws IOException
mergedRegion
- regionA
- regionB
- IOException
int scan() throws IOException
hbase:meta
table looking for
garbage to collect.IOException
boolean cleanParent(HRegionInfo parent, Result rowContent) throws IOException
parent
- HRegionInfo of split offlined parentrowContent
- Content of parent
row in
metaRegionName
parent
from meta table and from
the filesystem.IOException
private boolean hasNoReferences(Pair<Boolean,Boolean> p)
p
- A pair where the first boolean says whether or not the daughter
region directory exists in the filesystem and then the second boolean says
whether the daughter has references to the parent.p
signifies no references.Pair<Boolean,Boolean> checkDaughterInFs(HRegionInfo parent, HRegionInfo daughter) throws IOException
parent
- Parent regiondaughter
- Daughter regionIOException
private HTableDescriptor getTableDescriptor(TableName tableName) throws FileNotFoundException, IOException
FileNotFoundException
IOException
public boolean cleanMergeQualifier(HRegionInfo region) throws IOException
region
- IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.