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 |
(package private) Map<String,DeMUXStreamBaseClient.DequeueListener> |
listenerMap |
| 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) |
String |
getUniqueSuffix()
This manages a threadsafe counter which will give a different value each time it is called.
|
boolean |
isSubscribed(StreamProperties stream)
Return status if we are subscribed to the given stream
|
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.
|
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, connectionIDObject, describe, enableBuffering, enableBuffering, enqueue, enqueue, enqueue, enqueue, flushAllBuffers, flushBuffer, flushBuffer, getAllStreamProperties, getAllStreamProperties, getConnectionError, getConnectionID, getConnectionStatus, getDequeuer, getDequeueResultsInterceptor, getDynamicVariable, getDynamicVariables, getEnqueueBufferSize, getSchemaByHash, getSchemaByName, getSchemaForStream, getStreamProperties, getStreamProperties, getStreamPropertiesByHash, getStreamPropertiesByHash, getSubscribedStreamNames, getSubscribedStreams, getTupleDequeueCount, getTupleEnqueueCount, getVersion, hasSchema, hasStream, hasStreamProperties, incrementTuplesDequeued, incrementTuplesEnqueued, isClosed, listEntities, listEntities, listEntities, listEntities, listEntities, listEntities, readTable, readTable, removeConnectionStatusCallback, setConnectionID, setConnectionStatus, setDynamicVariable, setQuiescentLimit, typecheck, typecheck, unsubscribeInternalgetSettings, getURI, getURIs, haModeOn, operatorStatus, status, statusMap<String,DeMUXStreamBaseClient.DequeueListener> listenerMap
protected static final long DEQUEUE_WAIT
public DeMUXStreamBaseClient(List<StreamBaseURI> uris, ClientSettings settings) throws URIException, StreamBaseException
StreamBaseExceptionURIExceptionpublic DeMUXStreamBaseClient(String uri) throws URIException, StreamBaseException
URIExceptionStreamBaseExceptionpublic DeMUXStreamBaseClient(StreamBaseURI streamBaseURI) throws URIException, StreamBaseException
URIExceptionStreamBaseExceptionpublic 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)StreamBaseExceptionprotected static String getFullLogicalName(StreamProperties streamProperties)
public String getUniqueSuffix()
public boolean canDequeue()
StreamBaseClientcanDequeue in class StreamBaseClientpublic DequeueResult dequeue() throws StreamBaseException
StreamBaseClientdequeue in class StreamBaseClientStreamBaseException - thrown on network or other errorspublic DequeueResult dequeue(long timeoutMS) throws StreamBaseException
StreamBaseClientdequeue in class StreamBaseClienttimeoutMS - timeout in millisecondsStreamBaseException - thrown on network or other errorspublic DequeueResultsQueue setDequeueQueue(DequeueResultsQueue dequeuer)
StreamBaseClientsetDequeueQueue in class StreamBaseClientdequeuer - new DequeueResultsQueuepublic DequeueResult.Interceptor setDequeueResultInterceptor(DequeueResult.Interceptor dri)
StreamBaseClientsetDequeueResultInterceptor in class StreamBaseClientdri - dequeue results interceptor for this client connectionpublic StreamProperties subscribe(String streamname) throws StreamBaseException
StreamBaseClientsubscribe in class StreamBaseClientstreamname - the stream to subscribe toStreamBaseException - thrown on errorpublic StreamProperties subscribe(String streamName, CaptureTransformStrategy strategy) throws StreamBaseException
StreamBaseClientsubscribe in class StreamBaseClientstreamName - 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 capture transform strategyStreamBaseException - thrown on errorpublic StreamProperties subscribe(StreamProperties props) throws StreamBaseException
StreamBaseClientsubscribe in class StreamBaseClientprops - the stream to subscribe toStreamBaseException - thrown on errorpublic StreamProperties subscribe(String streamname, String logicalstream, String predicate) throws StreamBaseException
StreamBaseClientsubscribe in class StreamBaseClientstreamname - 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
StreamBaseClientsubscribe in class StreamBaseClientstreamName - 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
StreamBaseClientsubscribe in class StreamBaseClientprops - 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
StreamBaseClientresubscribe in class StreamBaseClientstreamname - 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
StreamBaseClientresubscribe in class StreamBaseClientprops - 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
StreamBaseClientunsubscribe in class StreamBaseClientlogicalStreamName - 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
StreamBaseClientunsubscribe in class StreamBaseClientlogicalProps - the StreamProperties for this logical subscriptionStreamBaseException - thrown on network or other errorspublic boolean isSubscribed(StreamProperties stream)
StreamBaseClientisSubscribed in class StreamBaseClientstream - the stream we want to checkpublic int getDequeueBufferSize()
StreamBaseClientgetDequeueBufferSize in class StreamBaseClientCopyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.