Package org.voltdb.stream.api.pipeline
Interface VoltStreamBuilder
public interface VoltStreamBuilder
-
Method Summary
Modifier and TypeMethodDescription<T> VoltOpenStreamBuilder
<T> consumeFromSource
(VoltStreamSourceConfigurator<T> configurator) Each stream must have one source.<T> VoltOpenStreamBuilder
<T> consumeFromSource
(VoltStreamSource<T> source) Each stream must have one source.onError()
Defines exception handling behaviour of this stream.Sets a name for the stream which will help to identify the stream in other systems, such as metric collecting system, etc.
-
Method Details
-
withName
Sets a name for the stream which will help to identify the stream in other systems, such as metric collecting system, etc.- Parameters:
name
- of the stream- Returns:
- builder
-
consumeFromSource
Each stream must have one source. The source can be a simple generator or an integration with upstream system.- Type Parameters:
T
- type this source generates- Parameters:
source
- lambda to execute- Returns:
- opened data stream
-
consumeFromSource
Each stream must have one source. This is an extension point. Pass a custom configurator and bind it with the target implementation. SeeVoltEnvironment.register(Class, ConfigurableOperatorProducer)
andVoltStreamExtension.registerExtension(VoltEnvironment)
- Type Parameters:
T
- type this source generates- Parameters:
configurator
- lambda to execute- Returns:
- opened data stream
-
onError
ExceptionHandlerBuilder onError()Defines exception handling behaviour of this stream. An error, along with affected messages are sent to an exception handler and the handler can decide what to do with the problem. By default, framework defines logging exception handler, which can be overridden here. A handler can define additional sinks to route affected messages on stream failure. Mind that those additional sinks should be always available and should not fail, otherwise framework cannot guarantee data consistency and will crash to prevent no further data lose. SeeExceptionHandler.handle(List, ExecutionContext, Throwable)
andExceptionHandlerBuilder.addNamedSink(String, VoltStreamSink)
.- Returns:
- exception handler builder
-
getExecutionContext
ExecutionContext getExecutionContext()
-