@Experimental public class GeodeRedisServer extends Object
Each Redis data type instance is stored in a separate Region
except for the Strings and
HyperLogLogs which are collectively stored in one Region respectively. That Region along with a
meta data region used internally are protected so the client may not store keys with the name
REDIS_META_DATA_REGION
or STRING_REGION
. The
default Region type is RegionShortcut.PARTITION
although this can be changed by
specifying the SystemProperty "gemfireredis.regiontype" to a type defined by
RegionShortcut
. If the NUM_THREADS_SYS_PROP_NAME
system property
is set to 0, one thread per client will be created. Otherwise a worker thread pool of specified
size is used or a default size of 4 * Runtime.availableProcessors()
if the property is
not set.
Setting the AUTH password requires setting the property "redis-password" just as "redis-port" would be in xml or through GFSH.
The supported commands are as follows:
Supported String commands - APPEND, BITCOUNT, BITOP, BITPOS, DECR, DECRBY, GET, GETBIT, GETRANGE, GETSET, INCR, INCRBY, INCRBYFLOAT, MGET, MSET, MSETNX, PSETEX, SET, SETBIT, SETEX, SETNX, STRLEN
Supported List commands - LINDEX, LLEN, LPOP, LPUSH, LPUSHX, LRANGE, LREM, LSET, LTRIM, RPOP, RPUSH, RPUSHX
Supported Hash commands - HDEL, HEXISTS, HGET, HGETALL, HINCRBY, HINCRBYFLOAT, HKEYS, HMGET, HMSET, HSETNX, HLEN, HSCAN, HSET, HVALS
Supported Set commands - SADD, SCARD, SDIFF, SDIFFSTORE, SINTER, SINTERSTORE, SISMEMBER, SMEMBERS, SMOVE, SREM, SPOP, SRANDMEMBER, SCAN, SUNION, SUNIONSTORE
Supported SortedSet commands - ZADD, ZCARD, ZCOUNT, ZINCRBY, ZLEXCOUNT, ZRANGE, ZRANGEBYLEX, ZRANGEBYSCORE, ZRANK, ZREM, ZREMRANGEBYLEX, ZREMRANGEBYRANK, ZREMRANGEBYSCORE, ZREVRANGE, ZREVRANGEBYSCORE, ZREVRANK, ZSCAN, ZSCORE
Supported HyperLogLog commands - PFADD, PFCOUNT, PFMERGE
Supported Keys commands - DEL, DBSIZE, EXISTS, EXPIRE, EXPIREAT, FLUSHDB, FLUSHALL, KEYS, PERSIST, PEXPIRE, PEXPIREAT, PTTL, SCAN, TTL
Supported Transaction commands - DISCARD, EXEC, MULTI
Supported Server commands - AUTH, ECHO, PING, TIME, QUIT
The command executors are not explicitly documented but the functionality can be found at Redis Commands
Exceptions to the Redis Commands Documents:
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_REDIS_SERVER_PORT
The default Redis port as specified by their protocol,
DEFAULT_REDIS_SERVER_PORT |
static String |
DEFAULT_REGION_SYS_PROP_NAME
The system property name used to set the default
Region creation type. |
RegionShortcut |
DEFAULT_REGION_TYPE
The actual
RegionShortcut type specified by the system property
"gemfireredis.regiontype". |
static String |
HLL_REGION
The field that defines the name of the
Region which holds all of the HyperLogLogs. |
static String |
NUM_THREADS_SYS_PROP_NAME
System property name that can be used to set the number of threads to be used by the
GeodeRedisServer
|
static String |
REDIS_META_DATA_REGION
The field that defines the name of the
Region which holds all of the Redis meta data. |
static String |
STRING_REGION
The field that defines the name of the
Region which holds all of the strings. |
Constructor and Description |
---|
GeodeRedisServer(int port)
Constructor for
GeodeRedisServer that will start the server on the given port and bind
to the first non-loopback address |
GeodeRedisServer(String bindAddress,
int port)
Constructor for
GeodeRedisServer that will start the server and bind to the given
address and port |
GeodeRedisServer(String bindAddress,
int port,
String logLevel)
Constructor for
GeodeRedisServer that will start the server and bind to the given
address and port. |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Static main method that allows the
GeodeRedisServer to be started from the command
line. |
void |
shutdown()
Shutdown method for
GeodeRedisServer . |
void |
start()
This is function to call on a
GeodeRedisServer instance to start it running |
public static final int DEFAULT_REDIS_SERVER_PORT
DEFAULT_REDIS_SERVER_PORT
public static final String STRING_REGION
Region
which holds all of the strings. The
current value of this field is STRING_REGION
.public static final String HLL_REGION
Region
which holds all of the HyperLogLogs. The
current value of this field is HLL_REGION
.public static final String REDIS_META_DATA_REGION
Region
which holds all of the Redis meta data.
The current value of this field is REDIS_META_DATA_REGION
.public static final String DEFAULT_REGION_SYS_PROP_NAME
Region
creation type. The property
name is DEFAULT_REGION_SYS_PROP_NAME
and the acceptable values are types defined by
RegionShortcut
, i.e. "PARTITION" would be used for RegionShortcut.PARTITION
.public static final String NUM_THREADS_SYS_PROP_NAME
public final RegionShortcut DEFAULT_REGION_TYPE
RegionShortcut
type specified by the system property
"gemfireredis.regiontype".public GeodeRedisServer(int port)
GeodeRedisServer
that will start the server on the given port and bind
to the first non-loopback addressport
- The port the server will bind to, will use 6379 by
defaultpublic GeodeRedisServer(String bindAddress, int port)
GeodeRedisServer
that will start the server and bind to the given
address and portbindAddress
- The address to which the server will attempt to bind toport
- The port the server will bind to, will use 6379 by
default if argument is less than or equal to 0public GeodeRedisServer(String bindAddress, int port, String logLevel)
GeodeRedisServer
that will start the server and bind to the given
address and port. Keep in mind that the log level configuration will only be set if a
Cache
does not already exist, if one already exists then setting that property will
have no effect.bindAddress
- The address to which the server will attempt to bind toport
- The port the server will bind to, will use 6379 by
default if argument is less than or equal to 0logLevel
- The logging level to be used by GemFirepublic void start()
GeodeRedisServer
instance to start it runningpublic void shutdown()
GeodeRedisServer
. This closes the Cache
, interrupts all
execution and forcefully closes all connections.public static void main(String[] args)
GeodeRedisServer
to be started from the command
line. The supported command line arguments are
-port=
-bind-address=
-log-level=
args
- Command line args