public class LocalStreamBuilder extends Object implements StreamBuilder
LocalStreamBuilder
implementation to run a data processing stream in a single
JVM across many threads. Depending on your data stream, the JVM heap may need to be set to a high value. Default
implementation uses unbound ConcurrentLinkedQueue
to connect stream components.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_STARTED_AT_KEY |
static String |
DEFAULT_STREAM_IDENTIFIER |
Constructor and Description |
---|
LocalStreamBuilder()
Creates a local stream builder with all configuration resolved by typesafe
|
LocalStreamBuilder(LocalRuntimeConfiguration localRuntimeConfiguration) |
LocalStreamBuilder(LocalRuntimeConfiguration localRuntimeConfiguration,
MonitoringConfiguration monitoringConfiguration) |
LocalStreamBuilder(MonitoringConfiguration monitoringConfiguration) |
Modifier and Type | Method and Description |
---|---|
StreamBuilder |
addStreamsPersistWriter(String id,
StreamsPersistWriter writer,
int numTasks,
String... inBoundIds) |
StreamBuilder |
addStreamsProcessor(String id,
StreamsProcessor processor,
int numTasks,
String... inBoundIds) |
protected void |
forceShutdown(Map<String,List<StreamsTask>> streamsTasks) |
org.apache.streams.config.StreamsConfiguration |
getStreamsConfiguration() |
protected int |
getTimeout() |
StreamBuilder |
newPerpetualStream(String id,
StreamsProvider provider) |
StreamBuilder |
newReadCurrentStream(String id,
StreamsProvider provider) |
StreamBuilder |
newReadNewStream(String id,
StreamsProvider provider,
BigInteger sequence) |
StreamBuilder |
newReadRangeStream(String id,
StreamsProvider provider,
org.joda.time.DateTime start,
org.joda.time.DateTime end) |
void |
prepare() |
StreamBuilder |
setStreamsConfiguration(org.apache.streams.config.StreamsConfiguration configuration) |
protected void |
setupComponentTasks(Map<String,List<StreamsTask>> streamsTasks) |
protected void |
setupProviderTasks(Map<String,StreamsProviderTask> provTasks) |
void |
setUseDeprecatedMonitors(boolean useDeprecatedMonitors) |
protected void |
shutdown(Map<String,List<StreamsTask>> streamsTasks) |
void |
start()
Runs the data stream in the this JVM and blocks till completion.
|
void |
stop()
NOT IMPLEMENTED.
|
protected void |
stopInternal(boolean systemExiting) |
public static final String DEFAULT_STREAM_IDENTIFIER
public static final String DEFAULT_STARTED_AT_KEY
public LocalStreamBuilder()
public LocalStreamBuilder(LocalRuntimeConfiguration localRuntimeConfiguration)
public LocalStreamBuilder(MonitoringConfiguration monitoringConfiguration)
public LocalStreamBuilder(LocalRuntimeConfiguration localRuntimeConfiguration, MonitoringConfiguration monitoringConfiguration)
public void prepare()
public void setUseDeprecatedMonitors(boolean useDeprecatedMonitors)
public StreamBuilder newPerpetualStream(String id, StreamsProvider provider)
newPerpetualStream
in interface StreamBuilder
public StreamBuilder newReadCurrentStream(String id, StreamsProvider provider)
newReadCurrentStream
in interface StreamBuilder
public StreamBuilder newReadNewStream(String id, StreamsProvider provider, BigInteger sequence)
newReadNewStream
in interface StreamBuilder
public StreamBuilder newReadRangeStream(String id, StreamsProvider provider, org.joda.time.DateTime start, org.joda.time.DateTime end)
newReadRangeStream
in interface StreamBuilder
public StreamBuilder setStreamsConfiguration(org.apache.streams.config.StreamsConfiguration configuration)
setStreamsConfiguration
in interface StreamBuilder
public org.apache.streams.config.StreamsConfiguration getStreamsConfiguration()
getStreamsConfiguration
in interface StreamBuilder
public StreamBuilder addStreamsProcessor(String id, StreamsProcessor processor, int numTasks, String... inBoundIds)
addStreamsProcessor
in interface StreamBuilder
public StreamBuilder addStreamsPersistWriter(String id, StreamsPersistWriter writer, int numTasks, String... inBoundIds)
addStreamsPersistWriter
in interface StreamBuilder
public void start()
start
in interface StreamBuilder
protected void forceShutdown(Map<String,List<StreamsTask>> streamsTasks)
protected void shutdown(Map<String,List<StreamsTask>> streamsTasks) throws InterruptedException
InterruptedException
protected void setupProviderTasks(Map<String,StreamsProviderTask> provTasks)
protected void setupComponentTasks(Map<String,List<StreamsTask>> streamsTasks)
public void stop()
stop
in interface StreamBuilder
protected void stopInternal(boolean systemExiting)
protected int getTimeout()
Copyright © 2018 The Apache Software Foundation. All rights reserved.