org.tranche.flatfile
Class ProjectFindingThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.tranche.commons.DebuggableThread
          extended by org.tranche.flatfile.ProjectFindingThread
All Implemented Interfaces:
java.lang.Runnable

public class ProjectFindingThread
extends org.tranche.commons.DebuggableThread

Loads information about available data, along with corrupted DataBlock files, from disk. This runs when a server starts up.

Author:
Bryan Smith - bryanesmith@gmail.com

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ProjectFindingThread(FlatFileTrancheServer ffts)
           
 
Method Summary
 boolean isStopped()
          Returns true if this has been stopped.
static void loadDataBlocks(DataBlockUtil dbu)
          Depth-first traversal of data blocks to repair and merge old data blocks.
static void loadDataBlocks(FlatFileTrancheServer ffts)
          Depth-first traversal of data blocks to repair, merge old data blocks and gather statistics.
 void run()
           
 void setStopped(boolean stopped)
          Set whether this thread is stopped or not.
 
Methods inherited from class org.tranche.commons.DebuggableThread
debugErr, debugErr, debugOut, isDebug, setDebug
 
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
 

Constructor Detail

ProjectFindingThread

public ProjectFindingThread(FlatFileTrancheServer ffts)
Parameters:
ffts -
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

isStopped

public boolean isStopped()

Returns true if this has been stopped.

Returns:

setStopped

public void setStopped(boolean stopped)

Set whether this thread is stopped or not.

Note that setting this stopped to false after the thread has stopped does nothing.

Parameters:
stopped -

loadDataBlocks

public static void loadDataBlocks(DataBlockUtil dbu)

Depth-first traversal of data blocks to repair and merge old data blocks.

This method interface is intended for tests and scripts. Production servers should not invoke this, but will actually run the ProjectFindingThread, which will in turn invoke this method.

Parameters:
dbu - Must not be null (required)

loadDataBlocks

public static void loadDataBlocks(FlatFileTrancheServer ffts)

Depth-first traversal of data blocks to repair, merge old data blocks and gather statistics.

This method interface is intended for tests and scripts. Production servers should not invoke this, but will actually run the ProjectFindingThread, which will in turn invoke this method.

Parameters:
ffts - Must not be null (required)


This code is free for use both commercially and non-commercially as stated in the project's license