Skip to content

Instantly share code, notes, and snippets.

@volnoboy
Created July 6, 2015 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save volnoboy/08732e56473641340cf6 to your computer and use it in GitHub Desktop.
Save volnoboy/08732e56473641340cf6 to your computer and use it in GitHub Desktop.
Simple Redis project
//<dependency>
// <groupId>redis.clients</groupId>
// <artifactId>jedis</artifactId>
// <version>2.7.0</version>
//</dependency>
public class Redis {
public static String a = "a";
public static void main(String[] args) {
Jedis jedis = new Jedis("localhost");
jedis.set("Israel", "Jerusalem");
jedis.set("China", "Beijing");
System.out.println(jedis.get("Israel"));
System.out.println(new Date());
for(int i= 0; i<10000; i++) {
jedis.set(RandomStringUtils.randomAlphabetic(100), RandomStringUtils.randomAlphabetic(100));
}
System.out.println(new Date());
System.out.println(a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment