Cutelyst  2.5.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Cutelyst::Memcached Class Reference

Cutelyst Memcached plugin. More...

#include <memcached.h>

Inheritance diagram for Cutelyst::Memcached:
Inheritance graph
[legend]

Public Types

enum  MemcachedReturnType {
  Success, Failure, HostLookupFailure, ConnectionFailure,
  WriteFailure, ReadFailure, UnknownReadFailure, ProtocolError,
  ClientError, ServerError, Error, DataExists,
  DataDoesNotExist, NotStored, Stored, NotFound,
  MemoryAllocationFailure, PartialRead, SomeErrors, NoServers,
  End, Deleted, Stat, Errno,
  NotSupported, FetchNotFinished, Timeout, Buffered,
  BadKeyProvided, InvalidHostProtocol, ServerMarkedDead, UnknownStatKey,
  E2Big, InvalidArguments, KeyTooBig, AuthProblem,
  AuthFailure, AuthContinue, ParseError, ParseUserError,
  Deprecated, InProgress, ServerTemporaryDisabled, ServerMemoryAllocationFailure,
  MaximumReturn, PluginNotRegisterd
}
 

Public Member Functions

 Memcached (Application *parent)
 
virtual ~Memcached ()
 
void setDefaultConfig (const QVariantMap &defaultConfig)
 
- Public Member Functions inherited from Cutelyst::Plugin
 Plugin (Application *parent)
 

Static Public Member Functions

static bool add (const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static bool add (const QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
static bool addByKey (const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static bool addByKey (const QString &groupKey, const QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
static bool cas (const QString &key, const QByteArray &value, time_t expiration, uint64_t cas, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static bool cas (const QString &key, const T &value, time_t expiration, uint64_t cas, MemcachedReturnType *returnType=nullptr)
 
static bool casByKey (const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, uint64_t cas, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static bool casByKey (const QString &groupKey, const QString &key, const T &value, time_t expiration, uint64_t cas, MemcachedReturnType *returnType=nullptr)
 
static bool decrement (const QString &key, uint32_t offset, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
 
static bool decrementByKey (const QString &groupKey, const QString &key, uint64_t offset, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
 
static bool decrementWithInitial (const QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
 
static bool decrementWithInitialByKey (const QString &groupKey, const QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
 
static QString errorString (Context *c, MemcachedReturnType rt)
 
static bool exist (const QString &key, MemcachedReturnType *returnType=nullptr)
 
static bool existByKey (const QString &groupKey, const QString &key, MemcachedReturnType *returnType=nullptr)
 
static bool flush (time_t expiration, MemcachedReturnType *returnType=nullptr)
 
static bool flushBuffers (MemcachedReturnType *returnType=nullptr)
 
static QByteArray get (const QString &key, uint64_t *cas=nullptr, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static T get (const QString &key, uint64_t *cas=nullptr, MemcachedReturnType *returnType=nullptr)
 
static QByteArray getByKey (const QString &groupKey, const QString &key, uint64_t *cas=nullptr, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static T getByKey (const QString &groupKey, const QString &key, uint64_t *cas=nullptr, MemcachedReturnType *returnType=nullptr)
 
static bool increment (const QString &key, uint32_t offset, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
 
static bool incrementByKey (const QString &groupKey, const QString &key, uint64_t offset, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
 
static bool incrementWithInitial (const QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
 
static bool incrementWithInitialByKey (const QString &groupKey, const QString &key, uint64_t offset, uint64_t initial, time_t expiration, uint64_t *value=nullptr, MemcachedReturnType *returnType=nullptr)
 
static QHash< QString, QByteArray > mget (const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static QHash< QString, T > mget (const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
 
static QHash< QString, QByteArray > mgetByKey (const QString &groupKey, const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static QHash< QString, T > mgetByKey (const QString &groupKey, const QStringList &keys, QHash< QString, uint64_t > *casValues=nullptr, MemcachedReturnType *returnType=nullptr)
 
static bool remove (const QString &key, MemcachedReturnType *returnType=nullptr)
 
static bool removeByKey (const QString &groupKey, const QString &key, MemcachedReturnType *returnType=nullptr)
 
static bool replace (const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static bool replace (const QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
static bool replaceByKey (const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static bool replaceByKey (const QString &groupKey, const QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
static bool set (const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static bool set (const QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
static bool setByKey (const QString &groupKey, const QString &key, const QByteArray &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
template<typename T >
static bool setByKey (const QString &groupKey, const QString &key, const T &value, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
static bool touch (const QString &key, time_t expiration, MemcachedReturnType *returnType=nullptr)
 
static bool touchByKey (const QString &groupKey, const QString &key, time_t expiration, MemcachedReturnType *returnType=nullptr)
 

Static Public Attributes

static const time_t expirationNotAdd
 

Protected Member Functions

virtual bool setup (Application *app) override
 

Detailed Description

The Memcached plugin for Cutelyst can be used to store, retrieve, delete and modify data on a memcached general-purpose distributed memory caching system. It uses libmemcached to connect to a pool of memcached servers and to perform the caching operations. In order to build this plugin, the libmemcached development and header files have to be present at build time.

Basically all values are stored as QByteArray. So, to store simple types, simply convert them into a QByteArray and vice versa on retrieval. For more complex or custom types you can use QDataStream to serialize them into a QByteArray. For most methods in this plugin there are template functions for convenience that perform this serialization. The requirement to use them is that the types to store and get provide stream operators for QDataStream.

Configuration

The Memcached plugin can be configured in the cutelyst configuration file in the Cutelyst_Memcached_Plugin section. It uses the same configuration strings as libmemcached but in lowercase and without the dashes in front and for consistence - replaced by _ . So –BINARY-PROTOCOL will be binary_protocol. To add servers and/or sockets use the servers configuration key. Servers can be added with name, port and weight, separated by , - multiple servers are separated by a ; . To add sockets, use a full path as name. If no configuration has been set or if the servers configuration key is empty, a default server at localhost on port 11211 will be used.

Additional to the configuration options of libmemcached there are some plugin specific options:

Note
If you want to use non-ASCII key names you have to enable the binary protocol.

To set default values directly in your application, use setDefaultConfig(). Configuration values that can not be found in the Cutelyst configuration file will be looked up for default values in that QVariantMap.

Configuration example

[Cutelyst_Memcached_Plugin]
servers=cache.example.com,11211,2;/path/to/memcached.sock,1
binary_protocol=true
namespace=foobar

Expiration times

Expiration times are set in seconds. If the value is bigger than 30 days, it is interpreted as a unix timestamp.

Logging and return types

Messages from this plugin are logged to the logging category cutelyst.plugin.memcached. All methods provide the possibility to specify a pointer to a MemcachedReturnType variable that can provide further information about occured errors if methods return false or empty results.

Usage example

#include <Cutelyst/Plugins/Memcached/Memcached>
bool MyCutelystApp::init()
{
// other initialization stuff
// ...
new Memcached(this);
// maybe more initialization stuff
//...
}
void MyController::index(Context *c)
{
QVariantList myData = Memcached::get<QVariantList>(QStringLiteral("myKey"));
if (myData.empty()) {
QSqlQuery q = CPreparedSqlQuery(QStringLiteral("SELECT * FROM myTable"));
if (q.exec()) {
myData = Sql::queryToHashList(q);
if (!myData.empty()) {
Memcached::set(QStringLiteral("myKey"), myData, 900);
}
}
}
// present your data
// ...
}

Build requirements

To build this plugin you need the development and header files for libmemcached and run cmake with -DPLUGIN_MEMCACHED:BOOL=ON.

Unit test

Enabling the build of the Memcached plugin will also enable the unit tests for this plugin. To perform the unit tests, there has to be at least one memcached server running. By default, the test uses a memcached server on localhost and default port 11211. To improve testing and/or to use other and/or multiple servers, you can set the CUTELYST_MEMCACHED_TEST_SERVERS environment variable in your build environment to define different servers. The syntax is the same as for adding servers in the configuration file. If you have for examble two servers, one on default location and another one on a unix socket, use the following for in bash:

export CUTELYST_MEMCACHED_TEST_SERVERS=localhost;/tmp/memcached.sock
Since
Cutelyst 1.11.0

Definition at line 141 of file memcached.h.

Member Enumeration Documentation

◆ MemcachedReturnType

Return types for memcached operations.

Enumerator
Success 

The request was successfully executed.

Failure 

A unknown failure has occurred in the server.

HostLookupFailure 

A DNS failure has occurred.

ConnectionFailure 

A unknown error has occured while trying to connect to a server.

WriteFailure 

An error has occured while trying to write to a server.

ReadFailure 

A read failure has occurred.

UnknownReadFailure 

An unknown read failure only occurs when either there is a bug in the server, or in rare cases where an ethernet nic is reporting dubious information.

ProtocolError 

An unknown error has occurred in the protocol.

ClientError 

An unknown client error has occured internally.

ServerError 

An unknown error has occurred in the server.

Error 

A general error occured.

DataExists 

The data requested with the key given was found.

DataDoesNotExist 

The data requested with the key given was not found.

NotStored 

The request to store an object failed.

Stored 

The requested object has been successfully stored on the server.

NotFound 

The object requested was not found.

MemoryAllocationFailure 

An error has occurred while trying to allocate memory.

PartialRead 

The read was only partially successful.

SomeErrors 

A multi request has been made, and some underterminate number of errors have occurred.

NoServers 

No servers have been added to the memcached_st object.

End 

The server has completed returning all of the objects requested.

Deleted 

The object requested by the key has been deleted.

Stat 

A “stat” command has been returned in the protocol.

Errno 

An error has occurred in the driver which has set errno.

NotSupported 

The given method is not supported in the server.

FetchNotFinished 

A request has been made, but the server has not finished the fetch of the last request.

Timeout 

Operation has timed out.

Buffered 

The request has been buffered.

BadKeyProvided 

The key provided is not a valid key.

InvalidHostProtocol 

The server you are connecting too has an invalid protocol. Most likely you are connecting to an older server that does not speak the binary protocol.

ServerMarkedDead 

The requested server has been marked dead.

UnknownStatKey 

The server you are communicating with has a stat key which has not be defined in the protocol.

E2Big 

Item is too large for the server to store.

InvalidArguments 

The arguments supplied to the given function were not valid.

KeyTooBig 

The key that has been provided is too large for the given server.

AuthProblem 

An unknown issue has occured during authentication.

AuthFailure 

The credentials provided are not valid for this server.

AuthContinue 

Authentication has been paused.

ParseError 

An error has occurred while trying to parse the configuration string. You should use memparse to determine what the error was.

ParseUserError 

An error has occurred in parsing the configuration string.

Deprecated 

The method that was requested has been deprecated.

PluginNotRegisterd 

The Cutelyst Memcached plugin has not been registered to the application.

Definition at line 159 of file memcached.h.

Constructor & Destructor Documentation

◆ Memcached()

Memcached::Memcached ( Application parent)

Constructs a new Memcached object with the given parent.

Definition at line 36 of file memcached.cpp.

◆ ~Memcached()

Memcached::~Memcached ( )
virtual

Deconstructs the Memcached object.

Definition at line 42 of file memcached.cpp.

Member Function Documentation

◆ add() [1/2]

bool Memcached::add ( const QString &  key,
const QByteArray &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Adds the value to the memcached server using key. If the object is found on the server an error occurs and this method returns false, otherwise the value is stored.

As this method returns false if the key has already been set on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of already existing key will not be logged.

Parameters
[in]keykey of object whose value to add
[in]valuevalue of object to add to server
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 325 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by add().

◆ add() [2/2]

template<typename T >
bool Cutelyst::Memcached::add ( const QString &  key,
const T &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Adds the value of type T to the memcached server using key. If the object is found on the server an error occurs and this method returns false, otherwise the value is stored.

Type T has to be serializable into a QByteArray using QDataStream.

As this method returns false if the key has already been set on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of already existing key will not be logged.

Parameters
[in]keykey of object whose value to add
[in]valuevalue of type T of object to add to server
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 984 of file memcached.h.

References add().

◆ addByKey() [1/2]

bool Memcached::addByKey ( const QString &  groupKey,
const QString &  key,
const QByteArray &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Adds the value to the memcached server using key. If the object is found on the server an error occurs and this method returns false, otherwise the value is stored. This method is functionally equivalent to Memcached::add(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.

As this method returns false if the key has already been set on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of already existing key will not be logged.

Parameters
[in]groupKeykey that specifies the server to write to
[in]keykey of object whose value to add
[in]valuevalue of object to add to server
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 364 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by addByKey().

◆ addByKey() [2/2]

template<typename T >
bool Cutelyst::Memcached::addByKey ( const QString &  groupKey,
const QString &  key,
const T &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Adds the value of type T to the memcached server using key. If the object is found on the server an error occurs and this method returns false, otherwise the value is stored. This method is functionally equivalent to Memcached::add(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.

Type T has to be serializable into a QByteArray using QDataStream.

As this method returns false if the key has already been set on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of already existing key will not be logged.

Parameters
[in]groupKeykey that specifies the server to write to
[in]keykey of object whose value to add
[in]valuevalue of object to add to server
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 993 of file memcached.h.

References addByKey().

◆ cas() [1/2]

bool Memcached::cas ( const QString &  key,
const QByteArray &  value,
time_t  expiration,
uint64_t  cas,
MemcachedReturnType returnType = nullptr 
)
static

Overwrites data for key in the server as long as the cas value is still the same in the server. You can get the cas value by using the cas return value of Memcached::get()

Parameters
[in]keykey of object whose value to compare and set
[in]valuevalue of object to write to server
[in]expirationtime in seconds to keep the object stored in the server
[in]casthe cas value to compare
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 960 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by cas(), and casByKey().

◆ cas() [2/2]

template<typename T >
bool Cutelyst::Memcached::cas ( const QString &  key,
const T &  value,
time_t  expiration,
uint64_t  cas,
MemcachedReturnType returnType = nullptr 
)
static

Overwrites data for key in the server as long as the cas value is still the same in the server. You can get the cas value by using the cas return value of Memcached::get()

Type T has to be serializable into a QByteArray using QDataStream.

Parameters
[in]keykey of object whose value to compare and set
[in]valuevalue of type T of object to write to server
[in]expirationtime in seconds to keep the object stored in the server
[in]casthe cas value to compare
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1044 of file memcached.h.

References cas().

◆ casByKey() [1/2]

bool Memcached::casByKey ( const QString &  groupKey,
const QString &  key,
const QByteArray &  value,
time_t  expiration,
uint64_t  cas,
MemcachedReturnType returnType = nullptr 
)
static

Overwrites data for key in groupKey in the server as long as the cas value is still the same in the server. You can get the cas value by using the cas return value of Memcached::getByKey().

This method behaves in a similar nature as Memcached::cas(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Parameters
[in]groupkeykey that specifies the server to write to
[in]keykey of object whose value to compare and set
[in]valuevalue of object to write to server
[in]expirationtime in seconds to keep the object stored in the server
[in]casthe cas value to compare
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1000 of file memcached.cpp.

References cas(), and PluginNotRegisterd.

Referenced by casByKey().

◆ casByKey() [2/2]

template<typename T >
bool Cutelyst::Memcached::casByKey ( const QString &  groupKey,
const QString &  key,
const T &  value,
time_t  expiration,
uint64_t  cas,
MemcachedReturnType returnType = nullptr 
)
static

Overwrites data for key in groupKey in the server as long as the cas value is still the same in the server. You can get the cas value by using the cas return value of Memcached::getByKey()

Type T has to be serializable into a QByteArray using QDataStream.

This method behaves in a similar nature as Memcached::cas(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Parameters
[in]groupkeykey that specifies the server to write to
[in]keykey of object whose value to compare and set
[in]valuevalue of type T of object to write to server
[in]expirationtime in seconds to keep the object stored in the server
[in]casthe cas value to compare
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1053 of file memcached.h.

References casByKey().

◆ decrement()

bool Memcached::decrement ( const QString &  key,
uint32_t  offset,
uint64_t *  value = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Decrements the value of key by offset. If there is a valid pointer to value, the decremented value will be returned to it.

Note
Be aware that the memcached server does not detect overflow and underflow.
This function does not work if encryption is enabled.
Parameters
[in]keykey to decrement
[in]offsetoffset for decrement
[out]valueoptional pointer to a variable that takes the decremented value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 835 of file memcached.cpp.

References PluginNotRegisterd.

◆ decrementByKey()

bool Memcached::decrementByKey ( const QString &  groupKey,
const QString &  key,
uint64_t  offset,
uint64_t *  value = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Drecrements the value of key in groupKey by offset. If there is a valid pointer to value, the decremented value will be returned to it. This method behaves in a similar nature as Memcached::decrement(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Note
Be aware that the memcached server does not detect overflow and underflow.
This function does not work if encryption is enabled.
Parameters
[in]groupKeykey that specifies the server to decrement the key on
[in]keykey to decrement
[in]offsetoffset for decrement
[out]valueoptional pointer to a variable that takes the decremented value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 864 of file memcached.cpp.

References PluginNotRegisterd.

◆ decrementWithInitial()

bool Memcached::decrementWithInitial ( const QString &  key,
uint64_t  offset,
uint64_t  initial,
time_t  expiration,
uint64_t *  value = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Decrements the value of key by offset. If the object specified by key does not exist, one of two things will happen: if the expiration value is Memcached::expirationNotAdd, the operation will fail. For all other expiration values, the operation will succeed by seeding the value for that key with a initial value to expire with the provided expiration time. The flags will be set to zero. If there is a valid pointer to value, the created or decremented value will be returned to it.

Note
This method will only work when using the binary protocol.
Be aware that the memcached server does not detect overflow and underflow.
This function does not work if encryption is enabled.
Parameters
[in]keykey to decrement or initialize
[in]offsetoffset for decrement
[in]initialinitial value if key does not exist
[in]expirationexpiration time in seconds
[out]valueoptional pointer to a variable that takes the decremented or initialized value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 896 of file memcached.cpp.

References PluginNotRegisterd.

◆ decrementWithInitialByKey()

bool Memcached::decrementWithInitialByKey ( const QString &  groupKey,
const QString &  key,
uint64_t  offset,
uint64_t  initial,
time_t  expiration,
uint64_t *  value = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Decrements the value of key in groupKey by offset. If the object specified by key does not exist, one of two things will happen: if the expiration value is Memcached::expirationNotAdd, the operation will fail. For all other expiration values, the operation will succeed by seeding the value for that key with a initial value to expire with the provided expiration time. The flags will be set to zero. If there is a valid pointer to value, the created or decremented value will be returned to it.

This method behaves in a similar nature as Memcached::decrementWithInitial(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Note
This method will only work when using the binary protocol.
Be aware that the memcached server does not detect overflow and underflow.
This function does not work if encryption is enabled.
Parameters
[in]groupKeykey that specifies the server to decrement or initialize the key on
[in]keykey to decrement or initialize
[in]offsetoffset for decrement
[in]initialinitial value if key does not exist
[in]expirationexpiration time in seconds
[out]valueoptional pointer to a variable that takes the decremented or initialized value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 927 of file memcached.cpp.

References PluginNotRegisterd.

◆ errorString()

QString Memcached::errorString ( Context c,
MemcachedReturnType  rt 
)
static

◆ exist()

bool Memcached::exist ( const QString &  key,
MemcachedReturnType returnType = nullptr 
)
static

Checks if the key exists.

Parameters
[in]keykey to check
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true if the key exists; false otherwise

Definition at line 653 of file memcached.cpp.

References PluginNotRegisterd.

◆ existByKey()

bool Memcached::existByKey ( const QString &  groupKey,
const QString &  key,
MemcachedReturnType returnType = nullptr 
)
static

Checks if the key exists in groupKey. This method behaves in a similar nature as Memcached::exist(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Parameters
groupKeykey that specifies the server to check on
keykey to check
returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true if the key exists; false otherwise

Definition at line 680 of file memcached.cpp.

References PluginNotRegisterd.

◆ flush()

bool Memcached::flush ( time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Wipe cleans the contents of memcached servers. It will either do this immediately or expire the content based on the expiration time passed to the method (a value of zero causes an immediate flush). The operation is not atomic to multiple servers, just atomic to a single server. That is, it will flush the servers in the order that they were added.

Parameters
[in]expirationtime in seconds
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1066 of file memcached.cpp.

References PluginNotRegisterd.

◆ flushBuffers()

bool Memcached::flushBuffers ( MemcachedReturnType returnType = nullptr)
static

Used in conjunction with buffer requests enabled to flush all buffers by sending the buffered commands to the server for processing.

Parameters
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1043 of file memcached.cpp.

References PluginNotRegisterd.

◆ get() [1/2]

QByteArray Memcached::get ( const QString &  key,
uint64_t *  cas = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Fetch an individial value from the server identified by key. The returned QByteArray will contain the data fetched from the server. If an error occured or if the key could not be found, the returned QByteArray will be null. Use QByteArray::isNull() to check for this.

As this method returns a null byte array if an error occured as well if the key could not be found, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.

Parameters
[in]keykey of object whose value to fecth
[out]casoptional pointer to a variable that takes the CAS value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
QByteArray containing the data fetched from the server; if an error occured or the key has not been found, this will be null.

Definition at line 487 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by get().

◆ get() [2/2]

template<typename T >
T Cutelyst::Memcached::get ( const QString &  key,
uint64_t *  cas = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Fetch an individial value of type T from the server identified by key. The returned type T will contain the data fetched from the server. If an error occured or if the key could not be found, the returned type T will be default constructed.

Type T has to be deserializable from a QByteArray using QDataStream.

As this method returns a default constructed type T if an error occured as well if the key could not be found, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.

Usage example
void MyController::index(Context *c)
{
//...
QVariantList list = Memcached::get<QVariantList>(QStringLiteral("MyKey"));
//...
}
Parameters
[in]keykey of object whose value to fecth
[out]casoptional pointer to a quint32 variable that takes the CAS value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
type T containing the data fetched from the server; if an error occured or the key has not been found, this will be a default constructed value

Definition at line 1020 of file memcached.h.

References get().

◆ getByKey() [1/2]

QByteArray Memcached::getByKey ( const QString &  groupKey,
const QString &  key,
uint64_t *  cas = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Fetch an individial value from the server identified by key. The returned QByteArray will contain the data fetched from the server. If an error occured or if the key could not be found, the returned QByteArray will be null. Use QByteArray::isNull() to check for this. This method behaves in a similar nature as Memcached::get(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

As this method returns a null byte array if an error occured as well if the key could not be found, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.

Parameters
[in]groupKeykey that specifies the server to fetch from
[in]keykey of object whose value to fecth
[out]casoptional pointer to a variable that takes the CAS value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
QByteArray containing the data fetched from the server; if an error occured or the key has not been found, this will be null.

Definition at line 540 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by getByKey().

◆ getByKey() [2/2]

template<typename T >
T Cutelyst::Memcached::getByKey ( const QString &  groupKey,
const QString &  key,
uint64_t *  cas = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Fetch an individial value from the server identified by key. The returned type T will contain the data fetched from the server. If an error occured or if the key could not be found, the returned type T will be default constructed. This method behaves in a similar nature as Memcached::get(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Type T has to be deserializable from a QByteArray using QDataStream.

As this method returns a default constructed type T if an error occured as well if the key could not be found, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.

Usage example
void MyController::index(Context *c)
{
//...
QVariantList list = Memcached::getByKey<QVariantList>(QStringLiteral("MyGroup"), QStringLiteral("MyKey"));
//...
}
Parameters
[in]groupKeykey that specifies the server to fetch from
[in]keykey of object whose value to fecth
[out]casoptional pointer to a variable that takes the CAS value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
type T containing the data fetched from the server; if an error occured or the key has not been found, this will be a default constructed value

Definition at line 1032 of file memcached.h.

References getByKey().

◆ increment()

bool Memcached::increment ( const QString &  key,
uint32_t  offset,
uint64_t *  value = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Increments the value of key by offset. If there is a valid pointer to value, the incremented value will be returned to it.

Note
Be aware that the memcached server does not detect overflow and underflow.
This function does not work if encryption is enabled.
Parameters
[in]keykey to increment
[in]offsetoffset for increment
[out]valueoptional pointer to a variable that takes the incremented value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 710 of file memcached.cpp.

References PluginNotRegisterd.

◆ incrementByKey()

bool Memcached::incrementByKey ( const QString &  groupKey,
const QString &  key,
uint64_t  offset,
uint64_t *  value = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Increments the value of key in groupKey by offset. If there is a valid pointer to value, the incremented value will be returned to it. This method behaves in a similar nature as Memcached::increment(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Note
Be aware that the memcached server does not detect overflow and underflow.
This function does not work if encryption is enabled.
Parameters
[in]groupKeykey that specifies the server to increment the key on
[in]keykey to increment
[in]offsetoffset for increment
[out]valueoptional pointer to a variable that takes the incremented value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 739 of file memcached.cpp.

References PluginNotRegisterd.

◆ incrementWithInitial()

bool Memcached::incrementWithInitial ( const QString &  key,
uint64_t  offset,
uint64_t  initial,
time_t  expiration,
uint64_t *  value = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Increments the value of key by offset. If the object specified by key does not exist, one of two things will happen: if the expiration value is Memcached::expirationNotAdd, the operation will fail. For all other expiration values, the operation will succeed by seeding the value for that key with a initial value to expire with the provided expiration time. The flags will be set to zero. If there is a valid pointer to value, the created or incremented value will be returned to it.

Note
This method will only work when using the binary protocol.
Be aware that the memcached server does not detect overflow and underflow.
This function does not work if encryption is enabled.
Parameters
[in]keykey to increment or initialize
[in]offsetoffset for increment
[in]initialinitial value if key does not exist
[in]expirationexpiration time in seconds
[out]valueoptional pointer to a variable that takes the incremented or initialized value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 771 of file memcached.cpp.

References PluginNotRegisterd.

◆ incrementWithInitialByKey()

bool Memcached::incrementWithInitialByKey ( const QString &  groupKey,
const QString &  key,
uint64_t  offset,
uint64_t  initial,
time_t  expiration,
uint64_t *  value = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Increments the value of key in groupKey by offset. If the object specified by key does not exist, one of two things will happen: if the expiration value is Memcached::expirationNotAdd, the operation will fail. For all other expiration values, the operation will succeed by seeding the value for that key with a initial value to expire with the provided expiration time. The flags will be set to zero. If there is a valid pointer to value, the created or incremented value will be returned to it.

This method behaves in a similar nature as Memcached::incrementWithInitial(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Note
This method will only work when using the binary protocol.
Be aware that the memcached server does not detect overflow and underflow.
This function does not work if encryption is enabled.
Parameters
[in]groupKeykey that specifies the server to increment the key on
[in]keykey to increment or initialize
[in]offsetoffset for increment
[in]initialinitial value if key does not exist
[in]expirationexpiration time in seconds
[out]valueoptional pointer to a variable that takes the incremented or initialized value
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 802 of file memcached.cpp.

References PluginNotRegisterd.

◆ mget() [1/2]

QHash< QString, QByteArray > Memcached::mget ( const QStringList &  keys,
QHash< QString, uint64_t > *  casValues = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Fetch multiple values from the server identified by a list of keys. If a pointer for the casValues is provided, keys and their cas values will be written to it.

As this might return an empty QHash if nothing has been found or if an error occured, you can use the returnType pointer to determine the reason.

Parameters
[in]keyslist of keys to fetch from the server
[out]casValuesoptional pointer to a QHash that will contain keys and their cas values
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
QHash containing the keys and values

Definition at line 1089 of file memcached.cpp.

References BadKeyProvided, and PluginNotRegisterd.

Referenced by mget().

◆ mget() [2/2]

template<typename T >
QHash< QString, T > Cutelyst::Memcached::mget ( const QStringList &  keys,
QHash< QString, uint64_t > *  casValues = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Fetch multiple values of type T from the server identified by a list of keys. If a pointer for the casValues is provided, keys and their cas values are written to it.

As this might return an empty QHash if nothing has been found or if an error occured, you can use the returnType pointer to determine the reason.

Type T has to be deserializable from a QByteArray using QDataStream.

Parameters
[in]keyslist of keys to fetch from the server
[out]casValuesoptional pointer to a QHash that will contain keys and their cas values
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
QHash containing the keys and values

Definition at line 1062 of file memcached.h.

References mget().

◆ mgetByKey() [1/2]

QHash< QString, QByteArray > Memcached::mgetByKey ( const QString &  groupKey,
const QStringList &  keys,
QHash< QString, uint64_t > *  casValues = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Fetch multiple values from the server specified by groupKey identified by a list of keys. If a pointer for the casValues is provided, keys and their cas values will be written to it.

As this might return an empty QHash if nothing has been found or if an error occured, you can use the returnType pointer to determine the reason.

This method behaves in a similar nature as Memcached::mget(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Parameters
[in]groupKeykey to specify the server to fetch values from
[in]keyslist of keys to fetch from the server
[out]casValuesoptional pointer to a QHash that will contain keys and their cas values
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
QHash containing the keys and values

Definition at line 1164 of file memcached.cpp.

References BadKeyProvided, and PluginNotRegisterd.

Referenced by mgetByKey().

◆ mgetByKey() [2/2]

template<typename T >
QHash< QString, T > Cutelyst::Memcached::mgetByKey ( const QString &  groupKey,
const QStringList &  keys,
QHash< QString, uint64_t > *  casValues = nullptr,
MemcachedReturnType returnType = nullptr 
)
static

Fetch multiple values of type T from the server specified by groupKey identified by a list of keys. If a pointer for the casValues is provided, keys and their cas values will be written to it.

As this might return an empty QHash if nothing has been found or if an error occured, you can use the returnType pointer to determine the reason.

Type T has to be deserializable from a QByteArray using QDataStream.

This method behaves in a similar nature as Memcached::mget(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Parameters
[in]groupKeykey to specify the server to fetch values from
[in]keyslist of keys to fetch from the server
[out]casValuesoptional pointer to a QHash that will contain keys and their cas values
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
QHash containing the keys and values

Definition at line 1080 of file memcached.h.

References mgetByKey().

◆ remove()

bool Memcached::remove ( const QString &  key,
MemcachedReturnType returnType = nullptr 
)
static

Directly deletes a particular key.

Parameters
[in]keykey of object to delete
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 596 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by Cutelyst::MemcachedSessionStore::setGroupKey().

◆ removeByKey()

bool Memcached::removeByKey ( const QString &  groupKey,
const QString &  key,
MemcachedReturnType returnType = nullptr 
)
static

Directly deletes a particular key in groupKey. This method behaves in a similar nature as Memcached::remove(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Parameters
[in]groupKeykey that specifies the server to delete from
[in]keykey of object to delete
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 624 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by Cutelyst::MemcachedSessionStore::setGroupKey().

◆ replace() [1/2]

bool Memcached::replace ( const QString &  key,
const QByteArray &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Replaces the data of key on the server with value. If the key ist not found on the server an error occures and false will be returned.

As this method returns false if the key can not be found on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.

Parameters
[in]keykey of object whose value to replace
[in]valuevalue to replace object on server with
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 406 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by replace().

◆ replace() [2/2]

template<typename T >
bool Cutelyst::Memcached::replace ( const QString &  key,
const T &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Replaces the data of key on the server with value of type T. If the key ist not found on the server an error occures and false will be returned.

Type T has to be serializable into a QByteArray using QDataStream.

As this method returns false if the key can not be found on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.

Parameters
[in]keykey of object whose value to replace
[in]valuevalue to replace object on server with
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1002 of file memcached.h.

References replace().

◆ replaceByKey() [1/2]

bool Memcached::replaceByKey ( const QString &  groupKey,
const QString &  key,
const QByteArray &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Replaces the data of key on the server with value. If the key ist not found on the server an error occures and false will be returned. This method is functionally equivalent to Memcached::replace(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.

As this method returns false if the key can not be found on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.

Parameters
[in]groupKeykey that specifies the server to write to
[in]keykey of object whose value to replace
[in]valuevalue to replace object on server with
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 445 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by replaceByKey().

◆ replaceByKey() [2/2]

template<typename T >
bool Cutelyst::Memcached::replaceByKey ( const QString &  groupKey,
const QString &  key,
const T &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Replaces the data of key on the server with value of Type T. If the key ist not found on the server an error occures and false will be returned. This method is functionally equivalent to Memcached::replace(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.

Type T has to be serializable into a QByteArray using QDataStream.

As this method returns false if the key can not be found on the server, you can use the value of the returnType to determine the reason. Other than with other errors, failing because of not found key will not be logged.

Parameters
[in]groupKeykey that specifies the server to write to
[in]keykey of object whose value to replace
[in]valuevalue to replace object on server with
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1011 of file memcached.h.

References replaceByKey().

◆ set() [1/2]

bool Memcached::set ( const QString &  key,
const QByteArray &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Writes the value to the memcached server using key. If the key already exists it will overwrite what is on the server. If the object does not exist it will be written.

Parameters
[in]keykey of object whose value to set
[in]valuevalue of object to write to server
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 244 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by set(), and Cutelyst::MemcachedSessionStore::setGroupKey().

◆ set() [2/2]

template<typename T >
bool Cutelyst::Memcached::set ( const QString &  key,
const T &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Writes the value of type T to the memcached server using key. If the key already exists it will overwrite what is on the server. If the object does not exist it will be written.

Type T has to be serializable into a QByteArray using QDataStream.

Parameters
[in]keykey of object whose value to set
[in]valuevalue of type T of object to write to server
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 966 of file memcached.h.

References set().

◆ setByKey() [1/2]

bool Memcached::setByKey ( const QString &  groupKey,
const QString &  key,
const QByteArray &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Writes the value to the memcached server using key. If the key already exists it will overwrite what is on the server. If the object does not exist it will be written. This method is functionally equivalent to Memcached::set(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.

Parameters
[in]groupKeykey that specifies the server to write to
[in]keykey of object whose value to set
[in]valuevalue of object to write to server
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 283 of file memcached.cpp.

References PluginNotRegisterd.

Referenced by setByKey(), and Cutelyst::MemcachedSessionStore::setGroupKey().

◆ setByKey() [2/2]

template<typename T >
bool Cutelyst::Memcached::setByKey ( const QString &  groupKey,
const QString &  key,
const T &  value,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Writes the value of type T to the memcached server using key. If the key already exists it will overwrite what is on the server. If the object does not exist it will be written. This method is functionally equivalent to Memcached::set(), except that the free-form groupKey can be used to map the key to a specific server. This allows related items to be grouped together on a single server for efficiency.

Type T has to be serializable into a QByteArray using QDataStream.

Parameters
[in]groupKeykey that specifies the server to write to
[in]keykey of object whose value to set
[in]valuevalue of type T of object to write to server
[in]expirationtime in seconds to keep the object stored in the server
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 975 of file memcached.h.

References setByKey().

◆ setDefaultConfig()

void Memcached::setDefaultConfig ( const QVariantMap &  defaultConfig)

Sets default configuration values for configuration keys that are not set in the Cutelyst configuratoin file.

Definition at line 47 of file memcached.cpp.

◆ setup()

bool Memcached::setup ( Application app)
overrideprotectedvirtual

Reads the configuration and sets up the plugin.

Reimplemented from Cutelyst::Plugin.

Definition at line 53 of file memcached.cpp.

References Cutelyst::Engine::config(), Cutelyst::Application::engine(), Cutelyst::Application::loadTranslations(), and Cutelyst::Application::postForked().

◆ touch()

bool Memcached::touch ( const QString &  key,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Updates the expiration time on an existing key.

Parameters
[in]keykey whose expiration time to update
[in]expirationnew expiration time in seconds
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1253 of file memcached.cpp.

References PluginNotRegisterd.

◆ touchByKey()

bool Memcached::touchByKey ( const QString &  groupKey,
const QString &  key,
time_t  expiration,
MemcachedReturnType returnType = nullptr 
)
static

Updates the expiration time on an existing key in group groupKey.

This method behaves in a similar nature as Memcached::touch(). The difference is that it takes a groupKey that is used for determining which server an object was stored if key partitioning was used for storage.

Parameters
[in]groupKeykey to specify the server to update the key on
[in]keykey whose expiration time to update
[in]expirationnew expiration time in seconds
[out]returnTypeoptional pointer to a MemcachedReturnType variable that takes the return type of the operation
Returns
true on success; false otherwise

Definition at line 1281 of file memcached.cpp.

References PluginNotRegisterd.

Member Data Documentation

◆ expirationNotAdd

const time_t Memcached::expirationNotAdd
static

Expiration time constant that can be used in the increment/decrement with initial methods. @ sa incrementWithInitial() incrementWithInitialByKey() decrementWithInitial() decrementWithInitialByKey()

Definition at line 584 of file memcached.h.