@InterfaceAudience.Private public final class ProcedureUtil extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
ProcedureUtil.CompatStateSerializer
A serializer (deserializer) for those Procedures which were serialized before this patch.
|
private static class |
ProcedureUtil.StateSerializer
A serializer for our Procedures.
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_PROCEDURE_RETRY_MAX_SLEEP_TIME_MS |
static long |
DEFAULT_PROCEDURE_RETRY_SLEEP_INTERVAL_MS |
static String |
PROCEDURE_RETRY_MAX_SLEEP_TIME_MS |
static String |
PROCEDURE_RETRY_SLEEP_INTERVAL_MS |
Modifier | Constructor and Description |
---|---|
private |
ProcedureUtil() |
Modifier and Type | Method and Description |
---|---|
static Procedure<?> |
convertToProcedure(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proto)
Helper to convert the protobuf procedure.
|
static org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockedResource |
convertToProtoLockedResource(LockedResource lockedResource) |
static org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockType |
convertToProtoLockType(LockType lockType) |
static org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure |
convertToProtoProcedure(Procedure<?> proc)
Helper to convert the procedure to protobuf.
|
static org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockedResourceType |
convertToProtoResourceType(LockedResourceType resourceType) |
static RetryCounter |
createRetryCounter(org.apache.hadoop.conf.Configuration conf)
Get a retry counter for getting the backoff time.
|
static boolean |
isFinished(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proc) |
private static Procedure<?> |
newProcedure(String className) |
(package private) static void |
validateClass(Procedure<?> proc) |
public static final String PROCEDURE_RETRY_SLEEP_INTERVAL_MS
public static final long DEFAULT_PROCEDURE_RETRY_SLEEP_INTERVAL_MS
public static final String PROCEDURE_RETRY_MAX_SLEEP_TIME_MS
public static final long DEFAULT_PROCEDURE_RETRY_MAX_SLEEP_TIME_MS
private ProcedureUtil()
private static Procedure<?> newProcedure(String className) throws BadProcedureException
BadProcedureException
static void validateClass(Procedure<?> proc) throws BadProcedureException
BadProcedureException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure convertToProtoProcedure(Procedure<?> proc) throws IOException
IOException
public static Procedure<?> convertToProcedure(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proto) throws IOException
IOException
public static org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockedResourceType convertToProtoResourceType(LockedResourceType resourceType)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockType convertToProtoLockType(LockType lockType)
public static org.apache.hadoop.hbase.shaded.protobuf.generated.LockServiceProtos.LockedResource convertToProtoLockedResource(LockedResource lockedResource) throws IOException
IOException
public static RetryCounter createRetryCounter(org.apache.hadoop.conf.Configuration conf)
RetryCounter.ExponentialBackoffPolicyWithLimit
policy, and the base unit is 1 second, max sleep time
is 10 minutes by default.
For UTs, you can set the PROCEDURE_RETRY_SLEEP_INTERVAL_MS
and
PROCEDURE_RETRY_MAX_SLEEP_TIME_MS
to make more frequent retry so your UT will not
timeout.public static boolean isFinished(org.apache.hadoop.hbase.shaded.protobuf.generated.ProcedureProtos.Procedure proc)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.