public class StreamWorkManager extends WorkManagerImpl
| Modifier and Type | Class and Description | 
|---|---|
class  | 
StreamWorkManager.WorkScheduling  | 
WorkManagerImpl.WorkCompletionSynchronizer, WorkManagerImpl.WorkThreadPoolExecutorWorkManager.Scheduling| Modifier and Type | Field and Description | 
|---|---|
static int | 
DEFAULT_CONCURRENCY  | 
static String | 
DEFAULT_WORK_CODEC  | 
static String | 
DEFAULT_WORK_LOG_CONFIG  | 
static String | 
DEFAULT_WORK_OVER_PROVISIONING  | 
protected static org.apache.commons.logging.Log | 
log  | 
protected LogManager | 
logManager  | 
protected Settings | 
settings  | 
protected long | 
stateTTL  | 
static String | 
STATETTL_DEFAULT_VALUE  | 
static String | 
STATETTL_KEY  | 
protected boolean | 
storeState  | 
static String | 
STORESTATE_KEY  | 
protected StreamProcessor | 
streamProcessor  | 
protected Topology | 
topology  | 
static String | 
WORK_CODEC_PROP  | 
static String | 
WORK_LOG_CONFIG_PROP  | 
static String | 
WORK_OVER_PROVISIONING_PROP  | 
active, categoryToQueueId, completionSynchronizer, DEFAULT_CATEGORY, DEFAULT_QUEUE_ID, executors, IMPL_EP, NAME, QUEUES_EP, queuing, registry, SHUTDOWN_DELAY_MS_KEY, shutdownInProgress, started, THREAD_PREFIXlastModified, name| Constructor and Description | 
|---|
StreamWorkManager()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
activateQueueMetrics(String queueId)  | 
boolean | 
awaitCompletion(String queueId,
               long duration,
               TimeUnit unit)
Waits for completion of work in a given queue. 
 | 
protected boolean | 
awaitCompletionOnQueue(String queueId,
                      long duration,
                      TimeUnit unit)  | 
boolean | 
awaitCompletionWithWaterMark(String queueId,
                            long duration,
                            TimeUnit unit)
Deprecated. 
 
since 10.2 because unused 
 | 
protected void | 
deactivateQueueMetrics(String queueId)  | 
Work | 
find(String s,
    Work.State state)
Finds a work instance. 
 | 
int | 
getApplicationStartedOrder()
The component notification order for  
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext). | 
protected Codec<Record> | 
getCodec()  | 
protected String | 
getCodecName()  | 
protected String | 
getLogConfig()  | 
protected LogManager | 
getLogManager()  | 
protected long | 
getLowWaterMark(String queueId)  | 
WorkQueueMetrics | 
getMetrics(String queueId)
Gets the metrics for the  
queueId | 
protected WorkQueueMetrics | 
getMetricsWithNuxeoClassLoader(String queueId)  | 
protected int | 
getOverProvisioningFactor()  | 
protected int | 
getPartitions(int maxThreads)  | 
int | 
getQueueSize(String queueId,
            Work.State state)
Gets the number of work instances in a given queue in a defined state. 
 | 
Work.State | 
getWorkState(String workId)
Gets the state in which a work instance is. 
 | 
void | 
init()
Starts up this  
WorkManager and attempts to resume work previously suspended and saved at
 WorkManager.shutdown(long, java.util.concurrent.TimeUnit) time. | 
protected void | 
initTopology()  | 
boolean | 
isProcessingEnabled(String queueId)
Is processing enabled for a given queue id. 
 | 
List<Work> | 
listWork(String s,
        Work.State state)
Lists the work instances in a given queue in a defined state. 
 | 
List<String> | 
listWorkIds(String s,
           Work.State state)
Lists the work ids in a given queue in a defined state. 
 | 
void | 
schedule(Work work,
        WorkManager.Scheduling scheduling,
        boolean afterCommit)
Schedules work for execution at a later time, with a specific scheduling policy. 
 | 
protected boolean | 
scheduleAfterCommit(Work work,
                   WorkManager.Scheduling scheduling)
Schedule after commit. 
 | 
boolean | 
shutdown(long timeout,
        TimeUnit timeUnit)
Shuts down this  
WorkManager and attempts to suspend and save the running and scheduled work instances. | 
boolean | 
shutdownQueue(String queueId,
             long timeout,
             TimeUnit unit)
Shuts down a work queue and attempts to suspend and save the running and scheduled work instances. 
 | 
void | 
start(ComponentContext context)
Start the component. 
 | 
boolean | 
supportsProcessingDisabling()  | 
awaitCompletion, enableProcessing, enableProcessing, getCategoryQueueId, getExecutor, getTimestampAfter, getWorkQueueDescriptor, getWorkQueueIds, hasWorkInState, index, isProcessingEnabled, isQueuingEnabled, isStarted, noScheduledOrRunningWork, registerContribution, remainingMillis, removeExecutor, schedule, schedule, schedule, setName, shutdownExecutorsactivate, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, stop, unregister, unregisterContribution, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStartedprotected static final org.apache.commons.logging.Log log
public static final String WORK_LOG_CONFIG_PROP
public static final String DEFAULT_WORK_LOG_CONFIG
public static final String WORK_CODEC_PROP
public static final String DEFAULT_WORK_CODEC
public static final String WORK_OVER_PROVISIONING_PROP
public static final String DEFAULT_WORK_OVER_PROVISIONING
public static final int DEFAULT_CONCURRENCY
public static final String STATETTL_KEY
public static final String STORESTATE_KEY
public static final String STATETTL_DEFAULT_VALUE
protected StreamProcessor streamProcessor
protected LogManager logManager
protected boolean storeState
protected long stateTTL
public StreamWorkManager()
protected int getOverProvisioningFactor()
protected String getCodecName()
public void schedule(Work work, WorkManager.Scheduling scheduling, boolean afterCommit)
WorkManagerschedule in interface WorkManagerschedule in class WorkManagerImplwork - the work to executescheduling - the scheduling policyafterCommit - if true and the work is scheduled, it will only be run after the current transaction
            (if any) has committedWorkManager.schedule(Work)public int getApplicationStartedOrder()
ComponentComponent.applicationStarted(org.nuxeo.runtime.model.ComponentContext).
 Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
getApplicationStartedOrder in interface ComponentgetApplicationStartedOrder in class WorkManagerImplpublic void start(ComponentContext context)
Componentstart in interface Componentstart in class WorkManagerImplpublic void init()
WorkManagerWorkManager and attempts to resume work previously suspended and saved at
 WorkManager.shutdown(long, java.util.concurrent.TimeUnit) time.init in interface WorkManagerinit in class WorkManagerImplprotected LogManager getLogManager()
protected String getLogConfig()
public boolean isProcessingEnabled(String queueId)
WorkManagerisProcessingEnabled in interface WorkManagerisProcessingEnabled in class WorkManagerImplprotected void initTopology()
protected int getPartitions(int maxThreads)
protected void activateQueueMetrics(String queueId)
protected void deactivateQueueMetrics(String queueId)
public boolean shutdownQueue(String queueId, long timeout, TimeUnit unit)
WorkManagershutdownQueue in interface WorkManagershutdownQueue in class WorkManagerImplqueueId - the queue idtimeout - the time to waitunit - the timeout unittrue if shutdown is done, false if there are still some threads executing after the
         timeoutpublic boolean shutdown(long timeout, TimeUnit timeUnit)
WorkManagerWorkManager and attempts to suspend and save the running and scheduled work instances.shutdown in interface WorkManagershutdown in class WorkManagerImpltimeout - the time to waittimeUnit - the timeout unittrue if shutdown is done, false if there are still some threads executing after the
         timeoutpublic int getQueueSize(String queueId, Work.State state)
WorkManagergetQueueSize in interface WorkManagergetQueueSize in class WorkManagerImplqueueId - the queue idstate - the state defining the state to look into, SCHEDULED, RUNNING, COMPLETED, or null for non-completed (
            SCHEDULED or RUNNING)protected WorkQueueMetrics getMetricsWithNuxeoClassLoader(String queueId)
public WorkQueueMetrics getMetrics(String queueId)
WorkManagerqueueIdgetMetrics in interface WorkManagergetMetrics in class WorkManagerImplpublic boolean awaitCompletion(String queueId, long duration, TimeUnit unit) throws InterruptedException
WorkManagerawaitCompletion in interface WorkManagerawaitCompletion in class WorkManagerImplqueueId - the queue idduration - the time to waitunit - the timeout unittrue if all work completed in the queue, or false if there is still some non-completed
         work after the timeoutInterruptedExceptionprotected boolean awaitCompletionOnQueue(String queueId, long duration, TimeUnit unit) throws InterruptedException
InterruptedException@Deprecated public boolean awaitCompletionWithWaterMark(String queueId, long duration, TimeUnit unit) throws InterruptedException
InterruptedExceptionprotected long getLowWaterMark(String queueId)
public Work.State getWorkState(String workId)
WorkManagergetWorkState in interface WorkManagergetWorkState in class WorkManagerImplworkId - the id of the work to findnull if not foundpublic Work find(String s, Work.State state)
WorkManagerfind in interface WorkManagerfind in class WorkManagerImpls - the id of the work to findstate - the state defining the state to look into, SCHEDULED, RUNNING, or null for non-completednull if not foundpublic List<Work> listWork(String s, Work.State state)
WorkManagerlistWork in interface WorkManagerlistWork in class WorkManagerImpls - the queue idstate - the state defining the state to look into, SCHEDULED, RUNNING, or null for non-completedpublic List<String> listWorkIds(String s, Work.State state)
WorkManagerlistWorkIds in interface WorkManagerlistWorkIds in class WorkManagerImpls - the queue idstate - the state defining the state to look into, SCHEDULED, RUNNING, or null for non-completedprotected boolean scheduleAfterCommit(Work work, WorkManager.Scheduling scheduling)
WorkManagerImplfalse if impossible (no transaction or transaction manager).scheduleAfterCommit in class WorkManagerImplpublic boolean supportsProcessingDisabling()
supportsProcessingDisabling in interface WorkManagersupportsProcessingDisabling in class WorkManagerImplCopyright © 2019 Nuxeo. All rights reserved.