public class DeMUXStreamBaseClient extends StreamBaseClient
Modifier and Type | Class and Description |
---|---|
static interface |
DeMUXStreamBaseClient.DequeueListener
Implement this interface to get calls back with data when using a DeMUXStreamBaseClient
|
StreamBaseClient.ListEntityFlags, StreamBaseClient.SerializedTupleBuffer, StreamBaseClient.TupleBuffer
Modifier and Type | Field and Description |
---|---|
protected static long |
DEQUEUE_WAIT |
Constructor and Description |
---|
DeMUXStreamBaseClient(java.util.List<StreamBaseURI> uris,
ClientSettings settings) |
DeMUXStreamBaseClient(StreamBaseURI streamBaseURI) |
DeMUXStreamBaseClient(java.lang.String uri) |
Modifier and Type | Method and Description |
---|---|
boolean |
canDequeue()
Return true if we can call dequeue without blocking.
|
DequeueResult |
dequeue()
Dequeue a batch of tuples from a subscribed stream.
|
DequeueResult |
dequeue(long timeoutMS)
Dequeue a batch of tuples from a subscribed stream.
|
int |
getDequeueBufferSize()
Return the number of tuples that are in the dequeue buffer.
|
protected static java.lang.String |
getFullLogicalName(StreamProperties streamProperties) |
ClientSettings |
getSettings()
Return the settings for this client
|
java.lang.String |
getUniqueSuffix()
This manages a threadsafe counter which will give a different value each time it is called.
|
StreamBaseURI |
getURI()
Return the URI used by this Client.
|
java.util.List<StreamBaseURI> |
getURIs()
get all of the URI's for this client
|
protected boolean |
haModeOn()
is HA mode on
|
boolean |
isSubscribed(StreamProperties stream)
Return status if we are subscribed to the given stream
|
java.lang.String[] |
operatorStatus(java.lang.String containerName)
Return the status of all the operators in the specified container
|
StreamProperties |
resubscribe(StreamProperties props,
java.lang.String logicalstream,
java.lang.String predicate)
Resubscribe to a stream with a predicate.
|
StreamProperties |
resubscribe(java.lang.String streamname,
java.lang.String logicalstream,
java.lang.String predicate)
Resubscribe to a stream with a predicate.
|
DequeueResultsQueue |
setDequeueQueue(DequeueResultsQueue dequeuer)
Set the queue that is used to dequeue tuples from remote servers.
|
DequeueResult.Interceptor |
setDequeueResultInterceptor(DequeueResult.Interceptor dri)
Set the dequeue results interceptor for this client connection.
|
java.lang.String[] |
status()
Return the status of the StreamBase Server
|
java.lang.String[] |
status(boolean verbose)
Return the status of the StreamBase Server
|
StreamProperties |
subscribe(StreamProperties props)
Subscribe to a stream
|
StreamProperties |
subscribe(StreamProperties props,
java.lang.String logicalstream,
java.lang.String predicate)
Subscribe to a stream with a predicate.
|
StreamProperties |
subscribe(java.lang.String streamname)
Subscribe to a stream
|
StreamProperties |
subscribe(java.lang.String streamName,
CaptureTransformStrategy strategy)
Subscribe to a stream
|
StreamProperties |
subscribe(java.lang.String streamName,
CaptureTransformStrategy strategy,
java.lang.String logicalstream,
java.lang.String predicate)
Subscribe to a stream with a predicate.
|
StreamProperties |
subscribe(java.lang.String streamname,
java.lang.String logicalstream,
java.lang.String predicate)
Subscribe to a stream with a predicate.
|
StreamProperties |
subscribe(java.lang.String streamname,
java.lang.String logicalstream,
java.lang.String predicate,
DeMUXStreamBaseClient.DequeueListener listener)
This is the only subscribe operation that is supported by the DeMUXStreamBaseClient
|
void |
unsubscribe(StreamProperties logicalProps)
Unsubscribe from the given stream name.
|
void |
unsubscribe(java.lang.String logicalStreamName)
Unsubscribe from the given stream name.
|
addConnectionStatusCallback, assureNameStartsWithContainer, checkValidStreamname, close, close, describe, enableBuffering, enableBuffering, enqueue, enqueue, enqueue, enqueue, flushAllBuffers, flushBuffer, flushBuffer, getAllStreamProperties, getAllStreamProperties, getConnectionError, getConnectionID, getConnectionStatus, getDequeueResultsInterceptor, getDynamicVariable, getDynamicVariables, getEnqueueBufferSize, getSchemaByHash, getSchemaByName, getSchemaForStream, getStreamProperties, getStreamProperties, getStreamPropertiesByHash, getStreamPropertiesByHash, getSubscribedStreamNames, getTupleDequeueCount, getTupleEnqueueCount, getVersion, hasSchema, hasStream, hasStreamProperties, isClosed, listEntities, listEntities, listEntities, listEntities, listEntities, listEntities, readTable, readTable, removeConnectionStatusCallback, setConnectionStatus, setDynamicVariable, setQuiescentLimit, typecheck, typecheck, unsubscribeInternal
protected static final long DEQUEUE_WAIT
public DeMUXStreamBaseClient(java.util.List<StreamBaseURI> uris, ClientSettings settings) throws URIException, StreamBaseException
StreamBaseException
URIException
public DeMUXStreamBaseClient(java.lang.String uri) throws URIException, StreamBaseException
URIException
StreamBaseException
public DeMUXStreamBaseClient(StreamBaseURI streamBaseURI) throws URIException, StreamBaseException
URIException
StreamBaseException
public StreamProperties subscribe(java.lang.String streamname, java.lang.String logicalstream, java.lang.String predicate, DeMUXStreamBaseClient.DequeueListener listener) throws StreamBaseException
streamname
- Qualified or partial streamname. If partial, will be relative to the connection base (usually default.)logicalstream
- Logical name for this stream. If you specify a predicate, this is required and must be different from streamname
Also, only one listener per logicalStream name is allowed for a given DeMUXStreamBaseClientpredicate
- Your querylistener
- Implement this interface to be called when your data arrives (and other events)StreamBaseException
protected static java.lang.String getFullLogicalName(StreamProperties streamProperties)
public java.lang.String getUniqueSuffix()
public boolean canDequeue()
StreamBaseClient
canDequeue
in class StreamBaseClient
public DequeueResult dequeue() throws StreamBaseException
StreamBaseClient
dequeue
in class StreamBaseClient
StreamBaseException
- thrown on network or other errorspublic DequeueResult dequeue(long timeoutMS) throws StreamBaseException
StreamBaseClient
dequeue
in class StreamBaseClient
StreamBaseException
- thrown on network or other errorspublic DequeueResultsQueue setDequeueQueue(DequeueResultsQueue dequeuer)
StreamBaseClient
setDequeueQueue
in class StreamBaseClient
dequeuer
- new DequeueResultsQueue
public DequeueResult.Interceptor setDequeueResultInterceptor(DequeueResult.Interceptor dri)
StreamBaseClient
setDequeueResultInterceptor
in class StreamBaseClient
public StreamProperties subscribe(java.lang.String streamname) throws StreamBaseException
StreamBaseClient
subscribe
in class StreamBaseClient
streamname
- the stream to subscribe toStreamBaseException
- thrown on errorpublic StreamProperties subscribe(java.lang.String streamName, CaptureTransformStrategy strategy) throws StreamBaseException
StreamBaseClient
subscribe
in class StreamBaseClient
streamName
- the name of a stream, that may be fully qualified (for example, mycontainer.MyInputSchema
).
When unqualified, the container from the URI the connection was established with is used, otherwise
StreamBaseURI.DEFAULT_CONTAINER
is used.StreamBaseException
- thrown on errorpublic StreamProperties subscribe(StreamProperties props) throws StreamBaseException
StreamBaseClient
subscribe
in class StreamBaseClient
props
- the stream to subscribe toStreamBaseException
- thrown on errorpublic StreamProperties subscribe(java.lang.String streamname, java.lang.String logicalstream, java.lang.String predicate) throws StreamBaseException
StreamBaseClient
subscribe
in class StreamBaseClient
streamname
- the stream to subscribe tologicalstream
- the name of the logical stream to associate with this predicate (if empty or null, defaults to streamname)predicate
- a predicate to apply to subset the streamStreamBaseException
- thrown on error, including empty or null streamname or predicatepublic StreamProperties subscribe(java.lang.String streamName, CaptureTransformStrategy strategy, java.lang.String logicalstream, java.lang.String predicate) throws StreamBaseException
StreamBaseClient
subscribe
in class StreamBaseClient
streamName
- the name of a stream, that may be fully qualified (for example, mycontainer.MyInputSchema
).
When unqualified, the container from the URI the connection was established with is used, otherwise
StreamBaseURI.DEFAULT_CONTAINER
is used.strategy
- the CaptureTransformStrategy to use if there are capture fields in the streamlogicalstream
- the name of the logical stream to associate with this predicate (if empty or null, defaults to streamname)predicate
- a predicate to apply to subset the streamStreamBaseException
- thrown on error, including empty or null streamname or predicatepublic StreamProperties subscribe(StreamProperties props, java.lang.String logicalstream, java.lang.String predicate) throws StreamBaseException
StreamBaseClient
subscribe
in class StreamBaseClient
props
- the stream to subscribe tologicalstream
- the name of the logical stream to associate with this predicate (if empty or null, defaults to streamname)predicate
- a predicate to apply to subset the streamStreamBaseException
- thrown on error, including empty or null streamname or predicatepublic StreamProperties resubscribe(java.lang.String streamname, java.lang.String logicalstream, java.lang.String predicate) throws StreamBaseException
StreamBaseClient
resubscribe
in class StreamBaseClient
streamname
- the stream to subscribe tologicalstream
- the name of the logical stream to associate with this predicatepredicate
- a predicate to apply to subset the streamStreamBaseException
- thrown on errorpublic StreamProperties resubscribe(StreamProperties props, java.lang.String logicalstream, java.lang.String predicate) throws StreamBaseException
StreamBaseClient
resubscribe
in class StreamBaseClient
props
- the stream to subscribe tologicalstream
- the name of the logical stream to associate with this predicatepredicate
- a predicate to apply to subset the streamStreamBaseException
- thrown on errorpublic void unsubscribe(java.lang.String logicalStreamName) throws StreamBaseException
StreamBaseClient
unsubscribe
in class StreamBaseClient
logicalStreamName
- the name of the stream to unsubscribe from, which is logical streamname on filtered subscribeStreamBaseException
- thrown on network or other errorspublic void unsubscribe(StreamProperties logicalProps) throws StreamBaseException
StreamBaseClient
unsubscribe
in class StreamBaseClient
logicalProps
- the StreamProperties for this logical subscriptionStreamBaseException
- thrown on network or other errorspublic boolean isSubscribed(StreamProperties stream)
StreamBaseClient
isSubscribed
in class StreamBaseClient
stream
- the stream we want to checkpublic int getDequeueBufferSize()
StreamBaseClient
getDequeueBufferSize
in class StreamBaseClient
protected boolean haModeOn()
public ClientSettings getSettings()
public java.lang.String[] status() throws StreamBaseException
StreamBaseException
- thrown on network and other errorspublic java.lang.String[] status(boolean verbose) throws StreamBaseException
verbose
- return a verbose statusStreamBaseException
- thrown on network and other errorspublic java.lang.String[] operatorStatus(java.lang.String containerName) throws StreamBaseException
containerName
- the name of the containerStreamBaseException
public StreamBaseURI getURI()
public java.util.List<StreamBaseURI> getURIs()