@InterfaceAudience.Private public class RegionMergeTransactionImpl extends Object implements RegionMergeTransaction
| Modifier and Type | Class and Description |
|---|---|
static class |
RegionMergeTransactionImpl.JournalEntryImpl |
RegionMergeTransaction.JournalEntry, RegionMergeTransaction.RegionMergeTransactionPhase, RegionMergeTransaction.TransactionListener| Constructor and Description |
|---|
RegionMergeTransactionImpl(Region a,
Region b,
boolean forcible)
Constructor
|
RegionMergeTransactionImpl(Region a,
Region b,
boolean forcible,
long masterSystemTime)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Put |
addLocation(Put p,
ServerName sn,
long openSeqNum) |
HRegion |
execute(Server server,
RegionServerServices services)
Run the transaction.
|
List<RegionMergeTransaction.JournalEntry> |
getJournal()
Get the journal for the transaction.
|
HRegionInfo |
getMergedRegionInfo() |
static HRegionInfo |
getMergedRegionInfo(HRegionInfo a,
HRegionInfo b)
Get merged region info through the specified two regions
|
RegionServerServices |
getRegionServerServices()
Get the RegonServerServices of the server running the transaction or rollback
|
Server |
getServer()
Get the Server running the transaction or rollback
|
boolean |
prepare(RegionServerServices services)
Does checks on merge inputs.
|
void |
prepareMutationsForMerge(HRegionInfo mergedRegion,
HRegionInfo regionA,
HRegionInfo regionB,
ServerName serverName,
List<Mutation> mutations,
int regionReplication) |
RegionMergeTransaction |
registerTransactionListener(RegionMergeTransaction.TransactionListener listener)
Register a listener for transaction preparation, execution, and possibly
rollback phases.
|
boolean |
rollback(Server server,
RegionServerServices services)
Roll back a failed transaction
|
HRegion |
stepsAfterPONR(Server server,
RegionServerServices services,
HRegion mergedRegion) |
HRegion |
stepsBeforePONR(Server server,
RegionServerServices services,
boolean testing) |
public RegionMergeTransactionImpl(Region a, Region b, boolean forcible)
a - region a to mergeb - region b to mergeforcible - if false, we will only merge adjacent regionspublic boolean prepare(RegionServerServices services) throws IOException
prepare in interface RegionMergeTransactionservices - true if the regions are mergeable else
false if they are not (e.g. its already closed, etc.).IOExceptionpublic HRegion execute(Server server, RegionServerServices services) throws IOException
execute in interface RegionMergeTransactionserver - Hosting server instance. Can be null when testingservices - Used to online/offline regions.IOException - If thrown, transaction failed. Call
rollback(Server, RegionServerServices)IOExceptionrollback(Server, RegionServerServices)public HRegion stepsAfterPONR(Server server, RegionServerServices services, HRegion mergedRegion) throws IOException
IOExceptionpublic void prepareMutationsForMerge(HRegionInfo mergedRegion, HRegionInfo regionA, HRegionInfo regionB, ServerName serverName, List<Mutation> mutations, int regionReplication) throws IOException
IOExceptionpublic Put addLocation(Put p, ServerName sn, long openSeqNum)
public HRegion stepsBeforePONR(Server server, RegionServerServices services, boolean testing) throws IOException
IOExceptionpublic static HRegionInfo getMergedRegionInfo(HRegionInfo a, HRegionInfo b)
a - merging region Ab - merging region Bpublic boolean rollback(Server server, RegionServerServices services) throws IOException
RegionMergeTransactionrollback in interface RegionMergeTransactionserver - Hosting server instance (May be null when testing).services - Services of regionserver, used to online regions.IOException - If thrown, rollback failed. Take drastic action.public HRegionInfo getMergedRegionInfo()
getMergedRegionInfo in interface RegionMergeTransactionpublic List<RegionMergeTransaction.JournalEntry> getJournal()
RegionMergeTransactionJournal entries are an opaque type represented as JournalEntry. They can also provide useful debugging information via their toString method.
getJournal in interface RegionMergeTransactionpublic RegionMergeTransaction registerTransactionListener(RegionMergeTransaction.TransactionListener listener)
RegionMergeTransactionA listener can abort a transaction by throwing an exception.
registerTransactionListener in interface RegionMergeTransactionlistener - the listenerpublic Server getServer()
RegionMergeTransactiongetServer in interface RegionMergeTransactionpublic RegionServerServices getRegionServerServices()
RegionMergeTransactiongetRegionServerServices in interface RegionMergeTransactionCopyright © 2007-2015 The Apache Software Foundation. All Rights Reserved.