public abstract class WorkAloneRedisManager extends Object implements IRedisManager
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_COUNT
Default value of count.
|
| Constructor and Description |
|---|
WorkAloneRedisManager() |
| Modifier and Type | Method and Description |
|---|---|
Long |
dbSize(byte[] pattern)
Return the size of redis db.
|
void |
del(byte[] key)
Delete a key-value pair.
|
byte[] |
get(byte[] key)
get value from redis
|
int |
getCount() |
protected abstract redis.clients.jedis.Jedis |
getJedis()
We are going to operate redis by acquiring Jedis object.
|
redis.clients.jedis.JedisPoolConfig |
getJedisPoolConfig() |
Set<byte[]> |
keys(byte[] pattern)
Return all the keys of Redis db.
|
byte[] |
set(byte[] key,
byte[] value,
int expireTime)
set
|
void |
setCount(int count) |
void |
setJedisPoolConfig(redis.clients.jedis.JedisPoolConfig jedisPoolConfig) |
protected static final int DEFAULT_COUNT
protected abstract redis.clients.jedis.Jedis getJedis()
public byte[] get(byte[] key)
get in interface IRedisManagerkey - keypublic byte[] set(byte[] key,
byte[] value,
int expireTime)
set in interface IRedisManagerkey - keyvalue - valueexpireTime - expire time in secondpublic void del(byte[] key)
del in interface IRedisManagerkey - keypublic Long dbSize(byte[] pattern)
dbSize in interface IRedisManagerpattern - key patternpublic Set<byte[]> keys(byte[] pattern)
keys in interface IRedisManagerpattern - key patternpublic int getCount()
public void setCount(int count)
public redis.clients.jedis.JedisPoolConfig getJedisPoolConfig()
public void setJedisPoolConfig(redis.clients.jedis.JedisPoolConfig jedisPoolConfig)
Copyright © 2020. All rights reserved.