@InterfaceAudience.Private public class ZooKeeperScanPolicyObserver extends Object implements RegionCoprocessor, RegionObserver
RegionObserver
state. See
RegionCoprocessorEnvironment.getSharedData()
.
This would be useful for an incremental backup tool, which would indicate the last time of a successful backup via ZK and instruct HBase that to safely delete the data which has already been backup.
Modifier and Type | Class and Description |
---|---|
private static class |
ZooKeeperScanPolicyObserver.ZKDataHolder
Internal watcher that keep "data" up to date asynchronously.
|
Coprocessor.State
RegionObserver.MutationType
Modifier and Type | Field and Description |
---|---|
private org.apache.curator.framework.recipes.cache.NodeCache |
cache |
static String |
NODE |
static String |
ZK_ENSEMBLE_KEY |
static int |
ZK_SESSION_TIMEOUT_DEFAULT |
static String |
ZK_SESSION_TIMEOUT_KEY |
private static String |
ZKKEY |
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
Constructor and Description |
---|
ZooKeeperScanPolicyObserver() |
Modifier and Type | Method and Description |
---|---|
private OptionalLong |
getExpireBefore() |
Optional<RegionObserver> |
getRegionObserver() |
void |
preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
Store store,
ScanType scanType,
ScanOptions options,
CompactionLifeCycleTracker tracker,
CompactionRequest request)
Called before we open store scanner for compaction.
|
void |
preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c,
Store store,
ScanOptions options,
FlushLifeCycleTracker tracker)
Called before we open store scanner for flush.
|
private void |
resetTTL(ScanOptions options) |
void |
start(CoprocessorEnvironment env)
Called by the
CoprocessorEnvironment during it's own startup to initialize the
coprocessor. |
void |
stop(CoprocessorEnvironment env)
Called by the
CoprocessorEnvironment during it's own shutdown to stop the
coprocessor. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBulkLoadObserver, getEndpointObserver
getServices
postAppend, postAppendBeforeWAL, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndPut, postClose, postCloseRegionOperation, postCommitStoreFile, postCompact, postCompactSelection, postDelete, postExists, postFlush, postFlush, postGetOp, postIncrement, postIncrementBeforeWAL, postInstantiateDeleteTracker, postMemStoreCompaction, postMutationBeforeWAL, postOpen, postPut, postReplayWALs, postScannerClose, postScannerFilterRow, postScannerNext, postScannerOpen, postStartRegionOperation, postStoreFileReaderOpen, postWALRestore, preAppend, preAppendAfterRowLock, preBatchMutate, preBulkLoadHFile, preCheckAndDelete, preCheckAndDeleteAfterRowLock, preCheckAndPut, preCheckAndPutAfterRowLock, preClose, preCommitStoreFile, preCompact, preCompactSelection, preDelete, preExists, preFlush, preFlush, preGetOp, preIncrement, preIncrementAfterRowLock, preMemStoreCompaction, preMemStoreCompactionCompact, preMemStoreCompactionCompactScannerOpen, preOpen, prePrepareTimeStampForDeleteVersion, prePut, preReplayWALs, preScannerClose, preScannerNext, preScannerOpen, preStoreFileReaderOpen, preStoreScannerOpen, preWALRestore
public static final String ZK_ENSEMBLE_KEY
public static final String ZK_SESSION_TIMEOUT_KEY
public static final int ZK_SESSION_TIMEOUT_DEFAULT
public static final String NODE
private static final String ZKKEY
private org.apache.curator.framework.recipes.cache.NodeCache cache
public ZooKeeperScanPolicyObserver()
public Optional<RegionObserver> getRegionObserver()
getRegionObserver
in interface RegionCoprocessor
public void start(CoprocessorEnvironment env) throws IOException
Coprocessor
CoprocessorEnvironment
during it's own startup to initialize the
coprocessor.start
in interface Coprocessor
IOException
public void stop(CoprocessorEnvironment env) throws IOException
Coprocessor
CoprocessorEnvironment
during it's own shutdown to stop the
coprocessor.stop
in interface Coprocessor
IOException
private OptionalLong getExpireBefore()
private void resetTTL(ScanOptions options)
public void preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, ScanOptions options, FlushLifeCycleTracker tracker) throws IOException
RegionObserver
options
to change max
versions and TTL for the scanner being opened.preFlushScannerOpen
in interface RegionObserver
c
- the environment provided by the region serverstore
- the store where flush is being requestedoptions
- used to change max versions and TTL for the scanner being openedIOException
public void preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, ScanType scanType, ScanOptions options, CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException
RegionObserver
options
to change max
versions and TTL for the scanner being opened.preCompactScannerOpen
in interface RegionObserver
c
- the environment provided by the region serverstore
- the store being compactedscanType
- type of Scanoptions
- used to change max versions and TTL for the scanner being openedtracker
- tracker used to track the life cycle of a compactionrequest
- the requested compactionIOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.