Spring-data-redis使用指南

所需积分/C币:29 2017-04-27 12:00:05 1.64MB PDF
收藏 收藏
举报

Spring-data-redis使用指南
5.10. Redis transactions 23 5.10.1.@ Transactional Support.…………………24 5. 11. pipelining 25 5. 12. Redis Scripting 26 5.13. Support Classes.......... ,,,,,,,,,,,,,,,,,,,,27 5. 13.1. Support for Spring Cache Abstraction .28 6. Redis cluster.,,,,,,,,,,,,,,,,,,,,,,,,,,,, 30 6.1. Enabling Redis Cluster............. ,,,,,,,,,,,,,,,,,,,,,.30 6. 2. Working With Redis Cluster Connection 32 6.3. Working With Redis Template and clusterOperations,................ 34 7. Redis repositories 36 7.1. Usage....,. ,,,,,36 7.2. Object to Hash Mapping 38 7.3. Keyspace ..,,,..,41 7.4. Secondary Indexes..……………………42 7.4.1. Simple property Index .43 7.4.2. Geospatial Index 45 7.5. Time to live,,,,,,,,,,,,,,,,,,,, 鲁自 46 7.6. Persisting References .,....48 7.7. Persisting Partial Updates. .........................................................48 7.8. Queries and Query Methods ,,.,,,49 7.9. Redis Repositories running on Cluster 51 7.10. CDI integration......... ,4鲁垂 51 Appendixes 53 Appendix A: Schema ,54 Core schema ·t,自D ,,,,,,,,,54 Appendix B: Command Reference 59 Supported commands…… 59 o 2011-2016 The original authors Copies of this document may be made for your own use and for NOTE distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically Preface The Spring Data Redis project applies core Spring concepts to the development of solutions using a receiving messages. You will notice similarities to the jDBC support in the Spring Framewor and key-value style data store. We provide a"template"as a high-level abstraction for sendin Chapter 1. New Features New and noteworthy in the latest releases 1.1. New in Spring Data Redis 1.8 Upgrade to jedis 2.9 Upgrade to Lettuce 4.2(Note: Lettuce 4.2 requires java 8). Support for redis geo commands Support for Geospatial Indexes using Spring Data Repository abstractions(see Geospatial Index) MappingRedisConverter based HashMapper implementation(see Hash mapping) Support for PartialUpdate in repository support(see Persisting Partial Updates SSL support for connections to Redis cluster Support for client name via Connection Factory when using Jedis 1.2. New in Spring data Redis 1.7 Support for Rediscluster Support for Spring data Repository abstractions(see Redis repositories 1.3. New in Spring data Redis 1.6 The Lettuce redis driver switched from wg/lettuce to mp911de/lettuce Support for ZRANGE BYLEX Enhanced range operations for zseT s including +inf /-inf. Performance improvements in RedisCache now releasing connections earlier Generic Jackson2 Redisserializer making use of Jackson's polymorphic deserialization 1.4. New in Spring Data Redis 1.5 Add support for Redis hyperlogLog commands PFADD, PF COUNT and PFMERGE Configurable JavaT ype lookup for Jackson based RedisSerializers Property Source based configuration for connecting to Redis Sentinel (see: Redis Sentinel Support) Introduction This document is the reference guide for Spring Data Redis(SDR) Support. It explains Key value module concepts and semantics and the syntax for various stores namespaces For an introduction to key value stores or Spring, or Spring Data examples, please refer to Getting Started this documentation refers only to Spring Data Redis Support and assumes the user is familiar with the key value storages and Spring concepts Chapter 2. Why Spring Data Redis? The Spring Framework is the leading full-stack Java/JEE application framework, It provides a lightweight container and a non-invasive programming model enabled by the use of dependency njection, AOP, and portable service abstractions. NoSQL storages provide an alternative to classical rdBMs for horizontal scalability and speed. In terms of implementation, Key value stores represent one of the largest (and oldest)members in the NOSQL Space. The Spring Data Redis (or sDr) framework makes it easy to write Spring applications that use the Redis key value store by eliminating the redundant tasks and boiler plate code required for interacting with the store through Springs excellent infrastructure support Chapter 3 Requirements Spring Data Redis 1. x binaries requires DK level 6.0 and above, and Spring Framework 43. 8. RELEASE and above In terms of key value stores, Redis 2.6. x or higher is required. Spring Data Redis is currently tested against the latest 3.2 release Chapter 4. Getting Started Learning a new framework is not always straight forward. In this section, we (the Spring Data team) tried to provide, what we think is, an easy to follow guide for starting with the Spring data Redis module. Of course, feel free to create your own learning path'as you see fit and, if possible please report back any improvements to the documentation that can help others 4.1. First Steps As explained in Why Spring Data Redis?, Spring Data Redis (SDR) provides integration between Spring framework and the Redis key value store. Thus, it is important to become acquainted with both of these frameworks(storages or environments depending on how you want to name them) Throughout the SDr documentation, each section provides links to resources relevant however, it is best to become familiar with these topics beforehand 4.1.1. Knowing Spring Spring data uses heavily Spring framework's core functionality, such as the IoC container, resource abstract or AoP infrastructure. While it is not important to know the Spring APIs, understanding the concepts behind them is At a minimum, the idea behind loc should be familiar. That being said, the more knowledge one has about the Spring, the faster she will pick up Spring Data Redis. Besides the very comprehensive (and sometimes disarming) documentation that explains in detail the Spring Framework, there are a lot of articles, blog entries and books on the matter-take a look at the Spring Guides home page for more information. In general, this should be the starting point for developers wanting to try Spring DR 4.1.2. Knowing NosQL and Key value stores NoSQL stores have taken the storage world by storm. It is a vast domain with a plethora of solutions, terms and patterns (to make things worse even the term itself has multiple meanings) While some of the principles are common, it is crucial that the user is familiar to some degree with the stores supported by SDR. The best way to get acquainted with these solutions is to read their documentation and follow their examples- it usually doesn't take more then 5-10 minutes to go through them and if you are coming from an RDMBS-only background many times these exercises can be an eye opener. 4.1.3. Trying Out The Samples One can find various samples for key value stores in the dedicated example repo, at http:/github.com/spring-projects/spring-data-keyvalue-examples.ForSpringDataRedis,ofinterest is the retwisj sample, a Twitter-clone built on top of Redis which can be run locally or be deployed into the cloud. See its documentation, the following blog entry or the live instance for more formation 4.2. Need Help? If you encounter issues or you are just looking for advice, feel free to use one of the links below: 4. 2.1. Community Support The Spring Data tag on Stackoverflow is a message board for all Spring Data (not just Redis)users to share information and help each other. Note that registration is needed only for posting. 4.2.2. Professional Support Professional, from-the-source support, with guaranteed response time, is available from Pivotal Software, Inc, the company behind Spring Data and spring 4.3. Following Development For information on the Spring Data source code repository, nightly builds and snapshot artifacts please see the Spring data home page You can help make Spring Data best serve the needs of the Spring community by interacting with developers on Stackoverflow at either spring-data or spring-data-redis If you encounter a bug or want to suggest an improvement, please create a ticket on the Spring Data issue tracker To stay up to date with the latest news and announcements in the Spring eco system, subscribe to the spring Community portal Lastly, you can follow the Spring blog or the project team (Thomas and Christoph) on Twitter Reference documentation Document structure This part of the reference documentation explains the core functionality offered by Spring Data Redis Redis support introduces the Redis module feature set.

...展开详情
试读 67P Spring-data-redis使用指南
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
qq_40093161 英文版的,英文不好的慎下
2018-08-10
回复
上传资源赚积分or赚钱
最新推荐
Spring-data-redis使用指南 29积分/C币 立即下载
1/67
Spring-data-redis使用指南第1页
Spring-data-redis使用指南第2页
Spring-data-redis使用指南第3页
Spring-data-redis使用指南第4页
Spring-data-redis使用指南第5页
Spring-data-redis使用指南第6页
Spring-data-redis使用指南第7页
Spring-data-redis使用指南第8页
Spring-data-redis使用指南第9页
Spring-data-redis使用指南第10页
Spring-data-redis使用指南第11页
Spring-data-redis使用指南第12页
Spring-data-redis使用指南第13页
Spring-data-redis使用指南第14页

试读结束, 可继续读6页

29积分/C币 立即下载 >