public interface StreamBuilder extends Serializable
StreamBuilder builder = ... builder.newReadCurrentStream(. . .) .addStreamsProcessor(. . .) ... .addStreamsPersistWriter(. . .) builder.run();
Modifier and Type | Method and Description |
---|---|
StreamBuilder |
addStreamsPersistWriter(String persistWriterId,
StreamsPersistWriter writer,
int numTasks,
String... connectToIds)
Add a
StreamsPersistWriter to the data processing stream. |
StreamBuilder |
addStreamsProcessor(String processorId,
StreamsProcessor processor,
int numTasks,
String... connectToIds)
Add a
StreamsProcessor to the data processing stream. |
StreamsConfiguration |
getStreamsConfiguration() |
StreamBuilder |
newPerpetualStream(String streamId,
StreamsProvider provider)
Add a
StreamsProvider to the data processing stream. |
StreamBuilder |
newReadCurrentStream(String streamId,
StreamsProvider provider)
Add a
StreamsProvider to the data processing stream. |
StreamBuilder |
newReadNewStream(String streamId,
StreamsProvider provider,
BigInteger sequence)
Add a
StreamsProvider to the data processing stream. |
StreamBuilder |
newReadRangeStream(String streamId,
StreamsProvider provider,
org.joda.time.DateTime start,
org.joda.time.DateTime end)
Add a
StreamsProvider to the data processing stream. |
StreamBuilder |
setStreamsConfiguration(StreamsConfiguration configuration) |
void |
start()
Builds the stream, and starts it or submits it based on implementation.
|
void |
stop()
Stops the streams processing.
|
StreamBuilder setStreamsConfiguration(StreamsConfiguration configuration)
StreamsConfiguration getStreamsConfiguration()
StreamBuilder addStreamsProcessor(String processorId, StreamsProcessor processor, int numTasks, String... connectToIds)
StreamsProcessor
to the data processing stream.processorId
- unique id for this processor - must be unique across the entire streamprocessor
- the processor to executenumTasks
- the number of instances of this processor to run concurrentlyconnectToIds
- the ids of the StreamsOperation
that this process will
receive data from.StreamBuilder addStreamsPersistWriter(String persistWriterId, StreamsPersistWriter writer, int numTasks, String... connectToIds)
StreamsPersistWriter
to the data processing stream.persistWriterId
- unique id for this processor - must be unique across the entire streamwriter
- the writer to executenumTasks
- the number of instances of this writer to run concurrentlyconnectToIds
- the ids of the StreamsOperation
that this process will
receive data from.StreamBuilder newPerpetualStream(String streamId, StreamsProvider provider)
StreamsProvider
to the data processing stream. The provider will execute
org.apache.streams.core.StreamsProvider:readCurrent()
to produce data.streamId
- unique if for this provider - must be unique across the entire stream.provider
- provider to executeStreamBuilder newReadCurrentStream(String streamId, StreamsProvider provider)
StreamsProvider
to the data processing stream. The provider will execute
org.apache.streams.core.StreamsProvider:readCurrent()
to produce data.streamId
- unique if for this provider - must be unique across the entire stream.provider
- provider to executeStreamBuilder newReadNewStream(String streamId, StreamsProvider provider, BigInteger sequence)
StreamsProvider
to the data processing stream. The provider will execute
org.apache.streams.core.StreamsProvider:readNext(BigInteger)
to produce data.streamId
- unique if for this provider - must be unique across the entire stream.provider
- provider to executesequence
- sequence to pass to org.apache.streams.core.StreamsProvider:readNext(BigInteger)
methodStreamBuilder newReadRangeStream(String streamId, StreamsProvider provider, org.joda.time.DateTime start, org.joda.time.DateTime end)
StreamsProvider
to the data processing stream. The provider will execute
org.apache.streams.core.StreamsProvider:readRange(DateTime, DateTime)
to produce data. Whether the start
and end dates are inclusive or exclusive is up to the implementation.streamId
- unique if for this provider - must be unique across the entire stream.provider
- provider to executestart
- start dateend
- end datevoid start()
void stop()
Copyright © 2017 The Apache Software Foundation. All rights reserved.