Skip to content

Commit 7778fbf

Browse files
committed
DATAREDIS-825 - Polishing.
Fix typos. Remove redundant mention of JDK requirements. Original pull request: #331.
1 parent 45d721d commit 7778fbf

File tree

9 files changed

+64
-77
lines changed

9 files changed

+64
-77
lines changed
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
[[appendix:schema]]
22
[appendix]
33
= Schema
4-
:resourcesDir: ../../resources
54

6-
== Core Schema
7-
8-
[source,xml]
9-
-------------------------------------------
10-
include::{resourcesDir}/org/springframework/data/redis/config/spring-redis-1.0.xsd[]
11-
-------------------------------------------
5+
link:http://www.springframework.org/schema/redis/spring-redis-1.0.xsd[Spring Data Redis Schema (redis-namespace)]

src/main/asciidoc/index.adoc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
Costin Leau, Jennifer Hickey, Christoph Strobl, Thomas Darimont, Mark Paluch, Jay Bryant
33
:revnumber: {version}
44
:revdate: {localdate}
5-
:toc: left
5+
:toc:
6+
:toc-placement!:
67
:spring-data-commons-include: ../../../../spring-data-commons/src/main/asciidoc
78
:spring-data-commons-docs: https://raw.githubusercontent.com/spring-projects/spring-data-commons/master/src/main/asciidoc
89

@@ -13,29 +14,40 @@ NOTE: Copies of this document may be made for your own use and for distribution
1314
toc::[]
1415

1516
include::preface.adoc[]
17+
1618
:leveloffset: +1
1719
include::new-features.adoc[]
20+
1821
:leveloffset: -1
1922

2023
[[introduction]]
2124
= Introduction
2225

2326
:leveloffset: +1
2427
include::introduction/introduction.adoc[]
28+
2529
include::introduction/why-sdr.adoc[]
30+
2631
include::introduction/requirements.adoc[]
32+
2733
include::introduction/getting-started.adoc[]
34+
2835
:leveloffset: -1
2936

3037
[[reference]]
3138
= Reference Documentation
3239

3340
:leveloffset: +1
3441
include::reference/introduction.adoc[]
42+
3543
include::reference/redis.adoc[]
44+
3645
include::reference/reactive-redis.adoc[]
46+
3747
include::reference/redis-cluster.adoc[]
48+
3849
include::reference/redis-repositories.adoc[]
50+
3951
:leveloffset: -1
4052

4153
[[appendixes]]
@@ -44,6 +56,9 @@ include::reference/redis-repositories.adoc[]
4456
:numbered!:
4557
:leveloffset: +1
4658
include::appendix/introduction.adoc[]
59+
4760
include::appendix/appendix-schema.adoc[]
61+
4862
include::appendix/appendix-command-reference.adoc[]
63+
4964
:leveloffset: -1

src/main/asciidoc/introduction/getting-started.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ NoSQL stores have taken the storage world by storm. It is a vast domain with a p
2121
[[get-started:first-steps:samples]]
2222
=== Trying out the Samples
2323

24-
One can find various samples for key-value stores in the dedicated Spring Data example repo, at https://github.com/spring-projects/spring-data-keyvalue-examples[http://github.com/spring-projects/spring-data-keyvalue-examples]. For Spring Data Redis, you should pay particular attention to the `retwisj` sample, a Twitter-clone built on top of Redis that can be run locally or be deployed into the cloud. See its http://static.springsource.org/spring-data/data-keyvalue/examples/retwisj/current/[documentation], the following blog http://blog.springsource.com/2011/04/27/getting-started-redis-spring-cloud-foundry/[entry] or the http://retwisj.cloudfoundry.com/[live instance] for more information.
24+
One can find various samples for key-value stores in the dedicated Spring Data example repo, at https://github.com/spring-projects/spring-data-keyvalue-examples[http://github.com/spring-projects/spring-data-keyvalue-examples]. For Spring Data Redis, you should pay particular attention to the `retwisj` sample, a Twitter-clone built on top of Redis that can be run locally or be deployed into the cloud. See its http://static.springsource.org/spring-data/data-keyvalue/examples/retwisj/current/[documentation], the following blog http://blog.springsource.com/2011/04/27/getting-started-redis-spring-cloud-foundry/[entry] for more information.
2525

2626
[[get-started:help]]
2727
== Need Help?
@@ -46,7 +46,7 @@ For information on the Spring Data source code repository, nightly builds, and s
4646
You can help make Spring Data best serve the needs of the Spring community by interacting with developers on Stack Overflow at either
4747
http://stackoverflow.com/questions/tagged/spring-data[spring-data] or http://stackoverflow.com/questions/tagged/spring-data-redis[spring-data-redis].
4848

49-
If you encounter a bug or want to suggest an improvement (including to this documentation), please create a ticket on the Spring Data issue https://jira.springsource.org/browse/DATAREDIS[tracker].
49+
If you encounter a bug or want to suggest an improvement (including to this documentation), please create a ticket on the Spring Data issue https://jira.spring.io/browse/DATAREDIS[tracker].
5050

5151
To stay up to date with the latest news and announcements in the Spring eco system, subscribe to the Spring Community http://spring.io/[Portal].
5252

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[[requirements]]
22
= Requirements
33

4-
Spring Data Redis 1.x binaries require JDK level 6.0 and above and http://projects.spring.io/spring-framework/[Spring Framework] {springVersion} and above.
4+
Spring Data Redis 2.x binaries require JDK level 8.0 and above and http://projects.spring.io/spring-framework/[Spring Framework] {springVersion} and above.
55

6-
In terms of key-value stores, http://redis.io[Redis] 2.6.x or higher is required. Spring Data Redis is currently tested against the latest 3.2 release.
6+
In terms of key-value stores, http://redis.io[Redis] 2.6.x or higher is required. Spring Data Redis is currently tested against the latest 4.0 release.

src/main/asciidoc/reference/reactive-redis.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This section covers reactive Redis support and how to get started. Reactive Redi
77
[[redis:reactive:requirements]]
88
== Redis Requirements
99

10-
Spring Data Redis requires Redis 2.6 or above and Java SE 8.0 or above. In terms of language bindings (or connectors), Spring Data Redis currently integrates with http://github.com/lettuce-io/lettuce-core[Lettuce] as the only reactive Java connector. https://projectreactor.io/[Project Reactor] is used as reactive composition library.
10+
Spring Data Redis currently integrates with http://github.com/lettuce-io/lettuce-core[Lettuce] as the only reactive Java connector. https://projectreactor.io/[Project Reactor] is used as reactive composition library.
1111

1212
[[redis:reactive:connectors]]
1313
== Connecting to Redis by Using a Reactive Driver
@@ -46,7 +46,7 @@ public ReactiveRedisConnectionFactory connectionFactory() {
4646
}
4747
----
4848

49-
The following exxample shows a more sophisticated configuration, including SSL and timeouts, that uses `LettuceClientConfigurationBuilder`:
49+
The following example shows a more sophisticated configuration, including SSL and timeouts, that uses `LettuceClientConfigurationBuilder`:
5050

5151
[source,java]
5252
----

src/main/asciidoc/reference/redis-cluster.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ redis-cli@127.0.0.1:7379 > cluster nodes
131131
----
132132
RedisClusterConnection connection = connectionFactory.getClusterConnnection();
133133
134-
connection.set("thing1", value); // slot: 12182
135-
connection.set("{thing1}.thing2", value); // slot: 12182
136-
connection.set("thing2", value); // slot: 5461
134+
connection.set("thing1", value); // slot: 12182
135+
connection.set("{thing1}.thing2", value); // slot: 12182
136+
connection.set("thing2", value); // slot: 5461
137137
138138
connection.mGet("thing1", "{thing1}.thing2"); <2>
139139
@@ -148,7 +148,7 @@ connection.mGet("thing1", "thing2"); <
148148

149149
TIP: The preceding examples demonstrate the general strategy followed by Spring Data Redis. Be aware that some operations might require loading huge amounts of data into memory to compute the desired command. Additionally, not all cross-slot requests can safely be ported to multiple single slot requests and error if misused (for example, `PFCOUNT`).
150150

151-
== Working with RedisTemplate and ClusterOperations
151+
== Working with `RedisTemplate` and `ClusterOperations`
152152

153153
See the <<redis:template>> section for information about the general purpose, configuration, and usage of `RedisTemplate`.
154154

src/main/asciidoc/reference/redis-messaging.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[pubsub]]
2-
= Redis Messaging and Pub/Sub
2+
= Redis Messaging (Pub/Sub)
33

44
Spring Data provides dedicated messaging integration for Redis, similar in functionality and naming to the JMS integration in Spring Framework.
55

@@ -13,7 +13,7 @@ This is an example of the pattern often called Publish/Subscribe (Pub/Sub for sh
1313
The `org.springframework.data.redis.connection` and `org.springframework.data.redis.listener` packages provide the core functionality for Redis messaging.
1414

1515
[[redis:pubsub:publish]]
16-
== Publishing or Sending Messages
16+
== Publishing (Sending Messages)
1717

1818
To publish a message, you can use, as with the other operations, either the low-level `RedisConnection` or the high-level `RedisTemplate`. Both entities offer the `publish` method, which accepts the message and the destination channel as arguments. While `RedisConnection` requires raw data (array of bytes), the `RedisTemplate` lets arbitrary objects be passed in as messages, as shown in the following example:
1919

@@ -28,7 +28,7 @@ template.convertAndSend("hello!", "world");
2828
----
2929

3030
[[redis:pubsub:subscribe]]
31-
== Subscribing to or Receiving Messages
31+
== Subscribing (Receiving Messages)
3232

3333
On the receiving side, one can subscribe to one or multiple channels either by naming them directly or by using pattern matching. The latter approach is quite useful, as it not only lets multiple subscriptions be created with one command but can also listen on channels not yet created at subscription time (as long as they match the pattern).
3434

@@ -49,8 +49,8 @@ Due to its blocking nature, low-level subscription is not attractive, as it requ
4949

5050
Furthermore, to minimize the application footprint, `RedisMessageListenerContainer` lets one connection and one thread be shared by multiple listeners even though they do not share a subscription. Thus, no matter how many listeners or channels an application tracks, the runtime cost remains the same throughout its lifetime. Moreover, the container allows runtime configuration changes so that you can add or remove listeners while an application is running without the need for a restart. Additionally, the container uses a lazy subscription approach, using a `RedisConnection` only when needed. If all the listeners are unsubscribed, cleanup is automatically performed, and the thread is released.
5151

52-
To help with the asynchronous nature of messages, the container requires a `java.util.concurrent.Executor` ( or Spring's `TaskExecutor`) for dispatching the messages. Depending on the load, the number of listeners, or the runtime environment, you should change or tweak the executor to better serve your needs. In particular, in managed environments (such as app servers), it is highly recommended to pick a proper `TaskExecutor` to take advantage of its runtime.
53-
// TODO How can one know which is "proper"?
52+
To help with the asynchronous nature of messages, the container requires a `java.util.concurrent.Executor` (or Spring's `TaskExecutor`) for dispatching the messages. Depending on the load, the number of listeners, or the runtime environment, you should change or tweak the executor to better serve your needs. In particular, in managed environments (such as app servers), it is highly recommended to pick a proper `TaskExecutor` to take advantage of its runtime.
53+
5454

5555
[[redis:pubsub:subscribe:adapter]]
5656
=== The MessageListenerAdapter

src/main/asciidoc/reference/redis-repositories.adoc

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Spring Data Redis lets you easily implement domain entities, as shown in the fol
1414
====
1515
[source,java]
1616
----
17-
@RedisHash("persons")
17+
@RedisHash("people")
1818
public class Person {
1919
2020
@Id String id;
@@ -88,15 +88,15 @@ public void basicCrudOperations() {
8888
repo.delete(rand); <4>
8989
}
9090
----
91-
<1> Generates a new `id` if the current value is `null` or reuses an already set `id` value and stores properties of type `Person` inside the Redis Hash with a key that has a pattern of `keyspace:id` -- in this case, it might be `persons:5d67b7e1-8640-4475-beeb-c666fab4c0e5`.
91+
<1> Generates a new `id` if the current value is `null` or reuses an already set `id` value and stores properties of type `Person` inside the Redis Hash with a key that has a pattern of `keyspace:id` -- in this case, it might be `people:5d67b7e1-8640-4475-beeb-c666fab4c0e5`.
9292
<2> Uses the provided `id` to retrieve the object stored at `keyspace:id`.
93-
<3> Counts the total number of entities available within the keyspace, `persons`, defined by `@RedisHash` on `Person`.
93+
<3> Counts the total number of entities available within the keyspace, `people`, defined by `@RedisHash` on `Person`.
9494
<4> Removes the key for the given object from Redis.
9595
====
9696

9797
[[redis.repositories.mapping]]
9898
== Object-to-Hash Mapping
99-
The Redis Repository support persists Objects in Hashes. This requires an Object-to-Hash conversion which is done by a `RedisConverter`. The default implementation uses `Converter` for mapping property values to and from Redis native `byte[]`.
99+
The Redis Repository support persists Objects to Hashes. This requires an Object-to-Hash conversion which is done by a `RedisConverter`. The default implementation uses `Converter` for mapping property values to and from Redis native `byte[]`.
100100

101101
Given the `Person` type from the previous sections, the default mapping looks like the following:
102102

@@ -338,7 +338,7 @@ public class ApplicationConfig {
338338
339339
@Override
340340
protected Iterable<KeyspaceSettings> initialConfiguration() {
341-
return Collections.singleton(new KeyspaceSettings(Person.class, "persons"));
341+
return Collections.singleton(new KeyspaceSettings(Person.class, "people"));
342342
}
343343
}
344344
}
@@ -368,7 +368,7 @@ public class ApplicationConfig {
368368
369369
@Override
370370
protected Iterable<KeyspaceSettings> initialConfiguration() {
371-
return Collections.singleton(new KeyspaceSettings(Person.class, "persons"));
371+
return Collections.singleton(new KeyspaceSettings(Person.class, "people"));
372372
}
373373
}
374374
}
@@ -388,7 +388,7 @@ Given the sample `Person` entity shown earlier, we can create an index for `firs
388388
====
389389
[source,java]
390390
----
391-
@RedisHash("persons")
391+
@RedisHash("people")
392392
public class Person {
393393
394394
@Id String id;
@@ -404,8 +404,8 @@ Indexes are built up for actual property values. Saving two Persons (for example
404404
====
405405
[source,text]
406406
----
407-
SADD persons:firstname:rand e2c7dcee-b8cd-4424-883e-736ce564363e
408-
SADD persons:firstname:aviendha a9d4b3a0-50d3-4538-a2fc-f7fc2581ee56
407+
SADD people:firstname:rand e2c7dcee-b8cd-4424-883e-736ce564363e
408+
SADD people:firstname:aviendha a9d4b3a0-50d3-4538-a2fc-f7fc2581ee56
409409
----
410410
====
411411

@@ -414,7 +414,7 @@ It is also possible to have indexes on nested elements. Assume `Address` has a `
414414
====
415415
[source,text]
416416
----
417-
SADD persons:address.city:tear e2c7dcee-b8cd-4424-883e-736ce564363e
417+
SADD people:address.city:tear e2c7dcee-b8cd-4424-883e-736ce564363e
418418
----
419419
====
420420

@@ -423,7 +423,7 @@ Furthermore, the programmatic setup lets you define indexes on map keys and list
423423
====
424424
[source,java]
425425
----
426-
@RedisHash("persons")
426+
@RedisHash("people")
427427
public class Person {
428428
429429
// ... other properties omitted
@@ -433,9 +433,9 @@ public class Person {
433433
List<Address> addresses; <3>
434434
}
435435
----
436-
<1> `SADD persons:attributes.map-key:map-value e2c7dcee-b8cd-4424-883e-736ce564363e`
437-
<2> `SADD persons:relatives.map-key.firstname:tam e2c7dcee-b8cd-4424-883e-736ce564363e`
438-
<3> `SADD persons:addresses.city:tear e2c7dcee-b8cd-4424-883e-736ce564363e`
436+
<1> `SADD people:attributes.map-key:map-value e2c7dcee-b8cd-4424-883e-736ce564363e`
437+
<2> `SADD people:relatives.map-key.firstname:tam e2c7dcee-b8cd-4424-883e-736ce564363e`
438+
<3> `SADD people:addresses.city:tear e2c7dcee-b8cd-4424-883e-736ce564363e`
439439
====
440440

441441
CAUTION: Indexes cannot be resolved on <<redis.repositories.references,References>>.
@@ -456,7 +456,7 @@ public class ApplicationConfig {
456456
457457
@Override
458458
protected Iterable<IndexDefinition> initialConfiguration() {
459-
return Collections.singleton(new SimpleIndexDefinition("persons", "firstname"));
459+
return Collections.singleton(new SimpleIndexDefinition("people", "firstname"));
460460
}
461461
}
462462
}
@@ -486,7 +486,7 @@ public class ApplicationConfig {
486486
487487
@Override
488488
protected Iterable<IndexDefinition> initialConfiguration() {
489-
return Collections.singleton(new SimpleIndexDefinition("persons", "firstname"));
489+
return Collections.singleton(new SimpleIndexDefinition("people", "firstname"));
490490
}
491491
}
492492
}
@@ -501,7 +501,7 @@ Assume the `Address` type contains a `location` property of type `Point` that ho
501501
====
502502
[source,java]
503503
----
504-
@RedisHash("persons")
504+
@RedisHash("people")
505505
public class Person {
506506
507507
Address address;
@@ -529,10 +529,10 @@ repository.save(rand); <3
529529
530530
repository.findByAddressLocationNear(new Point(15D, 37D), new Distance(200)); <4>
531531
----
532-
<1> Query method declaration on a nested property, using Point and Distance.
533-
<2> Query method declaration on a nested property, using Circle to search within.
534-
<3> `GEOADD persons:address:location 13.361389 38.115556 e2c7dcee-b8cd-4424-883e-736ce564363e`
535-
<4> `GEORADIUS persons:address:location 15.0 37.0 200.0 km`
532+
<1> Query method declaration on a nested property, using `Point` and `Distance`.
533+
<2> Query method declaration on a nested property, using `Circle` to search within.
534+
<3> `GEOADD people:address:location 13.361389 38.115556 e2c7dcee-b8cd-4424-883e-736ce564363e`
535+
<4> `GEORADIUS people:address:location 15.0 37.0 200.0 km`
536536
====
537537

538538
In the preceding example the, longitude and latitude values are stored by using `GEOADD` that use the object's `id` as the member's name. The finder methods allow usage of `Circle` or `Point, Distance` combinations for querying those values.
@@ -584,7 +584,7 @@ The `RedisKeyExpiredEvent` holds a copy of the expired domain object as well as
584584

585585
NOTE: Delaying or disabling the expiry event listener startup impacts `RedisKeyExpiredEvent` publishing. A disabled event listener does not publish expiry events. A delayed startup can cause loss of events because of the delayed listener initialization.
586586

587-
NOTE: The keyspace notification message listener alters `notify-keyspace-events` settings in Redis, if those are not already set. Existing settings are not overridden, so you must set up those settings correctly (or leav them empty). Note that `CONFIG` is disabled on AWS ElastiCache, and enabling the listener leads to an error.
587+
NOTE: The keyspace notification message listener alters `notify-keyspace-events` settings in Redis, if those are not already set. Existing settings are not overridden, so you must set up those settings correctly (or leave them empty). Note that `CONFIG` is disabled on AWS ElastiCache, and enabling the listener leads to an error.
588588

589589
NOTE: Redis Pub/Sub messages are not persistent. If a key expires while the application is down, the expiry event is not processed, which may lead to secondary indexes containing references to the expired object.
590590

@@ -601,7 +601,7 @@ _class = org.example.Person
601601
id = e2c7dcee-b8cd-4424-883e-736ce564363e
602602
firstname = rand
603603
lastname = al’thor
604-
mother = persons:a9d4b3a0-50d3-4538-a2fc-f7fc2581ee56 <1>
604+
mother = people:a9d4b3a0-50d3-4538-a2fc-f7fc2581ee56 <1>
605605
----
606606
<1> Reference stores the whole key (`keyspace:id`) of the referenced object.
607607
====
@@ -709,9 +709,9 @@ The following table shows the details of data on a cluster (based on previous ex
709709
[options = "header, autowidth"]
710710
|===============
711711
|Key|Type|Slot|Node
712-
|persons:e2c7dcee-b8cd-4424-883e-736ce564363e|id for hash|15171|127.0.0.1:7381
713-
|persons:a9d4b3a0-50d3-4538-a2fc-f7fc2581ee56|id for hash|7373|127.0.0.1:7380
714-
|persons:firstname:rand|index|1700|127.0.0.1:7379
712+
|people:e2c7dcee-b8cd-4424-883e-736ce564363e|id for hash|15171|127.0.0.1:7381
713+
|people:a9d4b3a0-50d3-4538-a2fc-f7fc2581ee56|id for hash|7373|127.0.0.1:7380
714+
|people:firstname:rand|index|1700|127.0.0.1:7379
715715
|
716716
|===============
717717
====
@@ -721,14 +721,14 @@ Some commands (such as `SINTER` and `SUNION`) can only be processed on the serve
721721
[options = "header, autowidth"]
722722
|===============
723723
|Key|Type|Slot|Node
724-
|{persons}:e2c7dcee-b8cd-4424-883e-736ce564363e|id for hash|2399|127.0.0.1:7379
725-
|{persons}:a9d4b3a0-50d3-4538-a2fc-f7fc2581ee56|id for hash|2399|127.0.0.1:7379
726-
|{persons}:firstname:rand|index|2399|127.0.0.1:7379
724+
|{people}:e2c7dcee-b8cd-4424-883e-736ce564363e|id for hash|2399|127.0.0.1:7379
725+
|{people}:a9d4b3a0-50d3-4538-a2fc-f7fc2581ee56|id for hash|2399|127.0.0.1:7379
726+
|{people}:firstname:rand|index|2399|127.0.0.1:7379
727727
|
728728
|===============
729729
====
730730

731-
TIP: Define and pin keyspaces by using `@RedisHash("{yourkeyspace}") to specific slots when you use Redis cluster.
731+
TIP: Define and pin keyspaces by using `@RedisHash("{yourkeyspace}")` to specific slots when you use Redis cluster.
732732

733733
[[redis.repositories.cdi-integration]]
734734
== CDI Integration

0 commit comments

Comments
 (0)