How to set Multiplicity for parallel operation in the StreamBase TERR operator

How to set Multiplicity for parallel operation in the StreamBase TERR operator

book

Article ID: KB0083279

calendar_today

Updated On:

Products Versions
TIBCO Streaming -

Description

Simply enabling concurrency with a multiplicity greater than one results in errors like:
2017-03-17 10:19:29.175-0400 [RingBufferThread - default.Terr:3] INFO   - TERR: could not get a terr instance!
2017-03-17 10:19:29.175-0400 [Main module default] WARN  com.streambase.sb.runtime.RuntimeEnv - Error at operator: default.Terr:3.Terr, port: 0, tuple:..., exception: Adapter Exception: TERR: Could not find a TERR instance to use.

Issue/Introduction

How to make the TERR operator concurrent with multiple parallel threads.

Resolution

If you see the above error, a tuple was dropped and no TERR output was produced.

To make the TERR operator concurrent you need to make several configuration changes:

1. Set multiple instances in the sbd.sbconf, as so:
<section name="terr-instance">
  <setting name="In1" val="I1"/>
  <setting name="In2" val="I2"/>
  <setting name="In3" val="I3"/>
...

2. Set operator property "TERR Instance to use" to reference them, for example: I1,I2,I3,I4,I5,I6,I7,I8

3. Enable TERR operator Concurrency and set Multiplicity to the number of TERR engines either started or referenced (whichever is smaller).

4. Set TERR operator Concurrency, "Dispatch styles" to "Round Robin" to each tuple only goes to one engine (default is Broadcast).

When starting the console log will report multiple TERR instances starting, as so:
started engine node pid==14148 at Fri Mar 17 10:56:55 2017
2017-03-17 10:56:55.622-0400 [Thread-7] INFO   - TERR: Using Developer Edition of TERR (4.2.0), not for production use.
started engine node pid==8608 at Fri Mar 17 10:56:56 2017
2017-03-17 10:56:56.184-0400 [Thread-7] INFO   - TERR: Using Developer Edition of TERR (4.2.0), not for production use.
...

The round-robin distribution will allow a single TERR operator to use multiple instances of TERR efficiently.