Skip to content

Commit bc31655

Browse files
christophstroblThomas Darimont
authored and
Thomas Darimont
committed
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.
1 parent c6c3818 commit bc31655

File tree

7 files changed

+203
-36
lines changed

7 files changed

+203
-36
lines changed

docs/src/info/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Spring Data Redis jars files can be found in the 'dist' directory.
2222
Please see the reference documentation.
2323
Additionally the blog at https://spring.io/blog as well as sections of interest in the reference documentation.
2424

25-
ADDITIONAL RESOURCES
25+
5. ADDITIONAL RESOURCES
2626
Spring Data Homepage: http://projects.spring.io/spring-data-redis/
2727
Spring Data Forum : http://forum.spring.io/forum/spring-projects/data/nosql
2828
Redis Homepage : http://redis.io
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<appendix xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="appendix-command-reference" xmlns:xi="http://www.w3.org/2001/XInclude">
3+
<title>Spring Data Redis Supported Commands</title>
4+
5+
<table>
6+
<title>Redis commands supported by <classname>RedisTemplate</classname>.</title>
7+
<tgroup cols="2">
8+
<colspec colwidth="2*"/>
9+
<colspec colwidth="1*"/>
10+
<thead>
11+
<row>
12+
<entry>Command</entry>
13+
<entry>Template Support</entry>
14+
</row>
15+
</thead>
16+
<tbody>
17+
<row><entry><code>APPEND</code></entry><entry>X</entry></row>
18+
<row><entry><code>AUTH</code></entry><entry>X</entry></row>
19+
<row><entry><code>BGREWRITEAOF</code></entry><entry>X</entry></row>
20+
<row><entry><code>BGSAVE</code></entry><entry>X</entry></row>
21+
<row><entry><code>BITCOUNT</code></entry><entry>X</entry></row>
22+
<row><entry><code>BITOP</code></entry><entry>X</entry></row>
23+
<row><entry><code>BLPOP</code></entry><entry>X</entry></row>
24+
<row><entry><code>BRPOP</code></entry><entry>X</entry></row>
25+
<row><entry><code>BRPOPLPUSH</code></entry><entry>X</entry></row>
26+
<row><entry><code>CLIENT GETNAME</code></entry><entry>-</entry></row>
27+
<row><entry><code>CLIENT KILL</code></entry><entry>-</entry></row>
28+
<row><entry><code>CLIENT LIST</code></entry><entry>-</entry></row>
29+
<row><entry><code>CLIENT SETNAME</code></entry><entry>-</entry></row>
30+
<row><entry><code>CONFIG GET</code></entry><entry>X</entry></row>
31+
<row><entry><code>CONFIG RESETSTAT</code></entry><entry>X</entry></row>
32+
<row><entry><code>CONFIG REWRITE</code></entry><entry>-</entry></row>
33+
<row><entry><code>CONFIG SET</code></entry><entry>X</entry></row>
34+
<row><entry><code>DBSIZE</code></entry><entry>X</entry></row>
35+
<row><entry><code>DEBUG OBJECT</code></entry><entry>-</entry></row>
36+
<row><entry><code>DEBUG SEGFAULT</code></entry><entry>-</entry></row>
37+
<row><entry><code>DECR</code></entry><entry>X</entry></row>
38+
<row><entry><code>DECRBY</code></entry><entry>X</entry></row>
39+
<row><entry><code>DEL</code></entry><entry>X</entry></row>
40+
<row><entry><code>DISCARD</code></entry><entry>X</entry></row>
41+
<row><entry><code>DUMP</code></entry><entry>X</entry></row>
42+
<row><entry><code>ECHO</code></entry><entry>X</entry></row>
43+
<row><entry><code>EVAL</code></entry><entry>X</entry></row>
44+
<row><entry><code>EVALSHA</code></entry><entry>X</entry></row>
45+
<row><entry><code>EXEC</code></entry><entry>X</entry></row>
46+
<row><entry><code>EXISTS</code></entry><entry>X</entry></row>
47+
<row><entry><code>EXPIRE</code></entry><entry>X</entry></row>
48+
<row><entry><code>EXPIREAT</code></entry><entry>X</entry></row>
49+
<row><entry><code>FLUSHALL</code></entry><entry>X</entry></row>
50+
<row><entry><code>FLUSHDB</code></entry><entry>X</entry></row>
51+
<row><entry><code>GET</code></entry><entry>X</entry></row>
52+
<row><entry><code>GETBIT</code></entry><entry>X</entry></row>
53+
<row><entry><code>GETRANGE</code></entry><entry>X</entry></row>
54+
<row><entry><code>GETSET</code></entry><entry>X</entry></row>
55+
<row><entry><code>HDEL</code></entry><entry>X</entry></row>
56+
<row><entry><code>HEXISTS</code></entry><entry>X</entry></row>
57+
<row><entry><code>HGET</code></entry><entry>X</entry></row>
58+
<row><entry><code>HGETALL</code></entry><entry>X</entry></row>
59+
<row><entry><code>HINCRBY</code></entry><entry>X</entry></row>
60+
<row><entry><code>HINCRBYFLOAT</code></entry><entry>X</entry></row>
61+
<row><entry><code>HKEYS</code></entry><entry>X</entry></row>
62+
<row><entry><code>HLEN</code></entry><entry>X</entry></row>
63+
<row><entry><code>HMGET</code></entry><entry>X</entry></row>
64+
<row><entry><code>HMSET</code></entry><entry>X</entry></row>
65+
<row><entry><code>HSCAN</code></entry><entry>-</entry></row>
66+
<row><entry><code>HSET</code></entry><entry>X</entry></row>
67+
<row><entry><code>HSETNX</code></entry><entry>X</entry></row>
68+
<row><entry><code>HVALS</code></entry><entry>X</entry></row>
69+
<row><entry><code>INCR</code></entry><entry>X</entry></row>
70+
<row><entry><code>INCRBY</code></entry><entry>X</entry></row>
71+
<row><entry><code>INCRBYFLOAT</code></entry><entry>X</entry></row>
72+
<row><entry><code>INFO</code></entry><entry>X</entry></row>
73+
<row><entry><code>KEYS</code></entry><entry>X</entry></row>
74+
<row><entry><code>LASTSAVE</code></entry><entry>X</entry></row>
75+
<row><entry><code>LINDEX</code></entry><entry>X</entry></row>
76+
<row><entry><code>LINSERT</code></entry><entry>X</entry></row>
77+
<row><entry><code>LLEN</code></entry><entry>X</entry></row>
78+
<row><entry><code>LPOP</code></entry><entry>X</entry></row>
79+
<row><entry><code>LPUSH</code></entry><entry>X</entry></row>
80+
<row><entry><code>LPUSHX</code></entry><entry>X</entry></row>
81+
<row><entry><code>LRANGE</code></entry><entry>X</entry></row>
82+
<row><entry><code>LREM</code></entry><entry>X</entry></row>
83+
<row><entry><code>LSET</code></entry><entry>X</entry></row>
84+
<row><entry><code>LTRIM</code></entry><entry>X</entry></row>
85+
<row><entry><code>MGET</code></entry><entry>X</entry></row>
86+
<row><entry><code>MIGRATE</code></entry><entry>-</entry></row>
87+
<row><entry><code>MONITOR</code></entry><entry>-</entry></row>
88+
<row><entry><code>MOVE</code></entry><entry>X</entry></row>
89+
<row><entry><code>MSET</code></entry><entry>X</entry></row>
90+
<row><entry><code>MSETNX</code></entry><entry>X</entry></row>
91+
<row><entry><code>MULTI</code></entry><entry>X</entry></row>
92+
<row><entry><code>OBJECT</code></entry><entry>-</entry></row>
93+
<row><entry><code>PERSIST</code></entry><entry>X</entry></row>
94+
<row><entry><code>PEXIPRE</code></entry><entry>X</entry></row>
95+
<row><entry><code>PEXPIREAT</code></entry><entry>X</entry></row>
96+
<row><entry><code>PING</code></entry><entry>X</entry></row>
97+
<row><entry><code>PSETEX</code></entry><entry>-</entry></row>
98+
<row><entry><code>PSUBSCRIBE</code></entry><entry>X</entry></row>
99+
<row><entry><code>PTTL</code></entry><entry>X</entry></row>
100+
<row><entry><code>PUBLISH</code></entry><entry>X</entry></row>
101+
<row><entry><code>PUBSUB</code></entry><entry>-</entry></row>
102+
<row><entry><code>PUBSUBSCRIBE</code></entry><entry>-</entry></row>
103+
<row><entry><code>QUIT</code></entry><entry>X</entry></row>
104+
<row><entry><code>RANDOMKEY</code></entry><entry>X</entry></row>
105+
<row><entry><code>RENAME</code></entry><entry>X</entry></row>
106+
<row><entry><code>RENAMENX</code></entry><entry>X</entry></row>
107+
<row><entry><code>RESTORE</code></entry><entry>X</entry></row>
108+
<row><entry><code>RPOP</code></entry><entry>X</entry></row>
109+
<row><entry><code>RPOPLPUSH</code></entry><entry>X</entry></row>
110+
<row><entry><code>RPUSH</code></entry><entry>X</entry></row>
111+
<row><entry><code>RPUSHX</code></entry><entry>X</entry></row>
112+
<row><entry><code>SADD</code></entry><entry>X</entry></row>
113+
<row><entry><code>SAVE</code></entry><entry>X</entry></row>
114+
<row><entry><code>SCAN</code></entry><entry>-</entry></row>
115+
<row><entry><code>SCARD</code></entry><entry>X</entry></row>
116+
<row><entry><code>SCRIPT EXITS</code></entry><entry>X</entry></row>
117+
<row><entry><code>SCRIPT FLUSH</code></entry><entry>X</entry></row>
118+
<row><entry><code>SCRIPT KILL</code></entry><entry>X</entry></row>
119+
<row><entry><code>SCRIPT LOAD</code></entry><entry>X</entry></row>
120+
<row><entry><code>SDIFF</code></entry><entry>X</entry></row>
121+
<row><entry><code>SDIFFSTORE</code></entry><entry>X</entry></row>
122+
<row><entry><code>SELECT</code></entry><entry>X</entry></row>
123+
<row><entry><code>SENTINEL FAILOVER</code></entry><entry>-</entry></row>
124+
<row><entry><code>SENTINEL GET-MASTER-ADD-BY-NAME</code></entry><entry>-</entry></row>
125+
<row><entry><code>SENTINEL MASTER</code></entry><entry>-</entry></row>
126+
<row><entry><code>SENTINEL MASTERS</code></entry><entry>-</entry></row>
127+
<row><entry><code>SENTINEL MONITOR</code></entry><entry>-</entry></row>
128+
<row><entry><code>SENTINEL REMOVE</code></entry><entry>-</entry></row>
129+
<row><entry><code>SENTINEL RESET</code></entry><entry>-</entry></row>
130+
<row><entry><code>SENTINEL SET</code></entry><entry>-</entry></row>
131+
<row><entry><code>SENTINEL SLAVES</code></entry><entry>-</entry></row>
132+
<row><entry><code>SET</code></entry><entry>X</entry></row>
133+
<row><entry><code>SETBIT</code></entry><entry>X</entry></row>
134+
<row><entry><code>SETEX</code></entry><entry>X</entry></row>
135+
<row><entry><code>SETNX</code></entry><entry>X</entry></row>
136+
<row><entry><code>SETRANGE</code></entry><entry>X</entry></row>
137+
<row><entry><code>SHUTDOWN</code></entry><entry>X</entry></row>
138+
<row><entry><code>SINTER</code></entry><entry>X</entry></row>
139+
<row><entry><code>SINTERSTORE</code></entry><entry>X</entry></row>
140+
<row><entry><code>SISMEMBER</code></entry><entry>X</entry></row>
141+
<row><entry><code>SLAVEOF</code></entry><entry>-</entry></row>
142+
<row><entry><code>SLOWLOG</code></entry><entry>-</entry></row>
143+
<row><entry><code>SMEMBERS</code></entry><entry>X</entry></row>
144+
<row><entry><code>SMOVE</code></entry><entry>X</entry></row>
145+
<row><entry><code>SORT</code></entry><entry>X</entry></row>
146+
<row><entry><code>SPOP</code></entry><entry>X</entry></row>
147+
<row><entry><code>SRANDMEMBER</code></entry><entry>X</entry></row>
148+
<row><entry><code>SREM</code></entry><entry>X</entry></row>
149+
<row><entry><code>SSCAN</code></entry><entry>-</entry></row>
150+
<row><entry><code>STRLEN</code></entry><entry>X</entry></row>
151+
<row><entry><code>SUBSCRIBE</code></entry><entry>X</entry></row>
152+
<row><entry><code>SUNION</code></entry><entry>X</entry></row>
153+
<row><entry><code>SUNIONSTORE</code></entry><entry>X</entry></row>
154+
<row><entry><code>SYNC</code></entry><entry>-</entry></row>
155+
<row><entry><code>TIME</code></entry><entry>X</entry></row>
156+
<row><entry><code>TTL</code></entry><entry>X</entry></row>
157+
<row><entry><code>TYPE</code></entry><entry>X</entry></row>
158+
<row><entry><code>UNSUBSCRIBE</code></entry><entry>X</entry></row>
159+
<row><entry><code>UNWATCH</code></entry><entry>X</entry></row>
160+
<row><entry><code>WATCH</code></entry><entry>X</entry></row>
161+
<row><entry><code>ZADD</code></entry><entry>X</entry></row>
162+
<row><entry><code>ZCARD</code></entry><entry>X</entry></row>
163+
<row><entry><code>ZCOUNT</code></entry><entry>X</entry></row>
164+
<row><entry><code>ZINCRBY</code></entry><entry>X</entry></row>
165+
<row><entry><code>ZINTERSTORE</code></entry><entry>X</entry></row>
166+
<row><entry><code>ZRANGE</code></entry><entry>X</entry></row>
167+
<row><entry><code>ZRANGEBYSCORE</code></entry><entry>X</entry></row>
168+
<row><entry><code>ZRANK</code></entry><entry>X</entry></row>
169+
<row><entry><code>ZREM</code></entry><entry>X</entry></row>
170+
<row><entry><code>ZREMRANGEBYRANK</code></entry><entry>X</entry></row>
171+
<row><entry><code>ZREVRANGE</code></entry><entry>X</entry></row>
172+
<row><entry><code>ZREVRANGEBYSCORE</code></entry><entry>X</entry></row>
173+
<row><entry><code>ZREVRANK</code></entry><entry>X</entry></row>
174+
<row><entry><code>ZSCAN</code></entry><entry>-</entry></row>
175+
<row><entry><code>ZSCORE</code></entry><entry>X</entry></row>
176+
<row><entry><code>ZUNINONSTORE</code></entry><entry>X</entry></row>
177+
</tbody>
178+
</tgroup>
179+
</table>
180+
</appendix>

docs/src/reference/docbook/appendix/appendix-schema.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
<title>Spring Data Redis Schema(s)</title>
44

55
<para>Core schema</para>
6-
<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">
7-
<xi:fallback>
8-
<para><emphasis>FIXME: REDIS SCHEMA LOCATION/NAME CHANGED</emphasis></para>
9-
</xi:fallback>
6+
<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">
7+
<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"/>
108
</xi:include>
119
</programlisting>
1210

docs/src/reference/docbook/index.xml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@
4040
further provided that each copy contains this Copyright Notice, whether
4141
distributed in print or electronically.
4242
</para>
43-
</legalnotice>
43+
</legalnotice>
44+
45+
<copyright xmlns:xi="http://www.w3.org/2001/XInclude">
46+
<year>2011-2014</year>
47+
<holder>The original authors.</holder>
48+
</copyright>
49+
4450
</bookinfo>
4551

4652
<toc/>
@@ -67,20 +73,7 @@
6773

6874
<xi:include href="appendix/introduction.xml"/>
6975
<xi:include href="appendix/appendix-schema.xml"/>
76+
<xi:include href="appendix/appendix-command-reference.xml"/>
7077
</part>
71-
<!--
72-
<part id="resources">
73-
<title>Other Documentation</title>
74-
75-
<partintro>
76-
<para>
77-
In addition to this reference documentation, there are a number of
78-
other resources that may help you learn how to use the various key value
79-
stores and Spring Data. These additional, third-party resources are
80-
enumerated in this section.
81-
</para>
82-
</partintro>
83-
<xi:include href="links.xml"/>
84-
</part>
85-
-->
86-
</book>
78+
79+
</book>

docs/src/reference/docbook/reference/redis-messaging.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ template.convertAndSend("hello!", "world");
5656
whether it is listening or not, <interfacename>RedisConnection</interfacename>
5757
provides <methodname>getSubscription</methodname> and <methodname>isSubscribed</methodname> method.</para>
5858

59-
<important>When using Jedis or JRedis connectors, subscribing commands are synchronous and thus blocking. That is, calling subscribe on a connection will cause
59+
<important>Subscription commands in Spring Data Redis are blocking. That is, calling subscribe on a connection will cause
6060
the current thread to block as it will start waiting for messages - the thread will be released only if the subscription
6161
is canceled, that is an additional thread invokes <methodname>unsubscribe</methodname> or <methodname>pUnsubscribe</methodname>
6262
on the <emphasis>same</emphasis> connection. See <link linkend="redis:pubsub:subscribe:containers">message listener container</link> below

docs/src/reference/docbook/reference/redis-scripting.xml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,13 @@
1717
<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
1818
it requires that we execute a set of commands atomically and the behavior of one command is influenced by the result of another.</para>
1919

20-
<programlisting language="xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
21-
<beans xmlns="http://www.springframework.org/schema/beans"
22-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23-
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
24-
25-
<bean id="script" class="org.springframework.data.redis.core.script.DefaultRedisScript">
26-
<property name="location" value="classpath:META-INF/scripts/checkandset.lua"/>
27-
<property name="resultType" value="java.lang.Boolean"/>
28-
</bean>
29-
...
30-
</beans>]]></programlisting>
20+
<programlisting language="java">@Bean
21+
public RedisScript&lt;Boolean&gt; script() {
22+
DefaultRedisScript&lt;Boolean&gt; redisScript = new DefaultRedisScript&lt;Boolean&gt;();
23+
redisScript.setScriptSource(new ResourceScriptSource(new ClassPathResource("META-INF/scripts/checkandset.lua")));
24+
redisScript.setResultType(Boolean.class);
25+
}
26+
</programlisting>
3127

3228
<programlisting language="java"><![CDATA[
3329
public class Example {
@@ -55,7 +51,7 @@ return false
5551
<para>The XML above configures a <classname>DefaultRedisScript</classname> pointing to a file called <literal>checkandset.lua</literal>, which is
5652
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
5753
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
58-
re-calcuation of the script's SHA1 on every script execution.
54+
re-calculation of the script's SHA1 on every script execution.
5955
</para>
6056

6157
<para>The checkAndSet method above then executes the configured <interfacename>RedisScript</interfacename> with the provided key and arguments and returns the result.</para>

docs/src/reference/docbook/reference/redis.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
p:host-name="server" p:port="6379"/>
135135
</beans>]]></programlisting>
136136

137-
<para>The configuration is quite similar to Jedis, with one notable exception. By default, the <literal>JedisConnectionFactory</literal> pools connections.
137+
<para>The configuration is quite similar to Jedis, with one notable exception. By default, the <literal>JredisConnectionFactory</literal> pools connections.
138138
In order to use a connection pool with JRedis, configure the <literal>JredisConnectionFactory</literal> with an instance of <literal>JredisPool</literal>. For example:
139139
</para>
140140

0 commit comments

Comments
 (0)