Cobra Interactive Query Language stream

NAME

stream — modify parameters for streaming input

SYNTAX

	stream [mode=text] [limit=N] [margin=N]

DESCRIPTION

This query command gives an online alternative to the command line options -text, -stream N, and -margin N.

These options are only effective if Cobra is used in streaming mode, while reading input from the standard input rather than from files listed on the command line (which is the normal mode of operation for Cobra).

In streaming mode, the initial set of tokens is processed according to the default setting of the parameters, or as specified on the command-line (using command-line flags -stream N and/or -stream_margin N). The settings can be overriden with a stream query command that can be placed, for instance before the first script that is run on the input stream. Once the command is executed, all subsequent reads from stdin will use the new parameter settings.

The stream window determines how much data is maintained in core, or equivalently how frequently the sliding window into the data stream is moved forward. Low values cause frequent updates and increase overhead (time). High values are more efficient, and can slightly increase memory use.

The stream margin size determines how many tokens to the left of the sliding window are kept when the window slides forward with a new data read. This can be useful when occassionally the script needs to be able to refer back by a small distance to tokens previously seen. The margin size should be kept as small as possible to avoid overhead.

EXAMPLES

	: stream mode=text limit=500000 margin=1000

NOTES

This query command requires Cobra version 3.2 or later.

The stream margin setting should be kept small relative to the stream window size itself, to avoid increasing memory overhead.


Return to index
Manual
Tutorial
(Last Updated: 13 November 2020)