API Changes in StreamBase 5.1

StreamBase releases 5.1.0 and 5.1.1 include the following additions and changes to the StreamBase APIs.

High Availability Changes

The Java, C++, and .NET APIs underwent changes to support release 5.1's remodeling of StreamBase's High Availability (HA) support.

  • StreamBase URI syntax: URIs can no longer refer to attributes of a secondary server. Every URI now refers to exactly one server. Methods related to secondary server information have been removed from the API.

  • It is possible to construct a StreamBaseClient object from a collection of URIs, currently limited to a maximum size of two. This can be accomplished in two ways:

    1. The new StreamBaseClient constructor takes a collection of StreamBaseURI objects.

    2. You can pass a comma-separated list of URIs to the StreamBaseClient constructor that takes a string.

  • When enqueuing to a multiserver StreamBaseClient, tuples are sent to all the servers. When dequeuing from a multiserver StreamBaseClient, tuples from all servers are returned.

  • The concept of a dequeue result interceptor was introduced, as discussed below.

  • The concept of leadership status was introduced, as discussed below.

  • the checkpoint() and loadCheckpoint() methods were removed from the StreamBaseAdminClient class.

Back to Top ^

Dequeue Result Interceptors

A dequeue result interceptor is an object that can be associated with a StreamBaseClient object. An interceptor is given the opportunity to modify or eliminate tuples before they are returned by the dequeue() method. Dequeue interceptors written in Java and that want to modify the set of tuples need to construct an object of the SimpleDequeueResult class. C++ dequeue interceptors can construct a DequeueResult directly. In Java, DequeueResult is abstract and thus cannot be constructed.

The DequeueResult class has been extended with the following methods:

  • getServerURI()

  • getLeadershipStatus()

  • getThrowable()

The first two of these methods can be used by dequeue result interceptors and callers of dequeue() to aid in determining which tuples from which servers should be used. getThrowable() is used by interceptors only, to handle certain exceptional conditions.

Leadership Status

Each server has a leadership status of either leader or non-leader. Leadership status can be queried using the getLeadershipStatus() method, and is set with the setLeadershipStatus() method in the StreamBaseAdminClient class. A Server’s initial status is leader unless otherwise specified in the configuration file (the .sbconf file) associated with that Server instance.

Java API Changes

The following changes were made to the Java API:

  • The mask(), setMaskStringDisplay(), and getMaskDisplay() methods were added to the SBPropertyDescriptor class to support properties whose contents should not be displayed in StreamBase Studio, such as passwords. The masked value is still stored as clear text.

  • The getContainer() and getFullyQualifiedName() methods were added to the Operator class. getContainerName() returns the name of the container that the current operator is in. getFullyQualifiedName() returns the full name of this operator, including container, interleaving modules, and the operator name.

  • New overloads of the modify() and addContainer() methods in the StreamBaseAdminClient class were added to support sbars.

  • The restartOperators(), resumeOperators(), shutdownOperators(), and suspendOperators() methods on StreamBaseAdminClient now take a List<String> argument rather than a Vector<String> argument.

Back to Top ^

Other API Changes

The following changes apply to the Java, C++, and .NET APIs:

  • The suspend() and resume() methods in the StreamBaseAdminClient class can now be applied only to particular containers, not to a Server as a whole.

  • The saveContainer() method was added to the StreamBaseAdminClient class to allow the application running in a container to be obtained in the form of data that can be saved in an sbar file.

Back to Top ^