Sample continuous (streaming) regular expression grep topology application.
This is a variant of the
Grep
application that demonstrates
filtering using Java functional programming.
This Java application builds a
simple topology that watches a directory for files, reads each file and
output lines that match a regular expression.
Thus as each file is added to the directory, the application will read
it and output matching lines.
The application implements the typical pattern of code that declares a
topology followed by submission of the topology to a Streams context
com.ibm.streamsx.topology.context.StreamsContext
.
This demonstrates Java functional programming using an anonymous class.
This may be executed from the samples/java/functional
directory as:
-
java -cp functionalsamples.jar:../../../com.ibm.streamsx.topology/lib/com.ibm.streamsx.topology.jar:$STREAMS_INSTALL/lib/com.ibm.streams.operator.samples.jar
simple.RegexGrep CONTEXT_TYPE $HOME/books ".*Queen.*England.*"
- Run directly from the command line.
CONTEXT_TYPE is one of:
DISTRIBUTED
- Run as an IBM Streams distributed
application.
STANDALONE
- Run as an IBM Streams standalone
application.
EMBEDDED
- Run embedded within this JVM.
BUNDLE
- Create an IBM Streams application bundle.
TOOLKIT
- Create an IBM Streams application toolkit.
-
An application execution within your IDE once you set the class path to include the correct jars.