66import java .util .Map ;
77import java .util .Set ;
88
9- public class BinaryJedisCluster implements BinaryJedisCommands , BasicCommands ,
9+ import redis .clients .util .SafeEncoder ;
10+
11+ public class BinaryJedisCluster implements BinaryJedisCommands ,
1012 JedisClusterBinaryScriptingCommands {
1113
1214 public static final short HASHSLOTS = 16384 ;
@@ -1042,7 +1044,7 @@ public List<byte[]> blpop(final byte[] arg) {
10421044 public List <byte []> execute (Jedis connection ) {
10431045 return connection .blpop (arg );
10441046 }
1045- }.runBinary (null );
1047+ }.runBinary (arg );
10461048 }
10471049
10481050 @ Override
@@ -1053,7 +1055,7 @@ public List<byte[]> brpop(final byte[] arg) {
10531055 public List <byte []> execute (Jedis connection ) {
10541056 return connection .brpop (arg );
10551057 }
1056- }.runBinary (null );
1058+ }.runBinary (arg );
10571059 }
10581060
10591061 @ Override
@@ -1086,7 +1088,7 @@ public Long move(final byte[] key, final int dbIndex) {
10861088 public Long execute (Jedis connection ) {
10871089 return connection .move (key , dbIndex );
10881090 }
1089- }.runBinary (key );
1091+ }.runBinary (null );
10901092 }
10911093
10921094 @ Override
@@ -1111,225 +1113,6 @@ public Long execute(Jedis connection) {
11111113 }.runBinary (key );
11121114 }
11131115
1114- @ Override
1115- public String ping () {
1116- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1117- maxRedirections ) {
1118- @ Override
1119- public String execute (Jedis connection ) {
1120- return connection .ping ();
1121- }
1122- }.run (null );
1123- }
1124-
1125- @ Override
1126- public String quit () {
1127- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1128- maxRedirections ) {
1129- @ Override
1130- public String execute (Jedis connection ) {
1131- return connection .quit ();
1132- }
1133- }.run (null );
1134- }
1135-
1136- @ Override
1137- public String flushDB () {
1138- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1139- maxRedirections ) {
1140- @ Override
1141- public String execute (Jedis connection ) {
1142- return connection .flushDB ();
1143- }
1144- }.run (null );
1145- }
1146-
1147- @ Override
1148- public Long dbSize () {
1149- return new JedisClusterCommand <Long >(connectionHandler , timeout ,
1150- maxRedirections ) {
1151- @ Override
1152- public Long execute (Jedis connection ) {
1153- return connection .dbSize ();
1154- }
1155- }.run (null );
1156- }
1157-
1158- @ Override
1159- public String select (final int index ) {
1160- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1161- maxRedirections ) {
1162- @ Override
1163- public String execute (Jedis connection ) {
1164- return connection .select (index );
1165- }
1166- }.run (null );
1167- }
1168-
1169- @ Override
1170- public String flushAll () {
1171- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1172- maxRedirections ) {
1173- @ Override
1174- public String execute (Jedis connection ) {
1175- return connection .flushAll ();
1176- }
1177- }.run (null );
1178- }
1179-
1180- @ Override
1181- public String auth (final String password ) {
1182- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1183- maxRedirections ) {
1184- @ Override
1185- public String execute (Jedis connection ) {
1186- return connection .auth (password );
1187- }
1188- }.run (null );
1189- }
1190-
1191- @ Override
1192- public String save () {
1193- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1194- maxRedirections ) {
1195- @ Override
1196- public String execute (Jedis connection ) {
1197- return connection .save ();
1198- }
1199- }.run (null );
1200- }
1201-
1202- @ Override
1203- public String bgsave () {
1204- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1205- maxRedirections ) {
1206- @ Override
1207- public String execute (Jedis connection ) {
1208- return connection .bgsave ();
1209- }
1210- }.run (null );
1211- }
1212-
1213- @ Override
1214- public String bgrewriteaof () {
1215- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1216- maxRedirections ) {
1217- @ Override
1218- public String execute (Jedis connection ) {
1219- return connection .bgrewriteaof ();
1220- }
1221- }.run (null );
1222- }
1223-
1224- @ Override
1225- public Long lastsave () {
1226- return new JedisClusterCommand <Long >(connectionHandler , timeout ,
1227- maxRedirections ) {
1228- @ Override
1229- public Long execute (Jedis connection ) {
1230- return connection .lastsave ();
1231- }
1232- }.run (null );
1233- }
1234-
1235- @ Override
1236- public String shutdown () {
1237- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1238- maxRedirections ) {
1239- @ Override
1240- public String execute (Jedis connection ) {
1241- return connection .shutdown ();
1242- }
1243- }.run (null );
1244- }
1245-
1246- @ Override
1247- public String info () {
1248- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1249- maxRedirections ) {
1250- @ Override
1251- public String execute (Jedis connection ) {
1252- return connection .info ();
1253- }
1254- }.run (null );
1255- }
1256-
1257- @ Override
1258- public String info (final String section ) {
1259- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1260- maxRedirections ) {
1261- @ Override
1262- public String execute (Jedis connection ) {
1263- return connection .info (section );
1264- }
1265- }.run (null );
1266- }
1267-
1268- @ Override
1269- public String slaveof (final String host , final int port ) {
1270- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1271- maxRedirections ) {
1272- @ Override
1273- public String execute (Jedis connection ) {
1274- return connection .slaveof (host , port );
1275- }
1276- }.run (null );
1277- }
1278-
1279- @ Override
1280- public String slaveofNoOne () {
1281- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1282- maxRedirections ) {
1283- @ Override
1284- public String execute (Jedis connection ) {
1285- return connection .slaveofNoOne ();
1286- }
1287- }.run (null );
1288- }
1289-
1290- @ Override
1291- public Long getDB () {
1292- return new JedisClusterCommand <Long >(connectionHandler , timeout ,
1293- maxRedirections ) {
1294- @ Override
1295- public Long execute (Jedis connection ) {
1296- return connection .getDB ();
1297- }
1298- }.run (null );
1299- }
1300-
1301- @ Override
1302- public String debug (final DebugParams params ) {
1303- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1304- maxRedirections ) {
1305- @ Override
1306- public String execute (Jedis connection ) {
1307- return connection .debug (params );
1308- }
1309- }.run (null );
1310- }
1311-
1312- @ Override
1313- public String configResetStat () {
1314- return new JedisClusterCommand <String >(connectionHandler , timeout ,
1315- maxRedirections ) {
1316- @ Override
1317- public String execute (Jedis connection ) {
1318- return connection .configResetStat ();
1319- }
1320- }.run (null );
1321- }
1322-
1323- public Map <String , JedisPool > getClusterNodes () {
1324- return connectionHandler .getNodes ();
1325- }
1326-
1327- @ Override
1328- public Long waitReplicas (int replicas , long timeout ) {
1329- // TODO Auto-generated method stub
1330- return null ;
1331- }
1332-
13331116 @ Override
13341117 public Object eval (final byte [] script , final byte [] keyCount , final byte []... params ) {
13351118 return new JedisClusterCommand <Object >(connectionHandler , timeout ,
@@ -1338,7 +1121,7 @@ public Object eval(final byte[] script, final byte[] keyCount, final byte[]... p
13381121 public Object execute (Jedis connection ) {
13391122 return connection .eval (script , keyCount , params );
13401123 }
1341- }.runBinary (ByteBuffer . wrap ( keyCount ). getInt ( ), params );
1124+ }.runBinary (Integer . parseInt ( SafeEncoder . encode ( keyCount ) ), params );
13421125 }
13431126
13441127 @ Override
0 commit comments