public class FailureInducer extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ACTIVE |
static int |
COMPLETED |
static int |
COMPLETING |
static int |
PREPARED |
static int |
PREPARING |
Constructor and Description |
---|
FailureInducer() |
Modifier and Type | Method and Description |
---|---|
static void |
activateFailureInducer()
This activates the FailureInducer.
|
static void |
crash()
Forces the TM to crash.
|
static void |
deactivateFailureInducer()
This deactivates the FailureInducer.
|
static int |
getWaitCount() |
static boolean |
isFailureInducerActive() |
static void |
setCrashPoint(Integer crashPoint)
Setting a crash point will cause the TM to wait at the
failure point, until crash() is called.
|
static void |
setWaitPoint(Integer waitPoint,
int waitDuration)
Setting a wait point will cause the TM to wait at the
failure point, for the stipulated wait duration.
|
static void |
setWaitPointRecovery(int waitDuration)
Enable wait action dyring delegated recovery via "add-wait-point-during-recovery"
property added to the transaction-service config
|
static void |
waitForFailure(GlobalTID gtid,
Integer failPoint)
This method is called by the coordinator at every valid
failure point.
|
static void |
waitInRecovery()
Perform wait action dyring delegated recovery
|
public static final int ACTIVE
public static final int PREPARING
public static final int PREPARED
public static final int COMPLETING
public static final int COMPLETED
public static void activateFailureInducer()
public static void deactivateFailureInducer()
public static boolean isFailureInducerActive()
public static void setCrashPoint(Integer crashPoint)
crashPoint
- pre-defined failure points
(PREPARING, PREPARED, COMMITTING, COMMITTED).public static void setWaitPoint(Integer waitPoint, int waitDuration)
crashPoint
- pre-defined failure points
(PREPARING, PREPARED, COMMITTING, COMMITTED).waitDuration
- time duration (seconds) for RM failure to happen.public static void crash()
public static int getWaitCount()
public static void waitForFailure(GlobalTID gtid, Integer failPoint)
coord
- the coordinator object (which represents the transaction.failPoint
- indicates the current failure point in coordinator code.public static void setWaitPointRecovery(int waitDuration)
public static void waitInRecovery()
Copyright © 2019. All rights reserved.