Package org.nuxeo.runtime.stream
Class StreamServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.runtime.stream.StreamServiceImpl
- All Implemented Interfaces:
Adaptable,Component,Extensible,TimestampedService,StreamService
- Since:
- 9.3
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected Booleanprotected LogManagerstatic final Stringprotected StreamManagerprotected static final Stringprotected static final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWaits for the computation to have no lag, for internal use only.protected LogConfigprotected voidprotected LogConfigintThe component notification order forComponent.start(ComponentContext).protected Stringprotected SettingsgetSettings(StreamProcessorDescriptor descriptor) protected voidinitProcessor(StreamProcessorDescriptor descriptor) protected booleanbooleanrestartComputation(Name computation) Restart the computation thread pool.booleansetComputationPositionAfterDate(Name computation, Name stream, Instant after) Moving computation position after a date.booleansetComputationPositionToBeginning(Name computation, Name stream) Moving computation position to the beginning of stream.booleansetComputationPositionToEnd(Name computation, Name stream) Moving computation position to the end of stream.booleansetComputationPositionToOffset(Name computation, Name stream, int partition, long offset) Moving computation position to a specific offset for a partition.voidstart(ComponentContext context) Start the component.booleanstartProcessor(String processorName) Starts a registered Processor.protected voidvoidstop(ComponentContext context) Stop the component.booleanstopComputation(Name computation) Stop computation thread pool immediately.booleanstopProcessor(String processorName) Stop a running processor.voidMethods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.stream.StreamService
getLogManager, getStreamManager
-
Field Details
-
DEFAULT_CODEC
- See Also:
-
XP_LOG_CONFIG
- See Also:
-
XP_STREAM_PROCESSOR
- See Also:
-
logManager
-
streamManager
-
STREAM_PROCESSING_ENABLED
- Since:
- 11.2
- See Also:
-
isStreamProcessingDisabled
-
-
Constructor Details
-
StreamServiceImpl
public StreamServiceImpl()
-
-
Method Details
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:ComponentThe component notification order forComponent.start(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.
- Specified by:
getApplicationStartedOrderin interfaceComponent- Returns:
- the order, 1000 by default
-
getLogManager
- Specified by:
getLogManagerin interfaceStreamService
-
getStreamManager
- Specified by:
getStreamManagerin interfaceStreamService
-
createLogIfNotExists
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
getNodeId
-
getLogConfigs
-
createMemLogConfig
-
createKafkaLogConfig
-
initProcessor
-
getSettings
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent- Throws:
InterruptedException
-
startProcessors
protected void startProcessors() -
stopProcessors
public void stopProcessors()- Specified by:
stopProcessorsin interfaceStreamService
-
startProcessor
Description copied from interface:StreamServiceStarts a registered Processor. Returns true if the processor has been started.- Specified by:
startProcessorin interfaceStreamService
-
stopProcessor
Description copied from interface:StreamServiceStop a running processor. Returns true if the processor has been stopped.- Specified by:
stopProcessorin interfaceStreamService
-
stopComputation
Description copied from interface:StreamServiceStop computation thread pool immediately.- Specified by:
stopComputationin interfaceStreamService
-
restartComputation
Description copied from interface:StreamServiceRestart the computation thread pool.Do nothing if the computation thread pool is already started.
- Specified by:
restartComputationin interfaceStreamService
-
setComputationPositionToEnd
Description copied from interface:StreamServiceMoving computation position to the end of stream.The computation thread pool must be stopped using
StreamService.stopComputation(Name)before changing its position.- Specified by:
setComputationPositionToEndin interfaceStreamService
-
setComputationPositionToBeginning
Description copied from interface:StreamServiceMoving computation position to the beginning of stream.The computation thread pool must be stopped using
StreamService.stopComputation(Name)before changing its position.- Specified by:
setComputationPositionToBeginningin interfaceStreamService
-
setComputationPositionToOffset
public boolean setComputationPositionToOffset(Name computation, Name stream, int partition, long offset) Description copied from interface:StreamServiceMoving computation position to a specific offset for a partition.The computation thread pool must be stopped using
StreamService.stopComputation(Name)before changing its position.- Specified by:
setComputationPositionToOffsetin interfaceStreamService
-
setComputationPositionAfterDate
Description copied from interface:StreamServiceMoving computation position after a date.The computation thread pool must be stopped using
StreamService.stopComputation(Name)before changing its position.- Specified by:
setComputationPositionAfterDatein interfaceStreamService
-
await
Description copied from interface:StreamServiceWaits for the computation to have no lag, for internal use only.- Specified by:
awaitin interfaceStreamService- Returns:
trueif there's no lag between producer and consumer orfalseif timeout is exceeded- Throws:
InterruptedException
-
isProcessingDisabled
protected boolean isProcessingDisabled()
-