public abstract class LoopingTaskProducer<T extends Morsel> extends Object implements Runnable
TaskQueue
by looping through all duplication policies for all accounts and spaces and
blindly creates duplication tasks. It will create tasks for all items in the
the source destination as well as all items in the destination provider but
not in the source provider. A notable feature of this task producer is that
it attempts to respect a designated maximum task queue size. Once the limit
has been reached, the producer will stop. On subsequent runs, the producer
will pick up where it left off, starting with the next account,space,set of
content items, and duplication store policy. If all content items are visited
within a single run before the task queue limit has been reached, the
producer will exit.
For more information about how this process fits into the whole system of
collaborating components, see
https://wiki.duraspace.org/display/DSPINT/DuraCloud+Duplication+-+System+Overview| Constructor and Description |
|---|
LoopingTaskProducer(CredentialsRepo credentialsRepo,
StorageProviderFactory storageProviderFactory,
org.duracloud.common.queue.TaskQueue taskQueue,
StateManager<T> state,
int maxTaskQueueSize,
Frequency frequency,
java.time.LocalTime startTime,
NotificationManager notificationManager,
LoopingTaskProducerConfigurationManager config) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToReloadList(T morsel) |
protected RunStats |
calculateStatTotals(RunStats currentTotals) |
protected Queue<T> |
createQueue() |
protected abstract RunStats |
createRunStats() |
protected CredentialsRepo |
getCredentialsRepo() |
protected Frequency |
getFrequency() |
protected abstract String |
getLoopingProducerTypePrefix()
A short looping producer type identifier for use with state files.
|
protected int |
getMaxTaskQueueSize() |
protected RunStats |
getStats(String account) |
protected org.duracloud.storage.provider.StorageProvider |
getStorageProvider(StorageProviderCredentials creds) |
protected org.duracloud.storage.provider.StorageProvider |
getStorageProvider(String account,
String storeId) |
protected org.duracloud.common.queue.TaskQueue |
getTaskQueue() |
protected abstract void |
loadMorselQueueFromSource(Queue<T> morselQueue) |
protected abstract void |
logCumulativeSessionStats(Map<String,RunStats> runstats,
RunStats cumulativeTotals) |
protected abstract void |
logGlobalncrementalStats(RunStats incrementalTotals) |
protected abstract void |
logIncrementalStatsByAccount(String account,
RunStats stats) |
protected abstract void |
nibble(Queue<T> queue) |
void |
run() |
protected void |
sendEmail(String message,
Exception ex) |
protected void |
sendEmail(String subject,
String body) |
public LoopingTaskProducer(CredentialsRepo credentialsRepo, StorageProviderFactory storageProviderFactory, org.duracloud.common.queue.TaskQueue taskQueue, StateManager<T> state, int maxTaskQueueSize, Frequency frequency, java.time.LocalTime startTime, NotificationManager notificationManager, LoopingTaskProducerConfigurationManager config)
protected Frequency getFrequency()
protected CredentialsRepo getCredentialsRepo()
protected org.duracloud.common.queue.TaskQueue getTaskQueue()
protected int getMaxTaskQueueSize()
protected void addToReloadList(T morsel)
morsel - protected org.duracloud.storage.provider.StorageProvider getStorageProvider(String account, String storeId)
protected org.duracloud.storage.provider.StorageProvider getStorageProvider(StorageProviderCredentials creds)
creds - protected abstract void loadMorselQueueFromSource(Queue<T> morselQueue)
morselQueue - protected abstract RunStats createRunStats()
protected abstract void logGlobalncrementalStats(RunStats incrementalTotals)
incrementalTotals - protected abstract void logIncrementalStatsByAccount(String account, RunStats stats)
account - stats - protected abstract void logCumulativeSessionStats(Map<String,RunStats> runstats, RunStats cumulativeTotals)
runstats - cumulativeTotals - protected abstract String getLoopingProducerTypePrefix()
Copyright © 2013–2018 DuraSpace. All rights reserved.