public String nonPipelineZADD ( String key , DataGenerator dataGenerator , String z_key_prefix , int max_score ) throws Exception { String zKey = z_key_prefix + key ; int success = 0 ; long returnOp = 0 ; for ( int i = 0 ; i < max_score ; i ++ ) { returnOp = jedisClient . get ( ) . zadd ( zKey , i , dataGenerator . getRandomValue ( ) + "__" + zKey ) ; success += returnOp ; } // all the above operations will separate entries if ( success != max_score - 1 ) { return null ; } return "OK" ; }
This adds MAX_SCORE of elements in a sorted set