@@ -0,0 +1,1528 @@
+package org.finikes.sider;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0Aimport org.finikes.sider.base.RedisClusterTopology;%0A%0Aimport redis.clients.jedis.Jedis;%0Aimport redis.clients.jedis.JedisPool;%0Aimport redis.clients.jedis.Pipeline;%0A%0A/**%0A * %E9%9B%86%E7%BE%A4%E7%8E%AF%E5%A2%83%E4%B8%8B%E9%80%9A%E8%BF%87pipeline%E6%96%B9%E5%BC%8F%E6%89%B9%E9%87%8F%E6%8F%92%E5%85%A5%E6%95%B0%E6%8D%AE%E5%AF%B9%E8%B1%A1(%E6%9C%AA%E7%BB%8F%E4%B8%A5%E6%A0%BC%E6%B5%8B%E8%AF%95)%0A * @author Finikes.Wu%0A *%0A */%0Apublic class UnsafeSider extends Sider %7B%0A%0A%09public UnsafeSider(RedisClusterTopology redisClusterTopology) %7B%0A%09%09super(redisClusterTopology);%0A%09%7D%0A%0A%09public List%3CString%3E mset(Map%3CString, String%3E kvs) %7B%0A%09%09int kvsLenth = kvs.size();%0A%09%09List%3CString%3E results = new ArrayList%3CString%3E(kvsLenth);%0A%09%09String%5B%5D keys = new String%5BkvsLenth%5D;%0A%0A%09%09int pointer = 0;%0A%09%09for (String key : kvs.keySet()) %7B%0A%09%09%09keys%5Bpointer%5D = key;%0A%09%09%09pointer++;%0A%09%09%7D%0A%0A%09%09Map%3CString, List%3CString%3E%3E keysSection = pair(keys);%0A%09%09Set%3Cjava.util.Map.Entry%3CString, List%3CString%3E%3E%3E ts0 = keysSection.entrySet();%0A%0A%09%09for (java.util.Map.Entry%3CString, List%3CString%3E%3E e : ts0) %7B%0A%09%09%09work(kvs, e);%0A%09%09%7D%0A%0A%09%09return results;%0A%09%7D%0A%0A%09private void work(Map%3CString, String%3E kvs, java.util.Map.Entry%3CString, List%3CString%3E%3E e) %7B%0A%09%09Jedis jedis = null;%0A%09%09try %7B%0A%09%09%09JedisPool pool = redisClusterTopology.getClusterMap().get(e.getKey()).getPool();%0A%09%09%09jedis = pool.getResource();%0A%09%09%09Pipeline pl = jedis.pipelined();%0A%09%09%09List%3CString%3E subKeys = e.getValue();%0A%09%09%09for (String k : subKeys) %7B%0A%09%09%09%09pl.set(k, kvs.get(k));%0A%09%09%09%7D%0A%0A%09%09%09pl.sync();%0A%09%09%7D catch (Exception ex) %7B%0A%09%09%09ex.printStackTrace();%0A%09%09%7D finally %7B%0A%09%09%09if (null != jedis) %7B%0A%09%09%09%09jedis.close();%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create UnsafeSider.java