|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.tranche.flatfile.ReplaceCorruptedDataBlockThread
public class ReplaceCorruptedDataBlockThread
Thread replaces any missing chunks from a corrupted data block. Reads requests for corrupted DataBlock objects from a queue.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static int |
MAX_QUEUE_SIZE
Maximum size before allowed queue blocks. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
ReplaceCorruptedDataBlockThread(DataBlockUtil dbu)
Private constructor. |
| Method Summary | |
|---|---|
void |
addChunkToRetrieve(BigHash hash,
boolean isMetaData)
Add a chunk that should be repaired from a corrupted data block. |
boolean |
isStop()
Returns value for flag that determines if the thread should stop. |
void |
run()
|
void |
setStop(boolean stop)
Set whether the thread should stop. |
void |
waitForQueueToEmpty(long maxTimeToWaitMillis)
Wait up to a certain amount of time for queue to empty. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_QUEUE_SIZE
Maximum size before allowed queue blocks.
| Constructor Detail |
|---|
protected ReplaceCorruptedDataBlockThread(DataBlockUtil dbu)
dataHashes - List of data hashes that need replaced immediately.metaHashes - List of meta data hashes that need replaced immediately.| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic boolean isStop()
Returns value for flag that determines if the thread should stop.
Note that the thread will continue until queue is empty.
public void setStop(boolean stop)
Set whether the thread should stop.
Note that the thread will continue until queue is empty.
stop - True if want to stop, false otherwise
public void addChunkToRetrieve(BigHash hash,
boolean isMetaData)
throws java.lang.InterruptedException
Add a chunk that should be repaired from a corrupted data block.
hash - isMetaData -
java.lang.InterruptedException
public void waitForQueueToEmpty(long maxTimeToWaitMillis)
throws java.lang.InterruptedException
Wait up to a certain amount of time for queue to empty. This is done to alleviate resources on server.
maxTimeToWaitMillis - Maximum time to wait for queue to empty in milliseconds. For example, if want to wait up to five seconds, value would be 5000.
java.lang.InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||