Package org.duracloud.mill.ltp
Class LoopingTaskProducer<T extends Morsel>
java.lang.Object
org.duracloud.mill.ltp.LoopingTaskProducer<T>
- All Implemented Interfaces:
Runnable
This class is responsible for filling the duplication
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- Author:
- Daniel Bernstein Date: Nov 5, 2013
-
Constructor Summary
ConstructorsConstructorDescriptionLoopingTaskProducer(CredentialsRepo credentialsRepo, StorageProviderFactory storageProviderFactory, org.duracloud.common.queue.TaskQueue taskQueue, StateManager<T> state, int maxTaskQueueSize, Frequency frequency, LocalTime startTime, NotificationManager notificationManager, LoopingTaskProducerConfigurationManager config) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToReloadList(T morsel) protected RunStatscalculateStatTotals(RunStats currentTotals) protected abstract RunStatsprotected CredentialsRepoprotected Frequencyprotected abstract StringA short looping producer type identifier for use with state files.protected intprotected RunStatsprotected org.duracloud.storage.provider.StorageProvidergetStorageProvider(String account, String storeId) protected org.duracloud.storage.provider.StorageProviderprotected org.duracloud.common.queue.TaskQueueprotected abstract voidloadMorselQueueFromSource(Queue<T> morselQueue) protected abstract voidlogCumulativeSessionStats(Map<String, RunStats> runstats, RunStats cumulativeTotals) protected abstract voidlogGlobalncrementalStats(RunStats incrementalTotals) protected abstract voidlogIncrementalStatsByAccount(String account, RunStats stats) protected abstract voidvoidrun()protected voidprotected void
-
Constructor Details
-
LoopingTaskProducer
public LoopingTaskProducer(CredentialsRepo credentialsRepo, StorageProviderFactory storageProviderFactory, org.duracloud.common.queue.TaskQueue taskQueue, StateManager<T> state, int maxTaskQueueSize, Frequency frequency, LocalTime startTime, NotificationManager notificationManager, LoopingTaskProducerConfigurationManager config)
-
-
Method Details
-
getFrequency
-
getCredentialsRepo
-
getTaskQueue
protected org.duracloud.common.queue.TaskQueue getTaskQueue() -
getMaxTaskQueueSize
protected int getMaxTaskQueueSize() -
run
public void run() -
calculateStatTotals
-
sendEmail
-
createQueue
- Returns:
-
addToReloadList
- Parameters:
morsel-
-
getStats
- Parameters:
account-- Returns:
-
getStorageProvider
-
getStorageProvider
protected org.duracloud.storage.provider.StorageProvider getStorageProvider(StorageProviderCredentials creds) - Parameters:
creds-- Returns:
-
loadMorselQueueFromSource
- Parameters:
morselQueue-
-
nibble
- Parameters:
queue-
-
createRunStats
- Returns:
-
logGlobalncrementalStats
- Parameters:
incrementalTotals-
-
logIncrementalStatsByAccount
- Parameters:
account-stats-
-
logCumulativeSessionStats
protected abstract void logCumulativeSessionStats(Map<String, RunStats> runstats, RunStats cumulativeTotals) - Parameters:
runstats-cumulativeTotals-
-
getLoopingProducerTypePrefix
A short looping producer type identifier for use with state files.- Returns:
-
sendEmail
- Parameters:
message-ex-
-