SPL File DpsGetTTLWithReconnect.spl

Content

Operators
  • DpsGetTTLWithReconnect: DpsGetTTLWithReconnect Uses the dpsGetTTL function to read key-value pairs from DPS (of any type).

Composites

composite DpsGetTTLWithReconnect(output Out; input In)

DpsGetTTLWithReconnect Uses the dpsGetTTL function to read key-value pairs from DPS (of any type). The purpose of this composite is to provide extensive error handling, a reconnection policy, and a complete set of informative metrics.

By default, keys and values are not encoded in order to provide maximum ease of access via non-Streams methods. If non-String types are provided for either the key or value, they will automatically be encoded. Use the Base64 encoding options to save space.

Note: The following metrics are only valid once we have established an initial connection to the DPS server. Before that connection, we will throw exceptions (without failure) and the isConnected metric will be valid. All other metrics will be unusable until first-connection is established.

Longterm and Current Metrics:
  • isConnected Maintains a metric of if we think we are connected to Redis or not.
  • totalGets Maintains a metric of the number of total gets done since startup--includes gets where the key was not in the data store.
  • totalKeyDidNotExistReturns Maintains a metric of the number of gets since operator startup that returned a 108 code indicating that the key was not in the store.
  • totalFailedGets Maintains a metric of the number of failed gets since startup--does not include gets where the key did not exist.
  • totalReconnections Maintains a metric of the number of reconnections to the DPS Server since startup.

Interval Metrics:

  • numGets Maintains a metric of the number inserts completed in the last interval of time.
  • numFailedGets Maintains a metric of the number of failed inserts done.
  • numKeyDidNotExistReturns Maintains a metric of the number of gets over the last interval of time that returned a 108 code indicating that the key was not in the store.
  • reconnectionAttptsSinceDisconnect Maintains a metric of the number of reconnection attempts in the last interval of time.

Parameters

  • keyEncoded: (default: false) Whether or not to encode the key in base64. False is only valid if the key is rstring/ustring, otherwise it automatically defaults to true.
  • valueEncoded: (default: false) Whether or not to encode the value in base64. False is only valid if the value is rstring/ustring, otherwise it automatically defaults to true.
  • reconnectionAttempts: (default: 1) Number of reconnection attempts per incoming tuple. Use -1 for unlimited, i.e. don't ever drop tuple, keep trying to reconnect. If set to 0, we will never reconnect upon connection loss.
  • reconnectionInterval: (default: 5s) Number of seconds to wait between each reconnection attempt.
  • outputType: (default: rstring value) Output stream requires an attribute called "value" matching the type of the value being retrieved from the DPS server.
  • metricsIntervalLength: (default: 15 * 60s) Time in seconds of the sliding window that the interval metrics are maintained over.
  • metricsUpdateRate: (default: 15.0s) Time in seconds between update of interval metrics.
  • configFile: (default: etc/no-sql-kv-store-servers.cfg) the name of the configuration file used for DPS
  • keyAttribute: the name of an input stream attribute containing the key for the get operation. The attribute can be of any type. This operator forwards punctuation.

Input Ports

  • In: Stream specifying get for DPS. An attribute designated by the keyAttribute parameter must exist.

Output Ports

  • Out: Stream - Attribute "value" of the type being retrieved from DPS is required. Stream contains attributes that match input attributes plus the value attribute.