public class DataJanitorState extends Object
TransactionProcessor
and by the HBaseTransactionPruningPlugin
to persist and read the compaction state.Modifier and Type | Class and Description |
---|---|
static interface |
DataJanitorState.TableSupplier
Supplies table for persisting state
|
Modifier and Type | Field and Description |
---|---|
static byte[] |
FAMILY |
static byte[] |
PRUNE_UPPER_BOUND_COL |
Constructor and Description |
---|
DataJanitorState(DataJanitorState.TableSupplier stateTableSupplier) |
Modifier and Type | Method and Description |
---|---|
void |
deleteAllRegionsOnOrBeforeTime(long time)
Delete all the regions that were recorded for all times equal or less than the given time.
|
void |
deleteEmptyRegionsOnOrBeforeTime(long time)
Delete empty region records saved on or before the given time.
|
void |
deleteInactiveTransactionBoundsOnOrBeforeTime(long time)
Delete all inactive transaction bounds recorded for a time less than the given time
|
void |
deletePruneUpperBounds(long deletionPruneUpperBound,
SortedSet<byte[]> excludeRegions)
Delete prune upper bounds for the regions that are not in the given exclude set, and the
prune upper bound is less than the given value.
|
SortedSet<byte[]> |
getEmptyRegionsAfterTime(long time,
SortedSet<byte[]> includeRegions)
Return regions that were recorded as empty after the given time.
|
long |
getInactiveTransactionBoundForTime(long time)
Return inactive transaction bound for the given time.
|
RegionPruneInfo |
getPruneInfoForRegion(byte[] regionId)
Get the latest
RegionPruneInfo for a given region. |
List<RegionPruneInfo> |
getPruneInfoForRegions(SortedSet<byte[]> regions)
Gets a list of
RegionPruneInfo for given regions. |
long |
getPruneUpperBoundForRegion(byte[] regionId)
Get latest prune upper bound for a given region.
|
Map<byte[],Long> |
getPruneUpperBoundForRegions(SortedSet<byte[]> regions)
Get latest prune upper bounds for given regions.
|
TimeRegions |
getRegionsOnOrBeforeTime(long time)
Return the set of regions saved for the time at or before the given time.
|
void |
saveEmptyRegionForTime(long time,
byte[] regionId)
Save the given region as empty as of the given time.
|
void |
saveInactiveTransactionBoundForTime(long time,
long inactiveTransactionBound)
Persist inactive transaction bound for a given time.
|
void |
savePruneUpperBoundForRegion(byte[] regionId,
long pruneUpperBound)
Persist the latest prune upper bound for a given region.
|
void |
saveRegionsForTime(long time,
Set<byte[]> regions)
Persist the regions for the given time.
|
public static final byte[] FAMILY
public static final byte[] PRUNE_UPPER_BOUND_COL
public DataJanitorState(DataJanitorState.TableSupplier stateTableSupplier)
public void savePruneUpperBoundForRegion(byte[] regionId, long pruneUpperBound) throws IOException
TransactionProcessor
after major compaction.regionId
- region idpruneUpperBound
- the latest prune upper bound for the regionIOException
- when not able to persist the data to HBasepublic long getPruneUpperBoundForRegion(byte[] regionId) throws IOException
regionId
- region idIOException
- when not able to read the data from HBase@Nullable public RegionPruneInfo getPruneInfoForRegion(byte[] regionId) throws IOException
RegionPruneInfo
for a given region.regionId
- region idRegionPruneInfo
for the regionIOException
- when not able to read the data from HBasepublic Map<byte[],Long> getPruneUpperBoundForRegions(SortedSet<byte[]> regions) throws IOException
getPruneUpperBoundForRegion(byte[])
regions
- a set of regionsIOException
- when not able to read the data from HBasepublic List<RegionPruneInfo> getPruneInfoForRegions(@Nullable SortedSet<byte[]> regions) throws IOException
RegionPruneInfo
for given regions. Returns all regions if the given regions set is null.regions
- a set of regionsRegionPruneInfo
s.IOException
- when not able to read the data from HBasepublic void deletePruneUpperBounds(long deletionPruneUpperBound, SortedSet<byte[]> excludeRegions) throws IOException
deletionPruneUpperBound
- prune upper bound below which regions will be deletedexcludeRegions
- set of regions that should not be deletedIOException
- when not able to delete data in HBasepublic void saveRegionsForTime(long time, Set<byte[]> regions) throws IOException
HBaseTransactionPruningPlugin
saves the set of
transactional regions existing in the HBase instance periodically.time
- timestamp in millisecondsregions
- set of regions at the timeIOException
- when not able to persist the data to HBase@Nullable public TimeRegions getRegionsOnOrBeforeTime(long time) throws IOException
time
- timestamp in millisecondsIOException
- when not able to read the data from HBasepublic void deleteAllRegionsOnOrBeforeTime(long time) throws IOException
time
- timestamp in millisecondsIOException
- when not able to delete data in HBasepublic void saveInactiveTransactionBoundForTime(long time, long inactiveTransactionBound) throws IOException
time
- time in millisecondsinactiveTransactionBound
- inactive transaction bound for the given timeIOException
- when not able to persist the data to HBasepublic long getInactiveTransactionBoundForTime(long time) throws IOException
time
- time in millisecondsIOException
- when not able to read the data from HBasepublic void deleteInactiveTransactionBoundsOnOrBeforeTime(long time) throws IOException
time
- time in millisecondsIOException
- when not able to delete data in HBasepublic void saveEmptyRegionForTime(long time, byte[] regionId) throws IOException
time
- time in millisecondsregionId
- region idIOException
public SortedSet<byte[]> getEmptyRegionsAfterTime(long time, @Nullable SortedSet<byte[]> includeRegions) throws IOException
time
- time in millisecondsincludeRegions
- If not null, the returned set will be an intersection of the includeRegions set
and the empty regions after the given timeIOException
public void deleteEmptyRegionsOnOrBeforeTime(long time) throws IOException
time
- time in millisecondsIOException
Copyright © 2018 The Apache Software Foundation. All rights reserved.