@InterfaceAudience.Private public class HBaseHbck extends Object implements Hbck
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.
ConnectionFactory,
ClusterConnection,
Hbck| Modifier and Type | Field and Description |
|---|---|
private boolean |
aborted |
private org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.HbckService.BlockingInterface |
hbck |
private static org.slf4j.Logger |
LOG |
private RpcControllerFactory |
rpcControllerFactory |
| Constructor and Description |
|---|
HBaseHbck(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.HbckService.BlockingInterface hbck,
RpcControllerFactory rpcControllerFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String why,
Throwable e)
Abort the server or client.
|
List<Long> |
assigns(List<String> encodedRegionNames,
boolean override)
Like
Admin.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). |
List<Boolean> |
bypassProcedure(List<Long> pids,
long waitTime,
boolean override,
boolean recursive)
Bypass specified procedure and move it to completion.
|
void |
close() |
void |
fixMeta()
Fix Meta.
|
boolean |
isAborted()
Check if the server or client was aborted.
|
boolean |
runHbckChore()
Request HBCK chore to run at master side.
|
List<Long> |
scheduleServerCrashProcedures(List<ServerName> serverNames) |
TableState |
setTableStateInMeta(TableState state)
Update table state in Meta only.
|
private static String |
toCommaDelimitedString(List<String> list) |
List<Long> |
unassigns(List<String> encodedRegionNames,
boolean override)
Like
Admin.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). |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitassigns, scheduleServerCrashProcedure, unassignsprivate static final org.slf4j.Logger LOG
private boolean aborted
private final org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.HbckService.BlockingInterface hbck
private RpcControllerFactory rpcControllerFactory
HBaseHbck(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.HbckService.BlockingInterface hbck, RpcControllerFactory rpcControllerFactory)
public void close() throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void abort(String why, Throwable e)
Abortablepublic boolean isAborted()
Abortablepublic TableState setTableStateInMeta(TableState state) throws IOException
HbcksetTableStateInMeta in interface Hbckstate - table stateIOExceptionpublic List<Long> assigns(List<String> encodedRegionNames, boolean override) throws IOException
HbckAdmin.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.assigns in interface HbckencodedRegionNames - 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 the override 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). This override flag will override this fencing mechanism.IOExceptionpublic List<Long> unassigns(List<String> encodedRegionNames, boolean override) throws IOException
HbckAdmin.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.unassigns in interface HbckencodedRegionNames - 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 the override 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). This override flag will override this fencing mechanism.IOExceptionprivate static String toCommaDelimitedString(List<String> list)
public List<Boolean> bypassProcedure(List<Long> pids, long waitTime, boolean override, boolean recursive) throws IOException
HbckbypassProcedure in interface Hbckpids - 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.IOExceptionpublic List<Long> scheduleServerCrashProcedures(List<ServerName> serverNames) throws IOException
scheduleServerCrashProcedures in interface HbckIOExceptionpublic boolean runHbckChore() throws IOException
HbckrunHbckChore in interface Hbcktrue if HBCK chore ran, false if HBCK chore already runningIOException - if a remote or network exception occurspublic void fixMeta() throws IOException
HbckfixMeta in interface HbckIOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.