You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/07/08 18:21:19 UTC
[11/21] incubator-geode git commit: GEODE-1566: rename
GeodeRedisServer and repackage redis code into org.apache.geode
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/main/java/org/apache/geode/redis/internal/RedisCommandType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/redis/internal/RedisCommandType.java b/geode-core/src/main/java/org/apache/geode/redis/internal/RedisCommandType.java
new file mode 100755
index 0000000..f288c60
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/redis/internal/RedisCommandType.java
@@ -0,0 +1,2344 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.geode.redis.internal;
+
+import org.apache.geode.redis.internal.executor.AuthExecutor;
+import org.apache.geode.redis.internal.executor.DBSizeExecutor;
+import org.apache.geode.redis.internal.executor.DelExecutor;
+import org.apache.geode.redis.internal.executor.EchoExecutor;
+import org.apache.geode.redis.internal.executor.ExistsExecutor;
+import org.apache.geode.redis.internal.executor.ExpireAtExecutor;
+import org.apache.geode.redis.internal.executor.ExpireExecutor;
+import org.apache.geode.redis.internal.executor.FlushAllExecutor;
+import org.apache.geode.redis.internal.executor.KeysExecutor;
+import org.apache.geode.redis.internal.executor.PExpireAtExecutor;
+import org.apache.geode.redis.internal.executor.PExpireExecutor;
+import org.apache.geode.redis.internal.executor.PTTLExecutor;
+import org.apache.geode.redis.internal.executor.PersistExecutor;
+import org.apache.geode.redis.internal.executor.PingExecutor;
+import org.apache.geode.redis.internal.executor.QuitExecutor;
+import org.apache.geode.redis.internal.executor.ScanExecutor;
+import org.apache.geode.redis.internal.executor.ShutDownExecutor;
+import org.apache.geode.redis.internal.executor.TTLExecutor;
+import org.apache.geode.redis.internal.executor.TimeExecutor;
+import org.apache.geode.redis.internal.executor.TypeExecutor;
+import org.apache.geode.redis.internal.executor.UnkownExecutor;
+import org.apache.geode.redis.internal.executor.hash.HDelExecutor;
+import org.apache.geode.redis.internal.executor.hash.HExistsExecutor;
+import org.apache.geode.redis.internal.executor.hash.HGetAllExecutor;
+import org.apache.geode.redis.internal.executor.hash.HGetExecutor;
+import org.apache.geode.redis.internal.executor.hash.HIncrByExecutor;
+import org.apache.geode.redis.internal.executor.hash.HIncrByFloatExecutor;
+import org.apache.geode.redis.internal.executor.hash.HKeysExecutor;
+import org.apache.geode.redis.internal.executor.hash.HLenExecutor;
+import org.apache.geode.redis.internal.executor.hash.HMGetExecutor;
+import org.apache.geode.redis.internal.executor.hash.HMSetExecutor;
+import org.apache.geode.redis.internal.executor.hash.HScanExecutor;
+import org.apache.geode.redis.internal.executor.hash.HSetExecutor;
+import org.apache.geode.redis.internal.executor.hash.HSetNXExecutor;
+import org.apache.geode.redis.internal.executor.hash.HValsExecutor;
+import org.apache.geode.redis.internal.executor.hll.PFAddExecutor;
+import org.apache.geode.redis.internal.executor.hll.PFCountExecutor;
+import org.apache.geode.redis.internal.executor.hll.PFMergeExecutor;
+import org.apache.geode.redis.internal.executor.list.LIndexExecutor;
+import org.apache.geode.redis.internal.executor.list.LInsertExecutor;
+import org.apache.geode.redis.internal.executor.list.LLenExecutor;
+import org.apache.geode.redis.internal.executor.list.LPopExecutor;
+import org.apache.geode.redis.internal.executor.list.LPushExecutor;
+import org.apache.geode.redis.internal.executor.list.LPushXExecutor;
+import org.apache.geode.redis.internal.executor.list.LRangeExecutor;
+import org.apache.geode.redis.internal.executor.list.LRemExecutor;
+import org.apache.geode.redis.internal.executor.list.LSetExecutor;
+import org.apache.geode.redis.internal.executor.list.LTrimExecutor;
+import org.apache.geode.redis.internal.executor.list.RPopExecutor;
+import org.apache.geode.redis.internal.executor.list.RPushExecutor;
+import org.apache.geode.redis.internal.executor.list.RPushXExecutor;
+import org.apache.geode.redis.internal.executor.set.SAddExecutor;
+import org.apache.geode.redis.internal.executor.set.SCardExecutor;
+import org.apache.geode.redis.internal.executor.set.SDiffExecutor;
+import org.apache.geode.redis.internal.executor.set.SDiffStoreExecutor;
+import org.apache.geode.redis.internal.executor.set.SInterExecutor;
+import org.apache.geode.redis.internal.executor.set.SInterStoreExecutor;
+import org.apache.geode.redis.internal.executor.set.SIsMemberExecutor;
+import org.apache.geode.redis.internal.executor.set.SMembersExecutor;
+import org.apache.geode.redis.internal.executor.set.SMoveExecutor;
+import org.apache.geode.redis.internal.executor.set.SPopExecutor;
+import org.apache.geode.redis.internal.executor.set.SRandMemberExecutor;
+import org.apache.geode.redis.internal.executor.set.SRemExecutor;
+import org.apache.geode.redis.internal.executor.set.SScanExecutor;
+import org.apache.geode.redis.internal.executor.set.SUnionExecutor;
+import org.apache.geode.redis.internal.executor.set.SUnionStoreExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZAddExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZCardExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZCountExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZIncrByExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZLexCountExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRangeByLexExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRangeByScoreExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRangeExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRankExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRemExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRemRangeByLexExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRemRangeByRankExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRemRangeByScoreExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRevRangeByScoreExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRevRangeExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZRevRankExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZScanExecutor;
+import org.apache.geode.redis.internal.executor.sortedset.ZScoreExecutor;
+import org.apache.geode.redis.internal.executor.string.AppendExecutor;
+import org.apache.geode.redis.internal.executor.string.BitCountExecutor;
+import org.apache.geode.redis.internal.executor.string.BitOpExecutor;
+import org.apache.geode.redis.internal.executor.string.BitPosExecutor;
+import org.apache.geode.redis.internal.executor.string.DecrByExecutor;
+import org.apache.geode.redis.internal.executor.string.DecrExecutor;
+import org.apache.geode.redis.internal.executor.string.GetBitExecutor;
+import org.apache.geode.redis.internal.executor.string.GetExecutor;
+import org.apache.geode.redis.internal.executor.string.GetRangeExecutor;
+import org.apache.geode.redis.internal.executor.string.GetSetExecutor;
+import org.apache.geode.redis.internal.executor.string.IncrByExecutor;
+import org.apache.geode.redis.internal.executor.string.IncrByFloatExecutor;
+import org.apache.geode.redis.internal.executor.string.IncrExecutor;
+import org.apache.geode.redis.internal.executor.string.MGetExecutor;
+import org.apache.geode.redis.internal.executor.string.MSetExecutor;
+import org.apache.geode.redis.internal.executor.string.MSetNXExecutor;
+import org.apache.geode.redis.internal.executor.string.PSetEXExecutor;
+import org.apache.geode.redis.internal.executor.string.SetBitExecutor;
+import org.apache.geode.redis.internal.executor.string.SetEXExecutor;
+import org.apache.geode.redis.internal.executor.string.SetExecutor;
+import org.apache.geode.redis.internal.executor.string.SetNXExecutor;
+import org.apache.geode.redis.internal.executor.string.SetRangeExecutor;
+import org.apache.geode.redis.internal.executor.string.StrlenExecutor;
+import org.apache.geode.redis.internal.executor.transactions.DiscardExecutor;
+import org.apache.geode.redis.internal.executor.transactions.ExecExecutor;
+import org.apache.geode.redis.internal.executor.transactions.MultiExecutor;
+import org.apache.geode.redis.internal.executor.transactions.UnwatchExecutor;
+import org.apache.geode.redis.internal.executor.transactions.WatchExecutor;
+
+/**
+ * The redis command type used by the server. Each command is directly from
+ * the redis protocol and calling {@link #getExecutor()} on a type returns the executor
+ * class for that command.
+ *
+ *
+ */
+public enum RedisCommandType {
+
+ /***************************************
+ *************** Keys ******************
+ ***************************************/
+
+ /**
+ * AUTH password <p>
+ * Authenticate to the server
+ */
+ AUTH {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new AuthExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * DEL key [key ...] <p>
+ * Delete a key
+ */
+ DEL {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new DelExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * EXISTS key <p>
+ * Determine if a key exists
+ */
+ EXISTS {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ExistsExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * EXPIRE key seconds <p>
+ * Set a key's time to live in seconds
+ */
+ EXPIRE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ExpireExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * EXPIREAT key timestamp <p>
+ * Set the expiration for a key as a UNIX timestamp
+ */
+ EXPIREAT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ExpireAtExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * FLUSHALL <p>
+ * Remove all keys from all databases
+ */
+ FLUSHALL {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new FlushAllExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * FLUSHDB<p>Remove all keys from the current database<p>Same as FLUSHALL for this implementation
+ */
+ FLUSHDB {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new FlushAllExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * KEYS pattern <p>
+ * Find all keys matching the given pattern
+ */
+ KEYS {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new KeysExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * PERSIST key <p>
+ * Remove the expiration from a key
+ */
+ PERSIST {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PersistExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * PEXPIRE key milliseconds<p>Set a key's time to live in milliseconds
+ */
+ PEXPIRE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PExpireExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * PEXPIREAT key milliseconds-timestamp<p>Set the expiration for a key as a UNIX timestamp specified in milliseconds
+ */
+ PEXPIREAT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PExpireAtExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * PTTL key<p>Get the time to live for a key in milliseconds
+ */
+ PTTL {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PTTLExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SCAN cursor [MATCH pattern] [COUNT count]<p>Incrementally iterate the keys space
+ */
+ SCAN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ScanExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * TTL key<p>Get the time to live for a key
+ */
+ TTL {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new TTLExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * TYPE key<p>Determine the type stored at key
+ */
+ TYPE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new TypeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /***************************************
+ ************** Strings ****************
+ ***************************************/
+
+ /**
+ * APPEND key value<p>Append a value to a key
+ */
+ APPEND {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new AppendExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * BITCOUNT key start end [start end ...]<p>Count set bits in a string
+ */
+ BITCOUNT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new BitCountExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * BITOP operation destkey key [key ...]<p>Perform bitwise operations between strings
+ */
+ BITOP {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new BitOpExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * BITPOS key bit [start] [end]<p>Find first bit set or clear in a string
+ */
+ BITPOS {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new BitPosExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * DECR key<p>Decrement the integer value of a key by one
+ */
+ DECR {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new DecrExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * DECRBY key decrement<p>Decrement the integer value of a key by the given number
+ */
+ DECRBY {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new DecrByExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * GET key<p>Get the value of a key
+ */
+ GET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new GetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * GETBIT key offset<p>Returns the bit value at offset in the string value stored at key
+ */
+ GETBIT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new GetBitExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * GETRANGE key start end<p>Get a substring of the string stored at a key
+ */
+ GETRANGE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new GetRangeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * GETSET key value<p>Set the string value of a key and return its old value
+ */
+ GETSET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new GetSetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * INCR key<p>Increment the integer value of a key by one
+ */
+ INCR {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new IncrExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * INCRBY key increment<p>Increment the integer value of a key by the given amount
+ */
+ INCRBY {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new IncrByExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * INCRBYFLOAT key increment<p>Increment the float value of a key by the given amount
+ */
+ INCRBYFLOAT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new IncrByFloatExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * MGET key [key ...]<p>Get the values of all the given keys
+ */
+ MGET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new MGetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * MSET key value [key value ...]<p>Set multiple keys to multiple values
+ */
+ MSET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new MSetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * MSETNX key value [key value ...]<p>Set multiple keys to multiple values, only if none of the keys exist
+ */
+ MSETNX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new MSetNXExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * PSETEX key milliseconds value<p>Set the value and expiration in milliseconds of a key
+ */
+ PSETEX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PSetEXExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SETEX key seconds value<p>Set the value and expiration of a key
+ */
+ SETEX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SetEXExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SET key value [EX seconds] [PX milliseconds] [NX|XX]<p>Set the string value of a key
+ */
+ SET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SETBIT key offset value<P>Sets or clears the bit at offset in the string value stored at key
+ */
+ SETBIT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SetBitExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SETNX key value<p>Set the value of a key, only if the key does not exist
+ */
+ SETNX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SetNXExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SETRANGE key offset value<p>Overwrite part of a string at key starting at the specified offset
+ */
+ SETRANGE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SetRangeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * STRLEN key<p>Get the length of the value stored in a key
+ */
+ STRLEN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new StrlenExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_STRING;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /***************************************
+ **************** Hashes ***************
+ ***************************************/
+ /**
+ * HDEL key field [field ...]<p>Delete one or more hash fields
+ */
+ HDEL {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HDelExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HEXISTS key field<p>Determine if a hash field exists
+ */
+ HEXISTS {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HExistsExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HGET key field<p>Get the value of a hash field
+ */
+ HGET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HGetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HGETALL key<p>Get all the fields and values in a hash
+ */
+ HGETALL {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HGetAllExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HINCRBY key field increment<p>Increment the integer value of a hash field by the given number
+ */
+ HINCRBY {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HIncrByExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HINCRBYFLOAT key field increment<p>Increment the float value of a hash field by the given amount
+ */
+ HINCRBYFLOAT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HIncrByFloatExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HKEYS key<p>Get all the fields in a hash
+ */
+ HKEYS {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HKeysExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HLEN key<p>Get the number of fields in a hash
+ */
+ HLEN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HLenExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HMGET key field [field ...]<p>Get the values of all the given hash fields
+ */
+ HMGET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HMGetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HMSET key field value [field value ...]<p>Set multiple hash fields to multiple values
+ */
+ HMSET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HMSetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HSCAN key cursor [MATCH pattern] [COUNT count]<p>Incrementally iterate hash fields and associated values
+ */
+ HSCAN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HScanExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HSET key field value<p>Set the string value of a hash field
+ */
+ HSET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HSetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HSETNX key field value<p>Set the value of a hash field, only if the field does not exist
+ */
+ HSETNX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HSetNXExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * HVALS key<p>Get all the values in a hash
+ */
+ HVALS {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new HValsExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HASH;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /***************************************
+ *********** HyperLogLogs **************
+ ***************************************/
+
+ /**
+ * PFADD key element [element ...]<p>Adds the specified elements to the specified HyperLogLog
+ */
+ PFADD {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PFAddExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HLL;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * PFCOUNT key [key ...]<p>Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s)
+ */
+ PFCOUNT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PFCountExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HLL;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * PFMERGE destkey sourcekey [sourcekey ...]<p>Merge N different HyperLogLogs into a single one
+ */
+ PFMERGE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PFMergeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_HLL;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /***************************************
+ *************** Lists *****************
+ ***************************************/
+
+ /**
+ * LINDEX key index<p>Get an element from a list by its index
+ */
+ LINDEX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LIndexExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LINSERT key BEFORE|AFTER pivot value<p>Insert an element before or after another element in a list
+ */
+ LINSERT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LInsertExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LLEN key<p>Get the length of a list
+ */
+ LLEN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LLenExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LPOP key<p>Remove and get the first element in a list
+ */
+ LPOP {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LPopExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LPUSH key value [value ...]<p>Prepend one or multiple values to a list
+ */
+ LPUSH {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LPushExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LPUSHX key value<p>Prepend a value to a list, only if the list exists
+ */
+ LPUSHX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LPushXExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LRANGE key start stop<p>Get a range of elements from a list
+ */
+ LRANGE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LRangeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LREM key count value<p>Remove elements from a list
+ */
+ LREM {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LRemExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LSET key index value<p>Set the value of an element in a list by its index
+ */
+ LSET {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LSetExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * LTRIM key start stop<p>Trim a list to the specified range
+ */
+ LTRIM {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new LTrimExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * RPOP key<p>Remove and get the last element in a list
+ */
+ RPOP {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new RPopExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * RPUSH key value [value ...]<p>Append one or multiple values to a list
+ */
+ RPUSH {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new RPushExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * RPUSHX key value<p>Append a value to a list, only if the list exists
+ */
+ RPUSHX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new RPushXExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_LIST;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /***************************************
+ **************** Sets *****************
+ ***************************************/
+
+ /**
+ * SADD key member [member ...]<p>Add one or more members to a set
+ */
+ SADD {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SAddExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SCARD key<p>Get the number of members in a set
+ */
+ SCARD {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SCardExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SDIFF key [key ...]<p>Subtract multiple sets
+ */
+ SDIFF {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SDiffExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SDIFFSTORE destination key [key ...]<p>Subtract multiple sets and store the resulting set in a key
+ */
+ SDIFFSTORE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SDiffStoreExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SISMEMBER key member<p>Determine if a given value is a member of a set
+ */
+ SISMEMBER {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SIsMemberExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SINTER key [key ...]<p>Intersect multiple sets
+ */
+ SINTER {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SInterExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SINTERSTORE destination key [key ...]<p>Intersect multiple sets and store the resulting set in a key
+ */
+ SINTERSTORE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SInterStoreExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SMEMBERS key<p>Get all the members in a set
+ */
+ SMEMBERS {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SMembersExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SMOVE source destination member<p>Move a member from one set to another
+ */
+ SMOVE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SMoveExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SPOP key<p>Remove and return a random member from a set
+ */
+ SPOP {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SPopExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SRANDMEMBER key [count]<p>Get one or multiple random members from a set
+ */
+ SRANDMEMBER {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SRandMemberExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SUNION key [key ...]<p>Add multiple sets
+ */
+ SUNION {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SUnionExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SUNIONSTORE destination key [key ...]<p>Add multiple sets and store the resulting set in a key
+ */
+ SUNIONSTORE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SUnionStoreExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SSCAN key cursor [MATCH pattern] [COUNT count]<p>Incrementally iterate Set elements
+ */
+ SSCAN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SScanExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SREM key member [member ...]<p>Remove one or more members from a set
+ */
+ SREM {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new SRemExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /***************************************
+ ************* Sorted Sets *************
+ ***************************************/
+
+ /**
+ * ZADD key score member [score member ...]<p>Add one or more members to a sorted set, or update its score if it already exists
+ */
+ ZADD {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZAddExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZCARD key<p>Get the number of members in a sorted set
+ */
+ ZCARD {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZCardExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZCOUNT key min max<p>Count the members in a sorted set with scores within the given values
+ */
+ ZCOUNT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZCountExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZINCRBY key increment member<p>Increment the score of a member in a sorted set
+ */
+ ZINCRBY {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZIncrByExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZLEXCOUNT key min max<p>Count the number of members in a sorted set between a given lexicographical range
+ */
+ ZLEXCOUNT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZLexCountExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZRANGE key start stop [WITHSCORES]<p>Return a range of members in a sorted set, by index
+ */
+ ZRANGE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRangeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZRANGEBYLEX key min max [LIMIT offset count]<p>Return a range of members in a sorted set, by lexicographical range
+ */
+ ZRANGEBYLEX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRangeByLexExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]<p>Return a range of members in a sorted set, by score
+ */
+ ZRANGEBYSCORE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRangeByScoreExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZREVRANGE key start stop [WITHSCORES]<p>Return a range of members in a sorted set, by index, with scores ordered from high to low
+ */
+ ZREVRANGE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRevRangeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZRANK key member<p>Determine the index of a member in a sorted set
+ */
+ ZRANK {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRankExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZREM key member [member ...]<p>Remove one or more members from a sorted set
+ */
+ ZREM {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRemExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZREMRANGEBYLEX key min max<p>Remove all members in a sorted set between the given lexicographical range
+ */
+ ZREMRANGEBYLEX {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRemRangeByLexExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZREMRANGEBYRANK key start stop<p>Remove all members in a sorted set within the given indexes
+ */
+ ZREMRANGEBYRANK {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRemRangeByRankExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZREMRANGEBYSCORE key min max<p>Remove all members in a sorted set within the given scores
+ */
+ ZREMRANGEBYSCORE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRemRangeByScoreExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]<p>Return a range of members in a sorted set, by score, with scores ordered from high to low
+ */
+ ZREVRANGEBYSCORE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRevRangeByScoreExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZREVRANK key member<p>Determine the index of a member in a sorted set, with scores ordered from high to low
+ */
+ ZREVRANK {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZRevRankExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZSCAN key cursor [MATCH pattern] [COUNT count]<P>Incrementally iterate sorted sets elements and associated scores
+ */
+ ZSCAN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZScanExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ZSCORE key member<p>Get the score associated with the given member in a sorted set
+ */
+ ZSCORE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ZScoreExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /***************************************
+ ************ Transactions *************
+ ***************************************/
+
+ /**
+ * DISCARD<p>Discard all commands issued after MULTI
+ */
+ DISCARD {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new DiscardExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * EXEC<p>Execute all commands issued after MULTI
+ */
+ EXEC {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ExecExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * MULTI<p>Mark the start of a transaction block
+ */
+ MULTI {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new MultiExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * UNWATCH<p>Forget about all watched keys
+ */
+ UNWATCH {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new UnwatchExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * WATCH key [key ...]<p>Watch the given keys to determine execution of the MULTI/EXEC block
+ */
+ WATCH {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new WatchExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /***************************************
+ *************** Server ****************
+ ***************************************/
+
+ /**
+ * DBSIZE<p>Return the number of keys in the selected database
+ */
+ DBSIZE {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new DBSizeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * ECHO message<p>Echo the given string
+ */
+ ECHO {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new EchoExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * TIME <p>Return the current server time
+ */
+ TIME {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new TimeExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * PING<p>Ping the server
+ */
+ PING {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new PingExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * QUIT<p>Close the connection
+ */
+ QUIT {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new QuitExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ /**
+ * SHUTDOWN<p>Shut down the server
+ */
+ SHUTDOWN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new ShutDownExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ },
+
+ // UNKNOWN
+ UNKNOWN {
+ private Executor executor;
+ @Override
+ public Executor getExecutor() {
+ if (executor == null) {
+ executor = new UnkownExecutor();
+ }
+ return executor;
+ }
+ private final RedisDataType dataType = RedisDataType.NONE;
+ @Override
+ public RedisDataType getDataType() {
+ return this.dataType;
+ }
+ };
+
+ /**
+ * Abstract method overridden by each value in enum
+ * to get the executor associated with that command type
+ *
+ * @return {@link Executor} for command type
+ */
+ public abstract Executor getExecutor();
+
+ public abstract RedisDataType getDataType();
+ /*
+ private RedisCommandType (RedisDataType dataType) {
+ this.dataType = dataType;
+ }
+ */
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/main/java/org/apache/geode/redis/internal/RedisConstants.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/redis/internal/RedisConstants.java b/geode-core/src/main/java/org/apache/geode/redis/internal/RedisConstants.java
new file mode 100644
index 0000000..9aa45b7
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/redis/internal/RedisConstants.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.redis.internal;
+
+
+public class RedisConstants {
+
+ public static final int NUM_DEFAULT_KEYS = 3;
+
+ /*
+ * Responses
+ */
+ public static final String QUIT_RESPONSE = "OK";
+ public static final String COMMAND_QUEUED = "QUEUED";
+
+
+ /*
+ * Error responses
+ */
+ static final String PARSING_EXCEPTION_MESSAGE = "The command recieved by GeodeRedisServer was improperly formatted";
+ static final String SERVER_ERROR_MESSAGE = "The server had an internal error please try again";
+ static final String SERVER_ERROR_UNKNOWN_RESPONSE = "Unkown response";
+ static final String SERVER_ERROR_SHUTDOWN = "The server is shutting down";
+ static final String ERROR_UNSUPPORTED_OPERATION_IN_TRANSACTION = "This command is not supported within a transaction";
+ static final String ERROR_TRANSACTION_EXCEPTION = "This transcation cannot be initiated, make sure the command is executed against a replicate region or your data is collocated. If you are using persistent regions, make sure transactions are enabled";
+ public static final String ERROR_NOT_NUMERIC = "Illegal non numeric argument";
+ public static final String ERROR_UNKOWN_COMMAND = "Unable to process uknown command";
+ public static final String ERROR_COMMIT_CONFLICT = "There has been a conflict with another transaction";
+ public static final String ERROR_REGION_CREATION = "This key could not be created. Gemfire does not allow certain characters to used in keys";
+ public static final String ERROR_UNWATCH = "Keys cannot be watched or unwatched because GemFire watches all keys by default for transactions";
+ public static final String ERROR_WATCH = "Keys cannot be watched or unwatched because GemFire watches all keys by default for transactions";
+ public static final String ERROR_ILLEGAL_GLOB = "Incorrect syntax for given glob regex";
+ public static final String ERROR_OUT_OF_RANGE = "The number provided is out of range";
+ public static final String ERROR_NESTED_MULTI = "The MULTI command cannot be nested";
+ public static final String ERROR_NAN_INF_INCR = "increment would produce NaN or Infinity";
+ public static final String ERROR_NO_PASS = "Attempting to authenticate when no password has been set";
+ public static final String ERROR_INVALID_PWD = "Attemping to authenticate with an invalid password";
+ public static final String ERROR_NOT_AUTH = "Must authenticate before sending any requests";
+
+ public static class ArityDef {
+
+ /*
+ * General
+ */
+ public static final int DBSIZE_ARITY = 0;
+ public static final String AUTH = "The wrong number of arguments or syntax was provided, the format for the AUTH command is \"AUTH password\"";
+ public static final String DBSIZE = null;
+ public static final String DEL = "The wrong number of arguments or syntax was provided, the format for the DEL command is \"DEL key [key ...]\"";
+ public static final String ECHO = "The wrong number of arguments or syntax was provided, the format for the ECHO command is \"ECHO message\"";
+ public static final String EXISTS = "The wrong number of arguments or syntax was provided, the format for the EXISTS command is \"EXISTS key\"";
+ public static final String EXPIREAT = "The wrong number of arguments or syntax was provided, the format for the EXPIREAT command is \"EXPIREAT key timestamp\"";
+ public static final String EXPIRE = "The wrong number of arguments or syntax was provided, the format for the EXPIRE command is \"EXPIRE key seconds\"";
+ public static final String FLUSHALL = null;
+ public static final String KEYS = "The wrong number of arguments or syntax was provided, the format for the KEYS command is \"KEYS pattern\"";
+ public static final String PERSIST = "The wrong number of arguments or syntax was provided, the format for the PERSIST command is \"PERSIST key\"";
+ public static final String PEXPIREAT = "The wrong number of arguments or syntax was provided, the format for the PEXPIREAT command is \"PEXPIREAT key milliseconds-timestamp\"";
+ public static final String PEXPIRE = "The wrong number of arguments or syntax was provided, the format for the PEXPIRE command is \"PEXPIRE key milliseconds\"";
+ public static final String PING = null;
+ public static final String PTTL = "The wrong number of arguments or syntax was provided, the format for the PTTL command is \"PTTL key\"";
+ public static final String QUIT = null;
+ public static final String SCAN = "The wrong number of arguments or syntax was provided, the format for the SCAN command is \"SCAN cursor [MATCH pattern] [COUNT count]\"";
+ public static final String SHUTDOWN = null;
+ public static final String TIME = null;
+ public static final String TTL = "The wrong number of arguments or syntax was provided, the format for the TTL command is \"TTL key\"";
+ public static final String TYPE = "The wrong number of arguments or syntax was provided, the format for the TYPE command is \"TYPE key\"";
+ public static final String UNKNOWN = null;
+
+ /*
+ * Hash
+ */
+ public static final String HDEL = "The wrong number of arguments or syntax was provided, the format for the HDEL command is \"HDEL key field [field ...]\"";
+ public static final String HEXISTS = "The wrong number of arguments or syntax was provided, the format for the HEXISTS command is \"HEXISTS key field\"";
+ public static final String HGETALL = "The wrong number of arguments or syntax was provided, the format for the HGETALL command is \"HGETALL key\"";
+ public static final String HGET = "The wrong number of arguments or syntax was provided, the format for the HGET command is \"HGET key field\"";
+ public static final String HINCRBY = "The wrong number of arguments or syntax was provided, the format for the HINCRBY command is \"HINCRBY key field increment\"";
+ public static final String HINCRBYFLOAT = "The wrong number of arguments or syntax was provided, the format for the HINCRBYFLOAT command is \"HINCRBYFLOAT key field increment\"";
+ public static final String HKEYS = "The wrong number of arguments or syntax was provided, the format for the HKEYS command is \"HKEYS key\"";
+ public static final String HLEN = "The wrong number of arguments or syntax was provided, the format for the HLEN command is \"HLEN key\"";
+ public static final String HMGET = "The wrong number of arguments or syntax was provided, the format for the HMGET command is \"HMGET key field [field ...]\"";
+ public static final String HMSET = "The wrong number of arguments or syntax was provided, the format for the HMSET command is \"HMSET key field value [field value ...]\", or not every field is associated with a value";
+ public static final String HSCAN = "The wrong number of arguments or syntax was provided, the format for the SSCAN command is \"SSCAN key cursor [MATCH pattern] [COUNT count]\"";
+ public static final String HSET = "The wrong number of arguments or syntax was provided, the format for the HSET command is \"HSET key field value\"";
+ public static final String HSETNX = "The wrong number of arguments or syntax was provided, the format for the HSETNX command is \"HSETNX key field value\"";
+ public static final String HVALS = "The wrong number of arguments or syntax was provided, the format for the HVALS command is \"HVALS key\"";
+
+ /*
+ * Hll
+ */
+ public static final String PFADD = "The wrong number of arguments or syntax was provided, the format for the PFADD command is \"PFADD key element [element ...]\"";
+ public static final String PFCOUNT = "The wrong number of arguments or syntax was provided, the format for the PFCOUNT command is \"PFCOUNT key [key ...]\"";
+ public static final String PFMERGE = "The wrong number of arguments or syntax was provided, the format for the PFMERGE command is \"PFMERGE destkey sourcekey [sourcekey ...]\"";
+
+ /*
+ * List
+ */
+ public static final String LINDEX = "The wrong number of arguments or syntax was provided, the format for the LINDEX command is \"LINDEX key index";
+ public static final String LINSERT = null;
+ public static final String LLEN = "The wrong number of arguments or syntax was provided, the format for the LLEN command is \"LLEN key";
+ public static final String LPOP = "The wrong number of arguments or syntax was provided, the format for the LPOP command is \"LPOP key";
+ public static final String LPUSH = "The wrong number of arguments or syntax was provided, the format for the LPUSH command is \"LPUSH key value [value ...]";
+ public static final String LPUSHX = "The wrong number of arguments or syntax was provided, the format for the LPUSHX command is \"LPUSHX key value";
+ public static final String LRANGE = "The wrong number of arguments or syntax was provided, the format for the LRANGE command is \"LRANGE key start stop\"";
+ public static final String LREM = "The wrong number of arguments or syntax was provided, the format for the LREM command is \"LREM key count value\"";
+ public static final String LSET = "The wrong number of arguments or syntax was provided, the format for the LSET command is \"LSET key index value\"";
+ public static final String LTRIM = "The wrong number of arguments or syntax was provided, the format for the LTRIM command is \"LTRIM key start stop\"";
+ public static final String RPOP = "The wrong number of arguments or syntax was provided, the format for the RPOP command is \"RPOP key";
+ public static final String RPUSH = "The wrong number of arguments or syntax was provided, the format for the RPUSH command is \"RPUSH key value [value ...]";
+ public static final String RPUSHX = "The wrong number of arguments or syntax was provided, the format for the RPUSHX command is \"RPUSHX key value";
+
+ /*
+ * Set
+ */
+ public static final String SADD = "The wrong number of arguments or syntax was provided, the format for the SADD command is \"SADD key member [member ...]\"";
+ public static final String SCARD = "The wrong number of arguments or syntax was provided, the format for the SCARD command is \"SCARD key\"";
+ public static final String SDIFF = "The wrong number of arguments or syntax was provided, the format for the SDIFF command is \"SDIFF key [key ...]\"";
+ public static final String SDIFFSTORE = "The wrong number of arguments or syntax was provided, the format for the SDIFF command is \"SDIFFSTORE destination key [key ...]\"";
+ public static final String SINTER = "The wrong number of arguments or syntax was provided, the format for the SINTER command is \"SINTER key [key ...]\"";
+ public static final String SINTERSTORE = "The wrong number of arguments or syntax was provided, the format for the SINTERSTORE command is \"SINTERSTORE destination key [key ...]\"";
+ public static final String SISMEMBER = "The wrong number of arguments or syntax was provided, the format for the SISMEMBER command is \"SISMEMBER key member\"";
+ public static final String SMEMBERS = "The wrong number of arguments or syntax was provided, the format for the SMEMBERS command is \"SMEMBERS key\"";
+ public static final String SMOVE = "The wrong number of arguments or syntax was provided, the format for the SMOVE command is \"SMOVE source destination member\"";
+ public static final String SPOP = "The wrong number of arguments or syntax was provided, the format for the SPOP command is \"SPOP key\"";
+ public static final String SRANDMEMBER = "The wrong number of arguments or syntax was provided, the format for the SRANDMEMBER command is \"SRANDMEMBER key [count]\"";
+ public static final String SREM = "The wrong number of arguments or syntax was provided, the format for the SREM command is \"SREM key member [member ...]\"";
+ public static final String SSCAN = "The wrong number of arguments or syntax was provided, the format for the SSCAN command is \"SSCAN key cursor [MATCH pattern] [COUNT count]\"";
+ public static final String SUNION = "The wrong number of arguments or syntax was provided, the format for the SUNION command is \"SUNION key [key ...]\"";
+ public static final String SUNIONSTORE = "The wrong number of arguments or syntax was provided, the format for the SUNIONSTORE command is \"SUNIONSTORE destination key [key ...]\"";
+
+ /*
+ * Sorted set
+ */
+ public static final String ZADD = "The wrong number of arguments or syntax was provided, the format for the ZADD command is \"ZADD key score member [score member ...]\", or not every score matches to a member";
+ public static final String ZCARD = "The wrong number of arguments or syntax was provided, the format for the ZCARD command is \"ZCARD key\"";
+ public static final String ZCOUNT = "The wrong number of arguments or syntax was provided, the format for the ZCOUNT command is \"ZCOUNT key min max\"";
+ public static final String ZINCRBY = "The wrong number of arguments or syntax was provided, the format for the ZINCRBY command is \"ZINCRBY key increment member\"";
+ public static final String ZLEXCOUNT = "The wrong number of arguments or syntax was provided, the format for the ZLEXCOUNT command is \"ZLEXCOUNT key min max\"";
+ public static final String ZRANGEBYLEX = "The wrong number of arguments or syntax was provided, the format for the ZRANGEBYLEX command is \"ZRANGEBYLEX key min max [LIMIT offset count]\"";
+ public static final String ZRANGEBYSCORE = "The wrong number of arguments or syntax was provided, the format for the ZRANGEBYSCORE command is \"ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]\"";
+ public static final String ZRANGE = "The wrong number of arguments or syntax was provided, the format for the ZRANGE command is \"ZRANGE key start stop [WITHSCORES]\"";
+ public static final String ZRANK = "The wrong number of arguments or syntax was provided, the format for the ZRANK command is \"ZRANK key member\"";
+ public static final String ZREM = "The wrong number of arguments or syntax was provided, the format for the ZREM command is \"ZREM key member [member ...]\"";
+ public static final String ZREMRANGEBYLEX = "The wrong number of arguments or syntax was provided, the format for the ZREMRANGEBYLEX command is \"ZREMRANGEBYLEX key min max\"";
+ public static final String ZREMRANGEBYRANK = "The wrong number of arguments or syntax was provided, the format for the ZREMRANGEBYRANK command is \"ZREMRANGEBYRANK key start stop\"";
+ public static final String ZREMRANGEBYSCORE = "The wrong number of arguments or syntax was provided, the format for the ZREMRANGEBYSCORE command is \"ZREMRANGEBYSCORE key min max\"";
+ public static final String ZREVRANGEBYSCORE = "The wrong number of arguments or syntax was provided, the format for the ZREVRANGEBYSCORE command is \"ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]\"";
+ public static final String ZREVRANGE = "The wrong number of arguments or syntax was provided, the format for the ZREVRANGE command is \"ZREVRANGE key start stop [WITHSCORES]\"";
+ public static final String ZREVRANK = "The wrong number of arguments or syntax was provided, the format for the ZREVRANK command is \"ZREVRANK key member\"";
+ public static final String ZSCAN = "The wrong number of arguments or syntax was provided, the format for the SSCAN command is \"SSCAN key cursor [MATCH pattern] [COUNT count]\"";
+ public static final String ZSCORE = "The wrong number of arguments or syntax was provided, the format for the ZSCORE command is \"ZSCORE key member\"";
+
+ /*
+ * String
+ */
+ public static final String APPEND = "The wrong number of arguments or syntax was provided, the format for the APPEND command is \"APPEND key value\"";
+ public static final String BITCOUNT = "The wrong number of arguments or syntax was provided, the format for the BITCOUNT command is \"BITCOUNT key [start end]\"";
+ public static final String BITOP = "The wrong number of arguments or syntax was provided, the format for the BITOP command is \"BITOP operation destkey key [key ...]\"";
+ public static final String BITPOS = "The wrong number of arguments or syntax was provided, the format for the BITOPS command is \"BITPOS key bit [start] [end]\"";
+ public static final String DECRBY = "The wrong number of arguments or syntax was provided, the format for the DECRBY command is \"DECRRBY key decrement\"";
+ public static final String DECR = "The wrong number of arguments or syntax was provided, the format for the DECR command is \"DECR key\"";
+ public static final String GETBIT = "The wrong number of arguments or syntax was provided, the format for the GETBIT command is \"GETBIT key offset\"";
+ public static final String GETEXECUTOR = "The wrong number of arguments or syntax was provided, the format for the GET command is \"GET key\"";
+ public static final String GETRANGE = "The wrong number of arguments or syntax was provided, the format for the GETRANGE command is \"GETRANGE key start end\"";
+ public static final String GETSET = "The wrong number of arguments or syntax was provided, the format for the GETSET command is \"GETSET key value\"";
+ public static final String INCRBY = "The wrong number of arguments or syntax was provided, the format for the INCRBY command is \"INCRBY key increment\"";
+ public static final String INCRBYFLOAT = "The wrong number of arguments or syntax was provided, the format for the INCRBY command is \"INCRBY key increment\"";
+ public static final String INCR = "The wrong number of arguments or syntax was provided, the format for the INCR command is \"INCR key\"";
+ public static final String MGET = "The wrong number of arguments or syntax was provided, the format for the MGET command is \"MGET key [key ...]\"";
+ public static final String MSET = "The wrong number of arguments or syntax was provided, the format for the MSET command is \"MSET key value [key value ...]\", or not every key matches a value";
+ public static final String MSETNX = "The wrong number of arguments or syntax was provided, the format for the MSETNX command is \"MSETNX key value [key value ...]\", or not every key matches a value";
+ public static final String PSETEX = "The wrong number of arguments or syntax was provided, the format for the PSETEX command is \"PSETEX key milliseconds value\"";
+ public static final String SETBIT = "The wrong number of arguments or syntax was provided, the format for the SETBIT command is \"SETBIT key offset value\"";
+ public static final String SET = "The wrong number of arguments or syntax was provided, the format for the SET command is \"SET key value [EX seconds] [PX milliseconds] [NX|XX]\"";
+ public static final String SETEX = "The wrong number of arguments or syntax was provided, the format for the SETEX command is \"SETEX key seconds value\"";
+ public static final String SETNX = "The wrong number of arguments or syntax was provided, the format for the SETNX command is \"SETNX key value\"";
+ public static final String SETRANGE = "The wrong number of arguments or syntax was provided, the format for the SETRANGE command is \"SETRANGE key offset value\"";
+ public static final String STRLEN = "The wrong number of arguments or syntax was provided, the format for the STRELEN command is \"STRLEN key\"";
+
+ /*
+ * Transaction
+ */
+ public static final String DISCARD = null;
+ public static final String EXEC = null;
+ public static final String MULTI = null;
+ public static final String UNWATCH = null;
+ public static final String WATCH = null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/dfd481e0/geode-core/src/main/java/org/apache/geode/redis/internal/RedisDataType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/redis/internal/RedisDataType.java b/geode-core/src/main/java/org/apache/geode/redis/internal/RedisDataType.java
new file mode 100755
index 0000000..6a2902c
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/redis/internal/RedisDataType.java
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.redis.internal;
+
+import com.gemstone.gemfire.cache.Region;
+import org.apache.geode.redis.GeodeRedisServer;
+
+/**
+ * The RedisDataType enum contains the choices to which every {@link Region}
+ * on the server must be. There is only one instance of {@link #REDIS_STRING}
+ * and {@link #REDIS_PROTECTED} defined by {@link GeodeRedisServer#STRING_REGION} and
+ * {@link GeodeRedisServer#REDIS_META_DATA_REGION} respectively.
+ * <p>
+ * The data types are:
+ * <li>{@link RedisDataType#REDIS_STRING}</li>
+ * <li>{@link RedisDataType#REDIS_HASH}</li>
+ * <li>{@link RedisDataType#REDIS_LIST}</li>
+ * <li>{@link RedisDataType#REDIS_SET}</li>
+ * <li>{@link RedisDataType#REDIS_SORTEDSET}</li>
+ * <li>{@link RedisDataType#REDIS_PROTECTED}</li>
+ *
+ */
+public enum RedisDataType {
+ /**
+ * Strings Regions
+ */
+ REDIS_STRING {
+ @Override
+ public String toString() {
+ return "string";
+ }
+ },
+
+ /**
+ * Hashes Regions
+ */
+ REDIS_HASH {
+ @Override
+ public String toString() {
+ return "hash";
+ }
+ },
+
+ /**
+ * Lists Regions
+ */
+ REDIS_LIST {
+ @Override
+ public String toString() {
+ return "list";
+ }
+ },
+
+ /**
+ * Sets Regions
+ */
+ REDIS_SET {
+ @Override
+ public String toString() {
+ return "set";
+ }
+ },
+
+ /**
+ * SortedSets Regions
+ */
+ REDIS_SORTEDSET {
+ @Override
+ public String toString() {
+ return "zset";
+ }
+ },
+
+ /**
+ * HyperLogLog Regions
+ */
+ REDIS_HLL {
+ @Override
+ public String toString() {
+ return "hyperloglog";
+ }
+ },
+
+ /**
+ * Regions protected from overwrite or deletion
+ */
+ REDIS_PROTECTED {
+ @Override
+ public String toString() {
+ return "protected";
+ }
+ },
+
+ /**
+ * None
+ */
+ NONE {
+ @Override
+ public String toString() {
+ return "none";
+ }
+ };
+
+};