|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
stella.util.TransferListener.TransferThread
private final class TransferListener.TransferThread
This is the main transfer thread. It has two (blocking) queues, the
high-priority fits queue and the lower priority copy queue. Copy-queue
files are simply copied, while fits file are first compressed before they
are copied using the imcopy program. The destination directory is
determined by scanning for the dateobs key in fits files or (for copy
files or if the dateobs is not successful) using the file creation time.
This time is used to calculate a jd, round that and calculating a date
from that rounded jd, formatting with yyyyMMdd. If the file header is
compatible to one of the TransferListener.KEY_FITSDB entries, also the obs db is
updated. If the file has been successfully transferred, it is moved into
the transfer directory and (if a db-relavant file), the db is updated
again.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private boolean |
cancel
If true, we cancel. |
private BlockingDeque<File> |
copyqueue
The que of the low-priority copy files. |
private BlockingDeque<File> |
fitsqueue
The queue of the fits files. |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
private |
TransferListener.TransferThread()
Constructs a new transfer thread and starts it. |
| Method Summary | |
|---|---|
private BlockingDeque<File> |
getCopyQueue()
Retunrs the blocking queue used for a simple copy of files. |
private BlockingDeque<File> |
getFitsQueue()
Return the blocking queue used for the fits files. |
void |
run()
We run forever until canceled. |
private void |
transferCopy()
Transfer the first file in the copy queue to the target host. |
private void |
transferFits()
Transfers the first file in the fitsqueue or waits at most TransferListener.KEY_POLLTIME for a file to get available. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, clone, 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 |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private BlockingDeque<File> fitsqueue
private BlockingDeque<File> copyqueue
private boolean cancel
| Constructor Detail |
|---|
private TransferListener.TransferThread()
| Method Detail |
|---|
private BlockingDeque<File> getFitsQueue()
private BlockingDeque<File> getCopyQueue()
public void run()
run in interface Runnablerun in class Threadprivate void transferFits()
TransferListener.KEY_POLLTIME for a file to get available. Once a file has
been found, the first action is to enter it into the obs database,
marking it as not-transferred, if the fits name is compliant with the
db-requesting #KEY_DBFITS. It is than compressed using the
rice loss-less image compression algorithm and transferred to the
home host. If all that was successful, it is marked in the db as
transferred and moved to the transfer dir.
private void transferCopy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||