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 -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. The format of the URI is:

sb://host[:port][/container][;user=xxx;password=yyy]

The default host is localhost, the optional default port is 10000, and the optional default container is named default. Thus, the following commands are equivalent for a server with all default settings:

sbc list

sbc -u sb://localhost list

sbc -u sb://localhost:10000 list

sbc -u sb://localhost:10000/default list

If 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 list

The user and password parameters 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 list

The URI for the StreamBase Server may 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 the Multiple URI Syntax for HA Scenarios page in the Administration 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 application.

iscluster

DEPRECATED. Returns true if the target sbd server is a member of a cluster managed by the legacy StreamBase Cluster Server sbclusterd command, or returns false if 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.

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

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

FILES

There is no configuration file for sbc.

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 host sbhost.example.com at port 20000, set the STREAMBASE_SERVER value as sb://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 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).

BUGS

For information about known bugs, please refer to the StreamBase Release Notes. To report bugs, go to Contact Information.