public class StreamBaseClient extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
StreamBaseClient.ListEntityFlags
Flags used by the ListEntities call.
|
class |
StreamBaseClient.SerializedTupleBuffer
A TupleBuffer which contains a byte buffer of serialized tuples
including space for a network header
|
class |
StreamBaseClient.TupleBuffer
Class for abstracting away where tuples come from, Buffers, Collections, and Single Enqueues.
|
Constructor and Description |
---|
StreamBaseClient()
Create a StreamBaseClient.
|
StreamBaseClient(List<StreamBaseURI> uris)
Create a StreamBaseClient, connecting to the servers at the provided URIs.
|
StreamBaseClient(List<StreamBaseURI> uris,
ClientSettings settings)
Create a StreamBaseClient, connecting to the servers at the provided URIs.
|
StreamBaseClient(StreamBaseURI uri)
Create a StreamBaseClient, connecting to the server at the provided URI
|
StreamBaseClient(String uriStrings)
Create a StreamBaseClient from one or more comma-separated URI strings
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionStatusCallback(ConnectionStatusCallback callback)
Track changes to the connection state.
|
protected static String |
assureNameStartsWithContainer(StreamProperties base,
String logicalName) |
boolean |
canDequeue()
Return true if we can call dequeue without blocking.
|
protected static void |
checkValidStreamname(String streamname) |
void |
close()
close the client
|
void |
close(String msg)
Flush all buffers and close the connection to the StreamBase server.
|
DequeueResult |
dequeue()
Dequeue a batch of tuples from a subscribed stream.
|
DequeueResult |
dequeue(long timeoutMS)
Dequeue a batch of tuples from a subscribed stream.
|
String |
describe(String entityName)
Return an XML description of a StreamBase entity
|
void |
enableBuffering(int bufferSize)
Turn on buffering with a default WakeAndFlushBuffer thread set to 250ms
|
void |
enableBuffering(int bufferSize,
long flushIntervalMilliSeconds)
Turn on buffering.
|
void |
enqueue(StreamProperties props,
Collection<Tuple> tuples)
Enqueue a collection of Tuples onto a stream.
|
void |
enqueue(StreamProperties props,
Tuple tuple)
Enqueue a single Tuple onto a stream.
|
void |
enqueue(String stream,
Collection<Tuple> tuples)
Enqueue a collection of Tuples onto a stream.
|
void |
enqueue(String stream,
Tuple tuple)
Enqueue a single Tuple onto a stream.
|
void |
flushAllBuffers()
Flush any pending enqueue buffers.
|
void |
flushBuffer(StreamProperties props)
Deprecated.
use
StreamBaseClient.flushAllBuffers() to preserve inter-stream ordering |
void |
flushBuffer(String stream_name)
Deprecated.
use
StreamBaseClient.flushAllBuffers() to preserve inter-stream ordering |
Set<StreamProperties> |
getAllStreamProperties(EntityType type)
Return all the StreamProperties available.
|
Set<StreamProperties> |
getAllStreamProperties(EntityType type,
CaptureTransformStrategy strategy)
Return all the StreamProperties available
|
String |
getConnectionError()
If the StreamBaseClient disconnected due to an internal error, return a message corresponding
to the error, otherwise return null.
|
byte[] |
getConnectionID()
Return the Connection ID for this Client Connection.
|
ConnectionStatus |
getConnectionStatus()
Return the current connection status of this StreamBaseClient.
|
DequeueResult.Interceptor |
getDequeueResultsInterceptor()
Get the current dequeue results interceptor, or null if there is no
current processor.
|
Object |
getDynamicVariable(String dynamicVariablePath)
Get the given dynamic variable
|
Tuple |
getDynamicVariables(String modulePath)
Get a Tuple of all the dynamic variables on the given module
|
int |
getEnqueueBufferSize()
Return the number of tuples in the enqueue buffer
|
Schema |
getSchemaByHash(byte[] hash)
Return the Schema object for the given hash value
|
Schema |
getSchemaByName(String name)
Return the Schema object for the given name.
|
Schema |
getSchemaForStream(String streamName)
Return the schema of a stream.
|
ClientSettings |
getSettings()
Return the settings for this client
|
StreamProperties |
getStreamProperties(String streamName)
Return the StreamProperties for the given stream name
|
StreamProperties |
getStreamProperties(String streamName,
CaptureTransformStrategy strategy)
Return the StreamProperties for the given stream name
|
StreamProperties |
getStreamPropertiesByHash(byte[] hash)
Return the StreamProperties for the given hash
StreamProperties are cached locally in the client.
|
StreamProperties |
getStreamPropertiesByHash(String hashHexString)
Return the StreamProperties for the given hash
StreamProperties are cached locally in the client.
|
Set<String> |
getSubscribedStreamNames()
Returns a Set of names of the Streams this client is currently subscribed
to.
|
long |
getTupleDequeueCount()
Returns the number of tuples this client has dequeued from the server.
|
long |
getTupleEnqueueCount()
Returns the number of tuples this client has actually enqueued to the server.
|
StreamBaseURI |
getURI()
Return the URI used by this Client.
|
List<StreamBaseURI> |
getURIs()
get all of the URI's for this client
|
static String |
getVersion()
Get the version of this client, returned in the format specified by
Version.INFO_LINE |
protected boolean |
haModeOn()
is HA mode on
|
boolean |
hasSchema(String schemaName)
Returns whether or not a schema with the passed in schemaName is available;
you can get this Schema by calling getSchemaByName.
|
boolean |
hasStream(String streamName)
Returns whether or not the client has a stream with the
passed in name.
|
boolean |
hasStreamProperties(String streamName)
Returns whether or not a stream with the given name exists.
|
boolean |
isClosed()
Return true if the client connection is closed.
|
boolean |
isSubscribed(StreamProperties stream)
Return status if we are subscribed to the given stream
|
String[] |
listEntities(EntityType entityType)
Return an array of entity names for the given entity type.
|
String[] |
listEntities(EntityType entityType,
CaptureTransformStrategy strategy)
Return an array of entity names for the given entity type.
|
String[] |
listEntities(EntityType entityType,
int flags)
Return an array of entity names for the given entity type and flags.
|
String[] |
listEntities(EntityType entityType,
int flags,
CaptureTransformStrategy strategy)
Return an array of entity names for the given entity type and flags.
|
String[] |
listEntities(String entityPath,
int flags)
Return an array of entity names for the given entity path.
|
String[] |
listEntities(String entityPath,
int flags,
CaptureTransformStrategy strategy)
Return an array of entity names for the given entity path.
|
String[] |
operatorStatus(String containerName)
Return the status of all the operators in the specified container
|
List<Tuple> |
readTable(String tablePath,
int rowLimit)
Return rows from a Query Table or Materialized Window.
|
List<Tuple> |
readTable(String tablePath,
int rowLimit,
String predicate)
Return rows from a Query Table or Materialized Window, applying an optional predicate to decide which rows are returned.
|
void |
removeConnectionStatusCallback(ConnectionStatusCallback callback)
Stop tracking changes to the connection state.
|
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.
|
protected void |
setConnectionStatus(ConnectionStatus status,
String additionalInfo) |
DequeueResult.Interceptor |
setDequeueResultInterceptor(DequeueResult.Interceptor dri)
Set the dequeue results interceptor for this client connection.
|
void |
setDynamicVariable(String dynvarPath,
Object value)
Set the given dynamic variable to a new value
|
void |
setQuiescentLimit(long timeoutMS)
If more then timeoutMS milliseconds elapse without receiving data or a
heart beat from the server, the client will close.
|
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[] |
typecheck(String application)
Typecheck (validate) the given StreamBase Application.
|
StreamProperties[] |
typecheck(String application,
boolean full)
Typecheck (validate) the given StreamBase Application.
|
void |
unsubscribe(StreamProperties logicalProps)
Unsubscribe from the given stream name.
|
void |
unsubscribe(String logicalStreamName)
Unsubscribe from the given stream name.
|
protected void |
unsubscribeInternal(StreamProperties logicalProps) |
public StreamBaseClient(String uriStrings) throws StreamBaseException
uriStrings
- The URIs to use, in string form; e.g.,
"sb://localhost:10000" or "sb://host1:10000,sb://host2"StreamBaseException
- on connect errorURIException
- on malformed or invalid URIStreamBaseURI
public StreamBaseClient() throws StreamBaseException, URIException
streambase.uri
property, or the system environment variable STREAMBASE_SERVER
,
or StreamBaseURI.DEFAULT_URI
if neither is defined.StreamBaseException
- on connect errorURIException
- on malformed or invalid URIStreamBaseURI.fromEnvironment()
public StreamBaseClient(StreamBaseURI uri) throws StreamBaseException
uri
- The uri to connect toStreamBaseException
- on connect errorStreamBaseURI
public StreamBaseClient(List<StreamBaseURI> uris) throws StreamBaseException
uris
- a list of URIs to connect toStreamBaseException
- on connect errorStreamBaseURI
public StreamBaseClient(List<StreamBaseURI> uris, ClientSettings settings) throws StreamBaseException
uris
- a list of URIs to connect tosettings
- client settingsStreamBaseException
- on connect errorStreamBaseURI
public void close() throws StreamBaseException
close
in interface AutoCloseable
StreamBaseException
public void close(String msg) throws StreamBaseException
msg
- StreamBaseException
public boolean canDequeue()
public boolean isClosed()
public DequeueResult dequeue() throws StreamBaseException
StreamBaseException
- thrown on network or other errorspublic DequeueResult dequeue(long timeoutMS) throws StreamBaseException
StreamBaseException
- thrown on network or other errorspublic DequeueResult.Interceptor setDequeueResultInterceptor(DequeueResult.Interceptor dri)
public DequeueResult.Interceptor getDequeueResultsInterceptor()
public String describe(String entityName) throws StreamBaseException
entityName
- the name of the entity to describeStreamBaseException
- thrown on network or other errorspublic void enableBuffering(int bufferSize, long flushIntervalMilliSeconds) throws StreamBaseException
bufferSize
- specifies the number of tuples to buffer before enqueueing. If set to a non-positive value, this call has no effectflushIntervalMilliSeconds
- specifies the interval in milliseconds between wakeups of WakeAndFlushBufferStreamBaseException
- thrown on network or other errorspublic void enableBuffering(int bufferSize) throws StreamBaseException
bufferSize
- specifies the number of tuples to buffer before enqueueing. if a non-positive value is given, this call has no effectStreamBaseException
- thrown on network or other errorsStreamBaseClient.enableBuffering(int, long)
public void enqueue(String stream, Tuple tuple) throws StreamBaseException
Performance note: this method should be avoided where possible. Use
StreamBaseClient.enqueue(StreamProperties, Tuple)
instead.
stream
- the name of the stream on which to enqueue the provided tuple.tuple
- the Tuple to enqueueStreamBaseException
- thrown on network or other errorsStreamBaseClient.enqueue(StreamProperties, Tuple)
public void enqueue(StreamProperties props, Tuple tuple) throws StreamBaseException
props
- the StreamProperties for the stream to enqueue the tuple totuple
- the Tuple to enqueueStreamBaseException
- thrown on network or other errorspublic void enqueue(String stream, Collection<Tuple> tuples) throws StreamBaseException
Performance note: this method should be avoided where possible. Use
StreamBaseClient.enqueue(StreamProperties, Collection)
instead.
stream
- the name of the stream on which to enqueue the provided tuples.tuples
- a Collection of Tuples to enqueue. Note that the tuples will be
modified as part of enqueueStreamBaseException
- thrown on network or other errorsStreamBaseClient.enqueue(StreamProperties, Collection)
public void enqueue(StreamProperties props, Collection<Tuple> tuples) throws StreamBaseException
props
- the StreamProperties for the stream to enqueue the tuples totuples
- a Collection of Tuples to enqueue. Note that the tuples will be
modified as part of enqueueStreamBaseException
- thrown on network or other errorspublic void flushAllBuffers() throws StreamBaseException
StreamBaseException
- if there is an IO error while flushing the bufferpublic void flushBuffer(String stream_name) throws StreamBaseException
StreamBaseClient.flushAllBuffers()
to preserve inter-stream orderingNote: Note that this will cause inter-stream ordering to be interrupted.
stream_name
- the stream whose enqueue buffers to flush, if not emptyStreamBaseException
- if there is an IO error while flushing the bufferpublic void flushBuffer(StreamProperties props) throws StreamBaseException
StreamBaseClient.flushAllBuffers()
to preserve inter-stream orderingStreamProperties
provided.
This operation has no effect if buffering is not enabled or there is no buffer
to flush for the given stream.
Note: Note that this will cause inter-stream ordering to be interrupted.
props
- the stream whose enqueue buffers to flush, if not emptyStreamBaseException
- if there is an IO error while flushing the bufferpublic void setQuiescentLimit(long timeoutMS) throws StreamBaseException
timeoutMS
- - If no heart beat is received from the server in
timeoutMS milliseconds, the server is considered unavailable.
This only has effect if the server is configured to emit client heart beats.
This is not a real-time detection mechanism, so generous timeout limits
should be used. 0 disables quiescent server detection.StreamBaseException
- thrown if the request limit is not at least
two times the servers configured client heart beat rate.public Schema getSchemaByHash(byte[] hash) throws StreamBaseException
hash
- a byte array that contains a hash valueStreamBaseException
- thrown on network or other errorspublic boolean hasSchema(String schemaName)
schemaName
- the name of the Schema to look upStreamBaseClient.getSchemaByName(String)
public Schema getSchemaByName(String name) throws StreamBaseException
StreamBaseClient.getStreamProperties(String)
.name
- the name of the Schema to lookupStreamBaseException
- thrown on network or other errorspublic boolean hasStreamProperties(String streamName)
streamName
- the stream name to look forStreamBaseClient.getStreamProperties(String)
public StreamProperties getStreamProperties(String streamName, CaptureTransformStrategy strategy) throws StreamBaseException
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 network or other errorspublic StreamProperties getStreamProperties(String streamName) throws StreamBaseException
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 network or other errorsprotected static String assureNameStartsWithContainer(StreamProperties base, String logicalName)
public StreamProperties getStreamPropertiesByHash(String hashHexString) throws StreamBaseException
hashHexString
- The Hash as a HexStringStreamBaseException
- thrown on network or other errorspublic StreamProperties getStreamPropertiesByHash(byte[] hash) throws StreamBaseException
hash
- The Hash to lookupStreamBaseException
- thrown on network or other errorspublic Set<StreamProperties> getAllStreamProperties(EntityType type, CaptureTransformStrategy strategy) throws StreamBaseException
type
- Can be STREAM, INPUT_STREAMS, or OUTPUT_STREAMSstrategy
- the CaptureTransformStrategy to use. Can be FLATTEN or NESTStreamBaseException
- thrown on network or other errorspublic Set<StreamProperties> getAllStreamProperties(EntityType type) throws StreamBaseException
type
- Can be STREAM, INPUT_STREAMS, or OUTPUT_STREAMSStreamBaseException
- thrown on network or other errorspublic boolean hasStream(String streamName)
streamName
- StreamBaseClient.getSchemaForStream(String)
public Schema getSchemaForStream(String streamName) throws StreamBaseException
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
- if the stream is not found, or on network errorspublic static String getVersion()
Version.INFO_LINE
public String[] listEntities(EntityType entityType, CaptureTransformStrategy strategy) throws StreamBaseException
StreamBaseClient.listEntities(EntityType, int)
with StreamBaseClient.ListEntityFlags.NO_FLAGS
as the second argument. Note: if the container you are connected to
does not exist when issuing this request, and this call is made without the
StreamBaseClient.ListEntityFlags.ALL_CONTAINERS
flag, the request will fail.entityType
- the entity type that the looking is being done forstrategy
- the strategy to use for capture fieldsStreamBaseException
- thrown on network or other errorsStreamBaseClient.listEntities(String, int)
,
EntityType
,
StreamBaseClient.ListEntityFlags
public String[] listEntities(EntityType entityType) throws StreamBaseException
StreamBaseClient.listEntities(EntityType, int)
with StreamBaseClient.ListEntityFlags.NO_FLAGS
as the second argument. Note: if the container you are connected to
does not exist when issuing this request, and this call is made without the
StreamBaseClient.ListEntityFlags.ALL_CONTAINERS
flag, the request will fail.entityType
- the entity type that the looking is being done forStreamBaseException
- thrown on network or other errorsStreamBaseClient.listEntities(String, int)
,
EntityType
,
StreamBaseClient.ListEntityFlags
public String[] listEntities(EntityType entityType, int flags, CaptureTransformStrategy strategy) throws StreamBaseException
Examples are as follows:
// list streams on container specified in StreamBaseURI given to StreamBaseClient
client.listEntities(EntityType.STREAM, StreamBaseClient.ListEntityFlags.NO_FLAGS)
// list operators on ALL containers
client.listEntities(EntityType.OPERATOR, StreamBaseClient.ListEntityFlags.ALL_CONTAINERS)
Note: if the container you are connected to
does not exist when issuing this request, and this call is made without the
StreamBaseClient.ListEntityFlags.ALL_CONTAINERS
flag, the request will fail.
entityType
- the entity type that the looking is being done forflags
- a combination of flags from StreamBaseClient.ListEntityFlags
strategy
- the strategy to use for capture fieldsStreamBaseException
- thrown on network or other errorsEntityType
,
StreamBaseClient.ListEntityFlags
public String[] listEntities(EntityType entityType, int flags) throws StreamBaseException
Examples are as follows:
// list streams on container specified in StreamBaseURI given to StreamBaseClient
client.listEntities(EntityType.STREAM, StreamBaseClient.ListEntityFlags.NO_FLAGS)
// list operators on ALL containers
client.listEntities(EntityType.OPERATOR, StreamBaseClient.ListEntityFlags.ALL_CONTAINERS)
Note: if the container you are connected to
does not exist when issuing this request, and this call is made without the
StreamBaseClient.ListEntityFlags.ALL_CONTAINERS
flag, the request will fail.
entityType
- the entity type that the looking is being done forflags
- a combination of flags from StreamBaseClient.ListEntityFlags
StreamBaseException
- thrown on network or other errorsEntityType
,
StreamBaseClient.ListEntityFlags
public String[] listEntities(String entityPath, int flags, CaptureTransformStrategy strategy) throws StreamBaseException
EntityType
class
Examples are as follows:
// list streams on container specified in StreamBaseURI given to StreamBaseClient
client.listEntities("streams", StreamBaseClient.ListEntityFlags.NO_FLAGS)
// list streams on container "other"
client.listEntities("other.streams", StreamBaseClient.ListEntityFlags.NO_FLAGS)
// list streams on ALL containers
client.listEntities("streams", StreamBaseClient.ListEntityFlags.ALL_CONTAINERS)
Note: if the container you are connected to
does not exist when issuing this request, and this call is made without the
StreamBaseClient.ListEntityFlags.ALL_CONTAINERS
flag, the request will fail.
entityPath
- the entity type to do the lookup. Use
container.entity-type to resolve across containersflags
- a combination of flags from StreamBaseClient.ListEntityFlags
strategy
- the strategy to use for capture fieldsStreamBaseException
- thrown on network or other errorsEntityType
,
StreamBaseClient.ListEntityFlags
public String[] listEntities(String entityPath, int flags) throws StreamBaseException
EntityType
class
Examples are as follows:
// list streams on container specified in StreamBaseURI given to StreamBaseClient
client.listEntities("streams", StreamBaseClient.ListEntityFlags.NO_FLAGS)
// list streams on container "other"
client.listEntities("other.streams", StreamBaseClient.ListEntityFlags.NO_FLAGS)
// list streams on ALL containers
client.listEntities("streams", StreamBaseClient.ListEntityFlags.ALL_CONTAINERS)
Note: if the container you are connected to
does not exist when issuing this request, and this call is made without the
StreamBaseClient.ListEntityFlags.ALL_CONTAINERS
flag, the request will fail.
entityPath
- the entity type to do the lookup. Use
container.entity-type to resolve across containersflags
- a combination of flags from StreamBaseClient.ListEntityFlags
StreamBaseException
- thrown on network or other errorsEntityType
,
StreamBaseClient.ListEntityFlags
public StreamProperties subscribe(String streamname) throws StreamBaseException
streamname
- the stream to subscribe toStreamBaseException
- thrown on errorpublic StreamProperties subscribe(String streamName, CaptureTransformStrategy strategy) throws StreamBaseException
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
props
- the stream to subscribe toStreamBaseException
- thrown on errorpublic StreamProperties subscribe(String streamname, String logicalstream, String predicate) throws StreamBaseException
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
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
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
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
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 StreamProperties[] typecheck(String application) throws StreamBaseException
application
- contents of an application. Text sbapp or ssql.StreamBaseException
- on network or typecheck errorpublic StreamProperties[] typecheck(String application, boolean full) throws StreamBaseException
application
- contents of an application. Text sbapp or ssql.full
- do a full typecheckStreamBaseException
- on network or typecheck errorpublic void unsubscribe(String logicalStreamName) throws StreamBaseException
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
logicalProps
- the StreamProperties for this logical subscriptionStreamBaseException
- thrown on network or other errorsprotected void unsubscribeInternal(StreamProperties logicalProps) throws StreamBaseException
StreamBaseException
public byte[] getConnectionID()
public Set<String> getSubscribedStreamNames()
public boolean isSubscribed(StreamProperties stream)
stream
- the stream we want to checkprotected static void checkValidStreamname(String streamname) throws StreamBaseException
StreamBaseException
public Object getDynamicVariable(String dynamicVariablePath) throws StreamBaseException
dynamicVariablePath
- the path to the dynamic variable, expressed as the path to the module containing the dynamic variable,
and then a dot, and then the name of the dynamic variable.Tuple.getField(String)
StreamBaseException
- if the dynamic variable path does not exist or an error occurs while communicating with the serverpublic Tuple getDynamicVariables(String modulePath) throws StreamBaseException
modulePath
- the module to get the dynamic variables ofStreamBaseException
- if the module does not exist, or an error occurs while communicating with the serverpublic void setDynamicVariable(String dynvarPath, Object value) throws StreamBaseException
dynvarPath
- the path to the dynamic variable to set. This consists of the dotted path to the module that contains
the dynamic variable, followed by a dot, followed by the name of the dynamic variable.value
- the value to set the dynamic variable to. It should be the same type that StreamBaseClient.getDynamicVariable(String)
would
return for this dynamic variable.StreamBaseException
- if the dynamic variable does not exist, or the value is not appropriate for setting the dynamic
variablepublic long getTupleEnqueueCount()
public long getTupleDequeueCount()
public int getEnqueueBufferSize()
public List<Tuple> readTable(String tablePath, int rowLimit) throws StreamBaseException
tablePath
- Path to the table. A fully qualified path is a dot-separated string optionally starting
with a container name (when omitted, the container specified by this client's URI is used), followed by
zero or more module reference names, and finally the table or window name. For example,
default.ModuleRef1.DataTable
is a valid fully qualified path, where default.
may be omitted when this client is connected to the default container.rowLimit
- Limit on number of rows to return, or -1 for all rows.StreamBaseException
- If the connection is not valid or the server cannot be contacted, or the table does not exist, or the predicate is faulty.public List<Tuple> readTable(String tablePath, int rowLimit, String predicate) throws StreamBaseException
tablePath
- Path to the table. A fully qualified path is a dot-separated string optionally starting
with a container name (when omitted, the container specified by this client's URI is used), followed by
zero or more module reference names, and finally the table or window name. For example,
default.ModuleRef1.DataTable
is a valid fully qualified path, where default.
may be omitted when this client is connected to the default container.rowLimit
- Limit on number of rows to return, or -1 for all rows.predicate
- A predicate to apply to the rows to select those for retrieval. A null predicate returns all rows.StreamBaseException
- If the connection is not valid or the server cannot be contacted, or the table does not exist, or the predicate is faulty.public void addConnectionStatusCallback(ConnectionStatusCallback callback)
callback
- a class that implements the ConnectionStatusCallback interfacepublic void removeConnectionStatusCallback(ConnectionStatusCallback callback)
callback
- an instance of ConnectionStatusCallbackprotected void setConnectionStatus(ConnectionStatus status, String additionalInfo)
public ConnectionStatus getConnectionStatus()
public String getConnectionError()
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()