Interface UpdateStream<T>

Type Parameters:
T - type of the value
All Known Subinterfaces:
RecoverableUpdateStream<T>

public interface UpdateStream<T>
An update stream provides a method for updating a specific topic.

An update stream is associated with a specific topic. Update streams are created using TopicUpdate.newUpdateStreamBuilder(). It can be created with an optional constraint. An optional TopicSpecification can be provided on creation. The type of the topic must match the type of values passed to the update stream. The existence of the topic, its type and the constraint are validated lazily by the first set(T) or validate() operation. Subsequent operations issued before the first operation completes will be deferred until the completion of the first operation.

An update stream can be used to send any number of updates. It sends a sequence of updates for a specific topic to the server. If supported by the data type, updates will be sent to the server as a stream of binary deltas by default. Optionally, deltas can be disabled when creating the stream. An update stream does not prevent other sessions from updating the topic. If exclusive access is required update streams should be used with session locks as constraints.

Once validated an update stream can be invalidated. An invalidated update stream rejects the operations applied to it. The update stream will be invalidated if:

  • the topic is removed
  • another update stream is created for the same topic
  • the topic is updated to a new value by anything other than the stream
  • the session does not have the UPDATE_TOPIC permission
  • an operation fails because of cluster repartitioning

Update streams are thread-safe.

Since:
6.2
Author:
DiffusionData Limited