@InterfaceAudience.Private public class SplitTransactionImpl extends Object implements SplitTransaction
Modifier and Type | Class and Description |
---|---|
static class |
SplitTransactionImpl.JournalEntryImpl |
SplitTransaction.JournalEntry, SplitTransaction.SplitTransactionPhase, SplitTransaction.TransactionListener
Modifier and Type | Field and Description |
---|---|
SplitTransactionCoordination.SplitTransactionDetails |
std |
Constructor and Description |
---|
SplitTransactionImpl(Region r,
byte[] splitrow)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Put |
addLocation(Put p,
ServerName sn,
long openSeqNum) |
PairOfSameType<Region> |
execute(Server server,
RegionServerServices services)
Run the transaction.
|
PairOfSameType<Region> |
execute(Server server,
RegionServerServices services,
User user)
Run the transaction.
|
List<SplitTransaction.JournalEntry> |
getJournal()
Get the journal for the transaction.
|
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()
Does checks on split inputs.
|
SplitTransaction |
registerTransactionListener(SplitTransaction.TransactionListener listener)
Register a listener for transaction preparation, execution, and possibly
rollback phases.
|
boolean |
rollback(Server server,
RegionServerServices services)
Roll back a failed transaction
|
boolean |
rollback(Server server,
RegionServerServices services,
User user)
Roll back a failed transaction
|
PairOfSameType<Region> |
stepsAfterPONR(Server server,
RegionServerServices services,
PairOfSameType<Region> regions)
Deprecated.
|
PairOfSameType<Region> |
stepsAfterPONR(Server server,
RegionServerServices services,
PairOfSameType<Region> regions,
User user) |
PairOfSameType<Region> |
stepsBeforePONR(Server server,
RegionServerServices services,
boolean testing) |
public SplitTransactionCoordination.SplitTransactionDetails std
public SplitTransactionImpl(Region r, byte[] splitrow)
r
- Region to splitsplitrow
- Row to split aroundpublic boolean prepare() throws IOException
prepare
in interface SplitTransaction
true
if the region is splittable else
false
if it is not (e.g. its already closed, etc.).IOException
public PairOfSameType<Region> stepsBeforePONR(Server server, RegionServerServices services, boolean testing) throws IOException
IOException
public PairOfSameType<Region> execute(Server server, RegionServerServices services) throws IOException
SplitTransaction
execute
in interface SplitTransaction
server
- Hosting server instance. Can be null when testing.services
- Used to online/offline regions.IOException
- If thrown, transaction failed.
Call SplitTransaction.rollback(Server, RegionServerServices)
SplitTransaction.rollback(Server, RegionServerServices)
public PairOfSameType<Region> execute(Server server, RegionServerServices services, User user) throws IOException
execute
in interface SplitTransaction
server
- Hosting server instance. Can be null when testingservices
- Used to online/offline regions.IOException
- If thrown, transaction failed.
Call rollback(Server, RegionServerServices)
IOException
rollback(Server, RegionServerServices)
@Deprecated public PairOfSameType<Region> stepsAfterPONR(Server server, RegionServerServices services, PairOfSameType<Region> regions) throws IOException
IOException
public PairOfSameType<Region> stepsAfterPONR(Server server, RegionServerServices services, PairOfSameType<Region> regions, User user) throws IOException
IOException
public Put addLocation(Put p, ServerName sn, long openSeqNum)
public boolean rollback(Server server, RegionServerServices services) throws IOException
SplitTransaction
rollback
in interface SplitTransaction
server
- Hosting server instance (May be null when testing).IOException
- If thrown, rollback failed. Take drastic action.public boolean rollback(Server server, RegionServerServices services, User user) throws IOException
SplitTransaction
rollback
in interface SplitTransaction
server
- Hosting server instance (May be null when testing).services
- IOException
- If thrown, rollback failed. Take drastic action.public List<SplitTransaction.JournalEntry> getJournal()
SplitTransaction
Journal entries are an opaque type represented as JournalEntry. They can also provide useful debugging information via their toString method.
getJournal
in interface SplitTransaction
public SplitTransaction registerTransactionListener(SplitTransaction.TransactionListener listener)
SplitTransaction
A listener can abort a transaction by throwing an exception.
registerTransactionListener
in interface SplitTransaction
listener
- the listenerpublic Server getServer()
SplitTransaction
getServer
in interface SplitTransaction
public RegionServerServices getRegionServerServices()
SplitTransaction
getRegionServerServices
in interface SplitTransaction