public class ZKSplitTransactionCoordination extends Object implements SplitTransactionCoordination
Modifier and Type | Class and Description |
---|---|
static class |
ZKSplitTransactionCoordination.ZkSplitTransactionDetails
ZK-based implementation.
|
SplitTransactionCoordination.SplitTransactionDetails
Constructor and Description |
---|
ZKSplitTransactionCoordination(CoordinatedStateManager coordinationProvider,
ZooKeeperWatcher watcher) |
Modifier and Type | Method and Description |
---|---|
void |
clean(HRegionInfo hri)
clean the split transaction
|
void |
completeSplitTransaction(RegionServerServices services,
Region a,
Region b,
SplitTransactionCoordination.SplitTransactionDetails std,
Region parent)
Finish off split transaction, transition the zknode
|
SplitTransactionCoordination.SplitTransactionDetails |
getDefaultDetails() |
int |
processTransition(HRegionInfo p,
HRegionInfo hri_a,
HRegionInfo hri_b,
ServerName sn,
SplitTransactionCoordination.SplitTransactionDetails std)
Required by AssignmentManager
|
void |
startSplitTransaction(HRegion parent,
ServerName serverName,
HRegionInfo hri_a,
HRegionInfo hri_b)
Creates a new ephemeral node in the PENDING_SPLIT state for the specified region.
|
void |
waitForSplitTransaction(RegionServerServices services,
Region parent,
HRegionInfo hri_a,
HRegionInfo hri_b,
SplitTransactionCoordination.SplitTransactionDetails sptd)
Wait for the splitting node to be transitioned from pending_split to splitting by master.
|
public ZKSplitTransactionCoordination(CoordinatedStateManager coordinationProvider, ZooKeeperWatcher watcher)
public void startSplitTransaction(HRegion parent, ServerName serverName, HRegionInfo hri_a, HRegionInfo hri_b) throws IOException
Does not transition nodes from other states. If a node already exists for this region, an Exception will be thrown.
startSplitTransaction
in interface SplitTransactionCoordination
parent
- region to be created as offlineserverName
- server event originates fromhri_a
- daughter regionhri_b
- daughter regionIOException
public void waitForSplitTransaction(RegionServerServices services, Region parent, HRegionInfo hri_a, HRegionInfo hri_b, SplitTransactionCoordination.SplitTransactionDetails sptd) throws IOException
waitForSplitTransaction
in interface SplitTransactionCoordination
services
- Used to online/offline regions.parent
- regionhri_a
- daughter regionhri_b
- daughter regionsptd
- split transaction detailsIOException
public void completeSplitTransaction(RegionServerServices services, Region a, Region b, SplitTransactionCoordination.SplitTransactionDetails std, Region parent) throws IOException
completeSplitTransaction
in interface SplitTransactionCoordination
services
- Used to online/offline regions.a
- daughter regionb
- daughter regionstd
- split transaction detailsparent
- IOException
- If thrown, transaction failed. Call
SplitTransaction.rollback(
Server, RegionServerServices)
public void clean(HRegionInfo hri)
SplitTransactionCoordination
clean
in interface SplitTransactionCoordination
hri
- node to deletepublic SplitTransactionCoordination.SplitTransactionDetails getDefaultDetails()
getDefaultDetails
in interface SplitTransactionCoordination
public int processTransition(HRegionInfo p, HRegionInfo hri_a, HRegionInfo hri_b, ServerName sn, SplitTransactionCoordination.SplitTransactionDetails std) throws IOException
SplitTransactionCoordination
processTransition
in interface SplitTransactionCoordination
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.