Package org.apache.hadoop.hbase.client
Class HBaseHbck
java.lang.Object
org.apache.hadoop.hbase.client.HBaseHbck
- All Implemented Interfaces:
Closeable,AutoCloseable,Abortable,Hbck
Use
Connection.getHbck() to obtain an instance of Hbck instead of constructing an
HBaseHbck directly.
Connection should be an unmanaged connection obtained via
ConnectionFactory.createConnection(Configuration).
NOTE: The methods in here can do damage to a cluster if applied in the wrong sequence or at the wrong time. Use with caution. For experts only. These methods are only for the extreme case where the cluster has been damaged or has achieved an inconsistent state because of some unforeseen circumstance or bug and requires manual intervention.
An instance of this class is lightweight and not-thread safe. A new instance should be created by each thread. Pooling or caching of the instance is not recommended.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.HbckService.BlockingInterfaceprivate static final org.slf4j.Loggerprivate RpcControllerFactory -
Constructor Summary
ConstructorsConstructorDescriptionHBaseHbck(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.HbckService.BlockingInterface hbck, RpcControllerFactory rpcControllerFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidAbort the server or client.LikeAdmin.assign(byte[])but 'raw' in that it can do more than one Region at a time -- good if many Regions to online -- and it will schedule the assigns even in the case where Master is initializing (as long as the ProcedureExecutor is up).bypassProcedure(List<Long> pids, long waitTime, boolean override, boolean recursive) Bypass specified procedure and move it to completion.voidclose()voidfixMeta()Fix Meta.booleanCheck if the server or client was aborted.booleanRequest HBCK chore to run at master side.scheduleServerCrashProcedures(List<ServerName> serverNames) setRegionStateInMeta(Map<String, RegionState.State> nameOrEncodedName2State) Update region state in Meta only.setTableStateInMeta(TableState state) Update table state in Meta only.private static StringtoCommaDelimitedString(List<String> list) LikeAdmin.unassign(byte[], boolean)but 'raw' in that it can do more than one Region at a time -- good if many Regions to offline -- and it will schedule the assigns even in the case where Master is initializing (as long as the ProcedureExecutor is up).
-
Field Details
-
LOG
-
aborted
-
hbck
private final org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.HbckService.BlockingInterface hbck -
rpcControllerFactory
-
-
Constructor Details
-
HBaseHbck
HBaseHbck(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.HbckService.BlockingInterface hbck, RpcControllerFactory rpcControllerFactory)
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
abort
Description copied from interface:AbortableAbort the server or client. -
isAborted
Description copied from interface:AbortableCheck if the server or client was aborted. -
setTableStateInMeta
Description copied from interface:HbckUpdate table state in Meta only. No procedures are submitted to open/assign or close/unassign regions of the table.- Specified by:
setTableStateInMetain interfaceHbck- Parameters:
state- table state- Returns:
- previous state of the table in Meta
- Throws:
IOException
-
setRegionStateInMeta
public Map<String,RegionState.State> setRegionStateInMeta(Map<String, RegionState.State> nameOrEncodedName2State) throws IOExceptionDescription copied from interface:HbckUpdate region state in Meta only. No procedures are submitted to manipulate the given region or any other region from same table.- Specified by:
setRegionStateInMetain interfaceHbck- Parameters:
nameOrEncodedName2State- list of all region states to be updated in meta- Returns:
- previous state of the region in Meta
- Throws:
IOException
-
assigns
public List<Long> assigns(List<String> encodedRegionNames, boolean override, boolean force) throws IOException Description copied from interface:HbckLikeAdmin.assign(byte[])but 'raw' in that it can do more than one Region at a time -- good if many Regions to online -- and it will schedule the assigns even in the case where Master is initializing (as long as the ProcedureExecutor is up). Does NOT call Coprocessor hooks.- Specified by:
assignsin interfaceHbck- Parameters:
encodedRegionNames- Region encoded names; e.g. 1588230740 is the hard-coded encoding for hbase:meta region and de00010733901a05f5a2a3a382e27dd4 is an example of what a random user-space encoded Region name looks like.override- You need to add override for unset of the procedure from RegionStateNode without byPassing preTransitCheckforce- You need to add force for case where a region has previously been bypassed. When a Procedure has been bypassed, a Procedure will have completed but no other Procedure will be able to make progress on the target entity (intentionally). Skips preTransitCheck only when selected along with override option- Throws:
IOException
-
unassigns
public List<Long> unassigns(List<String> encodedRegionNames, boolean override, boolean force) throws IOException Description copied from interface:HbckLikeAdmin.unassign(byte[], boolean)but 'raw' in that it can do more than one Region at a time -- good if many Regions to offline -- and it will schedule the assigns even in the case where Master is initializing (as long as the ProcedureExecutor is up). Does NOT call Coprocessor hooks.- Specified by:
unassignsin interfaceHbck- Parameters:
encodedRegionNames- Region encoded names; e.g. 1588230740 is the hard-coded encoding for hbase:meta region and de00010733901a05f5a2a3a382e27dd4 is an example of what a random user-space encoded Region name looks like.override- You need to add override for unset of the procedure from RegionStateNode without byPassing preTransitCheckforce- You need to add force for case where a region has previously been bypassed. When a Procedure has been bypassed, a Procedure will have completed but no other Procedure will be able to make progress on the target entity (intentionally). Skips preTransitCheck only when selected along with override option- Throws:
IOException
-
toCommaDelimitedString
-
bypassProcedure
public List<Boolean> bypassProcedure(List<Long> pids, long waitTime, boolean override, boolean recursive) throws IOException Description copied from interface:HbckBypass specified procedure and move it to completion. Procedure is marked completed but no actual work is done from the current state/step onwards. Parents of the procedure are also marked for bypass.- Specified by:
bypassProcedurein interfaceHbck- Parameters:
pids- of procedures to complete.waitTime- wait time in ms for acquiring lock for a procedureoverride- if override set to true, we will bypass the procedure even if it is executing. This is for procedures which can't break out during execution (bugs?).recursive- If set, if a parent procedure, we will find and bypass children and then the parent procedure (Dangerous but useful in case where child procedure has been 'lost'). Does not always work. Experimental.- Returns:
- true if procedure is marked for bypass successfully, false otherwise
- Throws:
IOException
-
scheduleServerCrashProcedures
- Specified by:
scheduleServerCrashProceduresin interfaceHbck- Throws:
IOException
-
scheduleSCPsForUnknownServers
- Specified by:
scheduleSCPsForUnknownServersin interfaceHbck- Throws:
IOException
-
runHbckChore
Description copied from interface:HbckRequest HBCK chore to run at master side.- Specified by:
runHbckChorein interfaceHbck- Returns:
trueif HBCK chore ran,falseif HBCK chore already running- Throws:
IOException- if a remote or network exception occurs
-
fixMeta
Description copied from interface:HbckFix Meta.- Specified by:
fixMetain interfaceHbck- Throws:
IOException
-