|
||||||||||
| 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.network.StatusUpdateProcess
org.tranche.network.ServerStatusUpdateProcess
public class ServerStatusUpdateProcess
The network status update process used when there is a local server.
The server update process consists of contacting a single server in a range of servers.
This process is the cornerstone of the status propagation scheme that was implemented to reduce the number of connections that were needed to be held by servers and clients.
To protected against malicious attack, only core servers can be trusted to return the status of other servers. Non-core servers must be contacted individually to determine their status.
The status table keeps all the rows within it sorted alphabetically by host name. Starting at the local host (if it's a core server), the core servers are split up into groups of a configurable size.
Each of the groups is called a range. Within this range, the first server that is not the local server and is online will be designated the "connection host", or the one from which the updates for that server should be requested.
Core servers with non-core servers alphabetically after them and before another core server must request the status of each of those servers individually.
It is with this orderly scheme that we can be sure the information will be propagated in an orderly manner.
| 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 org.tranche.network.StatusUpdateProcess |
|---|
isRunning |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
protected |
ServerStatusUpdateProcess()
Default constructor |
| Method Summary | |
|---|---|
protected static void |
adjustStatusTableRowRanges()
Updates the status table row ranges based on the status of the network. |
static java.util.Collection<StatusTableRowRange> |
getNonCoreServersToUpdate()
Gets the non-core servers that the local server will update individually. |
static ServerStatusTablePerspective |
getServerStatusTablePerspectiveForServer(java.lang.String host)
Get the status table information from the perspective of specified host. |
static java.util.Collection<StatusTableRowRange> |
getStatusTableRowRanges()
Gets the row ranges. |
void |
run()
Starts the process. |
| Methods inherited from class org.tranche.network.StatusUpdateProcess |
|---|
safeStop |
| 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 |
|---|
protected ServerStatusUpdateProcess()
Default constructor
| Method Detail |
|---|
public void run()
Starts the process.
run in interface java.lang.Runnablerun in class java.lang.Threadpublic static final java.util.Collection<StatusTableRowRange> getStatusTableRowRanges()
Gets the row ranges.
public static final java.util.Collection<StatusTableRowRange> getNonCoreServersToUpdate()
Gets the non-core servers that the local server will update individually.
protected static final void adjustStatusTableRowRanges()
Updates the status table row ranges based on the status of the network.
Also determines the non-core servers the local server should be getting updates from.
public static final ServerStatusTablePerspective getServerStatusTablePerspectiveForServer(java.lang.String host)
Get the status table information from the perspective of specified host. This could be the local host or a remote one.
host - The host for the server from whose perspective we want to see the network
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||