<?xml version="1.0" ?>
<operatorModel
  xmlns="http://www.ibm.com/xmlns/prod/streams/spl/operator" 
  xmlns:cmn="http://www.ibm.com/xmlns/prod/streams/spl/common" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.ibm.com/xmlns/prod/streams/spl/operator operatorModel.xsd">
  <cppOperatorModel>
    <context> 
      <description>Python Windowing Operation</description>
      <iconUri size="16">../opt/icons/aggregate_16.gif</iconUri>
      <iconUri size="32">f../opt/icons/aggregate_32.gif</iconUri>
      <metrics>
        <metric>
          <name>nCurrentPartitions</name>
          <description>The number of partitions in the window.</description>
          <kind>Gauge</kind>
        </metric>
      </metrics>
      <libraryDependencies>
        <library>
          <cmn:description>SPL Python includes</cmn:description>
          <cmn:managedLibrary>
            <cmn:includePath>../../opt/python/include</cmn:includePath>
          </cmn:managedLibrary>
        </library>
        <library>
          <cmn:description>Python libraries</cmn:description>
          <cmn:managedLibrary>
            <cmn:command>../pyversion.sh</cmn:command>
          </cmn:managedLibrary>
        </library>
      </libraryDependencies>
      <providesSingleThreadedContext>Always</providesSingleThreadedContext>
    </context>  
    <parameters>
      <allowAny>false</allowAny>
      <parameter>
        <name>toolkitDir</name>
        <description>Toolkit the operator was invoked from.</description>
        <optional>false</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>AttributeFree</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>pyModule</name>
        <description>Function or callable class's module</description>
        <optional>false</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>AttributeFree</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>pyName</name>
        <description>Function or callable class's name</description>
        <optional>false</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>AttributeFree</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>pyCallable</name>
        <description>Serialized instance of a callable class</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>AttributeFree</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>submissionParamNames</name>
        <description>Submission parameter names</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>rstring</type>
      </parameter>
      <parameter>
        <name>submissionParamValues</name>
        <description>Submission parameter values</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>AttributeFree</expressionMode>
        <type>rstring</type>
      </parameter>
      <parameter>
        <name>outputConnections</name>
        <description>Number of output connections.</description>
        <optional>true</optional>
        <rewriteAllowed>false</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>int32</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>pyStyle</name>
        <description>Style stream tuples are passed into Python.</description>
        <optional>true</optional>
        <rewriteAllowed>false</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>pyStateful</name>
        <description>Whether the operator has state to be saved in checkpointing.</description>
        <optional>false</optional>
        <rewriteAllowed>false</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>boolean</type>
        <cardinality>1</cardinality>
      </parameter>
      <parameter>
        <name>pyPartitionBy</name>
        <description>The attribute used for partitioning.  If the window is partitioned, either this or pyPartitionByName must be specified.</description>
        <optional>true</optional>
	<!-- we need to inspect this value at code gen time -->
        <rewriteAllowed>false</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
        <portScope><port>0</port></portScope>
      </parameter>
      <parameter>
        <name>pyPartitionByName</name>
        <description>The name of the python callable used for partitioning.  If the window is partitioned, either this or pyPartitionByName must be specified.</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
        <portScope><port>0</port></portScope>
      </parameter>
      <parameter>
        <name>pyPartitionByModule</name>
        <description>The module of the python callable used for partitioning.  If partitionByName is specified, this must also be specified.</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
        <portScope><port>0</port></portScope>
      </parameter>
      <parameter>
        <name>pyPartitionByCallable</name>
        <description>The the python callable used for partitioning.  If both pyPartitionByName and pyPartitionByCallable are specified, pyPartitionByCallable is used.</description>
        <optional>true</optional>
        <rewriteAllowed>true</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>rstring</type>
        <cardinality>1</cardinality>
        <portScope><port>0</port></portScope>
      </parameter>
      <parameter>
        <name>pyPartitionIsStateful</name>
        <description>Whether the partition function has state to be saved in checkpointing.</description>
        <optional>true</optional>
        <rewriteAllowed>false</rewriteAllowed>
        <expressionMode>Constant</expressionMode>
        <type>boolean</type>
        <cardinality>1</cardinality>
      </parameter>
    </parameters>
    <inputPorts>
      <inputPortSet>
        <tupleMutationAllowed>false</tupleMutationAllowed>
        <windowingMode>Windowed</windowingMode>
        <windowPunctuationInputMode>WindowBound</windowPunctuationInputMode>
        <windowExpressionMode>AttributeFree</windowExpressionMode>
        <cardinality>1</cardinality>
        <optional>false</optional>
      </inputPortSet>      
    </inputPorts>
    <outputPorts>
      <outputPortSet>
        <expressionMode>Nonexistent</expressionMode> 
        <autoAssignment>false</autoAssignment>
        <completeAssignment>false</completeAssignment>
        <rewriteAllowed>false</rewriteAllowed>
        <windowPunctuationOutputMode>Generating</windowPunctuationOutputMode>
        <tupleMutationAllowed>false</tupleMutationAllowed>
        <cardinality>1</cardinality>
        <optional>false</optional>
      </outputPortSet>          
    </outputPorts>
  </cppOperatorModel>
</operatorModel>
