|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.tranche.commons.DebuggableThread
org.tranche.server.ServerStartupThread
public class ServerStartupThread
Start up tasks thread for server. Important for integrity of network: makes sure certain items which should be deleted are, and attempts to get copies of any newly added chunks.
| 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 | |
|---|---|
ServerStartupThread(Server socketServer,
TrancheServer wrappedServer)
Start up tasks thread for server. |
|
| Method Summary | |
|---|---|
static boolean |
addMetaData(BigHash hash,
byte[] downloadedChunk,
FlatFileTrancheServer localServerToUpdate,
User user)
|
static boolean |
checkServerForChunksToAdd(long fromTimestamp,
long toTimestamp,
java.lang.String host,
FlatFileTrancheServer localServerToUpdate)
Update a local server (FlatFileTrancheServer) by checking specific server at a specific url is there any new chunks to consider between two timestamps. |
static boolean |
checkServerForChunksToDelete(long fromTimestamp,
long toTimestamp,
java.lang.String host,
FlatFileTrancheServer localServerToUpdate)
Update a local server (FlatFileTrancheServer) by checking specific server at a specific url is there any deletes to consider between two timestamps. |
static boolean |
checkServerForMetaDataToReplace(long fromTimestamp,
long toTimestamp,
java.lang.String host,
FlatFileTrancheServer localServerToUpdate)
|
static boolean |
checkServerForMetaDataToReplace(long fromTimestamp,
long toTimestamp,
java.lang.String host,
FlatFileTrancheServer localServerToUpdate,
int[] metaDataUpdateCount)
|
void |
run()
|
boolean |
waitForStartupToComplete(long maxTimeToWaitInMillis)
Wait for ServerStartupThread to finish running. |
| 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 |
|---|
public ServerStartupThread(Server socketServer,
TrancheServer wrappedServer)
Start up tasks thread for server. Important for integrity of network: makes sure certain items which should be deleted are, and attempts to get copies of any newly added chunks.
socketServer - wrappedServer - | Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
public static boolean addMetaData(BigHash hash,
byte[] downloadedChunk,
FlatFileTrancheServer localServerToUpdate,
User user)
throws java.lang.Exception
hash - downloadedChunk - localServerToUpdate - user -
java.lang.Exception
public static boolean checkServerForMetaDataToReplace(long fromTimestamp,
long toTimestamp,
java.lang.String host,
FlatFileTrancheServer localServerToUpdate)
fromTimestamp - toTimestamp - host - localServerToUpdate -
public static boolean checkServerForMetaDataToReplace(long fromTimestamp,
long toTimestamp,
java.lang.String host,
FlatFileTrancheServer localServerToUpdate,
int[] metaDataUpdateCount)
fromTimestamp - toTimestamp - host - localServerToUpdate - metaDataUpdateCount -
public static boolean checkServerForChunksToDelete(long fromTimestamp,
long toTimestamp,
java.lang.String host,
FlatFileTrancheServer localServerToUpdate)
Update a local server (FlatFileTrancheServer) by checking specific server at a specific url is there any deletes to consider between two timestamps. If so, will perform deletes only if user is trusted.
fromTimestamp - Starting of period to check (inclusive)toTimestamp - End of period to check (inclusive)host - Host name for server to check for deletionslocalServerToUpdate - The FlatFileTrancheServer to check
public static boolean checkServerForChunksToAdd(long fromTimestamp,
long toTimestamp,
java.lang.String host,
FlatFileTrancheServer localServerToUpdate)
Update a local server (FlatFileTrancheServer) by checking specific server at a specific url is there any new chunks to consider between two timestamps. If so, will add chunks only if user is trusted and belong to hash span.
Also performs a check for scenario known as 'Startup Radiation' (pun on Hawking Radiation) where, for tiny window of time, a chunk that is about to be deleted might be "rescued" by this activity. The delete should help prevent the replication of the "rescued" chunk, but cannot fully prevent it.
The only way to prevent the replication of a deleted chunk is to make sure that deletions are complete by verify after a time period that the chunk didn't replicate. This is a problem for a deletion tool and cannot be handled here.
fromTimestamp - Starting of period to check (inclusive)toTimestamp - End of period to check (inclusive)host - Host name for server to check for deletionslocalServerToUpdate - The FlatFileTrancheServer to checkpublic boolean waitForStartupToComplete(long maxTimeToWaitInMillis)
Wait for ServerStartupThread to finish running. Note this will only block for a maximum number of milliseconds, as set by parameter.
maxTimeToWaitInMillis - Maximum number of milliseconds to wait for thread to finish
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||