private final class TransferListener.TransferThread extends Thread
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.Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
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.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier | Constructor and Description |
|---|---|
private |
TransferThread()
Constructs a new transfer thread and starts it.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
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, yieldprivate BlockingDeque<File> fitsqueue
private BlockingDeque<File> copyqueue
private boolean cancel
private TransferThread()
private BlockingDeque<File> getFitsQueue()
private BlockingDeque<File> getCopyQueue()
public void run()
private 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()