Skip to content

Commit

Permalink
sample for Modify added
Browse files Browse the repository at this point in the history
  • Loading branch information
markheger committed Aug 20, 2020
1 parent 0d2eebe commit 87fcb25
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
16 changes: 16 additions & 0 deletions samples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed Materials - Property of IBM
# ObjectStorage Toolkit for IBM Streams
# (c) Copyright IBM Corp. 2020
# All rights reserved.
.PHONY: all clean

all:
for dir in $(shell ls -d -1 */); do\
make -C $$dir || exit 1; \
done

clean:
for dir in $(shell ls -d -1 */); do\
make -C $$dir clean || exit 1; \
done

25 changes: 25 additions & 0 deletions samples/Modify/Main.spl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

public composite Main {

graph

// Let’s generate some data.
stream<int64 iter> Data = Beacon() {
param
period: 0.2; // new tuple every second
iterations: 10;
output Data:
iter = (int64)IterationCount();
}

stream<I> Incr = com.ibm.streamsx.transform::Modify(Data as I) {
output Incr: iter=I.iter+100l;
}

() as sink = Custom(Incr as I) {
logic onTuple I: {
println((rstring)I);
}
}

}
17 changes: 17 additions & 0 deletions samples/Modify/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: all clean

SPLC_FLAGS = -a -t ../../com.ibm.streamsx.transform
SPLC = $(STREAMS_INSTALL)/bin/sc

SPL_CMD_ARGS ?=
SPL_MAIN_COMPOSITE = Main

all: distributed

distributed:
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)

clean:
$(SPLC) $(SPLC_FLAGS) -C -M $(SPL_MAIN_COMPOSITE)
rm -rf output

15 changes: 15 additions & 0 deletions samples/Modify/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<info:toolkitInfoModel xmlns:common="http://www.ibm.com/xmlns/prod/streams/spl/common" xmlns:info="http://www.ibm.com/xmlns/prod/streams/spl/toolkitInfo">
<info:identity>
<info:name>ModifySample</info:name>
<info:description>Sample application showing Modify operator</info:description>
<info:version>1.0.0</info:version>
<info:requiredProductVersion>4.3.0</info:requiredProductVersion>
</info:identity>
<info:dependencies>
<info:toolkit>
<common:name>com.ibm.streamsx.transform</common:name>
<common:version>[1.0.0,2.0.0)</common:version>
</info:toolkit>
</info:dependencies>
</info:toolkitInfoModel>

0 comments on commit 87fcb25

Please sign in to comment.