Namespace faabric::redis

namespace redis

Typedefs

using UniqueRedisReply = std::unique_ptr<redisReply, decltype(&freeReplyObject)>

Enums

enum RedisRole

Values:

enumerator QUEUE
enumerator STATE

Functions

UniqueRedisReply wrapReply(redisReply *r)
UniqueRedisReply safeRedisCommand(redisContext *c, const char *format, ...)
long getLongFromReply(const redisReply &reply)
std::vector<uint8_t> getBytesFromReply(const redisReply &reply)
void getBytesFromReply(const std::string &key, const redisReply &reply, uint8_t *buffer, size_t bufferLen)
long extractScriptResult(const redisReply &reply)

—&#8212; Lua scripts —&#8212;

std::set<std::string> extractStringSetFromReply(const redisReply &reply)
class Redis

Public Functions

~Redis()
void ping()

—&#8212; Standard Redis commands —&#8212;

std::vector<uint8_t> get(const std::string &key)
size_t strlen(const std::string &key)
void get(const std::string &key, uint8_t *buffer, size_t size)
void set(const std::string &key, const std::vector<uint8_t> &value)
void set(const std::string &key, const uint8_t *value, size_t size)
void del(const std::string &key)
long getCounter(const std::string &key)
long incr(const std::string &key)
long decr(const std::string &key)
long incrByLong(const std::string &key, long val)
long decrByLong(const std::string &key, long val)
void setRange(const std::string &key, long offset, const uint8_t *value, size_t size)
void setRangePipeline(const std::string &key, long offset, const uint8_t *value, size_t size)
void flushPipeline(long pipelineLength)
void getRange(const std::string &key, uint8_t *buffer, size_t bufferLen, long start, long end)

Note that start/end are both inclusive

void sadd(const std::string &key, const std::string &value)
void srem(const std::string &key, const std::string &value)
long scard(const std::string &key)
bool sismember(const std::string &key, const std::string &value)
std::string srandmember(const std::string &key)
std::set<std::string> smembers(const std::string &key)
std::set<std::string> sdiff(const std::string &keyA, const std::string &keyB)
std::set<std::string> sinter(const std::string &keyA, const std::string &keyB)
int lpushLong(const std::string &key, long val)
int rpushLong(const std::string &key, long val)
void flushAll()
long listLength(const std::string &queueName)
long getTtl(const std::string &key)
void expire(const std::string &key, long expiry)
void refresh()
uint32_t acquireLock(const std::string &key, int expirySeconds)

—&#8212; Locking —&#8212;

void releaseLock(const std::string &key, uint32_t lockId)
void delIfEq(const std::string &key, uint32_t value)
bool setnxex(const std::string &key, long value, int expirySeconds)
long getLong(const std::string &key)
void setLong(const std::string &key, long value)
void enqueue(const std::string &queueName, const std::string &value)

—&#8212; Queueing —&#8212;

void enqueueBytes(const std::string &queueName, const std::vector<uint8_t> &value)
void enqueueBytes(const std::string &queueName, const uint8_t *buffer, size_t bufferLen)
std::string dequeue(const std::string &queueName, int timeout = DEFAULT_TIMEOUT)
std::vector<uint8_t> dequeueBytes(const std::string &queueName, int timeout = DEFAULT_TIMEOUT)
size_t dequeueBytes(const std::string &queueName, uint8_t *buffer, size_t bufferLen, int timeout = DEFAULT_TIMEOUT)
void dequeueMultiple(const std::string &queueName, uint8_t *buff, long buffLen, long nElems)
void publishSchedulerResult(const std::string &key, const std::string &status_key, const std::vector<uint8_t> &result)

Public Static Functions

static Redis &getQueue()

—&#8212; Factories —&#8212;

static Redis &getState()

—&#8212; Utils —&#8212;

class RedisInstance

Public Functions

explicit RedisInstance(RedisRole role)

Public Members

std::string delifeqSha
std::string schedPublishSha
std::string ip
std::string hostname
int port
class RedisNoResponseException : public faabric::util::FaabricException

Public Functions

inline explicit RedisNoResponseException(std::string message)