@Test public void getUserOrderList() { userService.sortedUserList(1000000); }
public List getUserOrderList() { redisTemplate.opsForHash().get("user", "hashKey"); redisTemplate.opsForHash().put("user", "name", new CsdnUser("hash")); Map<String, CsdnUser> userMap = redisTemplate.opsForHash().entries("user"); logger.info("{}", userMap); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("001")); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("002")); Object list = redisTemplate.opsForList().range("userListKye", 0, 10); Set userSet = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet); redisTemplate.opsForSet().add("userSet", new CsdnUser("set")); Set userSet1 = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet1); redisTemplate.opsForZSet().add("userList", new CsdnUser("s10"), 10d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s13"), 13d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s0"), 0d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s6"), 6d); Set sortList = redisTemplate.opsForZSet().range("userList", 0, 10); logger.info("{}", sortList); return null; }
UserService { public List getUserOrderList() { redisTemplate.opsForHash().get("user", "hashKey"); redisTemplate.opsForHash().put("user", "name", new CsdnUser("hash")); Map<String, CsdnUser> userMap = redisTemplate.opsForHash().entries("user"); logger.info("{}", userMap); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("001")); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("002")); Object list = redisTemplate.opsForList().range("userListKye", 0, 10); Set userSet = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet); redisTemplate.opsForSet().add("userSet", new CsdnUser("set")); Set userSet1 = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet1); redisTemplate.opsForZSet().add("userList", new CsdnUser("s10"), 10d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s13"), 13d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s0"), 0d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s6"), 6d); Set sortList = redisTemplate.opsForZSet().range("userList", 0, 10); logger.info("{}", sortList); return null; } }
UserService { public List getUserOrderList() { redisTemplate.opsForHash().get("user", "hashKey"); redisTemplate.opsForHash().put("user", "name", new CsdnUser("hash")); Map<String, CsdnUser> userMap = redisTemplate.opsForHash().entries("user"); logger.info("{}", userMap); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("001")); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("002")); Object list = redisTemplate.opsForList().range("userListKye", 0, 10); Set userSet = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet); redisTemplate.opsForSet().add("userSet", new CsdnUser("set")); Set userSet1 = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet1); redisTemplate.opsForZSet().add("userList", new CsdnUser("s10"), 10d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s13"), 13d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s0"), 0d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s6"), 6d); Set sortList = redisTemplate.opsForZSet().range("userList", 0, 10); logger.info("{}", sortList); return null; }  }
UserService { public List getUserOrderList() { redisTemplate.opsForHash().get("user", "hashKey"); redisTemplate.opsForHash().put("user", "name", new CsdnUser("hash")); Map<String, CsdnUser> userMap = redisTemplate.opsForHash().entries("user"); logger.info("{}", userMap); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("001")); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("002")); Object list = redisTemplate.opsForList().range("userListKye", 0, 10); Set userSet = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet); redisTemplate.opsForSet().add("userSet", new CsdnUser("set")); Set userSet1 = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet1); redisTemplate.opsForZSet().add("userList", new CsdnUser("s10"), 10d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s13"), 13d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s0"), 0d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s6"), 6d); Set sortList = redisTemplate.opsForZSet().range("userList", 0, 10); logger.info("{}", sortList); return null; }  List getUserOrderList(); void sortedUserList(int size); }
UserService { public List getUserOrderList() { redisTemplate.opsForHash().get("user", "hashKey"); redisTemplate.opsForHash().put("user", "name", new CsdnUser("hash")); Map<String, CsdnUser> userMap = redisTemplate.opsForHash().entries("user"); logger.info("{}", userMap); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("001")); redisTemplate.opsForList().leftPush("userListKye", new CsdnUser("002")); Object list = redisTemplate.opsForList().range("userListKye", 0, 10); Set userSet = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet); redisTemplate.opsForSet().add("userSet", new CsdnUser("set")); Set userSet1 = redisTemplate.opsForSet().members("userSet"); logger.info("{}", userSet1); redisTemplate.opsForZSet().add("userList", new CsdnUser("s10"), 10d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s13"), 13d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s0"), 0d); redisTemplate.opsForZSet().add("userList", new CsdnUser("s6"), 6d); Set sortList = redisTemplate.opsForZSet().range("userList", 0, 10); logger.info("{}", sortList); return null; }  List getUserOrderList(); void sortedUserList(int size);  }