X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=datarouter-node%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fnode%2FDeliveryQueue.java;h=b7699e53b4393e9dcb24dd59953566b6f928e10f;hb=a60d80ff7bfae8a152c950486d9a1877628e13a4;hp=8cdafd6f9b4f01ebc0eb09e4ed36030344239c8f;hpb=0a440fd3ae3b413cd7de57677aec690f14ec7d53;p=dmaap%2Fdatarouter.git diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryQueue.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryQueue.java index 8cdafd6f..b7699e53 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryQueue.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/DeliveryQueue.java @@ -35,34 +35,43 @@ import org.jetbrains.annotations.Nullable; /** * Mechanism for monitoring and controlling delivery of files to a destination. * - *
The DeliveryQueue class maintains lists of DeliveryTasks for a single destination (a subscription or another data - * router node) and assigns delivery threads to try to deliver them. It also maintains a delivery status that causes it - * to back off on delivery attempts after a failure. + *
The DeliveryQueue class maintains lists of DeliveryTasks for a single + * destination (a subscription or another data router node) and assigns + * delivery threads to try to deliver them. It also maintains a delivery + * status that causes it to back off on delivery attempts after a failure. * - *
If the most recent delivery result was a failure, then no more attempts will be made for a period of time. - * Initially, and on the first failure following a success, this delay will be DeliveryQueueHelper.getInitFailureTimer() - * (milliseconds). If, after this delay, additional failures occur, each failure will multiply the delay by - * DeliveryQueueHelper.getFailureBackoff() up to a maximum delay specified by DeliveryQueueHelper.getMaxFailureTimer(). - * Note that this behavior applies to the delivery queue as a whole and not to individual files in the queue. If - * multiple files are being delivered and one fails, the delay will be started. If a second delivery fails while the - * delay was active, it will not change the delay or change the duration of any subsequent delay. If, however, it - * succeeds, it will cancel the delay. + *
If the most recent delivery result was a failure, then no more attempts + * will be made for a period of time. Initially, and on the first failure + * following a success, this delay will be DeliveryQueueHelper.getInitFailureTimer() (milliseconds). + * If, after this delay, additional failures occur, each failure will + * multiply the delay by DeliveryQueueHelper.getFailureBackoff() up to a + * maximum delay specified by DeliveryQueueHelper.getMaxFailureTimer(). + * Note that this behavior applies to the delivery queue as a whole and not + * to individual files in the queue. If multiple files are being + * delivered and one fails, the delay will be started. If a second + * delivery fails while the delay was active, it will not change the delay + * or change the duration of any subsequent delay. + * If, however, it succeeds, it will cancel the delay. * - *
The queue maintains 3 collections of files to deliver: A to do list of files that will be attempted, a working - * set of files that are being attempted, and a retry set of files that were attempted and failed. Whenever the to do - * list is empty and needs to be refilled, a scan of the spool directory is made and the file names sorted. Any files - * in the working set are ignored. If a DeliveryTask for the file is in the retry set, then that delivery task is placed - * on the to do list. Otherwise, a new DeliveryTask for the file is created and placed on the to do list. If, when a - * DeliveryTask is about to be removed from the to do list, its age exceeds DeliveryQueueHelper.getExpirationTimer(), - * then it is instead marked as expired. + *
The queue maintains 3 collections of files to deliver: A todo list of + * files that will be attempted, a working set of files that are being + * attempted, and a retry set of files that were attempted and failed. + * Whenever the todo list is empty and needs to be refilled, a scan of the + * spool directory is made and the file names sorted. Any files in the working set are ignored. + * If a DeliveryTask for the file is in the retry set, then that delivery + * task is placed on the todo list. Otherwise, a new DeliveryTask for the + * file is created and placed on the todo list. + * If, when a DeliveryTask is about to be removed from the todo list, its + * age exceeds DeliveryQueueHelper.getExpirationTimer(), then it is instead + * marked as expired. * - *
A delivery queue also maintains a skip flag. This flag is true if the failure timer is active or if no files are - * found in a directory scan. + *
A delivery queue also maintains a skip flag. This flag is true if the
+ * failure timer is active or if no files are found in a directory scan.
*/
public class DeliveryQueue implements Runnable, DeliveryTaskHelper {
-
private static EELFLogger logger = EELFManager.getInstance().getLogger(DeliveryQueue.class);
private DeliveryQueueHelper deliveryQueueHelper;
+
private DestInfo destinationInfo;
private Hashtable