public class RepairExecutor
extends java.lang.Object
If the repair was initiated by an exception, but the original exception is re-thrown, a transaction exit will rollback the repair! Executing the repair in a separate thread allows it to wait until the transaction has exited.
Other kinds of inconsistencies might be detected during cursor iteration. The repair will need to acquire write locks, but the open cursor might not allow that, resulting in deadlock. Executing the repair in a separate thread allows it to wait until the cursor has released locks.
This class keeps thread-local references to single-threaded executors. In other words, each user thread has at most one associated repair thread. Each repair thread has a fixed size queue, and they exit when they are idle. If the queue is full, newly added repair tasks are silently discarded.
The following system properties are supported:
Modifier and Type | Method and Description |
---|---|
static void |
execute(java.lang.Runnable repair) |
static boolean |
waitForRepairsToFinish(long timeoutMillis)
Waits for repairs that were executed from the current thread to finish.
|
public static void execute(java.lang.Runnable repair)
public static boolean waitForRepairsToFinish(long timeoutMillis) throws java.lang.InterruptedException
java.lang.InterruptedException
Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.