DATAREDIS-279 - Update documentation

Corrected typos and added copyright information.
Updated sync nature for subscriptions using RMLC.
Added RedisTemplate command reference.
Added include-fallback to appendix-schema reference.

Original pull request: #41.
This commit is contained in:
Christoph Strobl
2014-02-27 08:27:42 +01:00
committed by Thomas Darimont
parent c6c38180f3
commit bc31655417
7 changed files with 203 additions and 36 deletions

View File

@@ -22,7 +22,7 @@ The Spring Data Redis jars files can be found in the 'dist' directory.
Please see the reference documentation.
Additionally the blog at https://spring.io/blog as well as sections of interest in the reference documentation.
ADDITIONAL RESOURCES
5. ADDITIONAL RESOURCES
Spring Data Homepage: http://projects.spring.io/spring-data-redis/
Spring Data Forum : http://forum.spring.io/forum/spring-projects/data/nosql
Redis Homepage : http://redis.io

View File

@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<appendix xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="appendix-command-reference" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>Spring Data Redis Supported Commands</title>
<table>
<title>Redis commands supported by <classname>RedisTemplate</classname>.</title>
<tgroup cols="2">
<colspec colwidth="2*"/>
<colspec colwidth="1*"/>
<thead>
<row>
<entry>Command</entry>
<entry>Template Support</entry>
</row>
</thead>
<tbody>
<row><entry><code>APPEND</code></entry><entry>X</entry></row>
<row><entry><code>AUTH</code></entry><entry>X</entry></row>
<row><entry><code>BGREWRITEAOF</code></entry><entry>X</entry></row>
<row><entry><code>BGSAVE</code></entry><entry>X</entry></row>
<row><entry><code>BITCOUNT</code></entry><entry>X</entry></row>
<row><entry><code>BITOP</code></entry><entry>X</entry></row>
<row><entry><code>BLPOP</code></entry><entry>X</entry></row>
<row><entry><code>BRPOP</code></entry><entry>X</entry></row>
<row><entry><code>BRPOPLPUSH</code></entry><entry>X</entry></row>
<row><entry><code>CLIENT GETNAME</code></entry><entry>-</entry></row>
<row><entry><code>CLIENT KILL</code></entry><entry>-</entry></row>
<row><entry><code>CLIENT LIST</code></entry><entry>-</entry></row>
<row><entry><code>CLIENT SETNAME</code></entry><entry>-</entry></row>
<row><entry><code>CONFIG GET</code></entry><entry>X</entry></row>
<row><entry><code>CONFIG RESETSTAT</code></entry><entry>X</entry></row>
<row><entry><code>CONFIG REWRITE</code></entry><entry>-</entry></row>
<row><entry><code>CONFIG SET</code></entry><entry>X</entry></row>
<row><entry><code>DBSIZE</code></entry><entry>X</entry></row>
<row><entry><code>DEBUG OBJECT</code></entry><entry>-</entry></row>
<row><entry><code>DEBUG SEGFAULT</code></entry><entry>-</entry></row>
<row><entry><code>DECR</code></entry><entry>X</entry></row>
<row><entry><code>DECRBY</code></entry><entry>X</entry></row>
<row><entry><code>DEL</code></entry><entry>X</entry></row>
<row><entry><code>DISCARD</code></entry><entry>X</entry></row>
<row><entry><code>DUMP</code></entry><entry>X</entry></row>
<row><entry><code>ECHO</code></entry><entry>X</entry></row>
<row><entry><code>EVAL</code></entry><entry>X</entry></row>
<row><entry><code>EVALSHA</code></entry><entry>X</entry></row>
<row><entry><code>EXEC</code></entry><entry>X</entry></row>
<row><entry><code>EXISTS</code></entry><entry>X</entry></row>
<row><entry><code>EXPIRE</code></entry><entry>X</entry></row>
<row><entry><code>EXPIREAT</code></entry><entry>X</entry></row>
<row><entry><code>FLUSHALL</code></entry><entry>X</entry></row>
<row><entry><code>FLUSHDB</code></entry><entry>X</entry></row>
<row><entry><code>GET</code></entry><entry>X</entry></row>
<row><entry><code>GETBIT</code></entry><entry>X</entry></row>
<row><entry><code>GETRANGE</code></entry><entry>X</entry></row>
<row><entry><code>GETSET</code></entry><entry>X</entry></row>
<row><entry><code>HDEL</code></entry><entry>X</entry></row>
<row><entry><code>HEXISTS</code></entry><entry>X</entry></row>
<row><entry><code>HGET</code></entry><entry>X</entry></row>
<row><entry><code>HGETALL</code></entry><entry>X</entry></row>
<row><entry><code>HINCRBY</code></entry><entry>X</entry></row>
<row><entry><code>HINCRBYFLOAT</code></entry><entry>X</entry></row>
<row><entry><code>HKEYS</code></entry><entry>X</entry></row>
<row><entry><code>HLEN</code></entry><entry>X</entry></row>
<row><entry><code>HMGET</code></entry><entry>X</entry></row>
<row><entry><code>HMSET</code></entry><entry>X</entry></row>
<row><entry><code>HSCAN</code></entry><entry>-</entry></row>
<row><entry><code>HSET</code></entry><entry>X</entry></row>
<row><entry><code>HSETNX</code></entry><entry>X</entry></row>
<row><entry><code>HVALS</code></entry><entry>X</entry></row>
<row><entry><code>INCR</code></entry><entry>X</entry></row>
<row><entry><code>INCRBY</code></entry><entry>X</entry></row>
<row><entry><code>INCRBYFLOAT</code></entry><entry>X</entry></row>
<row><entry><code>INFO</code></entry><entry>X</entry></row>
<row><entry><code>KEYS</code></entry><entry>X</entry></row>
<row><entry><code>LASTSAVE</code></entry><entry>X</entry></row>
<row><entry><code>LINDEX</code></entry><entry>X</entry></row>
<row><entry><code>LINSERT</code></entry><entry>X</entry></row>
<row><entry><code>LLEN</code></entry><entry>X</entry></row>
<row><entry><code>LPOP</code></entry><entry>X</entry></row>
<row><entry><code>LPUSH</code></entry><entry>X</entry></row>
<row><entry><code>LPUSHX</code></entry><entry>X</entry></row>
<row><entry><code>LRANGE</code></entry><entry>X</entry></row>
<row><entry><code>LREM</code></entry><entry>X</entry></row>
<row><entry><code>LSET</code></entry><entry>X</entry></row>
<row><entry><code>LTRIM</code></entry><entry>X</entry></row>
<row><entry><code>MGET</code></entry><entry>X</entry></row>
<row><entry><code>MIGRATE</code></entry><entry>-</entry></row>
<row><entry><code>MONITOR</code></entry><entry>-</entry></row>
<row><entry><code>MOVE</code></entry><entry>X</entry></row>
<row><entry><code>MSET</code></entry><entry>X</entry></row>
<row><entry><code>MSETNX</code></entry><entry>X</entry></row>
<row><entry><code>MULTI</code></entry><entry>X</entry></row>
<row><entry><code>OBJECT</code></entry><entry>-</entry></row>
<row><entry><code>PERSIST</code></entry><entry>X</entry></row>
<row><entry><code>PEXIPRE</code></entry><entry>X</entry></row>
<row><entry><code>PEXPIREAT</code></entry><entry>X</entry></row>
<row><entry><code>PING</code></entry><entry>X</entry></row>
<row><entry><code>PSETEX</code></entry><entry>-</entry></row>
<row><entry><code>PSUBSCRIBE</code></entry><entry>X</entry></row>
<row><entry><code>PTTL</code></entry><entry>X</entry></row>
<row><entry><code>PUBLISH</code></entry><entry>X</entry></row>
<row><entry><code>PUBSUB</code></entry><entry>-</entry></row>
<row><entry><code>PUBSUBSCRIBE</code></entry><entry>-</entry></row>
<row><entry><code>QUIT</code></entry><entry>X</entry></row>
<row><entry><code>RANDOMKEY</code></entry><entry>X</entry></row>
<row><entry><code>RENAME</code></entry><entry>X</entry></row>
<row><entry><code>RENAMENX</code></entry><entry>X</entry></row>
<row><entry><code>RESTORE</code></entry><entry>X</entry></row>
<row><entry><code>RPOP</code></entry><entry>X</entry></row>
<row><entry><code>RPOPLPUSH</code></entry><entry>X</entry></row>
<row><entry><code>RPUSH</code></entry><entry>X</entry></row>
<row><entry><code>RPUSHX</code></entry><entry>X</entry></row>
<row><entry><code>SADD</code></entry><entry>X</entry></row>
<row><entry><code>SAVE</code></entry><entry>X</entry></row>
<row><entry><code>SCAN</code></entry><entry>-</entry></row>
<row><entry><code>SCARD</code></entry><entry>X</entry></row>
<row><entry><code>SCRIPT EXITS</code></entry><entry>X</entry></row>
<row><entry><code>SCRIPT FLUSH</code></entry><entry>X</entry></row>
<row><entry><code>SCRIPT KILL</code></entry><entry>X</entry></row>
<row><entry><code>SCRIPT LOAD</code></entry><entry>X</entry></row>
<row><entry><code>SDIFF</code></entry><entry>X</entry></row>
<row><entry><code>SDIFFSTORE</code></entry><entry>X</entry></row>
<row><entry><code>SELECT</code></entry><entry>X</entry></row>
<row><entry><code>SENTINEL FAILOVER</code></entry><entry>-</entry></row>
<row><entry><code>SENTINEL GET-MASTER-ADD-BY-NAME</code></entry><entry>-</entry></row>
<row><entry><code>SENTINEL MASTER</code></entry><entry>-</entry></row>
<row><entry><code>SENTINEL MASTERS</code></entry><entry>-</entry></row>
<row><entry><code>SENTINEL MONITOR</code></entry><entry>-</entry></row>
<row><entry><code>SENTINEL REMOVE</code></entry><entry>-</entry></row>
<row><entry><code>SENTINEL RESET</code></entry><entry>-</entry></row>
<row><entry><code>SENTINEL SET</code></entry><entry>-</entry></row>
<row><entry><code>SENTINEL SLAVES</code></entry><entry>-</entry></row>
<row><entry><code>SET</code></entry><entry>X</entry></row>
<row><entry><code>SETBIT</code></entry><entry>X</entry></row>
<row><entry><code>SETEX</code></entry><entry>X</entry></row>
<row><entry><code>SETNX</code></entry><entry>X</entry></row>
<row><entry><code>SETRANGE</code></entry><entry>X</entry></row>
<row><entry><code>SHUTDOWN</code></entry><entry>X</entry></row>
<row><entry><code>SINTER</code></entry><entry>X</entry></row>
<row><entry><code>SINTERSTORE</code></entry><entry>X</entry></row>
<row><entry><code>SISMEMBER</code></entry><entry>X</entry></row>
<row><entry><code>SLAVEOF</code></entry><entry>-</entry></row>
<row><entry><code>SLOWLOG</code></entry><entry>-</entry></row>
<row><entry><code>SMEMBERS</code></entry><entry>X</entry></row>
<row><entry><code>SMOVE</code></entry><entry>X</entry></row>
<row><entry><code>SORT</code></entry><entry>X</entry></row>
<row><entry><code>SPOP</code></entry><entry>X</entry></row>
<row><entry><code>SRANDMEMBER</code></entry><entry>X</entry></row>
<row><entry><code>SREM</code></entry><entry>X</entry></row>
<row><entry><code>SSCAN</code></entry><entry>-</entry></row>
<row><entry><code>STRLEN</code></entry><entry>X</entry></row>
<row><entry><code>SUBSCRIBE</code></entry><entry>X</entry></row>
<row><entry><code>SUNION</code></entry><entry>X</entry></row>
<row><entry><code>SUNIONSTORE</code></entry><entry>X</entry></row>
<row><entry><code>SYNC</code></entry><entry>-</entry></row>
<row><entry><code>TIME</code></entry><entry>X</entry></row>
<row><entry><code>TTL</code></entry><entry>X</entry></row>
<row><entry><code>TYPE</code></entry><entry>X</entry></row>
<row><entry><code>UNSUBSCRIBE</code></entry><entry>X</entry></row>
<row><entry><code>UNWATCH</code></entry><entry>X</entry></row>
<row><entry><code>WATCH</code></entry><entry>X</entry></row>
<row><entry><code>ZADD</code></entry><entry>X</entry></row>
<row><entry><code>ZCARD</code></entry><entry>X</entry></row>
<row><entry><code>ZCOUNT</code></entry><entry>X</entry></row>
<row><entry><code>ZINCRBY</code></entry><entry>X</entry></row>
<row><entry><code>ZINTERSTORE</code></entry><entry>X</entry></row>
<row><entry><code>ZRANGE</code></entry><entry>X</entry></row>
<row><entry><code>ZRANGEBYSCORE</code></entry><entry>X</entry></row>
<row><entry><code>ZRANK</code></entry><entry>X</entry></row>
<row><entry><code>ZREM</code></entry><entry>X</entry></row>
<row><entry><code>ZREMRANGEBYRANK</code></entry><entry>X</entry></row>
<row><entry><code>ZREVRANGE</code></entry><entry>X</entry></row>
<row><entry><code>ZREVRANGEBYSCORE</code></entry><entry>X</entry></row>
<row><entry><code>ZREVRANK</code></entry><entry>X</entry></row>
<row><entry><code>ZSCAN</code></entry><entry>-</entry></row>
<row><entry><code>ZSCORE</code></entry><entry>X</entry></row>
<row><entry><code>ZUNINONSTORE</code></entry><entry>X</entry></row>
</tbody>
</tgroup>
</table>
</appendix>

View File

@@ -3,10 +3,8 @@
<title>Spring Data Redis Schema(s)</title>
<para>Core schema</para>
<programlisting language="xml"><xi:include href="../../../src/main/resources/org/springframework/data/redis/config/spring-redis-1.0.xsd" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:fallback>
<para><emphasis>FIXME: REDIS SCHEMA LOCATION/NAME CHANGED</emphasis></para>
</xi:fallback>
<programlisting language="xml"><xi:include href="../../../src/main/resources/org/springframework/data/redis/config/spring-redis-1.0.xsd" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:fallback href="https://raw.github.com/spring-projects/spring-data-redis/src/main/resources/org/springframework/data/redis/config/spring-redis-1.0.xsd" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</xi:include>
</programlisting>

View File

@@ -40,7 +40,13 @@
further provided that each copy contains this Copyright Notice, whether
distributed in print or electronically.
</para>
</legalnotice>
</legalnotice>
<copyright xmlns:xi="http://www.w3.org/2001/XInclude">
<year>2011-2014</year>
<holder>The original authors.</holder>
</copyright>
</bookinfo>
<toc/>
@@ -67,20 +73,7 @@
<xi:include href="appendix/introduction.xml"/>
<xi:include href="appendix/appendix-schema.xml"/>
<xi:include href="appendix/appendix-command-reference.xml"/>
</part>
<!--
<part id="resources">
<title>Other Documentation</title>
<partintro>
<para>
In addition to this reference documentation, there are a number of
other resources that may help you learn how to use the various key value
stores and Spring Data. These additional, third-party resources are
enumerated in this section.
</para>
</partintro>
<xi:include href="links.xml"/>
</part>
-->
</book>
</book>

View File

@@ -56,7 +56,7 @@ template.convertAndSend("hello!", "world");
whether it is listening or not, <interfacename>RedisConnection</interfacename>
provides <methodname>getSubscription</methodname> and <methodname>isSubscribed</methodname> method.</para>
<important>When using Jedis or JRedis connectors, subscribing commands are synchronous and thus blocking. That is, calling subscribe on a connection will cause
<important>Subscription commands in Spring Data Redis are blocking. That is, calling subscribe on a connection will cause
the current thread to block as it will start waiting for messages - the thread will be released only if the subscription
is canceled, that is an additional thread invokes <methodname>unsubscribe</methodname> or <methodname>pUnsubscribe</methodname>
on the <emphasis>same</emphasis> connection. See <link linkend="redis:pubsub:subscribe:containers">message listener container</link> below

View File

@@ -17,17 +17,13 @@
<para>Here's an example that executes a common "check-and-set" scenario using a Lua script. This is an ideal use case for a Redis script, as
it requires that we execute a set of commands atomically and the behavior of one command is influenced by the result of another.</para>
<programlisting language="xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="script" class="org.springframework.data.redis.core.script.DefaultRedisScript">
<property name="location" value="classpath:META-INF/scripts/checkandset.lua"/>
<property name="resultType" value="java.lang.Boolean"/>
</bean>
...
</beans>]]></programlisting>
<programlisting language="java">@Bean
public RedisScript&lt;Boolean&gt; script() {
DefaultRedisScript&lt;Boolean&gt; redisScript = new DefaultRedisScript&lt;Boolean&gt;();
redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("META-INF/scripts/checkandset.lua")));
redisScript.setResultType(Boolean.class);
}
</programlisting>
<programlisting language="java"><![CDATA[
public class Example {
@@ -55,7 +51,7 @@ return false
<para>The XML above configures a <classname>DefaultRedisScript</classname> pointing to a file called <literal>checkandset.lua</literal>, which is
expected to return a boolean value. The script <literal>resultType</literal> should be one of Long, Boolean, List, or deserialized value type. It can also be null if the
script returns a throw-away status (i.e "OK"). It is ideal to configure a single instance of <classname>DefaultRedisScript</classname> in your application context to avoid
re-calcuation of the script's SHA1 on every script execution.
re-calculation of the script's SHA1 on every script execution.
</para>
<para>The checkAndSet method above then executes the configured <interfacename>RedisScript</interfacename> with the provided key and arguments and returns the result.</para>

View File

@@ -134,7 +134,7 @@
p:host-name="server" p:port="6379"/>
</beans>]]></programlisting>
<para>The configuration is quite similar to Jedis, with one notable exception. By default, the <literal>JedisConnectionFactory</literal> pools connections.
<para>The configuration is quite similar to Jedis, with one notable exception. By default, the <literal>JredisConnectionFactory</literal> pools connections.
In order to use a connection pool with JRedis, configure the <literal>JredisConnectionFactory</literal> with an instance of <literal>JredisPool</literal>. For example:
</para>