@InterfaceAudience.Private public class ZkOpenRegionCoordination extends Object implements OpenRegionCoordination
OpenRegionCoordination
.Modifier and Type | Class and Description |
---|---|
static class |
ZkOpenRegionCoordination.ZkOpenRegionDetails
ZK-based implementation.
|
OpenRegionCoordination.OpenRegionDetails
Modifier and Type | Field and Description |
---|---|
private CoordinatedStateManager |
coordination |
private static org.apache.commons.logging.Log |
LOG |
private ZooKeeperWatcher |
watcher |
Constructor and Description |
---|
ZkOpenRegionCoordination(CoordinatedStateManager coordination,
ZooKeeperWatcher watcher) |
Modifier and Type | Method and Description |
---|---|
boolean |
commitOpenOnMasterSide(AssignmentManager assignmentManager,
HRegionInfo regionInfo,
OpenRegionCoordination.OpenRegionDetails ord)
Commits opening operation on HM side (steps required for "commit"
are determined by coordination implementation).
|
private void |
debugLog(HRegionInfo region,
String string) |
private boolean |
deleteOpenedNode(HRegionInfo regionInfo,
OpenRegionCoordination.OpenRegionDetails ord) |
OpenRegionCoordination.OpenRegionDetails |
getDetailsForNonCoordinatedOpening()
No ZK tracking will be performed for that case.
|
private boolean |
isGoodVersion(ZkOpenRegionCoordination.ZkOpenRegionDetails zkOrd) |
private boolean |
isRegionStillOpening(HRegionInfo regionInfo,
RegionServerServices rsServices) |
OpenRegionCoordination.OpenRegionDetails |
parseFromProtoRequest(org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest.RegionOpenInfo regionOpenInfo)
Parse ZK-related fields from request.
|
boolean |
tickleOpening(OpenRegionCoordination.OpenRegionDetails ord,
HRegionInfo regionInfo,
RegionServerServices rsServices,
String context)
Update our OPENING state in zookeeper.
|
boolean |
transitionFromOfflineToOpening(HRegionInfo regionInfo,
OpenRegionCoordination.OpenRegionDetails ord)
Transition ZK node from OFFLINE to OPENING.
|
boolean |
transitionToOpened(HRegion r,
OpenRegionCoordination.OpenRegionDetails ord)
Tries to move regions to OPENED state.
|
boolean |
tryTransitionFromOfflineToFailedOpen(RegionServerServices rsServices,
HRegionInfo hri,
OpenRegionCoordination.OpenRegionDetails ord)
Try to transition to open.
|
boolean |
tryTransitionFromOpeningToFailedOpen(HRegionInfo hri,
OpenRegionCoordination.OpenRegionDetails ord)
This is not guaranteed to succeed, we just do our best.
|
private static final org.apache.commons.logging.Log LOG
private CoordinatedStateManager coordination
private final ZooKeeperWatcher watcher
public ZkOpenRegionCoordination(CoordinatedStateManager coordination, ZooKeeperWatcher watcher)
public boolean transitionToOpened(HRegion r, OpenRegionCoordination.OpenRegionDetails ord) throws IOException
OpenRegionCoordination
transitionToOpened
in interface OpenRegionCoordination
r
- Region we're working on.ord
- details about region opening taskIOException
public boolean transitionFromOfflineToOpening(HRegionInfo regionInfo, OpenRegionCoordination.OpenRegionDetails ord)
transitionFromOfflineToOpening
in interface OpenRegionCoordination
regionInfo
- region info instanceord
- - instance of open region details, for ZK implementation
will include version Of OfflineNode that needs to be compared
before changing the node's state from OFFLINEpublic boolean tickleOpening(OpenRegionCoordination.OpenRegionDetails ord, HRegionInfo regionInfo, RegionServerServices rsServices, String context)
tickleOpening
in interface OpenRegionCoordination
context
- Some context to add to logs if failureord
- details about opening task.regionInfo
- region we're working on.rsServices
- instance of RegionServerrServicespublic boolean tryTransitionFromOfflineToFailedOpen(RegionServerServices rsServices, HRegionInfo hri, OpenRegionCoordination.OpenRegionDetails ord)
tryTransitionFromOfflineToFailedOpen
in interface OpenRegionCoordination
rsServices
- hri
- Region we're working on.ord
- Details about region open taskprivate boolean isGoodVersion(ZkOpenRegionCoordination.ZkOpenRegionDetails zkOrd)
public boolean tryTransitionFromOpeningToFailedOpen(HRegionInfo hri, OpenRegionCoordination.OpenRegionDetails ord)
tryTransitionFromOpeningToFailedOpen
in interface OpenRegionCoordination
hri
- Region we're working on.ord
- details about region opening taskpublic OpenRegionCoordination.OpenRegionDetails parseFromProtoRequest(org.apache.hadoop.hbase.protobuf.generated.AdminProtos.OpenRegionRequest.RegionOpenInfo regionOpenInfo)
parseFromProtoRequest
in interface OpenRegionCoordination
public OpenRegionCoordination.OpenRegionDetails getDetailsForNonCoordinatedOpening()
getDetailsForNonCoordinatedOpening
in interface OpenRegionCoordination
public boolean commitOpenOnMasterSide(AssignmentManager assignmentManager, HRegionInfo regionInfo, OpenRegionCoordination.OpenRegionDetails ord)
OpenRegionCoordination
commitOpenOnMasterSide
in interface OpenRegionCoordination
private boolean deleteOpenedNode(HRegionInfo regionInfo, OpenRegionCoordination.OpenRegionDetails ord)
private void debugLog(HRegionInfo region, String string)
private boolean isRegionStillOpening(HRegionInfo regionInfo, RegionServerServices rsServices)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.