Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated InfoMap to reflect changes in INFO -- TESTED (Redis 2.2.6)

Added AdHocTestInfo to tests.
Not entirely sure yet how to deal with db# info enteries in InfoMap.

Compliance is now 2.2.6.
  • Loading branch information...
commit ae4f8ec664c3fbb46f973ee8dcaff1eb4521853d 1 parent f07aa36
@alphazero authored
View
36 core/api/src/main/java/org/jredis/RedisInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Joubin Houshyar
+ * Copyright 2009-2012 Joubin Houshyar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,18 +18,38 @@
/**
* [TODO: document me!]
- * [TODO: dbN:keys=2,expires=0 - where N: {0->n}]
-
+ * [TODO: dbN:keys=2,expires=0 - where N: {0->n}] << not sure if this is possible, cleanly...
*
* @author Joubin Houshyar (alphazero@sensesay.net)
* @version alpha.0, 04/02/09
* @since alpha.0
*
*/
-/*
- * TOOD:
- */
public enum RedisInfo {
+ redis_git_dirty,
+ redis_git_sha1,
+ used_cpu_user,
+ client_longest_output_list,
+ latest_fork_usec,
+ used_memory_peak,
+ pubsub_patterns,
+ used_cpu_sys_children,
+ used_memory_rss,
+ lru_clock,
+ aof_enabled,
+ mem_fragmentation_ratio,
+ used_memory_peak_human,
+ loading,
+ client_biggest_input_buf,
+ used_cpu_sys,
+ keyspace_hits,
+ evicted_keys,
+ pubsub_channels,
+ used_cpu_user_children,
+ gcc_version,
+ expired_keys,
+ mem_allocator,
+ keyspace_misses,
arch_bits,
multiplexing_api,
redis_version,
@@ -47,8 +67,8 @@
total_commands_processed,
uptime_in_seconds,
uptime_in_days,
- hash_max_zipmap_entries,
- hash_max_zipmap_value,
+// hash_max_zipmap_entries,
+// hash_max_zipmap_value,
vm_enabled,
role
}
View
52 core/ri/src/test/java/org/jredis/ri/adhoc/AdHocTestInfo.java
@@ -0,0 +1,52 @@
+package org.jredis.ri.adhoc;
+
+import java.util.Map;
+
+import org.jredis.JRedisFuture;
+import org.jredis.RedisInfo;
+import org.jredis.connector.ConnectionSpec;
+import org.jredis.ri.alphazero.JRedisPipeline;
+import org.jredis.ri.alphazero.connection.DefaultConnectionSpec;
+import org.jredis.ri.alphazero.support.Log;
+
+public class AdHocTestInfo {
+ public static void main(String[] args) throws Throwable {
+ try {
+ new AdHocTestInfo().run();
+ } catch (Exception e) {
+ Log.error(e.getMessage());
+ }
+ }
+ final ConnectionSpec spec;
+ JRedisFuture jredis = null;
+ public AdHocTestInfo() throws Throwable{
+ spec = DefaultConnectionSpec.newSpec().setCredentials("jredis".getBytes());
+ jredis = new JRedisPipeline(spec);
+ }
+ /** this is not supposed to get called unless you actually run redis on port 9999 :P */
+ public void run() {
+ try {
+ Map<String, String> infomap = jredis.info().get();
+ for(String k : infomap.keySet()){
+ System.out.format("%s => %s\n", k, infomap.get(k));
+ }
+
+ System.out.format("\n\n### InfoMap needs to be updated to include ###\n");
+ for(String k : infomap.keySet()){
+ try {
+ RedisInfo.valueOf(k);
+ }
+ catch (IllegalArgumentException e){
+ System.out.format("%s,\n", k);
+ }
+ }
+ System.out.format("### END ###\n");
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ finally {
+ jredis.quit();
+ }
+ }
+}
View
2  redis_version_compliance.txt
@@ -1,2 +1,2 @@
compliance: Redis 2.2.0
-tested with: Redis 2.2.4
+tested with: Redis 2.2.6
Please sign in to comment.
Something went wrong with that request. Please try again.