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(List<StreamBaseURI> uris,
ClientSettings settings) |
DeMUXStreamBaseClient(StreamBaseURI streamBaseURI) |
DeMUXStreamBaseClient(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 String |
getFullLogicalName(StreamProperties streamProperties) |
ClientSettings |
getSettings()
Return the settings for this client
|
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.
|
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
|
String[] |
operatorStatus(String containerName)
Return the status of all the operators in the specified container
|
StreamProperties |
resubscribe(StreamProperties props,
String logicalstream,
String predicate)
Resubscribe to a stream with a predicate.
|
StreamProperties |
resubscribe(String streamname,
String logicalstream,
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.
|
String[] |
status()
Return the status of the StreamBase Server
|
String[] |
status(boolean verbose)
Return the status of the StreamBase Server
|
StreamProperties |
subscribe(StreamProperties props)
Subscribe to a stream
|
StreamProperties |
subscribe(StreamProperties props,
String logicalstream,
String predicate)
Subscribe to a stream with a predicate.
|
StreamProperties |
subscribe(String streamname)
Subscribe to a stream
|
StreamProperties |
subscribe(String streamName,
CaptureTransformStrategy strategy)
Subscribe to a stream
|
StreamProperties |
subscribe(String streamName,
CaptureTransformStrategy strategy,
String logicalstream,
String predicate)
Subscribe to a stream with a predicate.
|
StreamProperties |
subscribe(String streamname,
String logicalstream,
String predicate)
Subscribe to a stream with a predicate.
|
StreamProperties |
subscribe(String streamname,
String logicalstream,
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(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(List<StreamBaseURI> uris, ClientSettings settings) throws URIException, StreamBaseException
StreamBaseException
URIException
public DeMUXStreamBaseClient(String uri) throws URIException, StreamBaseException
URIException
StreamBaseException
public DeMUXStreamBaseClient(StreamBaseURI streamBaseURI) throws URIException, StreamBaseException
URIException
StreamBaseException
public StreamProperties subscribe(String streamname, String logicalstream, 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 String getFullLogicalName(StreamProperties streamProperties)
public 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(String streamname) throws StreamBaseException
StreamBaseClient
subscribe
in class StreamBaseClient
streamname
- the stream to subscribe toStreamBaseException
- thrown on errorpublic StreamProperties subscribe(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(String streamname, String logicalstream, 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(String streamName, CaptureTransformStrategy strategy, String logicalstream, 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, String logicalstream, 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(String streamname, String logicalstream, 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, String logicalstream, 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(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 String[] status() throws StreamBaseException
StreamBaseException
- thrown on network and other errorspublic String[] status(boolean verbose) throws StreamBaseException
verbose
- return a verbose statusStreamBaseException
- thrown on network and other errorspublic String[] operatorStatus(String containerName) throws StreamBaseException
containerName
- the name of the containerStreamBaseException
public StreamBaseURI getURI()
public List<StreamBaseURI> getURIs()