Package org.nuxeo.lib.stream.computation
Interface StreamProcessor
- 
- All Known Implementing Classes:
- LogStreamProcessor
 
 public interface StreamProcessor Run a topology of computations according to some settings.- Since:
- 9.3
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleandrainAndStop(Duration timeout)Stop computations when input streams are empty.LatencygetLatency(String computationName)Returns the latency for a computation.longgetLowWatermark()Returns the low watermark for all the computations of the topology.longgetLowWatermark(String computationName)Returns the low watermark for the computation.StreamProcessorinit(Topology topology, Settings settings)Initialize streams, but don't run the computationsbooleanisDone(long timestamp)Returns true if all messages with a lower timestamp has been processed by the topology.booleanisTerminated()True if there is no active processing threads.voidshutdown()Shutdown immediately.voidstart()Run the initialized computations.booleanstop(Duration timeout)Try to stop computations gracefully after processing a record or a timer within the timeout duration.StringtoJson(Map<String,String> meta)Returns a JSON representation of the processor, this includes the list of streams and computations with their settings along with the topology.booleanwaitForAssignments(Duration timeout)Wait for the computations to have assigned partitions ready to process records.
 
- 
- 
- 
Method Detail- 
initStreamProcessor init(Topology topology, Settings settings) Initialize streams, but don't run the computations
 - 
startvoid start() Run the initialized computations.
 - 
stopboolean stop(Duration timeout) Try to stop computations gracefully after processing a record or a timer within the timeout duration. If this can not be done within the timeout, shutdown and returns false.
 - 
drainAndStopboolean drainAndStop(Duration timeout) Stop computations when input streams are empty. The timeout is applied for each computation, the total duration can be up to nb computations * timeoutReturns trueif computations are stopped during the timeout delay.
 - 
shutdownvoid shutdown() Shutdown immediately.
 - 
getLowWatermarklong getLowWatermark(String computationName) Returns the low watermark for the computation. Any message with an offset below the low watermark has been processed by this computation and its ancestors. The returned watermark is local to this processing node, if the computation is distributed the global low watermark is the minimum of all nodes low watermark.
 - 
getLowWatermarklong getLowWatermark() Returns the low watermark for all the computations of the topology. Any message with an offset below the low watermark has been processed. The returned watermark is local to this processing node.
 - 
getLatencyLatency getLatency(String computationName) Returns the latency for a computation. This works also for distributed computations.- Since:
- 10.1
 
 - 
isDoneboolean isDone(long timestamp) Returns true if all messages with a lower timestamp has been processed by the topology.
 - 
waitForAssignmentsboolean waitForAssignments(Duration timeout) throws InterruptedException Wait for the computations to have assigned partitions ready to process records. The processor must be started. This is useful for writing unit test.Returns trueif all computations have assigned partitions during the timeout delay.- Throws:
- InterruptedException
 
 - 
isTerminatedboolean isTerminated() True if there is no active processing threads.- Since:
- 10.1
 
 
- 
 
-