Skip to content

Commit

Permalink
Merge pull request #51 from chanskw/master
Browse files Browse the repository at this point in the history
Support for Streams 3.2.2 Beta
  • Loading branch information
chanskw committed Oct 24, 2014
2 parents 62b27d7 + 4404a1b commit b0ed0fd
Show file tree
Hide file tree
Showing 53 changed files with 739 additions and 448 deletions.
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
<arg value="${tktitle}" />
<arg value="--directory" />
<arg value="${tkdir}" />
<arg value="--copy-image-files" />
</exec>
</target>

Expand Down
2 changes: 1 addition & 1 deletion com.ibm.streamsx.messaging/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<classpathentry kind="lib" path="opt/downloaded/snappy-java-1.0.5.jar"/>
<classpathentry kind="lib" path="opt/downloaded/zkclient-0.3.jar"/>
<classpathentry kind="lib" path="opt/downloaded/zookeeper-3.3.4.jar"/>
<classpathentry kind="lib" path="opt/downloaded/mqtt-client-0.4.1-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="opt/downloaded/activemq-client-5.11-SNAPSHOT.jar"/>
<classpathentry kind="lib" path="opt/downloaded/geronimo-j2ee-management_1.1_spec-1.0.1.jar"/>
<classpathentry kind="lib" path="opt/downloaded/geronimo-jms_1.1_spec-1.1.1.jar"/>
<classpathentry kind="lib" path="opt/downloaded/slf4j-api-1.7.5.jar"/>
<classpathentry kind="con" path="com.ibm.streams.java/com.ibm.streams.operator"/>
<classpathentry kind="lib" path="opt/downloaded/org.eclipse.paho.client.mqttv3-1.0.1-SNAPSHOT.jar"/>
<classpathentry kind="output" path="impl/java/bin"/>
</classpath>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The following example shows the use of multiple `JMSSource` operators with diffe

composite Main {
graph
// JMSSource operator with the default ../etc/connections.xml(relative to the data directory)
// JMSSource operator with the default etc/connections.xml(relative to the application directory)
// connections document
stream &lt;int32 id, rstring fname, rstring lname&gt;
MyPersonNamesStream = JMSSource()
Expand Down Expand Up @@ -220,7 +220,7 @@ This mandatory parameter identifies the name of the connection specification tha
<parameter>
<name>connectionDocument</name>
<description>
This optional parameter specifies the path name of the file that contains the connection and access specifications, which are identified by the **connection** and **access** parameters. If this parameter is not specified, the operator uses the file that is in the default location `../etc/connections.xml`.</description>
This optional parameter specifies the path name of the file that contains the connection and access specifications, which are identified by the **connection** and **access** parameters. If this parameter is not specified, the operator uses the file that is in the default location `./etc/connections.xml`.</description>
<optional>true</optional>
<type>rstring</type>
<cardinality>1</cardinality>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sub connectionSetup {
my $connDocName;
my $connDocParam = $model->getParameterByName('connectionDocument');
if (defined $connDocParam) {
my $quotedConnDoc = $connDocParam->getValueAt(0)->getSPLExpression();
my $quotedConnDoc = SPL::CodeGen::compileTimeExpression($model, $connDocParam->getValueAt(0));
@splitted = split(/"/, $quotedConnDoc);
if (@splitted != 2) {
SPL::CodeGen::exitln("Value of parameter \'connectionDocument\' has unexpected format: $quotedConnDoc");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" ?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C)2014, International Business Machines Corporation and
others. All Rights Reserved.
Expand Down Expand Up @@ -51,7 +51,7 @@ The following example demonstrates the use of multiple `XMSSink` operators with

composite Main{
graph
stream &lt;int32 id, rstring fname, rstring lname&gt;
stream &lt;int32 id, rstring fname, rstring lname>
MyPersonNamesStream=Beacon()
{
param
Expand All @@ -62,37 +62,37 @@ The following example demonstrates the use of multiple `XMSSink` operators with
() as MySink1=XMSSink(MyPersonNamesStream)
{
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
}

//XMSSink Operator with the fully qualified
//name of connections.xml
() as MySink2=XMSSink(MyPersonNamesStream)
{
param
connectionDocument:"/home/streamsuser/connections/XMSconnections.xml";
connection: "wbe";
access: "OutTrading";
connectionDocument:&quot;/home/streamsuser/connections/XMSconnections.xml&quot;;
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
}

//XMSSink Operator with optional
//output error port specified
stream &lt;tuple&lt;int32 id, rstring fname,
rstring lname&gt;inTuple, rstring errorMessage&gt;
rstring lname>inTuple, rstring errorMessage>
MySink3 = XMSSink(MyPersonNamesStream)
{
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
}
//XMSSink Operator with reconnectionPolicy
//specified as NoRetry
() as MySink4 = XMSSink( MyPersonNamesStream )
{
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
reconnectionPolicy: NoRetry;
}

Expand All @@ -101,8 +101,8 @@ The following example demonstrates the use of multiple `XMSSink` operators with
() as MySink5 = XMSSink( MyPersonNamesStream )
{
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
reconnectionPolicy: InfiniteRetry;
period: 1.20;
}
Expand All @@ -111,8 +111,8 @@ The following example demonstrates the use of multiple `XMSSink` operators with
() as MySink6 = XMSSink( MyPersonNamesStream )
{
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
reconnectionPolicy: BoundedRetry;
reconnectionBound: 2u;
period: 1.20;
Expand All @@ -121,31 +121,31 @@ The following example demonstrates the use of multiple `XMSSink` operators with

The following is a sample `connections.xml` file:

&lt;st:connections xmlns:st="http://www.ibm.com/xmlns/prod/streams/adapters"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;connection_specifications&gt;
&lt;connection_specification name="wbe"&gt;
&lt;XMS initial_context="file:///opt/InitialContext/"
connection_factory="TestConFac" /&gt;
&lt;/connection_specification&gt;
&lt;/connection_specifications&gt;
&lt;st:connections xmlns:st=&quot;http://www.ibm.com/xmlns/prod/streams/adapters&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;>
&lt;connection_specifications>
&lt;connection_specification name=&quot;wbe&quot;>
&lt;XMS initial_context=&quot;file:///opt/InitialContext/&quot;
connection_factory=&quot;TestConFac&quot; />
&lt;/connection_specification>
&lt;/connection_specifications>

&lt;access_specifications&gt;
&lt;access_specification name="OutTrading"&gt;
&lt;destination identifier="TestDestination"
delivery_mode="persistent" message_class="map" /&gt;
&lt;uses_connection connection="wbe"/&gt;
&lt;native_schema&gt;
&lt;attribute name="id" type="Int"/&gt;
&lt;attribute name="fname" type="String"/&gt;
&lt;attribute name="lname" type="String"/&gt;
&lt;/native_schema&gt;
&lt;/access_specification&gt;
&lt;/access_specifications&gt;
&lt;/st:connections&gt;
&lt;access_specifications>
&lt;access_specification name=&quot;OutTrading&quot;>
&lt;destination identifier=&quot;TestDestination&quot;
delivery_mode=&quot;persistent&quot; message_class=&quot;map&quot; />
&lt;uses_connection connection=&quot;wbe&quot;/>
&lt;native_schema>
&lt;attribute name=&quot;id&quot; type=&quot;Int&quot;/>
&lt;attribute name=&quot;fname&quot; type=&quot;String&quot;/>
&lt;attribute name=&quot;lname&quot; type=&quot;String&quot;/>
&lt;/native_schema>
&lt;/access_specification>
&lt;/access_specifications>
&lt;/st:connections>
</description>
<iconUri size="16">XMSSink_16.gif</iconUri>
<iconUri size="32">XMSSink_32.gif</iconUri>
<iconUri size="16">XMSSink_16.gif</iconUri>
<iconUri size="32">XMSSink_32.gif</iconUri>
<metrics>
<metric>
<name>nTruncatedInserts</name>
Expand Down Expand Up @@ -213,6 +213,7 @@ The following is a sample `connections.xml` file:
}</template>
</codeTemplate>
</codeTemplates>
<splExpressionTree param="true"/>
</context>
<parameters>
<allowAny>false</allowAny>
Expand Down Expand Up @@ -270,7 +271,7 @@ This mandatory parameter identifies the access specification name.</description>
<parameter>
<name>connectionDocument</name>
<description>
This optional parameter specifies the path name of the file that contains the connection and access specifications, which are identified by the **connection** and **access** parameters. If the parameter is specified, it must have exactly one value that is a string constant. If the parameter is not specified, the operator uses the file that is in the default location `../etc/connections.xml`.
This optional parameter specifies the path name of the file that contains the connection and access specifications, which are identified by the **connection** and **access** parameters. If the parameter is specified, it must have exactly one value that is a string constant. If the parameter is not specified, the operator uses the file that is in the default location `../etc/connections.xml`. If a relative path is specified, the path is relative to the root of the applicaiton directory.
</description>
<optional>true</optional>
<rewriteAllowed>false</rewriteAllowed>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" ?>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C)2014, International Business Machines Corporation and
others. All Rights Reserved.
Expand Down Expand Up @@ -60,60 +60,60 @@ The following example demonstrates the use of multiple `XMSSource` operators wit
graph
//XMSSource Operator with connections.xml
//defaulted to ./etc/connections.xml
stream &lt;int32 id, rstring fname, rstring lname&gt;
stream &lt;int32 id, rstring fname, rstring lname>
MyPersonNamesStream = XMSSource(){
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
}

//XMSSource operator with fully
//qualified name of connections.xml
stream &lt;int32 id, rstring fname, rstring lname&gt;
stream &lt;int32 id, rstring fname, rstring lname>
MyPersonNamesStream = XMSSource(){
param
connectionDocument:"/home/streamsuser/connections/XMSconnections.xml";
connection: "wbe";
access: "OutTrading";
connectionDocument:&quot;/home/streamsuser/connections/XMSconnections.xml&quot;;
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
}

//XMSSource Operator with the optional
//error output port specified
(stream &lt;int32 id, rstring fname, rstring lname&gt;;
stream &lt;rstring errorMessage&gt; ErrorStream) = XMSSource(){
(stream &lt;int32 id, rstring fname, rstring lname>;
stream &lt;rstring errorMessage> ErrorStream) = XMSSource(){
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
}

//XMSSource operator with the optional
//initDelay and reconnectionPolicy specified
stream &lt;int32 id, rstring fname, rstring lname&gt;
stream &lt;int32 id, rstring fname, rstring lname>
MyPersonNamesStream = XMSSource(){
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
reconnectionPolicy: NoRetry;
initDelay: 10.0;
}

//XMSSource operator with the optional period
//and reconnectionPolicy specified
stream &lt;int32 id, rstring fname, rstring lname&gt;
stream &lt;int32 id, rstring fname, rstring lname>
MyPersonNamesStream = XMSSource(){
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
reconnectionPolicy: InfiniteRetry;
period: 1.20;
}
// XMSSource operator with the reconnectionPolicy
//specified as BoundedRetry
stream &lt;int32 id, rstring fname, rstring lname&gt;
stream &lt;int32 id, rstring fname, rstring lname>
MyPersonNamesStream = XMSSource(){
param
connection: "wbe";
access: "OutTrading";
connection: &quot;wbe&quot;;
access: &quot;OutTrading&quot;;
reconnectionPolicy: BoundedRetry;
reconnectionBound: 2u;
period: 1.20;
Expand All @@ -122,7 +122,7 @@ The following example demonstrates the use of multiple `XMSSource` operators wit

This example uses the same `connections.xml` that is provided in the example for the `XMSSink` operator.
</description>
<iconUri size="16">XMSSource_16.gif</iconUri>
<iconUri size="16">XMSSource_16.gif</iconUri>
<iconUri size="32">XMSSource_32.gif</iconUri>
<metrics>
<metric>
Expand All @@ -140,9 +140,9 @@ This example uses the same `connections.xml` that is provided in the example for
<description>The number of connection attempts that are made before a successful connection.</description>
<kind>Counter</kind>
</metric>
</metrics>
</metrics>
<customLiterals>
<enumeration>
<enumeration>
<name>ReconnectionPolicy</name>
<value>InfiniteRetry</value>
<value>NoRetry</value>
Expand Down Expand Up @@ -184,15 +184,17 @@ This example uses the same `connections.xml` that is provided in the example for
<codeTemplates>
<codeTemplate name="XMSSource">
<description>Basic XMSSource template</description>
<template>stream&lt;${streamType}&gt; ${streamName} = XMSSource() {
<template>stream&lt;${streamType}> ${streamName} = XMSSource() {
param
connection : &quot;${ConnectionSpecificationName}&quot;;
access : &quot;${AccessSpecificationName}&quot;;
}</template>
</codeTemplate>
</codeTemplates>
<splExpressionTree param="true"/>
</context>
<parameters>
<description/>
<allowAny>false</allowAny>
<parameter>
<name>reconnectionPolicy</name>
Expand Down Expand Up @@ -237,7 +239,7 @@ This optional parameter specifies the number of seconds that the `XMSSource` ope
</parameter>
<parameter>
<name>connection</name>
<description>
<description>
This mandatory parameter identifies the name of the connection specification that contains an XMS element.</description>
<optional>false</optional>
<rewriteAllowed>false</rewriteAllowed>
Expand All @@ -258,7 +260,7 @@ This mandatory parameter identifies the access specification name.</description>
<parameter>
<name>connectionDocument</name>
<description>
This optional parameter specifies the path name of the file that contains the connection and access specifications, which are identified by the **connection** and **access** parameters. If the parameter is specified, it must have exactly one value that is a string constant. If the parameter is not specified, the operator uses the file that is in the default location `../etc/connections.xml`.</description>
This optional parameter specifies the path name of the file that contains the connection and access specifications, which are identified by the **connection** and **access** parameters. If the parameter is specified, it must have exactly one value that is a string constant. If the parameter is not specified, the operator uses the file that is in the default location `../etc/connections.xml`. If a relative path is specified, the path is relative to the root of the application directory.</description>
<optional>true</optional>
<rewriteAllowed>false</rewriteAllowed>
<expressionMode>AttributeFree</expressionMode>
Expand All @@ -280,7 +282,7 @@ If only the mandatory output port is specified, the operator submits a tuple for
<windowPunctuationOutputMode>Free</windowPunctuationOutputMode>
<windowPunctuationInputPort>-1</windowPunctuationInputPort>
<tupleMutationAllowed>true</tupleMutationAllowed>
<cardinality>1</cardinality>
<cardinality>1</cardinality>
<optional>false</optional>
</outputPortSet>
<outputPortSet>
Expand All @@ -302,4 +304,4 @@ The optional output port is mutating and its punctuation mode is Free. Only one
</outputPortSet>
</outputPorts>
</cppOperatorModel>
</operatorModel>
</operatorModel>
Loading

0 comments on commit b0ed0fd

Please sign in to comment.