StreamBase releases 5.1.0 and 5.1.1 include the following additions and changes to the StreamBase APIs.
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
object from a collection of URIs, currently limited to a maximum size of two. This can be accomplished in two ways:StreamBaseClient-
The new
StreamBaseClientconstructor takes a collection ofStreamBaseURIobjects. -
You can pass a comma-separated list of URIs to the
StreamBaseClientconstructor 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()andloadCheckpoint()methods were removed from theStreamBaseAdminClientclass.
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.
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.
The following changes were made to the Java API:
-
The
mask(),setMaskStringDisplay(), andgetMaskDisplay()methods were added to theSBPropertyDescriptorclass 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()andgetFullyQualifiedName()methods were added to theOperatorclass.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()andaddContainer()methods in theStreamBaseAdminClientclass were added to supportsbars. -
The
restartOperators(),resumeOperators(),shutdownOperators(), andsuspendOperators()methods onStreamBaseAdminClientnow take aList<String>argument rather than aVector<String>argument.
The following changes apply to the Java, C++, and .NET APIs:
-
The
suspend()andresume()methods in theStreamBaseAdminClientclass can now be applied only to particular containers, not to a Server as a whole. -
The
saveContainer()method was added to theStreamBaseAdminClientclass to allow the application running in a container to be obtained in the form of data that can be saved in ansbarfile.
