sbc
StreamBase Client — starts the StreamBase Client
DESCRIPTION
sbc starts the StreamBase client utility, which lets you send requests to a running StreamBase Server (sbd). For example, the sbc list streams command requests the server to list available streams.
StreamBase users can submit sbc commands, but some may require authentication. To specify a username and password, use a URI of the format described in the -u option below.
Use the sbadmin command rather than sbc for administrative commands.
OPTIONS
-
-hcommand,--helpcommand -
Displays help for the specified command, then exits. For example,
sbc -h dequeueshows a usage message for the dequeue command. -
-uuri -
Specifies the URI of the StreamBase Server to communicate with. The format of the URI is:
sb://host[:port][/container][;user=xxx;password=yyy]The default
hostislocalhost, the optional defaultportis10000, and the optional defaultcontaineris nameddefault. Thus, the following commands are equivalent for a server with all default settings:sbc listsbc -u sb://localhost listsbc -u sb://localhost:10000 listsbc -u sb://localhost:10000/default listIf you want the command to list entities in a non-default container in the running server process, specify the container's name. For example:
sbc -u sb://localhost/myContainer listThe
userandpasswordparameters are only necessary if you are communicating with a StreamBase Server instance that has authentication enabled. There are no defaults, which means you must specify a full URI when connecting with authentication. For example:sbc -u sb://sbhost.example.com:10000;user=sbuser;password=secret listThe URI for the StreamBase Server may also be set using the
STREAMBASE_SERVERenvironment variable.Note
When used with the
status,enqueue, anddequeuesubcommands, the sbc command's-uoption accepts a comma-separated list of URIs, where each URI specifies a different StreamBase Server in a High Availability cluster. See the Multiple URI Syntax for HA Scenarios page in the Administration Guide for details. -
-pTCP-port -
Specifies the port number on
localhostfor the StreamBase Server to communicate with. This is a shortcut alternative to specifying the full URI with-uin cases where the server is running onlocalhostbut on a port other than the default 10000. Thus, the following lines are equivalent:sbc -p 9900 listsbc -u sb://localhost:9900 listNote
The
-poption is not supported for StreamBase applications that have authentication enabled or are using High Availability features. -
-ofilename -
Redirects all non-error standard output to the specified file.
-
--version -
Prints version information and exits.
COMMANDS
-
deq·ueue
[OPTIONS] [stream-names...] -
Dequeues data from one or more streams to
stdout. By default, outputs comma-separated values. Fields containing commas are enclosed in double quotation marks. Command can be abbreviated to deq.-
stream-names -
The names of streams from which to dequeue. The default is to dequeue from all output streams (streams that do not feed into the input ports of other operators).
-
--all -
Dequeue from all streams (including input, intermediate, and output streams).
-
-ddelim -
Use
delim(a single character, or 'tab') as a field separator. The default field separator is a comma. -
--header -
Write a header at the beginning of the output. This option is valid only if exactly one stream is specified.
-
--info -
Write out informational lines, such as when all streams have been subscribed to. Informational lines begin with an asterisk (*) and two quotation marks (which is an invalid CSV line) so they can be distinguished from other output.
-
-qquote -
Use
quote(a single character) as a quotation mark. The default quote is a double quote. -
-v -
Output human-readable tuples.
-
-
describe
name... -
Outputs a description of one or more components in the application.
-
iscluster -
DEPRECATED. Returns
trueif the target sbd server is a member of a cluster managed by the legacy StreamBase Cluster Server sbclusterd command, or returnsfalseif not. The sbclusterd and sbc iscluster commands are maintained in StreamBase 5.1 for backward compatibility with 5.0 and 3.x releases, but will be removed in a future StreamBase release -
enq·ueue
[OPTIONS] [stream-name] -
Reads and enqueues data from
stdin. By default, enqueue expects comma-separated values. Fields containing commas must be enclosed in quotation marks. Command can be abbreviated to enq.-
stream-name -
The name of the stream on which to enqueue data. If no stream name is given, the first input field is expected to be the stream name for each tuple.
-
-bsize -
Use
sizeto indicate the number of tuples to buffer. Default is no buffering. -
-ddelim -
Use
delim(a single character, or 'tab') as a field separator. The default field separator is a comma. -
-ffield1,field2... -
Specify the order of fields in the input. The first column in the input is field
field1in the input stream, and so on. Only valid when a stream name is provided. -
-iinterval -
Use
intervalto indicate the enqueueing flush interval in milliseconds. If buffering was not enabled, defaults to 250 milliseconds. -
-nstring -
Consider a field to be null when
stringis specified as a value. The default string to indicate a null field isnull. -
-qquote -
Use
quote(a single character) as a quotation mark. The default quote is a double quote.
-
-
list [-c]
[-m]
type... -
Lists entities available on the running sbd server.
typemay bestreams,schemas,operators,input-streams,output-streams(or the singular forms of these keywords). By default, container names and modules are omitted. Use the-cor-mflags to include either or both.-
-a -
DEPRECATED. Used in previous StreamBase releases to display all entities. In current releases,
-ais a no-op maintained for compatibility. -
-c -
Includes container names as a prefix to the entity names in the resulting list.
-
-m -
Includes module references. Modules can be explicitly referenced in the application, or referenced implicitly by StreamBase. That is, when a component runs in one separate or multiple parallel threads, StreamBase creates a module for each running instance.
-
- status [--verbose] [--operators [containerName]]
-
Displays a one-line summary of current information about the specified sbd server. By default, the information includes:
-
The URI and port of the server.
-
The server's process ID.
-
The StreamBase version number.
-
The hostname of the host machine.
The
--verboseoption adds:-
The path to the Java JVM being used by the server.
-
Memory usage (total memory used by the sbd process).
-
The number of currently connected clients.
-
The HA leadership status.
Here is a sample of verbose output:
sbd at monaghan:9900; pid=8241; version=5.1.5; name=monaghan; \ javahome=/usr/java/jdk1.6.0_04/jre; memory=445724kb; clients=1; \ leadership_status=LEADER
-
--operators [containerName] -
Instead of server status, displays the status of any Java operators or embedded adapters in the server. Optionally narrows the status to any Java operators or embedded adapters in the specified container. The status for each Java operator or embedded adapter has possible values of NOT_YET_STARTED, STARTED, SUSPENDED_AND_DROPPING_TUPLES, SUSPENDED_AND_PROCESSING_TUPLES, and SHUTDOWN.
-
-
typecheck
file.sbapp -
Typechecks an application modification and prints descriptions of the resultant streams.
ENVIRONMENT
-
STREAMBASE_SERVER -
Optional. The URI for the StreamBase Server. The default is
sb://localhost:10000.You can set this environment variable if the server is on another node or listening on another port. For example, if sbd is on hostsbhost.example.comat port 20000, set theSTREAMBASE_SERVERvalue assb://sbhost.example.com:20000. -
STREAMBASE_RETITLE_TERMINALS -
Optional. If set to any value, StreamBase command-line utilities assign a terminal window title to match the name of the executable being run. By default terminal titles are not affected.
-
STREAMBASE_LOG_LEVEL -
Optional. Sets the minimum severity of messages that StreamBase writes to
syslogorstderr. Default is 0, which gets NOTICE level messages and higher. Reasonable values are -1 (which disables NOTICE messages and shows only WARN, ERROR and FATAL messages), 1 (which adds INFO messages to the standard messages), and 2 (which adds DEBUG messages).
BUGS
For information about known bugs, please refer to the StreamBase Release Notes. To report bugs, go to Contact Information.
