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 |
BROADCAST_INTERVAL_KEY |
static String |
BROADCAST_KEY |
static String |
DEFAULT_STARTED_AT_KEY |
static String |
DEFAULT_STREAM_IDENTIFIER |
static String |
STREAM_IDENTIFIER_KEY |
static String |
TIMEOUT_KEY |
| Constructor and Description |
|---|
LocalStreamBuilder()
Creates a local stream builder with all configuration resolved by typesafe
|
LocalStreamBuilder(int maxQueueCapacity)
Deprecated.
use LocalRuntimeConfiguration constructor instead
|
LocalStreamBuilder(int maxQueueCapacity,
Map<String,Object> streamConfig)
Deprecated.
use LocalRuntimeConfiguration constructor instead
|
LocalStreamBuilder(LocalRuntimeConfiguration streamConfig) |
LocalStreamBuilder(Map<String,Object> streamConfig)
Deprecated.
use LocalRuntimeConfiguration constructor instead
|
| 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 TIMEOUT_KEY
public static final String BROADCAST_KEY
public static final String STREAM_IDENTIFIER_KEY
public static final String BROADCAST_INTERVAL_KEY
public static final String DEFAULT_STREAM_IDENTIFIER
public static final String DEFAULT_STARTED_AT_KEY
public LocalStreamBuilder()
@Deprecated public LocalStreamBuilder(Map<String,Object> streamConfig)
streamConfig - @Deprecated public LocalStreamBuilder(int maxQueueCapacity)
maxQueueCapacity - @Deprecated public LocalStreamBuilder(int maxQueueCapacity, Map<String,Object> streamConfig)
maxQueueCapacity - streamConfig - public LocalStreamBuilder(LocalRuntimeConfiguration streamConfig)
public void prepare()
public void setUseDeprecatedMonitors(boolean useDeprecatedMonitors)
public StreamBuilder newPerpetualStream(String id, StreamsProvider provider)
newPerpetualStream in interface StreamBuilderpublic StreamBuilder newReadCurrentStream(String id, StreamsProvider provider)
newReadCurrentStream in interface StreamBuilderpublic StreamBuilder newReadNewStream(String id, StreamsProvider provider, BigInteger sequence)
newReadNewStream in interface StreamBuilderpublic StreamBuilder newReadRangeStream(String id, StreamsProvider provider, org.joda.time.DateTime start, org.joda.time.DateTime end)
newReadRangeStream in interface StreamBuilderpublic StreamBuilder setStreamsConfiguration(org.apache.streams.config.StreamsConfiguration configuration)
setStreamsConfiguration in interface StreamBuilderpublic org.apache.streams.config.StreamsConfiguration getStreamsConfiguration()
getStreamsConfiguration in interface StreamBuilderpublic StreamBuilder addStreamsProcessor(String id, StreamsProcessor processor, int numTasks, String... inBoundIds)
addStreamsProcessor in interface StreamBuilderpublic StreamBuilder addStreamsPersistWriter(String id, StreamsPersistWriter writer, int numTasks, String... inBoundIds)
addStreamsPersistWriter in interface StreamBuilderpublic void start()
start in interface StreamBuilderprotected void forceShutdown(Map<String,List<StreamsTask>> streamsTasks)
protected void shutdown(Map<String,List<StreamsTask>> streamsTasks) throws InterruptedException
InterruptedExceptionprotected void setupProviderTasks(Map<String,StreamsProviderTask> provTasks)
protected void setupComponentTasks(Map<String,List<StreamsTask>> streamsTasks)
public void stop()
stop in interface StreamBuilderprotected void stopInternal(boolean systemExiting)
protected int getTimeout()
Copyright © 2012–2016 The Apache Software Foundation. All rights reserved.