@@ -0,0 +1,1181 @@
+package com.ctrip.xpipe.redis.integratedtest.function;%0A%0Aimport redis.clients.jedis.Jedis;%0A%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Date;%0A%0A/**%0A * @author Jason Song(song_s@ctrip.com)%0A */%0Apublic class MassiveInsertUtil %7B%0A    private Jedis masterJedis;%0A    private String someKeyPrefix;%0A%0A    public MassiveInsertUtil() %7B%0A        masterJedis = createJedis(%22localhost%22, 6379);%0A        someKeyPrefix = new SimpleDateFormat(%22yyyyMMddHHmmss%22).format(new Date());%0A    %7D%0A%0A    private Jedis createJedis(String ip, int port) %7B%0A        Jedis jedis = new Jedis(ip, port);%0A        return jedis;%0A    %7D%0A%0A    public void insert(int count) %7B%0A        for (int i = 0; i %3C count; i++) %7B%0A            if (i %3E 0 && i %25 100 == 0) %7B%0A                System.out.println(String.format(%22%25d keys inserted%22, i));%0A            %7D%0A            String key = String.format(%22%25s-bulk-%25d%22, someKeyPrefix, i);%0A%0A            masterJedis.set(key, key);%0A        %7D%0A        System.out.println(String.format(%22Insert finished, totally %25d keys inserted%22, count));%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        MassiveInsertUtil insertUtil = new MassiveInsertUtil();%0A        insertUtil.insert(10000);%0A    %7D%0A%7D%0A

add MassiveInsertUtil