sbc

StreamBase Client — starts the StreamBase Client

SYNOPSIS

sbc [OPTIONS] [COMMAND] [COMMAND-OPTIONS]

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 sburi page of the Reference Guide.

the -u option below.

Use the sbadmin command rather than sbc for administrative commands.

OPTIONS

-h command, --help command

Displays help for the specified command, then exits. For example, sbc -h dequeue shows a usage message for the dequeue command.

-u uri

Specifies the URI of the StreamBase Server to communicate with. See the sburi page of the Reference Guide (or see sburi(5) at the UNIX shell prompt) for a discussion of the URI format and its shortcuts. The URI can also be set using the STREAMBASE_SERVER environment variable.

Note

When used with the status, enqueue, and dequeue subcommands, the sbc command's -u option accepts a comma-separated list of URIs, where each URI specifies a different StreamBase Server in a High Availability cluster. See Multiple URI Syntax for HA Scenarios in the Reference Guide for details.

-p TCP-port

Specifies the port number on localhost for the StreamBase Server to communicate with. This is a shortcut alternative to specifying the full URI with -u in cases where the server is running on localhost but on a port other than the default 10000. Thus, the following lines are equivalent:

sbc -p 9900 list

sbc -u sb://localhost:9900 list

Note

The -p option is not supported for StreamBase applications that have authentication enabled or are using High Availability features.

-o filename

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).

-d delim

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.

-q quote

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 specified running application.

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.

-b size

Use size to indicate the number of tuples to buffer. Default is no buffering.

-d delim

Use delim (a single character, or 'tab') as a field separator. The default field separator is a comma.

-f field1, field2...

Specify the order of fields in the input. The first column in the input is field field1 in the input stream, and so on. Only valid when a stream name is provided.

-i interval

Use interval to indicate the enqueuing flush interval in milliseconds. If buffering was not enabled, defaults to 250 milliseconds.

-n string

Consider a field to be null when string is specified as a value. The default string to indicate a null field is null.

-q quote

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. type may be streams, schemas, operators, input-streams, output-streams (or the singular forms of these keywords). By default, container names and modules are omitted. Use the -c or -m flags to include either or both.

-a

DEPRECATED. Used in previous StreamBase releases to display all entities. In current releases, -a is a no-op maintained for compatibility.

-c

Includes container names as a prefix to the entity names in the resulting list.

-C container-name

Lists the streams and operators for the specified container. For example, the following command lists the contents of the container named mainapp on the default server and port:

sbc list -C mainapp
-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 an implicit 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 --verbose option 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. Contains the URI for a StreamBase Server instance. Use this variable to set a default StreamBase URI for StreamBase commands that take the –u option. If set, commands use the URI in this variable, overriding their built-in default URI, which is sb://localhost:10000. If this variable is set, you must use the –u option to communicate with any server other than the one specified in this variable. See the sburi page in the Reference Guide for more on StreamBase URIs.

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 syslog or stderr. 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).

SEE ALSO

sbd
sbadmin
Using Containers
syslog(3)