Package org.apache.hadoop.hbase.client
Interface Hbck
- All Superinterfaces:
Abortable
,AutoCloseable
,Closeable
- All Known Implementing Classes:
HBaseHbck
Hbck fixup tool APIs. Obtain an instance from
Connection.getHbck()
and call
Closeable.close()
when done.
WARNING: the below methods can damage the cluster. It may leave the cluster in an indeterminate state, e.g. region not assigned, or some hdfs files left behind. After running any of the below, operators may have to do some clean up on hdfs or schedule some assign procedures to get regions back online. DO AT YOUR OWN RISK. For experienced users only.
- Since:
- 2.0.2, 2.1.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionLikeAdmin.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.void
fixMeta()
Fix Meta.boolean
Request HBCK chore to run at master side.scheduleServerCrashProcedure
(List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> serverNames) Deprecated.since 2.2.1.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.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).
-
Method Details
-
setTableStateInMeta
Update table state in Meta only. No procedures are submitted to open/assign or close/unassign regions of the table.- Parameters:
state
- table state- Returns:
- previous state of the table in Meta
- Throws:
IOException
-
setRegionStateInMeta
Map<String,RegionState.State> setRegionStateInMeta(Map<String, RegionState.State> nameOrEncodedName2State) throws IOExceptionUpdate region state in Meta only. No procedures are submitted to manipulate the given region or any other region from same table.- Parameters:
nameOrEncodedName2State
- list of all region states to be updated in meta- Returns:
- previous state of the region in Meta
- Throws:
IOException
-
assigns
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). Does NOT call Coprocessor hooks.- Parameters:
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.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.- Throws:
IOException
-
assigns
- Throws:
IOException
-
unassigns
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). Does NOT call Coprocessor hooks.- Parameters:
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.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.- Throws:
IOException
-
unassigns
- Throws:
IOException
-
bypassProcedure
List<Boolean> bypassProcedure(List<Long> pids, long waitTime, boolean override, boolean recursive) throws IOException Bypass 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.- 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
-
scheduleServerCrashProcedure
@Deprecated default List<Long> scheduleServerCrashProcedure(List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> serverNames) throws IOException Deprecated.since 2.2.1. Will removed in 3.0.0.UsescheduleServerCrashProcedures(List)
instead.- Throws:
IOException
-
scheduleServerCrashProcedures
- Throws:
IOException
-
scheduleSCPsForUnknownServers
- Throws:
IOException
-
runHbckChore
Request HBCK chore to run at master side.- Returns:
true
if HBCK chore ran,false
if HBCK chore already running- Throws:
IOException
- if a remote or network exception occurs
-
fixMeta
Fix Meta.- Throws:
IOException
-