Package com.streambase.sb.client
Interface Admin
- All Known Implementing Classes:
HAAdmin
interface Admin
Interface describes the admin commands that pass from the
client to the stream base server.
Currently, the lowest implementation layer uses XMLRPC for the protocol.
-
Method Summary
Modifier and TypeMethodDescriptionString[]
addContainer
(long timeoutMS, String containerName, byte[] application, List<String> containerStreamMappings) Add the given application to the given container in the StreamBaseServerString[]
Add the given deploy file to the server.boolean
checkLicense
(long timeoutMS, String featureName) Return true if a license for the specified feature is available and false otherwise.clearEvalCache
(long timeoutMS, String containerName) Clear evaluation cacheReturn an XML description of a StreamBase entityvoid
Drain a StreamBase container or if empty the entire Servervoid
enqueue
(long timeoutMS, StreamProperties props, Collection<String> tuples) Enqueue a list of CSV encoded tuples using connectionless XMLRPCvoid
fastForwardTime
(long timeoutMS, Object msecs) Number of milliseconds to jump forward in time.getByteOrder
(long timeoutMS) What is the byte order of the server?com.streambase.sb.util.ByteString
Return the connection id (which may be null)getDynamicVariables
(long timeoutMS, com.streambase.sb.util.Path modulePath) Return the current value of the dynamic variables in the given module, as a Tuple of field name to Java value.getEvalCacheContent
(long timeoutMS, String containerName) Get evaluation cache contentgetMapperCacheContent
(long timeoutMS, String containerName) Get mapper cache contentgetNamesForContainer
(long timeoutMS, int id) Return a map of id and names for the given container id.String[]
getOperatorProperties
(long timeoutMS, String operatorName) For the given Operator, return its set of properties and their values.getOperatorProperty
(long timeoutMS, String operatorName, String propertyName) Return the value of the given property on the given Operator.getSchemaByHash
(long timeoutMS, byte[] hash) Return the Schema object for the given hash valuegetSchemaByName
(long timeoutMS, String schemaName) Return the Schema object for the given namegetStreamProperties
(long timeoutMS, String streamName) Return the StreamProperties for the given name.getStreamProperties
(long timeoutMS, String streamName, CaptureTransformStrategy strategy) Return the StreamProperties for the given name.getStreamPropertiesByHash
(long timeoutMS, byte[] hash) Return the StreamProperties for the given hashgetTargetTime
(long timeoutMS) Get target timeString[]
internalCommand
(long timeoutMS, String... args) run an internal commandboolean
isHA()
Are we in HA modeString[]
killAllConnections
(long timeoutMS) Kill all of the connections on the serverString[]
killConnection
(long timeoutMS, byte[] connectionId) Kill the connection with the given connectionIdString[]
listConnections
(long timeoutMS, StreamBaseAdminClient.ListConnectionArgument... arg) Return an array of client connectionsString[]
listEntities
(long timeoutMS, String entityType, int flags, CaptureTransformStrategy strategy) Return an array of entity names for the given entity typeString[]
manageJdbcConnections
(long timeoutMS, List<String> args) Manage jdbc connections: count [name]Count the open JDBC connections to the named data source (or all data sources if ommitted) close [name]Close any open JDBC connections to the named data source (or all data sources if ommitted)String[]
modifyContainer
(long timeoutMS, String containerName, List<String> args) Modify the given containerString[]
operatorStatus
(long timeoutMS, String containerName) Return the status of each Operator present in the StreamBase server.Return rows from the table.String[]
removeContainer
(long timeoutMS, String containerName, List<String> args) Remove the given container in the StreamBaseServerString[]
restartContainer
(long timeoutMS, String containerName) Restart the given containervoid
restartOperators
(long timeoutMS, List<String> operators) Restart the given Operators on the StreamBase server.void
Resume a paused StreamBase container of if empty the whole Servervoid
resumeOperators
(long timeoutMS, List<String> operators) Resume the given Operators on the StreamBase servervoid
setConnectionID
(com.streambase.sb.util.ByteString connectionid) Set the Connection IDvoid
setDynamicVariable
(long timeoutMS, com.streambase.sb.util.Path dynamicVariablePath, Object value) Set the value of the given dynamic variable to the given value.void
setOperatorProperty
(long timeoutMS, String operatorName, String propertyName, String value) On the given Operator, set the given property to the given value.void
setRuntimeParam
(long timeoutMS, String paramName, String paramValue, String operator) set the given runtime paramShutdown a StreamBase container or if empty the whole servervoid
shutdownOperators
(long timeoutMS, List<String> operators) Shut down the given Operators on the StreamBase server.String[]
status
(long timeoutMS, boolean verbose) Return the status of the StreamBase Serversubscribe
(long timeoutMS, SubscriptionEntry subscription, List<TupleConnections.StreamTupleConnection> connections) Subscribe to an output stream.void
Suspend (pause) a StreamBase container or operatorvoid
suspendOperators
(long timeoutMS, List<String> operators) Suspend the given Operators on the StreamBase ServerTypecheck (validate) the given StreamBase Application.void
unsubscribe
(long timeoutMS, StreamProperties props, String logicalstream, List<TupleConnections.StreamTupleConnection> connections) UnSubscribe to an output stream.
-
Method Details
-
addContainer
String[] addContainer(long timeoutMS, String containerName, byte[] application, List<String> containerStreamMappings) throws StreamBaseException Add the given application to the given container in the StreamBaseServer- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completecontainerName
- the containerNameapplication
- contents of an application. Text sbapp, ssql or binary contents of a jar filecontainerStreamMappings
- stream mappings between containers. Each member of the list should contain a mapping. For example: newContainer.newStream=oldContainer.oldStream- Returns:
- results if any
- Throws:
StreamBaseException
- thrown on typecheck and other errors
-
addDeploy
Add the given deploy file to the server. This will add all containers and all container connections defined in the deploy file. At that point, they are treated as any other container or container connection, and may be manipulated by modifyContainer and removeContainer. The given bytes may either be UTF-8 XML that conforms to the deploy file xsd, or a StreamBase Archive that was produced by running the sbargen command on an XML deploy file.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completedeploy
- contents of deploy file. XML text or binary contents of an sbar file made from a deploy file.args
- command arguments- Returns:
- results if any
- Throws:
StreamBaseException
- thrown on typecheck and other errorsStreamBaseException
- thrown on typecheck and other errors- Since:
- 7.0
-
removeContainer
String[] removeContainer(long timeoutMS, String containerName, List<String> args) throws StreamBaseException Remove the given container in the StreamBaseServer- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completecontainerName
- the containerNameargs
- command arguments- Returns:
- results if any
- Throws:
StreamBaseException
- thrown on typecheck and other errors
-
modifyContainer
String[] modifyContainer(long timeoutMS, String containerName, List<String> args) throws StreamBaseException Modify the given container- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completecontainerName
-args
- list of arguments- Returns:
- results if any
- Throws:
StreamBaseException
-
restartContainer
Restart the given container- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completecontainerName
- the name of the container to restart- Returns:
- results if any
- Throws:
StreamBaseException
-
typecheck
StreamProperties[] typecheck(long timeoutMS, String application, boolean full) throws StreamBaseException Typecheck (validate) the given StreamBase Application. Return a list of StreamProperties for that Application- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeapplication
- contents of an application. Text sbapp or ssql.full
- do a full typecheck- Returns:
- array of StreamProperties for the StreamBase application
- Throws:
StreamBaseException
- on network or typecheck error
-
shutdown
Shutdown a StreamBase container or if empty the whole server- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completecontainerName
- optional containerName- Returns:
- message describing the shutdown outcome
- Throws:
StreamBaseException
- thrown on network or other errors
-
getDynamicVariables
Tuple getDynamicVariables(long timeoutMS, com.streambase.sb.util.Path modulePath) throws StreamBaseException Return the current value of the dynamic variables in the given module, as a Tuple of field name to Java value.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completemodulePath
- the path to the module- Returns:
- a Tuple of all the module's dynamic variables. The field names are the names of the dynamic variables, and the values are their current values.
- Throws:
StreamBaseException
- on nonexistence of the path, network, if the module contains no dynamic variables, or other errors.
-
setDynamicVariable
void setDynamicVariable(long timeoutMS, com.streambase.sb.util.Path dynamicVariablePath, Object value) throws StreamBaseException Set the value of the given dynamic variable to the given value.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completedynamicVariablePath
- the path to the dynamic variablevalue
- the value to set the variable to- Throws:
StreamBaseException
-
fastForwardTime
Number of milliseconds to jump forward in time. Note that if you specify a negative number for msecs, the behavior could vary depending on the TimeService implementation. (no guaranteed what could happen!)- Parameters:
timeoutMS
- Timeout in milliseconds to wait for completionmsecs
- number of milliseconds to jump forward in time- Throws:
StreamBaseException
- Error forwarding time
-
getTargetTime
Get target time- Parameters:
timeoutMS
- Timeout in milliseconds to wait for completion- Returns:
- Target time
- Throws:
StreamBaseException
- Error getting time
-
getEvalCacheContent
Get evaluation cache content- Parameters:
timeoutMS
- Timeout in milliseconds to wait for completioncontainerName
- Container name- Returns:
- Cache contents
- Throws:
StreamBaseException
- Error reading cache
-
clearEvalCache
Clear evaluation cache- Parameters:
timeoutMS
- Timeout in milliseconds to wait for completioncontainerName
- Container name- Returns:
- Cache contents
- Throws:
StreamBaseException
- Error clearing cache
-
getMapperCacheContent
Get mapper cache content- Parameters:
timeoutMS
- Timeout in milliseconds to wait for completioncontainerName
- Container name- Returns:
- Cache contents
- Throws:
StreamBaseException
- Error reading cache
-
getOperatorProperties
For the given Operator, return its set of properties and their values.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeoperatorName
- The operator whose properties are retrieved.- Returns:
- set of operator properties and values
- Throws:
StreamBaseException
-
getOperatorProperty
String getOperatorProperty(long timeoutMS, String operatorName, String propertyName) throws StreamBaseException Return the value of the given property on the given Operator.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeoperatorName
- The operator whose property value is retrieved.propertyName
- The property whose value is retrieved.- Returns:
- set of operator properties and values
- Throws:
StreamBaseException
-
setOperatorProperty
void setOperatorProperty(long timeoutMS, String operatorName, String propertyName, String value) throws StreamBaseException On the given Operator, set the given property to the given value.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeoperatorName
- The operator whose property value is set.propertyName
- The property whose value is set.value
- The value set.- Throws:
StreamBaseException
-
shutdownOperators
Shut down the given Operators on the StreamBase server.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeoperators
- The Operators to shut down- Throws:
StreamBaseException
- throws on network or other errors
-
restartOperators
Restart the given Operators on the StreamBase server. The Operators must currently be shut down.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeoperators
- The Operators to shut down- Throws:
StreamBaseException
- throws on network or other errors
-
suspendOperators
Suspend the given Operators on the StreamBase Server- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeoperators
- the operators to suspend- Throws:
StreamBaseException
- thrown on network or other errors
-
suspend
Suspend (pause) a StreamBase container or operator- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completename
- container or operator name- Throws:
StreamBaseException
- thrown on network or other errors
-
resumeOperators
Resume the given Operators on the StreamBase server- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeoperators
- the operators to suspend- Throws:
StreamBaseException
-
resume
Resume a paused StreamBase container of if empty the whole Server- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completecontainerName
- optional containerName- Throws:
StreamBaseException
-
describe
Return an XML description of a StreamBase entity- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeentityName
- the name of the entity to describe- Returns:
- an XML description of a StreamBase entity
- Throws:
StreamBaseException
- thrown on network or other errors
-
checkLicense
Return true if a license for the specified feature is available and false otherwise.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completefeatureName
- the name of the licensed feature- Returns:
- true if a license for the specified feature is available and false otherwise
- Throws:
StreamBaseException
- thrown on network or other errors
-
getStreamProperties
Return the StreamProperties for the given name. UsesCaptureTransformStrategy.FLATTEN
- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completestreamName
- the stream name to lookup- Returns:
- The StreamProperties object for the given name
- Throws:
StreamBaseException
- thrown on network or other errors
-
getStreamProperties
StreamProperties getStreamProperties(long timeoutMS, String streamName, CaptureTransformStrategy strategy) throws StreamBaseException Return the StreamProperties for the given name.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completestreamName
- the stream name to lookupstrategy
- theCaptureTransformStrategy
to use if the target stream has capture fields.- Returns:
- The StreamProperties object for the given name
- Throws:
StreamBaseException
- thrown on network or other errors- Since:
- 7.2.6
-
getStreamPropertiesByHash
Return the StreamProperties for the given hash- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completehash
- The Hash to lookup- Returns:
- The StreamProperties object for the given name
- Throws:
StreamBaseException
- thrown on network or other errors
-
listEntities
String[] listEntities(long timeoutMS, String entityType, int flags, CaptureTransformStrategy strategy) throws StreamBaseException Return an array of entity names for the given entity type- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeentityType
- the entity type to do the lookupflags
- FULLY_QUALIFIED_NAMES and INCLUDE_MODULES flagsstrategy
- the capture transform strategy- Returns:
- an array of entity names for the given entity type
- Throws:
StreamBaseException
- thrown on network or other errors
-
getSchemaByHash
Return the Schema object for the given hash value- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completehash
- a byte array that contains a hash value- Returns:
- The Schema object associated with the given hash value
- Throws:
StreamBaseException
- thrown on network or other errors
-
getSchemaByName
Return the Schema object for the given name- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeschemaName
- the name of the Schema to lookup- Returns:
- the Schema for the given name
- Throws:
StreamBaseException
- thrown on network or other errors
-
drain
Drain a StreamBase container or if empty the entire Server- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completecontainerName
- optional containerName- Throws:
StreamBaseException
- thrown on network or other errors
-
operatorStatus
Return the status of each Operator present in the StreamBase server.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completecontainerName
- name of the container- Returns:
- An array of Strings, each String hold the status of an Operator present in the server.
- Throws:
StreamBaseException
-
status
Return the status of the StreamBase Server- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeverbose
- return a verbose status- Returns:
- the status
- Throws:
StreamBaseException
- thrown on network and other errors
-
subscribe
SubscriptionEntry subscribe(long timeoutMS, SubscriptionEntry subscription, List<TupleConnections.StreamTupleConnection> connections) throws StreamBaseException Subscribe to an output stream.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completesubscription
- aSubscriptionEntry
describing the desired subscription. Contains theStreamProperties
of the desired stream, an optional predicate, and an optional logical stream to associate with the predicate.connections
- the list of tupleconnections on which to subscribe to- Returns:
- a subscription entry
- Throws:
StreamBaseException
- server errors, or network errors.
-
unsubscribe
void unsubscribe(long timeoutMS, StreamProperties props, String logicalstream, List<TupleConnections.StreamTupleConnection> connections) throws StreamBaseException UnSubscribe to an output stream.- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeprops
- the streamlogicalstream
- name of the logical streamconnections
- the list of tupleconnections on which to subscribe to- Throws:
StreamBaseException
- server errors, or network errors.
-
internalCommand
run an internal command- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeargs
- the arguments for the command- Returns:
- the results of the command
- Throws:
StreamBaseException
- thrown on network or other errors
-
listConnections
String[] listConnections(long timeoutMS, StreamBaseAdminClient.ListConnectionArgument... arg) throws StreamBaseException Return an array of client connections- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completearg
- arguments for the command- Returns:
- an array of client connections
- Throws:
StreamBaseException
- thrown on network or other errors
-
killConnection
Kill the connection with the given connectionId- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeconnectionId
-- Returns:
- status of kill command
- Throws:
StreamBaseException
-
killAllConnections
Kill all of the connections on the server- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to complete- Returns:
- status of kill command
- Throws:
StreamBaseException
-
manageJdbcConnections
Manage jdbc connections:- count [name]
- Count the open JDBC connections to the named data source (or all data sources if ommitted)
- close [name]
- Close any open JDBC connections to the named data source (or all data sources if ommitted)
- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeargs
- a list that must contain at least one command string (close
orcount
), and may contain an optional second argument string (the name of a data source). When no argument string is given, the command will apply to all data sources.- Returns:
- for
close
, one string containing the number of connections closed forcount
, one string containing the number of open connections - Throws:
StreamBaseException
- throw on network or other errors- Since:
- 7.2
-
enqueue
void enqueue(long timeoutMS, StreamProperties props, Collection<String> tuples) throws StreamBaseException Enqueue a list of CSV encoded tuples using connectionless XMLRPC- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeprops
- StreamProperties for streamtuples
- list of tuples- Throws:
StreamBaseException
-
setRuntimeParam
void setRuntimeParam(long timeoutMS, String paramName, String paramValue, String operator) throws StreamBaseException set the given runtime param- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to completeparamName
- the name of the paramparamValue
- the value of the commandoperator
- the operator for the param- Throws:
StreamBaseException
-
isHA
boolean isHA()Are we in HA mode- Returns:
- return if in HA mode
-
getByteOrder
What is the byte order of the server?- Parameters:
timeoutMS
- the timeout in milliseconds to wait for the command to complete- Returns:
- byte order of the server
- Throws:
StreamBaseException
-
setConnectionID
void setConnectionID(com.streambase.sb.util.ByteString connectionid) Set the Connection ID- Parameters:
connectionid
-
-
getConnectionID
com.streambase.sb.util.ByteString getConnectionID()Return the connection id (which may be null)- Returns:
- connection id (which may be null)
-
readTable
List<Tuple> readTable(long timeoutMS, String tablePath, int rowLimit, String predicate) throws StreamBaseException Return rows from the table.- Parameters:
timeoutMS
- timeout in millisecondstablePath
- Path to the table.rowLimit
- Limit on number of rows to return, or -1 for all rows.predicate
-- Returns:
- A list of rows from the table.
- Throws:
StreamBaseException
- If the connection is not valid or the server cannot be contacted.- Since:
- 10.2 Executes a cluster wide-query on partitioned transasctional memory tables
-
getNamesForContainer
Return a map of id and names for the given container id.- Parameters:
timeoutMS
-id
-- Returns:
- a map of id and names for the given container id
- Throws:
StreamBaseException
-