C++ counterparts of SPL native functions that provide general utilities. More...


Detailed Description

C++ counterparts of SPL native functions that provide general utilities.


Function Documentation

a unique name generation for parameters and files.

Abort program execution.

Parameters:

Determine whether a message at the given level would be traced.

Parameters:
Returns:
The value 'true' if a message at the given traceLevel would be traced.

Log a message in the tracing system.

Parameters:

Log a message in the tracing system.

Parameters:

Log a message in the tracing system.

Parameters:

Log a message in the tracing system.

Parameters:

Log a message in the tracing system.

Parameters:

Determine whether a message at the given level would be logged.

Parameters:
Returns:
The value 'true' if a message at the given logLevel would be logged.

Log a message in the logging system.

Parameters:

Log a message in the logging system.

Parameters:

Log a message in the logging system.

Parameters:

Log a message in the logging system.

Parameters:

Log a message in the logging system.

Parameters:

Log a message in the tracing system.

Note:
Deprecated - use appTrc.
Parameters:

Log a message in the tracing system.

Note:
Deprecated - use appTrc.
Parameters:

Log a message in the tracing system.

Note:
Deprecated - use appTrc.
Parameters:

Log a message in the tracing system.

Note:
Deprecated - use appTrc.
Parameters:

Log a message in the tracing system.

Note:
Deprecated - use appTrc.
Parameters:

Shutdown the current processing element (PE).

Check if shutdown is requested.

Returns:
The value 'true' if the system is shutting down.

Block until shutdown is requested, or the specified amount of time has elapsed, whichever comes first.

Parameters:

Get the parallel channel index.

Returns:
The index of the parallel channel.

Get the maximum number of parallel channels.

Returns:
The maximum number of parallel channels.

Get the physical name of the operator.

Returns:
The physical name of the operator.

Get the logical name of the operator.

Returns:
The logical name of the operator.

Get the value of an environment variable.

Parameters:
Returns:
The value for the environment variable, or empty string if not set.

Get the value of an environment variable.

Parameters:
Returns:
The value for the environment variable if set, otherwise the default value.

Get the value of an environment variable.

Parameters:
Returns:
The value for the environment variable, or empty string if not set.

Get the specified input port metric value for the current operator.

Parameters:
Exceptions:

Get the specified output port metric value for the current operator.

Parameters:
Exceptions:

Get the specified custom metric value for the current operator.

Parameters:
Exceptions:

Get the specified custom metric value for the current operator.

Parameters:
Exceptions:

Set the specified custom metric value for the current operator.

Parameters:
Exceptions:

Set the specified custom metric value for the current operator.

Parameters:
Exceptions:

Create the specified custom metric for the current operator and set its initial value.

Parameters:
Exceptions:

Create the specified custom metric for the current operator and set its initial value.

Parameters:
Exceptions:

Check if the specified custom metric exists.

Parameters:
Returns:
The value 'true' if the custom metric exists, otherwise 'false'.

Check if the specified custom metric exists.

Parameters:
Returns:
The value 'true' if the custom metric exists, otherwise 'false'.

Return the names of the custom metrics for the current operator.

Returns:
List of names of custom metrics.

Format an integer using locale specific format. The number is returned as a string with the locale specific grouping.

Parameters:
Returns:
The input value as a string using locale specific number format.

Format an integer using locale specific format. The number is returned as a string with the locale specific grouping.

Parameters:
Returns:
The input value as a string using locale specific number format.

Format a float using locale specific format. The number is returned as a string with the locale specific grouping and decimal point.

Parameters:
Returns:
The input value as a string using locale specific number format.

Format a float using locale specific format. The number is returned as a string with the locale specific grouping and decimal point.

Parameters:
Returns:
The input value as a string using locale specific number format.

Parse a string that represents a number, using the current locale. This function exposes the full capability of the underlying strtoll function.

Parameters:
Returns:
The number of bytes read on success, -1 otherwise.

Parse a string that represents a base 10 number, using the current locale.

Parameters:
Returns:
The number of bytes read on success, -1 otherwise.

Parse a string that represents a number, using the current locale.

Parameters:
Returns:
The number of bytes read on success, -1 otherwise.

Parse a string that represents a number, using the current locale.

Note:
This function is implemented using ICU and does not accept 'e' as the exponent character. Use 'E' instead (e.g. 1.05E+3).
Parameters:
Returns:
The number of bytes read on success, -1 otherwise.

Parse a string that represents a number, using the current locale.

Note:
This function is implemented using ICU and does not accept 'e' as the exponent character. Use 'E' instead (e.g. 1.05E+3).
Parameters:
Returns:
The number of bytes read on success, -1 otherwise.

Convert an errno value to a string for intelligent printing.

Parameters:
Returns:
String description of errnum.

Convert a string in base 2 to 36 to an unsigned number. See POSIX strtoull.

Parameters:
Returns:
String converted to a uint64.

Convert a string in base 2 to 36 to an unsigned number. See POSIX strtoull.

Parameters:
Returns:
String converted to a uint64.

Convert a string in base 2 to 36 to an signed number. See POSIX strtoll.

Parameters:
Returns:
String converted to an int64.

Convert a string in base 2 to 36 to an signed number. See POSIX strtoll.

Parameters:
Returns:
String converted to a int64.

Convert a string to a floating point number. See POSIX strtod.

Parameters:
Returns:
String converted to a float64.

Convert a string to a floating point number. See POSIX strtod.

Parameters:
Returns:
String converted to a float64.
template<class T >

Write any SPL type to stdout as an SPL literal. For example, strings are quoted, and characters escaped. If you want to print strings without using the string literal format, use the printString function instead. The output is not flushed.

Parameters:

Write a string to stdout, followed by a newline, and then the output is flushed.

Parameters:

Write a string to stdout, followed by a newline, and then the output is flushed.

Parameters:

Write a string to stdout, followed by a newline, and then the output is flushed.

Parameters:

Write a string to stdout. The output is not flushed.

Parameters:

Write a string to stdout. The output is not flushed.

Parameters:

Write a string to stdout. The output is not flushed.

Parameters:
template<class T >

Write any SPL type to stdout, in serialized form, followed by a newline. For example, strings are quoted, and characters escaped. The output is then flushed.

Parameters:

Flush all stdio output streams. Will ensure printString and print output is written to standard output.

Assign matching fields of a tuple from another one.

Parameters:
template<class T >

Compute the hash of a value.

The hash function is designed to return a fixed output value for a given input value, and to reduce the likelihood of returning the same output value for different input values. The hash function can be used to map a set of input values to a smaller range of output values, for example, by performing a modulo operation on the returned hash value and the size of the desired range. In cases where there may be patterns in the input values (such as all even numbers), a more even distribution of output values may be possible by using a prime number as the modulus.

The current hash function uses the C++ standard library std::tr1::hash function.

Parameters:
Returns:
Hash of the value.
template<class T >

Compute hashes of a list of values, using the same hashing method as hashCode().

Parameters:
Returns:
List of the hashes of the values.
template<class T , int32_t N>

Compute hashes of a list of values, using the same hashing method as hashCode().

Parameters:
Returns:
List of the hashes of the values.

Miscellaneous.

Return the absolute pathname to the data directory for the Processing Element.

Returns:
Data directory (absolute path).
template<class T >

Swap any two SPL values

Parameters:

Return the name of a temporary file created using a template. The POSIX mkstemp function is used to create the file, and the file is closed.

Parameters:
Returns:
The generated temporary file, or the empty string if there were errors. Note that since the file is closed before returning, there is a brief window that another process might use to create the same file.

Return the Job ID for the current job that this operator is executing in.

Returns:
The job ID for the current job.

Return the name of the current job that this operator is executing in.

Returns:
The name of the current job.

Return the name of the job group for the current job that this operator is executing in.

Returns:
The name of the job group.

Return the name of the application that is executing this operator.

Returns:
The name of the application.

Return the PE ID for the current processing element that this operator is executing in.

Returns:
The PE ID for the current processing element.

Return the instance ID that the PE is running in.

Returns:
The instance ID for the current processing element (username if running standalone).

Return the domain ID that the PE is running in.

Returns:
The domain ID for the current processing element (username if running standalone).

Return the number of times the PE that the operator is executing in has been relaunched.

Returns:
The relaunch count of the PE.

Check if the input port is a control port.

Parameters:
Returns:
The value 'true' if the port is a control port, 'false' otherwise.

Check if the input port is consistent. An input port is consistent if all its input streams are produced by operators that belong to the same consistent region.

Parameters:
Returns:
The value 'true' if the input port is consistent, 'false' otherwise.

Check if the operator is in a consistent region.

Returns:
The value 'true' if the operator is in a consistent region, 'false' otherwise.

Check if the operator is a start operator of a consistent region.

Returns:
The value 'true' if the operator is a start operator of a consistent region, 'false' otherwise.

Check if the operator is an end operator of a consistent region.

Returns:
The value 'true' if the operator is an end operator in a consistent region, 'false' otherwise.

Check if the operator the trigger operator of an operator-driven consistent region.

Returns:
The value 'true' if the operator is the trigger operator of a consistent region, 'false' otherwise.

Gets the index of the consistent region.

Returns:
Index of the consistent region, or -1 if the operator is not in a consistent region.

Gets the current sequence identifier of a consistent region. It indicates the id that a drain or a reset should be associated to. After operator startup, this function returns 1. On operator restart, the function returns -1 until it has reset.

Returns:
The current sequence id of a drain or reset, or -1 if the operator is not in a consistent region or has not yet reset after an operator restart.

Gets the drain timeout of a consistent region.

Returns:
The drain timeout, or -1 if the operator is not in a consistent region.

Gets the reset timeout of a consistent region.

Returns:
The reset timeout, or -1 if the operator is not in a consistent region.

If the operator is in a consistent region, this function returns the retry attempt of resetting the consistent region to a consistent state. If resetting, returns the current reset attempt. If not, this function returns the retry attempt of the last reset.

Returns:
Reset retry attempt, or -1 if the operator is not in a consistent region or has not yet reset after an operator restart.

This function requests the ConsistentRegionControllerMXBean to restore the consistent region to the last established consistent state. This function can be used by operators when detecting an operator-specific transient failure. If the region is already being reset, a new reset attempt is triggered. If the operator is not in a consistent region, this function has no effect.

Evaluates the SPL predicate, represented as an rstring, using the given tuple. The predicate has the same limitations as the 'filter' parameter to the Import operator.

Returns:
Value of evaluating the expression.
Parameters:

Get the host name.

Returns:
Full host name (with the domain) of the node running this operator as returned by the system call gethostname().
Exceptions:

Get the short host name.

Returns:
Short host name (without the domain) of the node running this operator.
Exceptions:

Get the hostname used by the streams instance for this host. This returns the full hostname (with domain) for the interface configured for use by the streams instance for this host. This may differ from the IP address for the name returned from getHostName() if there are multiple network interfaces on this host.

Returns:
The hostname for the configured streams interface for this host representation.
Exceptions:

Get the IP address for the current host.

Returns:
IP address in rstring representation.

Get the export properties for an exported output port.

Parameters:
Returns:
Error return code: 0 for success, 1 for invalid or not exported port.

Set the export properties for an exported output port.

Parameters:
Returns:
Error return code: 0 for success, 1 for invalid or not exported port, 2 for invalid properties, 3 for set properties failed.
Note:
Example: setOutputPortExportProperties([{name = "a", value = "\"string value"", typ = "rstring"}], 0u);

Set the export properties for an exported output port.

Parameters:
Returns:
Error return code: 0 for success, 1 for invalid or not exported port, 2 for invalid types in properties tuple, 3 for set properties failed.
Note:
Example: setOutputPortExportProperties({a = "hi", b = [ 4l, -8l]}, 0u);

Get the import subscription for an imported input port.

Parameters:
Returns:
Subscription for imported port, or empty string if error.

Set the import subscription for an imported input port.

Parameters:
Returns:
Error return code: 0 for success, 1 for invalid or not imported imported by subscription input port, 2 for invalid subscription expression, 3 for set of subscription failed.

Get the filter expression for an imported input port.

Parameters:
Returns:
Filter expression for imported port, or empty string if the filter expression is empty or on error.

Set the filter expression for an imported input port.

Parameters:
Returns:
Error return code: 0 for success, 1 for invalid or not imported imported by subscription input port, 2 for invalid filter expression, 3 for set of filter expression failed.

Loads and formats a string from a toolkit resource. The execution locale is used.

Parameters:
Returns:
The formatted string.
Exceptions:

Loads and formats a string from a toolkit resource.

Parameters:
Returns:
The formatted string.
Exceptions:

Loads a string from a toolkit resource. The execution locale is used.

Parameters:
Returns:
The requested string.

Loads a string from a toolkit resource.

Parameters:
Returns:
The requested string.

Return the connection information for an output port that connects to another PE.

Parameters:
Returns:
Error return code: 0 for success, -1 for invalid port, -2 for invalid argument.
Note:
Example: mutable Sys.PEConnections conns; int32 ret = getPEOutputPortConnections(0, conns);

Return the maximum congestion factor for all connections from an output port that connects to another PE.

Parameters:
Returns:
-1 for invalid port or 0..100 congestion factor.
Note:
Example: int32 maxCongestionFactor = getOutputPortCongestionFactor(0);