Package org.jredis.ri.alphazero

Examples of org.jredis.ri.alphazero.JRedisPipeline.sync()


          for(int i=0; i<100000; i++){
            rand.nextBytes(data);
            pipeline.lpush("my-list", data);
          }
          /* sync call */
          long llen = pipeline.sync().llen("my-list");
         
          String cntrKey = "my-cntr";
          for(int i=0; i<100000; i++) {
            pipeline.incr(cntrKey);
          }
View Full Code Here


          String cntrKey = "my-cntr";
          for(int i=0; i<100000; i++) {
            pipeline.incr(cntrKey);
          }
          /* sync call */
          long cntr = toLong (pipeline.sync().get(cntrKey));
         
          for(int i=0; i<100000; i++){
            pipeline.set("random:"+i, "value:" + rand.nextInt());
          }
          /* sync call */
 
View Full Code Here

         
          for(int i=0; i<100000; i++){
            pipeline.set("random:"+i, "value:" + rand.nextInt());
          }
          /* sync call */
          String randomVal = toStr (pipeline.sync().get("random:"+999));
         
          pipeline.flushdb();
        System.out.format ("end using sync() = %d msec\n", System.currentTimeMillis() - start);
         
          System.out.format("%s => %d\n", cntrKey, cntr);
View Full Code Here

        }
        catch (RedisException e) {
          Log.problem("RedisException: " + e);
        }
        finally{
          pipeline.sync().quit();
        }
    }
  /**
     * @param connectionSpec
     */
 
View Full Code Here

          Random rand = new Random();
          byte[] data = new byte[8];
          for(int i=0; i<100000; i++)
            pipeline.incr(cntrKey);
         
          long cntr = toLong (pipeline.sync().get(cntrKey));
         
          for(int i=0; i<100000; i++){
            rand.nextBytes(data);
            pipeline.set("random:"+i, "value:" + rand.nextInt());
          }
View Full Code Here

         
          for(int i=0; i<100000; i++){
            rand.nextBytes(data);
            pipeline.set("random:"+i, "value:" + rand.nextInt());
          }
          String randomVal = toStr (pipeline.sync().get("random:"+999));
        System.out.format ("end using sync() = %d msec\n", System.currentTimeMillis() - start);
         
          System.out.format("%s => %d\n", cntrKey, cntr);
          System.out.format("%s => %s\n", "random:"+999, randomVal);
         
View Full Code Here

        }
        catch (RedisException e) {
          Log.problem("RedisException: " + e);
        }
        finally{
          pipeline.sync().quit();
        }

    }
  /**
     * pipelines SET reqCnt times and then waits on response of the last INCR.
View Full Code Here

           * the following call will block until
           * all the responses for above + the llen()
           * itself have been received.
           */
         
          long llen = pipeline.sync().llen("my-list");
         
          String cntrKey = "my-cntr";
          for(int i=0; i<100000; i++) {
            pipeline.incr(cntrKey);
          }
View Full Code Here

          String cntrKey = "my-cntr";
          for(int i=0; i<100000; i++) {
            pipeline.incr(cntrKey);
          }
          /* sync call */
          long cntr = toLong (pipeline.sync().get(cntrKey));
         
          for(int i=0; i<100000; i++){
            pipeline.set("random:"+i, "value:" + rand.nextInt());
          }
          /* sync call */
 
View Full Code Here

         
          for(int i=0; i<100000; i++){
            pipeline.set("random:"+i, "value:" + rand.nextInt());
          }
          /* sync call */
          String randomVal = toStr (pipeline.sync().get("random:"+999));
         
          pipeline.flushdb();
        System.out.format ("end using sync() = %d msec\n", System.currentTimeMillis() - start);
         
          System.out.format("%s => %d\n", cntrKey, cntr);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.