Namespace spl.utility
This namespace contains components of general utility that include customizable operators, and functions for obtaining configuration information, logging, managing consistent regions and using custom metrics.
By default this namespace is in scope for SPL programs, so no explicit use statement is required to use them.
Operators
- Barrier: The Barrier operator is used to synchronize tuples from two or more streams.
- Beacon: The Beacon operator is a utility source that generates tuples on an ad hoc basis.
- CharacterTransform: The CharacterTransform operator is used to convert from one encoding in blob to another encoding in blob.
- Compress: The Compress operator is used to compress data in a blob and generate blob output.
- Custom: The Custom operator is a special logic-related operator that can receive and send any number of streams and does not do anything by itself.
- DeDuplicate: The DeDuplicate operator suppresses duplicate tuples that are seen within a specified time period.
- Decompress: The Decompress operator decompresses data in blob input and generates blob output that contains the decompressed data.
- Delay: The Delay operator is used to delay a stream by an amount while it keeps the inter-arrival times of tuples and punctuation intact.
- DynamicFilter: The DynamicFilter is a version of the Filter operator that can decide at run time which input tuples are passed through, based on control input it receives.
- Format: The Format operator is similar to the FileSink, TCPSink, and UDPSink operators, in that it converts SPL tuples into formatted data.
- Gate: The Gate operator is used to control the rate at which tuples are passed through.
- JavaOp: The JavaOp operator is used to call out to operators implemented in Java by using the Java Operator API.
- Pair: The Pair operator is used to pair tuples from two or more streams.
- Parse: The Parse operator is similar to the FileSource, TCPSource, and UDPSource operators, in that it transforms input data in a raw form into well-structured SPL tuples.
- PythonOp: The PythonOp operator is used to call out to operators implemented in Python by using the Python Operator API.
- ReplayableStart: The ReplayableStart operator forwards tuples and punctuations from its input port to its output port.
- Split: The Split operator is used to split a stream into one or more output streams, which are based on a user-specified split condition.
- Switch: The Switch operator is used to temporarily stop tuples from flowing.
- ThreadedSplit: The ThreadedSplit operator splits tuples across multiple output ports to improve concurrency.
- Throttle: The Throttle operator is used to pace a stream to make it flow at a specified rate.
- Union: The Union operator merges the streams that are connected to multiple input ports into a single stream.
Functions
- PEID(): Return the PE ID for the current processing element that this operator is executing in.
- abort(): Abort program execution.
- appLog(enum{error, warn, info}, T): Log a message in the logging system.
- appLog(enum{error, warn, info}, T, T): Log a message in the logging system.
- appTrc(enum{error, warn, info, debug, trace}, T): Log a message in the tracing system.
- appTrc(enum{error, warn, info, debug, trace}, T, T): Log a message in the tracing system.
- assert(boolean): Check assertion at runtime in non-optimized code.
- assert(boolean, T): Check assertion at runtime in non-optimized code (with a specified message).
- assert(list<boolean>): Check assertion at runtime in non-optimized code.
- assert(list<boolean>[N]): Check assertion at runtime in non-optimized code.
- assert(map<T, boolean>): Check assertion at runtime in non-optimized code.
- assert(map<T, boolean>[N]): Check assertion at runtime in non-optimized code.
- assignFrom(T1, T2): Assign matching attributes of a tuple from another one.
- block(float64): Block until shutdown is requested, or the specified amount of time has elapsed, whichever comes first.
- createCustomMetric(rstring, rstring, enum{Gauge, Counter, Time}, int64): Create the specified custom metric for the current operator and set its initial value.
- createCustomMetric(ustring, ustring, enum{Gauge, Counter, Time}, int64): Create the specified custom metric for the current operator and set its initial value.
- dataDirectory(): Return the absolute pathname to the runtime location of the data directory for the SPL application.
- domainID(): Return the domain ID for the domain that the PE is running in.
- evalPredicate(rstring, T, int32): Evaluates an SPL predicate expression, represented as an rstring, using the given tuple.
- flushStdio(): Flush all stdio output streams.
- formatNumber(float64): Format a float using locale specific format.
- formatNumber(float64, uint32, uint32, boolean): Format a float using locale specific format.
- formatNumber(int64): Format an integer using locale specific format.
- formatNumber(int64, uint32): Format an integer using locale specific format.
- getAllChannels(): Get the parallel channel indexes for all nested parallel regions.
- getAllMaxChannels(): Get the maximum number of parallel channels for all nested parallel regions.
- getApplicationConfiguration(map<rstring, rstring>, rstring): Get the application configuration with the given name.
- getApplicationConfigurationProperty(rstring, rstring, int32): Get the value associated with the given configuration property propertyName from the configuration identified by configName.
- getApplicationConfigurationProperty(rstring, rstring, rstring): Get the value associated with the given configuration property propertyName from the configuration identified by configName.
- getApplicationDir(): Return the runtime location of the full path to the SPL application directory.
- getApplicationName(): Return the name of the application that is executing this operator.
- getChannel(): Get the parallel channel index.
- getCompileTimeListValue(rstring): Return the named compiler invocation argument list value (name="value0,value1").
- getCompileTimeValue(rstring): Return a named compiler invocation argument value (name=value).
- getCompileTimeValue(rstring, rstring): Return a named compiler invocation argument value (name=value).
- getConfiguredHostName(): Get the hostname used by the streams instance for this host.
- getConsistentRegionIndex(): Gets the index of the consistent region.
- getCustomMetricNames(): Return the names of the custom metrics for the current operator.
- getCustomMetricValue(rstring, int64): Get the specified custom metric value for the current operator.
- getCustomMetricValue(ustring, int64): Get the specified custom metric value for the current operator.
- getDrainTimeout(): Gets the drain timeout of a consistent region.
- getEnvironmentVariable(rstring): Get the value of an environment variable.
- getEnvironmentVariable(rstring, boolean): Get the value of an environment variable.
- getEnvironmentVariable(rstring, rstring): Get the value of an environment variable.
- getExceptionPortExportProperties(list<tuple<rstring name, rstring value, rstring typ>>, uint32): Get the export properties for an output port that produces a stream that is exported with properties.
- getExceptionPortMetricValue(uint32, enum{nTuplesSubmitted, nWindowPunctsSubmitted, nFinalPunctsSubmitted}, int64): Get the specified exception port metric value for the current operator.
- getHostName(): Get the host name.
- getIPAddress(): Get the IP address for the current host.
- getInputPortImportFilterExpression(uint32, int32): Get the filter expression for an input port that receives a stream that is imported.
- getInputPortImportSubscription(uint32, int32): Get the import subscription for an input port that receives a stream that is imported by subscription.
- getInputPortMetricValue(uint32, enum{nTuplesProcessed, nTuplesDropped, nTuplesQueued, nWindowPunctsProcessed, nFinalPunctsProcessed, nWindowPunctsQueued, nFinalPunctsQueued, queueSize, maxItemsQueued, recentMaxItemsQueued, recentMaxItemsQueuedInterval, nEnqueueWaits}, int64): Get the specified input port metric value for the current operator.
- getJobGroup(): Return the name of the job group for the current job that this operator is executing in.
- getJobName(): Return the name of the current job that this operator is executing in.
- getLocalChannel(): Get the parallel channel index.
- getLocalMaxChannels(): Get the maximum number of parallel channels.
- getMainCompositeName(): Return the name of the main composite.
- getMaxChannels(): Get the maximum number of parallel channels.
- getOperatorMetricValue(enum{relativeOperatorCost}, int64): Get the specified system metric value for the current operator.
- getOutputPortCongestionFactor(uint32): Return the maximum congestion factor for all the connections from an output port that connect to another PE.
- getOutputPortExportProperties(list<tuple<rstring name, rstring value, rstring typ>>, uint32): Get the export properties for an output port that produces a stream that is exported with properties.
- getOutputPortMetricValue(uint32, enum{nTuplesSubmitted, nWindowPunctsSubmitted, nFinalPunctsSubmitted}, int64): Get the specified output port metric value for the current operator.
- getPEOutputPortConnections(uint32, list<tuple<int64 pe, int64 port, uint8 congestionFactor, uint64 nTuplesFilteredOut>>): Return the connection information for an output port that connects to another PE.
- getRelaunchCount(): Return the number of times the PE that the operator is executing in has been relaunched.
- getResetAttempt(): If the operator is in a consistent region, this function returns the number of attempts made to reset the consistent region to a consistent state.
- getResetTimeout(): Gets the reset timeout of a consistent region.
- getSequenceId(): Gets the current sequence identifier of a consistent region.
- getShortHostName(): Get the short host name.
- getSubmissionTimeListValue(rstring): Return the named submission time list value (name="value0,value1").
- getSubmissionTimeListValue(rstring, list<rstring>): Return the named submission time list value (name="value0,value1").
- getSubmissionTimeValue(rstring): Return the named submission time value (name="value").
- getSubmissionTimeValue(rstring, rstring): Return the named submission time value (name="value").
- getThisCompositeInstanceName(): Return the name of the current composite instance.
- getThisFileDir(): Return the full pathname of the runtime location of the directory containing the current SPL file as an rstring.
- getThisFileName(): Return the current SPL file name as an rstring.
- getThisFilePath(): Return the full pathname of the runtime location of the current SPL file as an rstring.
- getThisLine(): Return the current line number as an int32.
- getThisOperatorLogicalName(): Get the logical name of the operator.
- getThisOperatorName(): Get the physical name of the operator.
- getThisToolkitDir(): Return the full path to the runtime location of the root directory of the toolkit containing the current SPL file.
- hasCustomMetric(rstring): Check if the specified custom metric exists.
- hasCustomMetric(ustring): Check if the specified custom metric exists.
- hashCode(T): Compute the hash of a value.
- hashCodeForEach(L): Compute hashes of a list of values, using the same hashing method as hashCode().
- inputPort(T): Return the index corresponding to an input port.
- instanceID(): Return the Streams instance ID that the PE is running in.
- isConsistentInputPort(uint32): Check if the input port is consistent.
- isControlInputPort(uint32): Check if the input port is a control port.
- isEndOfConsistentRegion(): Check if the operator is an end operator of a consistent region.
- isInConsistentRegion(): Check if the operator is in a consistent region.
- isLoggable(enum{error, warn, info}): Determine whether a message at the given level would be logged.
- isShutdown(): Check if shutdown is requested.
- isStartOfConsistentRegion(): Check if the operator is a start operator of a consistent region.
- isTraceable(enum{error, warn, info, debug, trace}): Determine whether a message at the given level would be traced.
- isTriggerOfConsistentRegion(): Check if the operator is the trigger operator of an operator-driven consistent region.
- jobID(): Return the Job ID for the current job that this operator is executing in.
- loadAndFormatResource(rstring, rstring, rstring): Loads a string from a toolkit resource using the execution locale.
- loadAndFormatResource(rstring, rstring, rstring, T): Loads and formats a string from a toolkit resource using the execution locale.
- loadAndFormatResource(rstring, rstring, rstring, T, rstring): Loads and formats a string from a toolkit resource using the specified locale.
- loadAndFormatResource(rstring, rstring, rstring, rstring): Loads a string from a toolkit resource using the specified locale.
- log(enum{error, info, debug, trace}, T): Log a message in the tracing system.
- log(enum{error, info, debug, trace}, T, T): Log a message in the tracing system.
- mktemp(rstring): Return the name of a temporary file created using a template.
- outputPort(T): Return the index corresponding to an output port.
- parseNumber(float64, rstring): Parse a string that represents a number, using the current locale.
- parseNumber(float64, ustring): Parse a string that represents a number, using the current locale.
- parseNumber(int64, rstring): Parse a string that represents a base 10 number, using the current locale.
- parseNumber(int64, rstring, int32): Parse a string that represents a number of the specified base, using the current locale.
- parseNumber(int64, ustring): Parse a string that represents a number, using the current locale.
- print(T): Write any SPL type to the standard output stdout as an SPL literal.
- printString(T): Write a string to the standard output, stdout.
- printStringLn(T): Write a string to the standard output, stdout, followed by a newline, then flush the output.
- println(T): Write any SPL type to the standard output, stdout, in serialized form, followed by a newline.
- resetConsistentRegion(): This function requests the ConsistentRegionControllerMXBean to restore the consistent region to the last established consistent state.
- setCustomMetricValue(rstring, int64): Set the specified custom metric value for the current operator.
- setCustomMetricValue(ustring, int64): Set the specified custom metric value for the current operator.
- setExceptionPortExportProperties(T, uint32): Set the export properties for an output port that produces a stream that is exported with properties.
- setExceptionPortExportProperties(list<tuple<rstring name, rstring value, rstring typ>>, uint32): Set the export properties for an output port that produces a stream that is exported with properties.
- setInputPortImportFilterExpression(rstring, uint32): Set the filter expression for an input port that receives a stream that is imported.
- setInputPortImportSubscription(rstring, uint32): Set the import subscription for an input port that receives a stream that is imported by subscription.
- setOutputPortExportProperties(T, uint32): Set the export properties for an output port that produces a stream that is exported with properties.
- setOutputPortExportProperties(list<tuple<rstring name, rstring value, rstring typ>>, uint32): Set the export properties for an output port that produces a stream that is exported with properties.
- shutdownPE(): Shutdown the current processing element (PE).
- strerror(int32): Convert an errno value to a string for intelligent printing.
- strtod(rstring): Convert a string to a floating point number.
- strtod(rstring, int32): Convert a string to a floating point number.
- strtoll(rstring, int32): Convert a string in base 2 to 36 to an signed number.
- strtoll(rstring, int32, int32): Convert a string in base 2 to 36 to an signed number.
- strtoull(rstring, int32): Convert a string in base 2 to 36 to an unsigned number.
- strtoull(rstring, int32, int32): Convert a string in base 2 to 36 to an unsigned number.
- swap(T, T): Swap any two SPL values