Streams DPS Toolkit > com.ibm.streamsx.dps 4.1.8 > com.ibm.streamsx.store.distributed > C++ Native Functions
Base64 decode a given string.
the string to decode
mutable parameter that will contain the decoded result.
rstring base64EncodedString = "bXlEQlN0b3JlMQ=="; mutable rstring base64DecodedString = ""; // base64DecodedString will have a value o:f "myDBStore1" dpsBase64Decode(rowKey, base64DecodedString);
Base64 encode a given string.
the string to encode
mutable parameter that will contain the encoded result.
mutable list<rstring>[5] cn = []; dpsBase64Encode("cf1:Company", cn[0]); dpsBase64Encode("IBM", cn[1]); dpsBase64Encode("Microsoft", cn[2]); dpsBase64Encode("Amazon", cn[3]); dpsBase64Encode("Google", cn[4]); //the cn array will now contain the decoded values
This function gets a store iterator that can be used to iterate over all the key-value pairs in a given store id. No other operations that can modify the state can be used until after dpsEndIteration() is called for this same store. Once a store iterator is obtained, it must be released by calling dpsEndIteration() once the iterator is no longer needed. See the documentation for dpsGetNext() for a complete example of how to use the iterator.
handle of the store for which an iterator is needed.
Contains the error code describing the result of the function call. Will be '0' if no error occurred, otherwise will have a non-zero value.
an value representing an iterator that can be used with the two other store iteration functions, dpsGetNext() and dpsEndIteration().
Clear the given store.
the handle of the store to clear
Contains the error code describing the result of the operation. Will be '0' if the store was successfully emptied, otherwise will have a non-zero value.
Create a new process store with a given name or simply return its handle it already exists.
the name of the store to retrieve, or to create if it doesn't already exist.
this variable should be provided to indicate the type of the key to use in the store.
this variable indicates the type of the values in the store.
mutable variable provided that will contain the error code, if an error occurs. Will be set to '0' if the store was created successfully, or a non-zero value otherwise.
the process store handle of the created store. If an error occurs, the return value of this function is undefined. It is recommended that the store id is cached in your application.
mutable uint64 err = 0ul; mutable uint64 s = 0ul; rstring dummyRstring = ""; uint32 dummyUint32 = 0u; s = dpsCreateOrGetStore("myDBStore1", dummyRstring, dummyUint32, err); if (err != 0ul) { uint64 rc = dpsGetLastStoreErrorCode; rstring msg = dpsGetLastStoreErrorString(); printStringLn("Unexpected error in creating a store named myDBStore1: rc = " + (rstring)rc + ", msg = " + msg); }
Create a new process store with a given name.
the name of the store to create
this variable should be provided to indicate the type of the key to use in the store.
this variable indicates the type of the values in the store.
mutable variable provided that will contain the error code, if an error occurs. Will be set to '0' if the store was created successfully, or a non-zero value otherwise.
the process store handle, if created. It is advisable to cache the store id in your application. The return value will be '0' if a process store with the same name already exists, and undefined if there is an error.
mutable uint64 err = 0ul; mutable uint64 s = 0ul; rstring dummyRstring = ""; uint32 dummyUint32 = 0u; s = dpsCreateStore("myDBStore1", dummyRstring, dummyUint32, err); if (err != 0ul) { uint64 rc = dpsGetLastStoreErrorCode; rstring msg = dpsGetLastStoreErrorString(); printStringLn("Unexpected error in creating a store named myDBStore1: rc = " + (rstring)rc + ", msg = " + msg); }
This function deserializes a given blob containing one or more serialized key-value pairs. The specified store will be populated with the deserialized data. This technique can be used to copy the contents of one store into another.
the handle of the store into which the deserialized data will be saved.
the data to deserialize and save into the specified store.
variable indicating the type of the keys in the store
variable indicating the type of the values in the store
a mutable variable that will contain the error code describing the result of the deserialization. Will be '0' if deserialization was successful, and a non-zero value otherwise.
mutable uint64 err = 0ul; rstring dummyRstring = ""; list<rstring> dummyRstringList = ["1", "2"]; mutable blob sData = []; dpsSerialize(s1, sData, dummyRstring, dummyRstringList, err); if (err == 0ul) { //now deserialize it into another store. dpsDeserialize(store2, sData, dummyRstring, dummyRstringList, err); if (err != 0ul) { //perform error handling using dpsGetLastStoreErrorCode() and dpsGetLastStoreErrorString() }
This function must be called once all iteration is complete.
the handle of the store.
the store iterator id obtained from dpsBeginIteration().
Contains the error code. Will be '0' if no error occurs, and a non-zero value otherwise.
Find a process store given its name.
The name of the store to look up.
This parameter will be set by the function to contain the error code if an error occurs finding the store, and '0' otherwise.
The process store handle if found, 0 otherwise.
Given a key, retrieves its value from the given store. This function has better performance than dpsGetSafe since it doesn't carry out any safety checks.
the handle identifying the store in question.
the key of the item to look up
if the key exists in the store and has a value of the same type, this parameter will be set to the key's value.
contains the non-zero error code, if an error occurs, or will have a value of '0'.
true if the if the operation was successful and the store contains an item with the given key and a matching type, and false if the key-value pair wasn't found.
Get details of the client machine where this operator is running. The machine name, Linux OS version and the CPU architecture (x86 or PPC) will be assigned to the corresponding parameters
the value of this parameter will be set to the machine's name.
the value of this parameter will be set to the Linux OS version.
the value of this parameter will be set to the CPU architecture of the client.
rstring dbProductName = dpsGetNoSqlDbProductName(); // Get the details about the machine where this operator is running. mutable rstring machineName = "", osVersion = "", cpuArchitecture = ""; dpsGetDetailsAboutThisMachine(machineName, osVersion, cpuArchitecture); // Display the NoSQL DB product name being used printStringLn("====================================================="); printStringLn("Details about this DPS client machine:"); printStringLn("NoSQL key-value store product name: " + dbProductName); printStringLn("Machine name: " + machineName); printStringLn("OS version: " + osVersion); printStringLn("CPU architecture: " + cpuArchitecture); printStringLn("=====================================================");
This function can be called to get i.e. read/fetch multiple Key/Value (KV) pairs present in a given store.
The handle of the store.
User provided mutable list variable in which the keys found in the store will be returned. This list must be suitable for storing multiple keys found in a given store and it must be made of a given store's key data type.
User provided mutabe list variable in which the fetched values will be returned. This list must be suitable for storing multiple values obtained from a given store and it must be made of a given store's value data type. Fetched values will be available in this list at the same index where the corresponding key appears in the keys list.
User can indicate a zero index based start position from where the K/V pairs should be fetched and returned. It must be greater than or equal to zero. If not, this API will return back with an empty list of keys.
User can indicate the total number of K/V pairs to be returned as available from the given key start position. It must be greater than or equal to 0 and less than or equal to 50000. If it is set to 0, then all the available K/V pairs upto a maximum of 50000 pairs from the given key start position will be returned.
User provided mutable uint64 typed variable in which the result of this bulk get KV pairs operation will be returned. It will be 0 if no error occurs and a non-zero error code otherwise.
This function can be called to get i.e. read/fetch multiple keys present in a given store.
The handle of the store.
User provided mutable list variable. This list must be suitable for storing multiple keys found in a given store and it must be made of a given store's key data type.
User can indicate a zero index based start position from where keys should be fetched and returned. It must be greater than or equal to zero. If not, this API will return back with an empty list of keys.
User can indicate the total number of keys to be returned as available from the given key start position. It must be greater than or equal to 0 and less than or equal to 50000. If it is set to 0, then all the available keys upto a maximum of 50000 keys from the given key start position will be returned.
User can provide an expression made of the attributes from the key's data type. This expression will be evaluated in determining which matching keys to be returned. Due to very high logic complexity, this feature is not implemented at this time.
User can provide an expression made of the attributes from the value's data type. This expression will be evaluated in determining which matching keys to be returned. Due to very high logic complexity, this feature is not implemented at this time.
User provided mutable uint64 typed variable in which the result of this bulk get keys operation will be returned. It will be 0 if no error occurs and a non-zero error code otherwise.
Get the error code of the last error occurred involving data that was stored with a Time To Live (TTL).
the error code, or '0' if the last TTL store operation was successful.
Get the description of the last error that occurred involving data stored with a Time To Live (TTL).
the error message, or the empty string if the last TTL store operation was successful.
Get the error code of the last store error.
the error code for the last store operation or '0' if the last operation was successful.
Get the description of the last store error.
the error message, or the empty string if the last data store operation was successful.
This function is used to get the next key and value of given types in the given store when iterating over all the items in the store. The key and value parameters must be of the same type that was used when the store was originally created using either dpsCreateStore() or dpsCreateOrGetStore().
the store being iterated over
the iterator handle, must have been created from a previous call to dpsBeginIteration()
a mutable variable to store the key for the current key-value pair in the iteration sequence
a mutable variable to store the value for the current key-value pair
Contains the error code. Will be '0' if no error occurs, and a non-zero value otherwise.
true if the next key-value pair was successfully returned, or if store is empty, and false if the end of the iteration was reached. If this method returns false because the store is empty or the end of the iteration was reached, the err parameter will have a value of '0'. If an error occurs, the function will return false and the err parameter will have a non-zero value.
mutable uint64 err = 0ul; uint64 it = dpsBeginIteration(s, err); mutable rstring key = ""; mutable rstring value = ""; while (dpsGetNext(s, it, key, value, err)) { printStringLn("'" + key + "' => " + value); } if (err != 0){ //an error occurred during iteration } dpsEndIteration(s, it, err);
Get the name of the NoSQL database product being used.
Given a key, retrieve its value from the given store. Returns true if the store did contain an item with the given key and a matching type, false otherwise. This function is identical to dpsGet, with the exception that it does safety checks and is therefore slower.
Get the SPL type name for the key of a given store id.
the handle for the store in question.
the type for the keys in the store.
Get the SPL type name for the value of a given store id.
the handle for the store in question
the type for the values in the store
Get the store name for a given store id.
the store to look up
the name used to create the store, if it exists.
Get an item that was stored with a TTL (Time To Live in seconds) value.
the key to look up
will receive the saved value for the given key.
will receive the error code if an error occurs, or will be set to '0' otherwise.
true if the global TTL store did contain an item with the given key and a matching type, false otherwise or if an error occurs.
mutable rstring myKey = "", myValue = ""; myKey = "New York"; myValue = ""; mutable uint64 err = 0ul; boolean res = dpsGetTTL(myKey, myValue, err); if (res == true) { printStringLn("TTL based key-value pair is read successfully. Key=" + myKey + ", Value=" + myValue); } else { //handle error using dpsGetLastErrorCodeTTL() and dpsGetLastErrorStringTTL()) }
Get an item that was stored with a TTL (Time To Live in seconds) value.
the key to look up (In this API, you can specify whether the key is base64 encoded or not.)
will receive the saved value for the given key.
will receive the error code if an error occurs, or will be set to '0' otherwise.
set to true if the key shall be base64 encoded, set to false otherwise.
set to true if the value shall be base64 encoded, set to false otherwise.
true if the global TTL store did contain an item with the given key and a matching type, false otherwise or if an error occurs.
mutable rstring myKey = "", myValue = ""; myKey = "New York"; myValue = ""; mutable uint64 err = 0ul; // In this overloaded API, the final parameter can be used to specify whether the // key was originally base64 encoded or not. boolean res = dpsGetTTL(myKey, myValue, err, true); if (res == true) { printStringLn("TTL based key-value pair is read successfully. Key=" + myKey + ", Value=" + myValue); } else { //handle error using dpsGetLastErrorCodeTTL() and dpsGetLastErrorStringTTL()) }
This function can be called to get i.e. read/fetch values for a given list of multiple keys present in a given store.
The handle of the store.
User provided list variable that contains keys for which values need to be fetched. It must be made of a given store's key data type.
User provided mutable list variable in which true or false status for every user given key will be returned. This is done to indicate to the user about if that key exists or not in the given store. This list must be made of a boolean data type. Status returned in this list can be used in combination with the items returned in the values list which is explained next.
User provided mutabe list variable in which the fetched values will be returned. This list must be suitable for storing multiple values obtained from a given store and it must be made of a given store's value data type. Fetched values will be available in this list at the same index where the key appeared in the user provided keys list. If a user given key is not present in the store, there will still be a default value returned in that key's index. It is better to first confirm in the keyExistsOrNot list that will carry true or false status about the existence of all the user provided keys. Depending on the key existence status found in that other list, user can decide to either consider using or ignore a value in a given index of the values list.
User provided mutable uint64 typed variable in which the result of this bulk get values operation will be returned. It will be 0 if no error occurs and a non-zero error code otherwise.
Check if an item exists in the given store.
the store handle representing the store to check.
the key to look up.
contains the error code for this function call. Will be '0' if no error occurs, otherwise will have a non-zero value.
true if the given store does contain an item with the given key, false otherwise.
This function can be called to check for the existence of a given list of keys in a given store.
The handle of the store.
User provided list variable that contains the keys to be checked for their existence in the given store. This list must be made of a given store's key data type.
User provided mutable list variable in which the key existence check true or false results will be returned. This list must be made of a boolean data type.
User provided mutable uint64 typed variable in which the result of this bulk has keys operation will be returned. It will be 0 if no error occurs and a non-zero error code otherwise.
Check if an item exists that was stored with a TTL (Time To Live in seconds) value.
the key to look up. Can be any SPL type.
mutable parameter that receives the error code for this function call. If the error code is non-zero, an error has occurred.
true if a TTL item with the given key exists, false if no such item exists or if an error occurs.
mutable rstring myKey = ""; myKey = "New York"; mutable uint64 err = 0ul; boolean res = dpsHasTTL(myKey, err); if (res == true) { printStringLn("Unexpected error: TTL based key-value pair 'New York':'Albany' is still present after the TTL expiration."); } else if (err == 0ul) { //no error occurred and the element was not found printStringLn("key-value pair 'New York':'Albany' was not found, this may be because it was removed after its TTL expiration."); }
Check if an item exists that was stored with a TTL (Time To Live in seconds) value.
the key to look up. Can be any SPL type. (In this API, you can specify whether the key is base64 encoded or not.)
mutable parameter that receives the error code for this function call. If the error code is non-zero, an error has occurred.
set to true if the key shall be base64 encoded, set to false otherwise.
true if a TTL item with the given key exists, false if no such item exists or if an error occurs.
mutable rstring myKey = ""; myKey = "New York"; mutable uint64 err = 0ul; // In this overloaded API, the final argument is used to specify whether the key is base64 encoded or not. boolean res = dpsHasTTL(myKey, err, true); if (res == true) { printStringLn("Unexpected error: TTL based key-value pair 'New York':'Albany' is still present after the TTL expiration."); } else if (err == 0ul) { //no error occurred and the element was not found printStringLn("key-value pair 'New York':'Albany' was not found, this may be because it was removed after its TTL expiration."); }
It allows to check the connection status of the back-end data store.
true if the connection is established, false otherwise.
Persist any operations involving stores used in this application to disk.
contains the error code for this function call. Will be '0' if no error occurs and if all write operations received before this function was called have been committed to storage. It also returns '0' if the database does not support this operation. It will be non-zero if an error occurs.
Put a new key-value pair into a store. This function has better performance than dpsPutSafe since no safety checks are done to ensure that there is a valid user created store present. Hence, use the dpsPut() function only when there is a user created store present in the back-end DB infrastructure. If this rule is violated, the back-end infrastructure will have inconsistent data items. The specified key and item must be of the same type as those used to create the store in dpsCreateStore or dpsCreateOrGetStore, otherwise, store operations will produce undesired results.
The handle specifying the store.
The key for the new pair.
The value for the new pair. Must be the same type as the value that was provided when the store was created.
Will be set to '0' on success, and will be non-zero otherwise.
If no error occurs, returns true, and false otherwise.
rstring dummyRstring = ""; uint32 dummyUint32 = 0u; mutable uint64 err = 0ul; mutable uint64 dbStore_handle = 0ul; dbStore_handle = dpsCreateStore("myDBStore1", dummyRstring, dummyUint32, err); //..perform error checks mutable uint64 err = 0ul; mutable boolean result = true; rstring key = "IBM"; uint32 value = 399; err = 0ul; result = dpsPut(dbStore_handle, key, value, err); if (err != 0ul) { //use dpsGetLastStoreErrorCode() and dpsGetLastStoreErrorString() as needed }
This function can be called to put i.e. write/save multiple Key/Value (KV) pairs to a given store. Note: You must make sure that the intended store exists before you use this function. If not, you will end up creating bulk K/V pairs in an unmanageable fashion in the backend data store which will make it less useful.
The handle of the store.
User provided list variable that contains the keys to be written i.e. saved. This list must be made of a given store's key data type.
User provided list variable that contains the values to be written i.e. saved. This list must be made of a given store's value data type. A KV pair is formed with a key and a value taken from the same index position of the keys and values lists. If the keys and values lists are not of the same size, this function will simply return back without doing any bulk put operation.
User provided mutable uint64 typed variable in which the result of this bulk put operation will be returned. It will be 0 if no error occurs and a non-zero error code otherwise.
Put an item into the given store. This function is identical to dpsPut, however, it performs additional safety checks. As a result, this function will be slower than dpsPut.
The handle specifying the store.
The key for the new pair.
The value for the new pair. Must be the same type as the value that was provided when the store was created.
Will be set to '0' on success, and will be non-zero otherwise.
If no error occurs, returns true, and false otherwise.
Put an key-value pair with in a TTL (Time To Live in seconds) value into the global area of the back-end data store. The key and value can be any SPL type.
the key with which to associate the given value
the value to associate with the key
the amount of time, in seconds, this pair will be kept in the global store before it is automatically removed. A value of '0' means that this pair will be in the store indefinitely until manually removed via dpsRemoveTTL.
will be set to '0' if the operation was successful, and a non-zero value otherwise.
true if the operation is successful, false otherwise.
mutable rstring myKey = "", myValue = ""; myKey = "New York"; myValue = "Albany"; mutable uint64 err = 0ul; // Put a key-value pair with 5 seconds of TTL. boolean res = dpsPutTTL(myKey, myValue, 5u, err); if (res == false) { //handle error using dpsGetLastErrorCodeTTL() and dpsGetLastErrorStringTTL()); }
Put a key-value pair with in a TTL (Time To Live in seconds) value into the global area of the back-end data store. The key and value can be any SPL type.
the key with which to associate the given value (In this API, key can be configured to be base64 encoded or not.)
the value to associate with the key
the amount of time, in seconds, this pair will be kept in the global store before it is automatically removed. A value of '0' means that this pair will be in the store indefinitely until manually removed via dpsRemoveTTL.
will be set to '0' if the operation was successful, and a non-zero value otherwise.
set to true if the key shall be base64 encoded, set to false otherwise
set to true if the value shall be base64 encoded, set to false otherwise
true if the operation is successful, false otherwise.
mutable rstring myKey = "", myValue = ""; myKey = "New York"; myValue = "Albany"; mutable uint64 err = 0ul; // Put a key-value pair with 5 seconds of TTL. // In this overloaded API, 5th and 6th arguments let you configure the key to be base64 encoded or not as well as // the value to be serialized or not before storing it in the back-end data store.) boolean res = dpsPutTTL(myKey, myValue, 5u, err, false, false); if (res == false) { //handle error using dpsGetLastErrorCodeTTL() and dpsGetLastErrorStringTTL()); }
Put a key-value pair with in a TTL (Time To Live in seconds) value into the global area of the back-end data store. The key and value can be any SPL type.
the key with which to associate the given value (In this API, key can be configured to be base64 encoded or not.)
the value to associate with the key
the amount of time, in seconds, this pair will be kept in the global store before it is automatically removed. A value of '0' means that this pair will be in the store indefinitely until manually removed via dpsRemoveTTL.
will be set to '0' if the operation was successful, and a non-zero value otherwise.
Will be set to the actual storage size occupied by the given key in the back-end data store.
Will be set to the actual storage size occupied by the given value in the back-end data store.
set to true if the key shall be base64 encoded, set to false otherwise
set to true if the value shall be base64 encoded, set to false otherwise
true if the operation is successful, false otherwise.
mutable rstring myKey = "", myValue = ""; myKey = "New York"; myValue = "Albany"; mutable uint64 err = 0ul; mutable uint32 storedKeySize = 0u; mutable uint32 storedValueSize = 0u; // Put a key-value pair with 5 seconds of TTL. // In this overloaded API, 7th and 8th arguments let you configure the key to be base64 encoded or not as well as // the value to be serialized or not before storing it in the back-end data store.) // When this API returns successfully, 5th and 6th arguments will have storage size for the key and the value. boolean res = dpsPutTTL(myKey, myValue, 5u, err, storedKeySize, storedValueSize, false, false); if (res == false) { //handle error using dpsGetLastErrorCodeTTL() and dpsGetLastErrorStringTTL()); }
It allows to reconnect to the back-end data store. A simple example that waits 5 seconds and tries to reconnect is given below.
true if the connection could be re-established, false otherwise.
// invoke a DPS function mutable uint64 err = 0ul; dpsPut(storeHandle, myKey, myValue, err); // check for connection problems, DPS_CONNECTION_ERROR = 102, DL_CONNECTION_ERROR = 501 if(err == 102ul || err == 501ul) { // wait 5 seconds block(5.0); // retry to connect if (dpsReconnect() == false) { // if that was not successful, give up abort(); } }
Remove an item from the given store.
handle of the store from which the key will be removed
the key to remove. Can be a valid SPL type.
contains the non-zero error code, if an error occurs, or will have a value of '0'.
true if the store did contain an item with the given key, false otherwise.
mutable uint64 err = 0ul; mutable boolean result = true; rstring key = "IBM"; result = dpsRemove(store_id, key, err); if (res==true && err==0ul) { // remove has succeeded } else { //handle error using dpsGetLastStoreErrorCode() and dpsGetLastStoreErrorString() }
This function can be called to remove a given list of keys from a given store.
The handle of the store.
User provided list variable that contains the keys to be removed from the given store. This list must be made of a given store's key data type.
User provided mutable int32 variable in which the total number of keys removed from the store will be returned.
User provided mutable uint64 typed variable in which the result of this bulk remove keys operation will be returned. It will be 0 if no error occurs and a non-zero error code otherwise.
Remove a process store given its handle.
The process store handle identifying the store to remove.
This parameter will contain the error code, if an error occurs. Or will be set '0' if the remove operation was successful.
true if the store existed and was successfully removed.
mutable boolean result = true; result = dpsRemoveStore(dbStore_handle, err); if (err != 0ul) { uint64 rc = dpsGetLastStoreErrorCode(); printStringLn("Unexpected error in removing a store: rc = " + (rstring)rc + ", msg = " + dpsGetLastStoreErrorString()); }
Remove an item that was stored with a TTL (Time To Live in seconds) value.
the key to remove.
will receive the error code if an error occurs or will be set to '0' if the remove was successful.
true if an item with the given key was removed, false otherwise.
Remove an item that was stored with a TTL (Time To Live in seconds) value.
the key to remove. (In this API, you can specify whether the key is base64 encoded or not.)
will receive the error code if an error occurs or will be set to '0' if the remove was successful.
set to true if the key shall be base64 encoded, set to false otherwise.
true if an item with the given key was removed, false otherwise.
This is a Redis specific API using which any aribitrary Redis command can be executed by providing the different parts of that Redis command inside a list of strings. This API is vastly better than the other native data store run API shown above. It allows the keys and values to have spaces and quotes. It allows two way command execution by returning the result of the Redis command execution. This suits well for the string based key and values where the user wants to format their own valid Redis command.
This function can be used to execute simple arbitrary back-end data store (fire and forget) native commands. This includes any native commands that don't have to fetch and return key-value pairs or return size of the database, like Insert and Delete. However, key and value can only have string types.
the command to execute.
a mutable variable that will contain the error code in case an error occurs executing the command. Will be '0' on success and non-zero otherwise.
true if the one way command was successful, and false otherwise.
// Insert a key-value pair by using the popular Redis set command. cmd = "set foo bar"; err = 0ul; res = dpsRunDataStoreCommand(cmd, err); if (res == true) { printStringLn("Running a Redis native command 'set foo bar' worked correctly."); } else { uint64 rc = dpsGetLastStoreErrorCode(); rstring msg = dpsGetLastStoreErrorString(); printStringLn("Error in running a Redis native command 'set foo bar'. Error code=" + (rstring)rc + ", msg = " + msg); }
This is an advanced function that can be used to execute arbitrary back-end data store two way native commands for database technologies that work with cURL. A HTTP request is sent to the server and the response is saved in the jsonResponse parameter. This function is not supported with Redis. Therefore, this function can only be used with database technologies that are currently not officially supported by Streams, such as HBase. See the samples for this toolkit for a detailed example.
This function serializes all the key-value pairs in a given store id into a blob. The blob can be used to recreate all the key-value pairs into another store. This is a useful technique for copying an entire store into a different store. See dpsDeserialize() for a detailed example on how to use the serialization functions to copy a store.
the handle of the store to serialize.
a mutable blob that will contain all the key-value pairs in the store once the serialization is complete.
a dummy variable to indicate the type of the key
a mutable variable that will contain the error code describing the result of the serialization. Will be '0' if no error occurs, and a non-zero value otherwise.
Allows for setting a path to the configuration file. Relative paths are relative to the toolkit root directory. If not set, then 'etc/no-sql-kv-store-servers.cfg' file will be used. If a file with the given name is not found, the DPS toolkit tries to read the configuration from a Streams application configuration object with the given name. In order to use the Streams application configuration, the user must call the dpsSetConfigFile method to specify the Streams app config name. In the Streams application configuration, the user has to specify every configuration line as an individual property. The names of the properties are as shown below. Following is an example of how a DPS application configuration named dps-cfg-for-app1 would be created using the streamtool:
streamtool mkappconfig --property dps.nosql.db=redis dps-cfg-for-app1 streamtool chappconfig --property dps.server1=MyMachine1:6379:MyPassword dps-cfg-for-app1 streamtool chappconfig --property dps.server2=MyMachine2:6379:MyPassword dps-cfg-for-app1 streamtool chappconfig --property dps.server3=MyMachine3:6379:MyPassword dps-cfg-for-app1 streamtool chappconfig --property dps.server4=MyMachine4:6379:MyPassword dps-cfg-for-app1
the path to the configuration file or the name of an application configuration that should be used
returns always true
Get the total number of key-value pairs in the given store.
the handle of the store in question.
contains the error code for this function call. Will be '0' if no error occurs, otherwise will have a non-zero value.
the size of the store. The return value of this function is undefined if an error occurs.
The purpose of this is to allow the DPS connection to be attempted during operator initialization, and not prevent startup from completing on failure. Return true if we successfully established a connection or false if not.