...
Table of Contents | ||
---|---|---|
|
pccBeginBucketDataTransaction
Creates a transaction object that can be called when using transaction lock.
Code Block |
---|
any pccBeginBucketDataTransaction() |
Parameters
Parameter | Description |
---|---|
Returns: | A transaction object. |
...
Info | ||
---|---|---|
| ||
will create a transaction object named myTransaction . |
pccBucketDataLookup
Retrieves the BucketDataHolder
object with the stated key from storage.
Code Block |
---|
BucketDataHolder pccBucketDataLookup( string key, any txn ) |
Parameters
Parameter | Description |
---|---|
| The key that uniquely identifies the |
| States the transaction object to be used when using transaction lock. If transaction lock is not used, this parameter should be set to |
Returns: | The |
...
Info | ||
---|---|---|
| ||
will retrieve a |
pccBucketDataLookupMany
Retrieves a number of BucketDataHolder
objects included in the stated list from storage.
Code Block |
---|
map<string, BucketDataHolder> pccBucketDataLookupMany ( list<string> keys, any txn ) |
Parameters
Parameter | Description |
---|---|
| The list of keys that uniquely identify the |
| States the transaction object to be used when using transaction lock. If transaction lock is not used, this parameter should be set to |
Returns: | The |
...
Info | ||
---|---|---|
| ||
will retrieve the |
pccBucketDataStore
Stores the BucketDataHolder
object to storage.
...
Note |
---|
To avoid race conditions during the creation of a new bucket data holder object it is recommended to use a transaction object. If it is not used and there are two parallel requests for object creation, the second request will overwrite the first. |
Parameters
Parameter | Description | |||||
---|---|---|---|---|---|---|
| The key that uniquely identifies the | |||||
| The | |||||
| States the transaction object to be used when using transaction lock. If a transaction without a lock is used, this parameter should be set to | |||||
| An optional parameter that can be set to false to be able to handle any storage errors. In this case the return value has to be checked and the | |||||
expiration | An optional parameter that can be set to an integer value in seconds. This value is the TTL (Time-To-Live) for the BucketDataHolder object passed along with it. This parameter is only supported for Couchbase data store, versions 5.5 and above.
| |||||
Returns: | True if the operation succeeded. This will always be the case unless |
...
Info | ||
---|---|---|
| ||
In the case of using a Couchbase data store, the above function stores the myBucket BucketDataHolder object with 60 seconds TTL and key 777, while adding the BucketDataHolder object into the transaction object myTransaction. In the case of any other data store, the above function stores the myBucket BucketDataHolder object with key 777, while adding the BucketDataHolder object into the transaction object myTransaction. |
pccCommitBucketDataTransaction
Commits the changes that have been made to the BucketDataHolder
objects that are using the stated transaction object.
Code Block |
---|
void pccCommitBucketDataTransaction( any txn ) |
Parameters
Parameter | Description |
---|---|
| The transaction object for which changes should be committed. |
...
Info | ||
---|---|---|
| ||
will commit the changes made to the |
pccRollbackBucketDataTransaction
Removes any changes that have been made to the BucketDataHolder
objects that are using the stated transaction object.
Code Block |
---|
void pccRollbackBucketDataTransaction( any txn ) |
Parameters
Parameter | Description |
---|---|
| The transaction object for which changes should be rolled back. |
...
Info | ||
---|---|---|
| ||
will rollback the changes made to the |
pccBucketDataRemove
Removes a BucketDataHolder
object from storage.
Code Block |
---|
void pccBucketDataRemove( string key, any txn ) |
Parameters
Parameter | Description |
---|---|
| The key that uniquely identifies the |
| The transaction when transaction lock is used. |
...
Info | ||
---|---|---|
| ||
will remove the |
pccCreateBucketDataKeyIterator
Creates an iterator which is used for moving from key to key in the database.
Code Block |
---|
any pccCreateBucketDataKeyIterator( [string startKey [, string stopKey]] ) |
Parameters
Parameter | Description |
---|---|
| Optional parameter for stating which key to start with. This key will also be included. |
| Optional parameter for stating which key to end with. This key will also be included. |
Returns: | The iterator that has been created. |
...
Info | ||
---|---|---|
| ||
will create an iterator named myIterator . |
pccDestroyBucketDataKeyIterator
Removes the stated iterator and returns all the resources that are being used.
Code Block |
---|
void pccDestroyBucketDataKeyIterator( any iterator ) |
Parameters
Parameter | Description |
---|---|
| The iterator you want to remove. |
...
Info | ||
---|---|---|
| ||
will remove the iterator named myIterator . |
pccHasNextBucketDataKey
Asks the iterator if there are more keys to retrieve.
Code Block |
---|
boolean pccHasNextBucketDataKey( any iterator ) |
Parameters
Parameter | Description |
---|---|
| The iterator you want to ask. |
Returns: | Information whether there is more data to retrieve or not. If true is returned, there is more data to be retrieved with the pccGetNextBucketDataKey function. If false is returned, there is no more data and the function pccGetNextBucketDataKey should not be called again. |
...
Info | ||
---|---|---|
| ||
will return the next key from the iterator named myIterator if the iterator has next key. |
pccGetNextBucketDataKey
Retrieves the next key from the iterator.
Code Block |
---|
string pccGetNextBucketDataKey( any iterator ) |
Parameters
Parameter | Description |
---|---|
| The iterator you want to retrieve the key from. |
Returns: | The next key, or null if no more keys are available. |
...
Info | ||
---|---|---|
| ||
will return the next key from the iterator named myIterator . |
pccGetNextBucketDataKeys
Retrieves several keys from the iterator.
Code Block |
---|
list<string> pccGetNextBucketDataKeys( any iterator [, int count] ) |
Parameters
Parameter | Description |
---|---|
| The iterator you want to retrieve the keys from. |
| Optional parameter for controlling the maximum number of keys to retrieve. |
Returns: | A list containing the retrieved keys. |
...