From 81922361cf62b9c43bd9d3fb591fc844756b84a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=95=E6=9C=89=E7=81=B5=E7=8A=80?= <475660@qq.com> Date: Fri, 21 Sep 2018 11:35:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E9=97=B4=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 53 +- bin/.gitignore | 1 + bin/main/.gitignore | 6 + bin/main/application.properties | 200 +-- bin/main/cassandra.properties | 4 +- bin/main/couchdb.xml | 18 +- bin/main/ehcache.xml | 108 +- bin/main/log4j2.xml | 120 +- .../SpringBoot2NoSqlApplication.class | Bin 1046 -> 0 bytes .../config/CassandraConfig.class | Bin 2706 -> 0 bytes .../config/RedissonConfig.class | Bin 7406 -> 0 bytes .../Cassandra/CassandraController.class | Bin 3193 -> 0 bytes .../Ehcache/EhcacheDataController.class | Bin 2424 -> 0 bytes .../ElasticSearch/ESDataController.class | Bin 10592 -> 0 bytes .../ElasticSearch/ESSearchController.class | Bin 3798 -> 0 bytes .../Mongo/MongoDataController.class | Bin 5410 -> 0 bytes .../Redis/RedisDataController.class | Bin 1647 -> 0 bytes .../Redis/RedissonController$1.class | Bin 1274 -> 0 bytes .../Redis/RedissonController$2.class | Bin 1274 -> 0 bytes .../Redis/RedissonController$3.class | Bin 1274 -> 0 bytes .../Redis/RedissonController$4.class | Bin 1274 -> 0 bytes .../controller/Redis/RedissonController.class | Bin 11058 -> 0 bytes .../controller/Solr/SolrController.class | Bin 2480 -> 0 bytes .../CreateIndexFailedException.class | Bin 670 -> 0 bytes .../exception/GetMappingFailedException.class | Bin 677 -> 0 bytes .../IndicesExistsFailedException.class | Bin 669 -> 0 bytes .../exception/PutMappingFailedException.class | Bin 674 -> 0 bytes .../model/Cassandra/Customer.class | Bin 1873 -> 0 bytes .../model/ElasticSearch/Product.class | Bin 1637 -> 0 bytes .../model/Mongo/Department.class | Bin 983 -> 0 bytes .../model/Mongo/Location.class | Bin 832 -> 0 bytes .../SpringBoot2NoSQL/model/Mongo/Person.class | Bin 2341 -> 0 bytes .../SpringBoot2NoSQL/model/Redis/User.class | Bin 1284 -> 0 bytes .../model/Solr/Customer.class | Bin 1772 -> 0 bytes bin/main/xy/SpringBoot2NoSQL/model/User.class | Bin 1530 -> 0 bytes .../Cassandra/CustomerRepository.class | Bin 1076 -> 0 bytes .../SampleProductRepository.class | Bin 1060 -> 0 bytes .../Mongo/DepartmentRepository.class | Bin 479 -> 0 bytes .../repository/Mongo/PersonRepository.class | Bin 992 -> 0 bytes .../repository/Redis/ObjectRepository.class | Bin 1542 -> 0 bytes .../Redis/StringStringRepository.class | Bin 1677 -> 0 bytes .../repository/Redis/UserRepository.class | Bin 427 -> 0 bytes .../Solr/SolrCustomerRepository.class | Bin 549 -> 0 bytes .../service/Ehcache/UserService.class | Bin 2829 -> 0 bytes .../SpringBoot2NoSQL/utils/ESSearchUtil.class | Bin 6584 -> 0 bytes .../utils/IElasticSearchMapping.class | Bin 325 -> 0 bytes .../SpringBoot2NoSQL/utils/RandomUtil.class | Bin 2792 -> 0 bytes .../SpringBoot2NoSQL/utils/RedissonUtil.class | Bin 5406 -> 0 bytes bin/test/.gitignore | 1 + myCache.ehcache/.ehcache-diskstore.lock | 0 myCache.ehcache/users.index | Bin 4 -> 0 bytes .../SpringBoot2NoSqlApplication.java | 0 .../config/CassandraConfig.java | 88 +- .../config/RedissonConfig.java | 526 +++---- .../Cassandra/CassandraController.java | 152 +- .../Couchbase/CouchbaseController.java | 106 +- .../Ehcache/EhcacheDataController.java | 128 +- .../ElasticSearch/ESDataController.java | 372 ++--- .../ElasticSearch/ESSearchController.java | 134 +- .../controller/Mongo/MongoDataController.java | 218 +-- .../controller/Redis/RedisDataController.java | 68 +- .../controller/Redis/RedissonController.java | 658 ++++----- .../controller/Solr/SolrController.java | 102 +- .../exception/CreateIndexFailedException.java | 14 +- .../exception/GetMappingFailedException.java | 14 +- .../IndicesExistsFailedException.java | 12 +- .../exception/PutMappingFailedException.java | 14 +- .../model/Cassandra/Customer.java | 152 +- .../model/Couchbase/Customer.java | 110 +- .../model/ElasticSearch/Product.java | 114 +- .../model/Mongo/Department.java | 70 +- .../model/Mongo/Location.java | 74 +- .../model/Mongo/Person.java | 136 +- .../model/Redis/User.java | 98 +- .../model/Solr/Customer.java | 114 +- .../model/User.java | 108 +- .../Cassandra/CustomerRepository.java | 48 +- .../CouchbaseCustomerRepository.java | 34 +- .../SampleProductRepository.java | 30 +- .../Mongo/DepartmentRepository.java | 26 +- .../repository/Mongo/PersonRepository.java | 40 +- .../repository/Redis/ObjectRepository.java | 54 +- .../Redis/StringStringRepository.java | 48 +- .../repository/Redis/UserRepository.java | 58 +- .../Solr/SolrCustomerRepository.java | 20 +- .../service/Ehcache/UserService.java | 98 +- .../utils/ESSearchUtil.java | 320 ++-- .../utils/IElasticSearchMapping.java | 26 +- .../utils/RandomUtil.java | 238 +-- .../utils/RedisCacheUtils.java | 1298 ++++++++--------- .../utils/RedissonUtil.java | 314 ++-- 91 files changed, 3377 insertions(+), 3368 deletions(-) create mode 100644 bin/.gitignore create mode 100644 bin/main/.gitignore delete mode 100644 bin/main/xy/SpringBoot2NoSQL/SpringBoot2NoSqlApplication.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/config/CassandraConfig.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/config/RedissonConfig.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Cassandra/CassandraController.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Ehcache/EhcacheDataController.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/ElasticSearch/ESDataController.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/ElasticSearch/ESSearchController.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Mongo/MongoDataController.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedisDataController.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$1.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$2.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$3.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$4.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/controller/Solr/SolrController.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/exception/CreateIndexFailedException.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/exception/GetMappingFailedException.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/exception/IndicesExistsFailedException.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/exception/PutMappingFailedException.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/model/Cassandra/Customer.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/model/ElasticSearch/Product.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/model/Mongo/Department.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/model/Mongo/Location.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/model/Mongo/Person.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/model/Redis/User.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/model/Solr/Customer.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/model/User.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/repository/Cassandra/CustomerRepository.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/repository/ElasticSearch/SampleProductRepository.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/repository/Mongo/DepartmentRepository.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/repository/Mongo/PersonRepository.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/repository/Redis/ObjectRepository.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/repository/Redis/StringStringRepository.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/repository/Redis/UserRepository.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/repository/Solr/SolrCustomerRepository.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/service/Ehcache/UserService.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/utils/ESSearchUtil.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/utils/IElasticSearchMapping.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/utils/RandomUtil.class delete mode 100644 bin/main/xy/SpringBoot2NoSQL/utils/RedissonUtil.class create mode 100644 bin/test/.gitignore create mode 100644 myCache.ehcache/.ehcache-diskstore.lock delete mode 100644 myCache.ehcache/users.index rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/SpringBoot2NoSqlApplication.java (100%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/config/CassandraConfig.java (92%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/config/RedissonConfig.java (96%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/Cassandra/CassandraController.java (89%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/Couchbase/CouchbaseController.java (86%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/Ehcache/EhcacheDataController.java (88%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/ElasticSearch/ESDataController.java (94%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/ElasticSearch/ESSearchController.java (88%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/Mongo/MongoDataController.java (89%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/Redis/RedisDataController.java (73%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/Redis/RedissonController.java (95%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/controller/Solr/SolrController.java (86%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/exception/CreateIndexFailedException.java (84%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/exception/GetMappingFailedException.java (84%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/exception/IndicesExistsFailedException.java (84%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/exception/PutMappingFailedException.java (84%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/Cassandra/Customer.java (92%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/Couchbase/Customer.java (91%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/ElasticSearch/Product.java (92%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/Mongo/Department.java (87%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/Mongo/Location.java (84%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/Mongo/Person.java (92%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/Redis/User.java (90%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/Solr/Customer.java (90%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/model/User.java (91%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/Cassandra/CustomerRepository.java (85%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/Couchbase/CouchbaseCustomerRepository.java (80%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/ElasticSearch/SampleProductRepository.java (80%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/Mongo/DepartmentRepository.java (66%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/Mongo/PersonRepository.java (82%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/Redis/ObjectRepository.java (84%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/Redis/StringStringRepository.java (89%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/Redis/UserRepository.java (84%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/repository/Solr/SolrCustomerRepository.java (70%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/service/Ehcache/UserService.java (92%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/utils/ESSearchUtil.java (91%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/utils/IElasticSearchMapping.java (83%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/utils/RandomUtil.java (95%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/utils/RedisCacheUtils.java (96%) rename src/main/java/xy/{SpringBoot2NoSQL => spring2nosql}/utils/RedissonUtil.java (94%) diff --git a/.gitignore b/.gitignore index 9243c63..ad808e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,27 @@ -.gradle -/build/ -!gradle/wrapper/gradle-wrapper.jar - -### STS ### -.apt_generated -.classpath -.factorypath -.project -.settings -.springBeans -.sts4-cache - -### IntelliJ IDEA ### -.idea -*.iws -*.iml -*.ipr -/out/ - -### NetBeans ### -/nbproject/private/ -/nbbuild/ -/dist/ -/nbdist/ -/.nb-gradle/ \ No newline at end of file +.gradle +/build/ +!gradle/wrapper/gradle-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr +/out/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +/target/ diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..cf8a6b1 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +/default/ diff --git a/bin/main/.gitignore b/bin/main/.gitignore new file mode 100644 index 0000000..4c740c4 --- /dev/null +++ b/bin/main/.gitignore @@ -0,0 +1,6 @@ +/application.properties +/cassandra.properties +/couchdb.xml +/ehcache.xml +/log4j2.xml +/xy/ diff --git a/bin/main/application.properties b/bin/main/application.properties index 79c7f91..9f67005 100644 --- a/bin/main/application.properties +++ b/bin/main/application.properties @@ -1,101 +1,101 @@ -server.port=9092 -debug=true -spring.devtools.restart.exclude=static/** - -#spring.datasource.url=jdbc:mysql://localhost:3306/boot?useUnicode=true&zeroDateTimeBehavior=convertToNull&autoReconnect=true -#spring.datasource.username=root -#spring.datasource.password=mysql -#spring.datasource.driver-class-name=com.mysql.jdbc.Driver - -# MONGODB -spring.data.mongodb.host=127.0.0.1 -spring.data.mongodb.port=27017 -spring.data.mongodb.database=test - -#Cassandra -#spring.data.cassandra.keyspace-name=mydb -#spring.data.cassandra.contact-points=localhost -#spring.data.cassandra.port=9042 - -#Solr -spring.data.solr.host=http://localhost:8983/solr - -#Couchbase -#spring.couchbase.bootstrap-hosts=127.0.0.1 -#spring.couchbase.bucket.name=mydb -#spring.couchbase.bucket.password=123456 -#spring.data.couchbase.auto-index=true - -# Redis -# Redis\u6570\u636e\u5e93\u7d22\u5f15\uff08\u9ed8\u8ba4\u4e3a0\uff09 -spring.redis.database=0 -spring.redis.host=127.0.0.1 -spring.redis.port=6379 -#spring.redis.password=123 -# \u8fde\u63a5\u6c60\u6700\u5927\u8fde\u63a5\u6570\uff08\u4f7f\u7528\u8d1f\u503c\u8868\u793a\u6ca1\u6709\u9650\u5236\uff09 -spring.redis.pool.max-active=60 -# \u8fde\u63a5\u6c60\u4e2d\u7684\u6700\u5927\u7a7a\u95f2\u8fde\u63a5 -spring.redis.pool.max-idle=30 -# \u8fde\u63a5\u6c60\u6700\u5927\u963b\u585e\u7b49\u5f85\u65f6\u95f4\uff08\u4f7f\u7528\u8d1f\u503c\u8868\u793a\u6ca1\u6709\u9650\u5236\uff09 -spring.redis.pool.max-wait=-1 -# \u8fde\u63a5\u6c60\u4e2d\u7684\u6700\u5c0f\u7a7a\u95f2\u8fde\u63a5 -spring.redis.pool.min-idle=0 - -#redisson\u914d\u7f6e -#redis\u94fe\u63a5\u5730\u5740 -spring.redisson.address=redis://127.0.0.1:6379 -#\u5f53\u524d\u5904\u7406\u6838\u6570\u91cf * 2 -spring.redisson.thread=4 -#\u6307\u5b9a\u7f16\u89e3\u7801 -spring.redisson.codec=org.redisson.codec.JsonJacksonCodec -#\u6700\u5c0f\u7a7a\u95f2\u8fde\u63a5\u6570,\u9ed8\u8ba4\u503c:10,\u6700\u5c0f\u4fdd\u6301\u8fde\u63a5\u6570\uff08\u957f\u8fde\u63a5\uff09 -spring.redisson.connectionMinimumIdleSize=12 -#\u8fde\u63a5\u7a7a\u95f2\u8d85\u65f6\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2 \u9ed8\u8ba410000;\u5f53\u524d\u8fde\u63a5\u6c60\u91cc\u7684\u8fde\u63a5\u6570\u91cf\u8d85\u8fc7\u4e86\u6700\u5c0f\u7a7a\u95f2\u8fde\u63a5\u6570\uff0c -#\u800c\u8fde\u63a5\u7a7a\u95f2\u65f6\u95f4\u8d85\u8fc7\u4e86\u8be5\u6570\u503c\uff0c\u8fd9\u4e9b\u8fde\u63a5\u5c06\u4f1a\u81ea\u52a8\u88ab\u5173\u95ed\uff0c\u5e76\u4ece\u8fde\u63a5\u6c60\u91cc\u53bb\u6389 -spring.redisson.idleConnectionTimeout=10000 -#ping\u8282\u70b9\u8d85\u65f6,\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba41000 -spring.redisson.pingTimeout=1000 -#\u8fde\u63a5\u7b49\u5f85\u8d85\u65f6,\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba410000 -spring.redisson.connectTimeout=10000 -#\u547d\u4ee4\u7b49\u5f85\u8d85\u65f6,\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba43000\uff1b\u7b49\u5f85\u8282\u70b9\u56de\u590d\u547d\u4ee4\u7684\u65f6\u95f4\u3002\u8be5\u65f6\u95f4\u4ece\u547d\u4ee4\u53d1\u9001\u6210\u529f\u65f6\u5f00\u59cb\u8ba1\u65f6 -spring.redisson.timeout=3000 -#\u547d\u4ee4\u5931\u8d25\u91cd\u8bd5\u6b21\u6570\uff0c\u9ed8\u8ba4\u503c:3 -spring.redisson.retryAttempts=2 -#\u547d\u4ee4\u91cd\u8bd5\u53d1\u9001\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba4\u503c:1500 -spring.redisson.retryInterval=1500 -#\u91cd\u65b0\u8fde\u63a5\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba4\u503c\uff1a3000;\u8fde\u63a5\u65ad\u5f00\u65f6\uff0c\u7b49\u5f85\u4e0e\u5176\u91cd\u65b0\u5efa\u7acb\u8fde\u63a5\u7684\u65f6\u95f4\u95f4\u9694 -spring.redisson.reconnectionTimeout=3000 -#\u6267\u884c\u5931\u8d25\u6700\u5927\u6b21\u6570, \u9ed8\u8ba4\u503c\uff1a3\uff1b\u5931\u8d25\u540e\u76f4\u5230 reconnectionTimeout\u8d85\u65f6\u4ee5\u540e\u518d\u6b21\u5c1d\u8bd5\u3002 -spring.redisson.failedAttempts=2 -#\u8eab\u4efd\u9a8c\u8bc1\u5bc6\u7801 -#spring.redisson.password= -#\u5355\u4e2a\u8fde\u63a5\u6700\u5927\u8ba2\u9605\u6570\u91cf\uff0c\u9ed8\u8ba4\u503c\uff1a5 -spring.redisson.subscriptionsPerConnection=5 -#\u5ba2\u6237\u7aef\u540d\u79f0 -#spring.redisson.clientName= -#\u53d1\u5e03\u548c\u8ba2\u9605\u8fde\u63a5\u7684\u6700\u5c0f\u7a7a\u95f2\u8fde\u63a5\u6570\uff0c\u9ed8\u8ba4\u503c\uff1a1\uff1bRedisson\u5185\u90e8\u7ecf\u5e38\u901a\u8fc7\u53d1\u5e03\u548c\u8ba2\u9605\u6765\u5b9e\u73b0\u8bb8\u591a\u529f\u80fd\u3002 -#\u957f\u671f\u4fdd\u6301\u4e00\u5b9a\u6570\u91cf\u7684\u53d1\u5e03\u8ba2\u9605\u8fde\u63a5\u662f\u5fc5\u987b\u7684 -spring.redisson.subscriptionConnectionMinimumIdleSize=1 -#\u53d1\u5e03\u548c\u8ba2\u9605\u8fde\u63a5\u6c60\u5927\u5c0f\uff0c\u9ed8\u8ba4\u503c\uff1a50 -spring.redisson.subscriptionConnectionPoolSize=50 -#\u8fde\u63a5\u6c60\u6700\u5927\u5bb9\u91cf\u3002\u9ed8\u8ba4\u503c\uff1a64\uff1b\u8fde\u63a5\u6c60\u7684\u8fde\u63a5\u6570\u91cf\u81ea\u52a8\u5f39\u6027\u4f38\u7f29 -spring.redisson.connectionPoolSize=64 -#\u6570\u636e\u5e93\u7f16\u53f7\uff0c\u9ed8\u8ba4\u503c\uff1a0 -spring.redisson.database=0 -#\u662f\u5426\u542f\u7528DNS\u76d1\u6d4b\uff0c\u9ed8\u8ba4\u503c\uff1afalse -spring.redisson.dnsMonitoring=false -#DNS\u76d1\u6d4b\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2\uff0c\u9ed8\u8ba4\u503c\uff1a5000 -spring.redisson.dnsMonitoringInterval=5000 - - -# elasticsearch -#\u8282\u70b9\u540d\u5b57\uff0c\u9ed8\u8ba4elasticsearch -spring.data.elasticsearch.cluster-name=elasticsearch -# \u8282\u70b9\u5730\u5740\uff0c\u591a\u4e2a\u8282\u70b9\u7528\u9017\u53f7\u9694\u5f00 -spring.data.elasticsearch.cluster-nodes=127.0.0.1:9300 -#spring.data.elasticsearch.local=false -spring.data.elasticsearch.repositories.enable=true - -# ehcache -spring.cache.type=ehcache +server.port=9092 +debug=true +spring.devtools.restart.exclude=static/** + +#spring.datasource.url=jdbc:mysql://localhost:3306/boot?useUnicode=true&zeroDateTimeBehavior=convertToNull&autoReconnect=true +#spring.datasource.username=root +#spring.datasource.password=mysql +#spring.datasource.driver-class-name=com.mysql.jdbc.Driver + +# MONGODB +spring.data.mongodb.host=127.0.0.1 +spring.data.mongodb.port=27017 +spring.data.mongodb.database=test + +#Cassandra +#spring.data.cassandra.keyspace-name=mydb +#spring.data.cassandra.contact-points=localhost +#spring.data.cassandra.port=9042 + +#Solr +spring.data.solr.host=http://localhost:8983/solr + +#Couchbase +#spring.couchbase.bootstrap-hosts=127.0.0.1 +#spring.couchbase.bucket.name=mydb +#spring.couchbase.bucket.password=123456 +#spring.data.couchbase.auto-index=true + +# Redis +# Redis\u6570\u636e\u5e93\u7d22\u5f15\uff08\u9ed8\u8ba4\u4e3a0\uff09 +spring.redis.database=0 +spring.redis.host=127.0.0.1 +spring.redis.port=6379 +#spring.redis.password=123 +# \u8fde\u63a5\u6c60\u6700\u5927\u8fde\u63a5\u6570\uff08\u4f7f\u7528\u8d1f\u503c\u8868\u793a\u6ca1\u6709\u9650\u5236\uff09 +spring.redis.pool.max-active=60 +# \u8fde\u63a5\u6c60\u4e2d\u7684\u6700\u5927\u7a7a\u95f2\u8fde\u63a5 +spring.redis.pool.max-idle=30 +# \u8fde\u63a5\u6c60\u6700\u5927\u963b\u585e\u7b49\u5f85\u65f6\u95f4\uff08\u4f7f\u7528\u8d1f\u503c\u8868\u793a\u6ca1\u6709\u9650\u5236\uff09 +spring.redis.pool.max-wait=-1 +# \u8fde\u63a5\u6c60\u4e2d\u7684\u6700\u5c0f\u7a7a\u95f2\u8fde\u63a5 +spring.redis.pool.min-idle=0 + +#redisson\u914d\u7f6e +#redis\u94fe\u63a5\u5730\u5740 +spring.redisson.address=redis://127.0.0.1:6379 +#\u5f53\u524d\u5904\u7406\u6838\u6570\u91cf * 2 +spring.redisson.thread=4 +#\u6307\u5b9a\u7f16\u89e3\u7801 +spring.redisson.codec=org.redisson.codec.JsonJacksonCodec +#\u6700\u5c0f\u7a7a\u95f2\u8fde\u63a5\u6570,\u9ed8\u8ba4\u503c:10,\u6700\u5c0f\u4fdd\u6301\u8fde\u63a5\u6570\uff08\u957f\u8fde\u63a5\uff09 +spring.redisson.connectionMinimumIdleSize=12 +#\u8fde\u63a5\u7a7a\u95f2\u8d85\u65f6\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2 \u9ed8\u8ba410000;\u5f53\u524d\u8fde\u63a5\u6c60\u91cc\u7684\u8fde\u63a5\u6570\u91cf\u8d85\u8fc7\u4e86\u6700\u5c0f\u7a7a\u95f2\u8fde\u63a5\u6570\uff0c +#\u800c\u8fde\u63a5\u7a7a\u95f2\u65f6\u95f4\u8d85\u8fc7\u4e86\u8be5\u6570\u503c\uff0c\u8fd9\u4e9b\u8fde\u63a5\u5c06\u4f1a\u81ea\u52a8\u88ab\u5173\u95ed\uff0c\u5e76\u4ece\u8fde\u63a5\u6c60\u91cc\u53bb\u6389 +spring.redisson.idleConnectionTimeout=10000 +#ping\u8282\u70b9\u8d85\u65f6,\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba41000 +spring.redisson.pingTimeout=1000 +#\u8fde\u63a5\u7b49\u5f85\u8d85\u65f6,\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba410000 +spring.redisson.connectTimeout=10000 +#\u547d\u4ee4\u7b49\u5f85\u8d85\u65f6,\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba43000\uff1b\u7b49\u5f85\u8282\u70b9\u56de\u590d\u547d\u4ee4\u7684\u65f6\u95f4\u3002\u8be5\u65f6\u95f4\u4ece\u547d\u4ee4\u53d1\u9001\u6210\u529f\u65f6\u5f00\u59cb\u8ba1\u65f6 +spring.redisson.timeout=3000 +#\u547d\u4ee4\u5931\u8d25\u91cd\u8bd5\u6b21\u6570\uff0c\u9ed8\u8ba4\u503c:3 +spring.redisson.retryAttempts=2 +#\u547d\u4ee4\u91cd\u8bd5\u53d1\u9001\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba4\u503c:1500 +spring.redisson.retryInterval=1500 +#\u91cd\u65b0\u8fde\u63a5\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2,\u9ed8\u8ba4\u503c\uff1a3000;\u8fde\u63a5\u65ad\u5f00\u65f6\uff0c\u7b49\u5f85\u4e0e\u5176\u91cd\u65b0\u5efa\u7acb\u8fde\u63a5\u7684\u65f6\u95f4\u95f4\u9694 +spring.redisson.reconnectionTimeout=3000 +#\u6267\u884c\u5931\u8d25\u6700\u5927\u6b21\u6570, \u9ed8\u8ba4\u503c\uff1a3\uff1b\u5931\u8d25\u540e\u76f4\u5230 reconnectionTimeout\u8d85\u65f6\u4ee5\u540e\u518d\u6b21\u5c1d\u8bd5\u3002 +spring.redisson.failedAttempts=2 +#\u8eab\u4efd\u9a8c\u8bc1\u5bc6\u7801 +#spring.redisson.password= +#\u5355\u4e2a\u8fde\u63a5\u6700\u5927\u8ba2\u9605\u6570\u91cf\uff0c\u9ed8\u8ba4\u503c\uff1a5 +spring.redisson.subscriptionsPerConnection=5 +#\u5ba2\u6237\u7aef\u540d\u79f0 +#spring.redisson.clientName= +#\u53d1\u5e03\u548c\u8ba2\u9605\u8fde\u63a5\u7684\u6700\u5c0f\u7a7a\u95f2\u8fde\u63a5\u6570\uff0c\u9ed8\u8ba4\u503c\uff1a1\uff1bRedisson\u5185\u90e8\u7ecf\u5e38\u901a\u8fc7\u53d1\u5e03\u548c\u8ba2\u9605\u6765\u5b9e\u73b0\u8bb8\u591a\u529f\u80fd\u3002 +#\u957f\u671f\u4fdd\u6301\u4e00\u5b9a\u6570\u91cf\u7684\u53d1\u5e03\u8ba2\u9605\u8fde\u63a5\u662f\u5fc5\u987b\u7684 +spring.redisson.subscriptionConnectionMinimumIdleSize=1 +#\u53d1\u5e03\u548c\u8ba2\u9605\u8fde\u63a5\u6c60\u5927\u5c0f\uff0c\u9ed8\u8ba4\u503c\uff1a50 +spring.redisson.subscriptionConnectionPoolSize=50 +#\u8fde\u63a5\u6c60\u6700\u5927\u5bb9\u91cf\u3002\u9ed8\u8ba4\u503c\uff1a64\uff1b\u8fde\u63a5\u6c60\u7684\u8fde\u63a5\u6570\u91cf\u81ea\u52a8\u5f39\u6027\u4f38\u7f29 +spring.redisson.connectionPoolSize=64 +#\u6570\u636e\u5e93\u7f16\u53f7\uff0c\u9ed8\u8ba4\u503c\uff1a0 +spring.redisson.database=0 +#\u662f\u5426\u542f\u7528DNS\u76d1\u6d4b\uff0c\u9ed8\u8ba4\u503c\uff1afalse +spring.redisson.dnsMonitoring=false +#DNS\u76d1\u6d4b\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\uff1a\u6beb\u79d2\uff0c\u9ed8\u8ba4\u503c\uff1a5000 +spring.redisson.dnsMonitoringInterval=5000 + + +# elasticsearch +#\u8282\u70b9\u540d\u5b57\uff0c\u9ed8\u8ba4elasticsearch +spring.data.elasticsearch.cluster-name=elasticsearch +# \u8282\u70b9\u5730\u5740\uff0c\u591a\u4e2a\u8282\u70b9\u7528\u9017\u53f7\u9694\u5f00 +spring.data.elasticsearch.cluster-nodes=127.0.0.1:9300 +#spring.data.elasticsearch.local=false +spring.data.elasticsearch.repositories.enable=true + +# ehcache +spring.cache.type=ehcache spring.cache.ehcache.config=classpath:ehcache.xml \ No newline at end of file diff --git a/bin/main/cassandra.properties b/bin/main/cassandra.properties index 6b39d8e..0034e8a 100644 --- a/bin/main/cassandra.properties +++ b/bin/main/cassandra.properties @@ -1,3 +1,3 @@ -cassandra.contactpoints=127.0.0.1 -cassandra.port=9042 +cassandra.contactpoints=127.0.0.1 +cassandra.port=9042 cassandra.keyspace=mydb \ No newline at end of file diff --git a/bin/main/couchdb.xml b/bin/main/couchdb.xml index e7d752b..df39966 100644 --- a/bin/main/couchdb.xml +++ b/bin/main/couchdb.xml @@ -1,10 +1,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/bin/main/ehcache.xml b/bin/main/ehcache.xml index c645ed7..9a17794 100644 --- a/bin/main/ehcache.xml +++ b/bin/main/ehcache.xml @@ -1,55 +1,55 @@ - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/bin/main/log4j2.xml b/bin/main/log4j2.xml index 00314e0..a4ee0a0 100644 --- a/bin/main/log4j2.xml +++ b/bin/main/log4j2.xml @@ -1,61 +1,61 @@ - - - - - /tmp/logs - /tmp/logs/7z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + /tmp/logs + /tmp/logs/7z + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bin/main/xy/SpringBoot2NoSQL/SpringBoot2NoSqlApplication.class b/bin/main/xy/SpringBoot2NoSQL/SpringBoot2NoSqlApplication.class deleted file mode 100644 index 55a0c8b4162a9ce18c51bc9804e8b9fd44c592d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1046 zcmb7DTW=CU6#k}#LMZ}Lt=4P30}s2=^udIti6#0(>SYam@M+i%bm}sLGlQ0&<&%vM z{s4cJ@yxbq7vaThcFxYZpYJ>S`_Io`0JhO6V2L3-nTFBWNHyHk+P&D<(fjT{iZ98l z@i>t&cT%eYatyU&{*{LbSHtja|5(J1VP!`u>2?{G8_ga=uA>h{3Cmb5Baan^YF8?; zKN%#$8B(%;XOId>#2!}IQcw$-MRBQ6!gM&ncWvc1Up(b~;k5mykRn;Pb^Jw9XATtm>D~oS|>(j+{7ls z8s&Uv^jH`-Wq8?`uRpJ8&Z|nejk^WhVQ6VH3~kEF!0?gyrp@QDPyC!Sli{O`d$>=i z(=ZJEZ0SzIt!*y?qq``5td$cdF6?MEki&`bfMn{B+M7Mj+zg4L^#z$3N|BzJSiF&* z;jP)ln%SekbHuRu;f#cyw9*$;O1pH=sKWN*K6!j3LVn>GzE-}~4yirU3_ASz|_VA5F7M^0Za5nyH96M0=S_yhb=9`Ed?NeB^pJoZC(XLjy=?tPwTX7cA>zyAT?GISa#fr+hcceN4vL3KuJ zb8$(p-YvPF4%YpuJ1e6|29;3G#^W>w1a9iE>P9hOJ(P9zM2DMhMH=aPyQ_EM)8)v7 z(lb3Y%}^R&2LeN-I|~bQD+2kFC6x{7Z7724bsa=*O;@W_<(71HN?=$8kNr>wbrl$j zjsd+YJRK^R>)g4{T0)PnGy~(;)tVpq<(irf0&QXik-)XSL}eu@V4c!+xb4a|z@2Uy z{lpJdg|wL)Ud<1D^O?ZD!uXoNz^tyQEDqvu8ixeVzS+}!!tNl4BTPkA85$M1R46@? zkEL6av_4y7N~gyEEj#-m@V0|N3<(@8`GHz$*2^lqC+SuoSJIxWt;x{0Annzfkx`+*A{F?VZwQ<>J4ebXe zvMVk+xP;3BhazRTsqM$*_#->0U*gs>xFT?%!`RTF$>JKWr}2rv;ZCnE(qUDF4yJH} zo1-DaNOA5Tco(gh&m4S?FIWkRStc)gu&_A3mc|TCbeNMO&NTg6MTHrB$*nb;q(1M3 zN*YzkKk>~*zGXI_xXnMvVjAJK1uf1E^jXZQ1ch|esagPa+L!_iwDjq_>$_UFWN9QYL@PdP~8 zDF0gkFoI+83^?MA)q=Tv+OLBX&v3jKawLY>r8e3LoaA!=?_#V4zQO?Zn=|nn-pieO zfzv7c%yDgQ8N5E9zMs_ z9enx=MqXn2es1;|=3ZI5kh`^mh1_lai|4yQcXBJ7-NC&V_$GzPj^Lv-2_~O+EJdHD z$TQf)+1S9*L|Dr}28v%F(!9VA_>sl>iO2zt#u{0$pL^4kCa diff --git a/bin/main/xy/SpringBoot2NoSQL/config/RedissonConfig.class b/bin/main/xy/SpringBoot2NoSQL/config/RedissonConfig.class deleted file mode 100644 index caf069a164a3737a09a558cbda616921468ef904..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7406 zcmb7|ZFn42703V6=B?XlNeV3m3Z=tO|k%iVBJfiVBJf&%+0O9zUp$|1-0j-MzWv1NpG` z&V4!ech5cd+;j5me;;`QKquaA#uNif_Khb8bDonO>2+Oy`4)HZ%z*w$!&Jp z$>-f{U+~$C1_P}ZT6?Ty#>$Q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YNc_Vm0-50$^v=dqr7R)SR50C2;Wp+4;>)Z)-;vCYjjCsuTHbIy?vK;Wsjb`l^sLUke@5wvEzv0!McDz*|!FI%2r18J=s|3|k$&Thd$E zX$}k|Vw4nC_fq&0U$NgQtcV5=`7Shem({<~$TZh{(B`JLX6dZJ(U-s#reg6Gw!HzO z-2tM?6>Zz%o2W+BtRmM_SjGc^&LHxwqpaa!3J%z<6Ncq21$~hhRZe+ZO<@C@ z?7)Gy^ys>yOIE|;inP=nm1`{65Z2^^U3H53HA7tw2W!6q^&fzf%Kz8v->z2|XBj26 z;?5ri4zqo?@!urEhj$d;P`#Yo4pK4B$#CXn%hi6arnp;hP7gjq=iuN|q@SbbH@x$h zya?XoyVKX%gD85@g&w?5o|2{v4&ejN0w20-w z^a95P{=m@P%t34v`D3Ji8?_kV*j5y1f zFEG}d=*K-qYT_6+aU9>XT7Kl$pD>7DcmY1fu#ee|0D};-KKzVnTp?0f{D7;ZBGk5x zYoyw!a~0P~MXC8NZjfrH{u{`VQhB_IPq{1a`!>@8_gO!;BiyO-lnij66R1a{w5Y$> zdNz}_Y%XAtmILjdwa~tVJCx{ReSqF?7xUK865Qu_6FNRgA|~G zuc=AkJ|5Ie%NC{!O{R-2O_!QYU*5xXF*IF%iRqOl(}r*QY8Z95AN6yrK1JmPyk-Zk fH#pE;i@h6$??42P2wenQe$*LK-*8<&O56Vcr`Q^> diff --git a/bin/main/xy/SpringBoot2NoSQL/controller/Ehcache/EhcacheDataController.class b/bin/main/xy/SpringBoot2NoSQL/controller/Ehcache/EhcacheDataController.class deleted file mode 100644 index 9f12bb495535b205c1c6fd5ca7312946ee740fd3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2424 zcmb7FTUQfT7~LmC0%1f2(MnNKsgh6~K}xM4E#Rfph)57`we}=Agn?m(&P=qlt52;z zq)&Zq*J@*}YxM{8H}t9hqnCY75<)Qb@-TDGobz4xx4&=x_~*CZ0gPfjftbL=mz#EW zBXGRpwC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SQL/controller/ElasticSearch/ESDataController.class deleted file mode 100644 index e17d887ea2ef0f63c715efa3b92b2b4582358cb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10592 zcmb_i33yc3b^g!HNKcHO1Povz8@yl}OGq#VW2|TZTN_xhBtXIt3CDOe^CXQmnh`T^ z0NHU+ zEa?m1$IP4i?mg!}|2g;EbMMucuDtwt0J|k^ARyRxb~ZXZlS^eLy0Te&*I;(|NPjeu z&DgnYI&I~mz3F(~P9=t|crGy+?H%rk+wtzwYXc#{nn&ZO!&D+*CA4snLot#E`R!+N;IH1WiMQjGdac zj-~Rcv9#5h$z<)Kj&@%iV^%zqkB-L^b~ZN~jh6;QI}3L9Oe$w3DRyH%K0TAR4(GDT zLc$)hX0rK|>MuCZ@5fZG)T4;iWop=84pnTZu=A)zeR10obo-)S5;H|1lwP|xl}XwA z1;OT)V}ek3Hfe2n8%@-pwjMWQi-B9{=WoLVFmWqxBP}GiJDsvJoN~9iv{Xb_ zG@;){oldcOY(=wyI|Mf=5ZCBxq6OOob$QFSX&OUehrj&n^mH~8Eq03zyZvKfv|)#V z?SgGSsume#B8oeym1cG3$*N#2wO06$f_GuJfx85E_z~$7KPK+R9zh^G#dO!~@wk(% zV#^7{T8B`=yRz#NBUVtKn6wg8_gnF_JtKCl5Xxgd%?Fge6gDRyR5_EWdy6C+2_}%R@ z+Hy?I&m$&QAzY7PJZRvkpvMpWa`U{2V>r(An~$GnI@sz(ScM2Gx{YN+oWWg%R61$p>M$WNz0M0GiIno%qe|dHkF*?9J<=wok>OItv}$FNf=zz9 zT_wy1Nz9lyrNX+-&N>L{z>HN9H?KYQ)a$QY*inxH&KNi?Xe_g$2r+RMT;+rDBo$U* zEBb3xg~;P3-iaqjjB;#eI?eRvwWH5wrNdQ}Ii*ZWsj&|4QX>nAgq0`0de_-XJze0L z`KpD{ASwRuQ=GRJn&3_j4}Q00CCTCXiiq45 zeLR(XBKmlSWgj`*QdzhKgv zauSalEh@I2R?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NoSQL/controller/Mongo/MongoDataController.class b/bin/main/xy/SpringBoot2NoSQL/controller/Mongo/MongoDataController.class deleted file mode 100644 index a7838b125f592f0cdd5a87bd47d18ed8c8bac888..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5410 zcmb_fYj+dZ72Q|JNS4Q#D8XQw77{|@R~X|!0LvlxMIZ=cTVU#hK*#b}9xQ9b%m{F4 znl|*2gglxyY13DlzSDP-CK$(ked>q)j*_hYgs#=q)qQ8i(%2dna@!Bm+?l!e>~r?n z_nbR_`}c=`0Gc9VM?H7 ztW6c7vR-M$ff~`(#SqZIb~$>GX|sU3H7Cx#L$)cobGsR3iP(7D@n>Y zGSjKHP~&rSIKLtnG!@SBC4EwzGzwEeg2(g=CEa$8YsI3(5U9JT$xy+) z*d&mcX1x9L!?Z0kSH-D716e<1>sH#Zxet=9ZQi7kW8_u&OeQ8{t3C}_h@0i{H*j~1p)&-0DdemAdF>U?ootv##et|^4b zh27jXRE;&yLF7WWz|Nprj}{y~r(2Y(%XW~+6Sd4+lQW(l-IAAm3ijh6rtp&C%#2F+ z4!gPU%Q0>1H2Ht0=aO6bmfd75+(6W^!2Ln@%A2lAGZO5ef=6+P`tsKH&mWx<*c4pv zRn}D7cpUu#F}sw_>NZP6#Nf;(Z`pvX)>=+(w?~3&%h+MHa>j9r>X>d9Sx@yL7FuVX z!W#Ww*7pW@@v)^?_th-cL6^Zw5lONc`JpY>56Rl&3Q{-}Lt5a08bhncFh*iHA+Y0? zD~^zn3_DE8RxpY&fq37*z|hFap+QPBGzOQ$%Cb}f$8b_s{8Iw0tu-xa8<(z~R`6+w z*wEiMcy4TH^wd!1Bo*bAPTH!qHV8B_g6u3QbUR86Pf?Fym9M(q6VIR&ES9gcK^3HV z2uM|Dw)#oUjU^6^4Z>l+=uRLDJqBv|j>-n{_mqNZFM%^K zBG!!B>Qz$*U{k2isbE-loEET6LHa9GrAo97S) z6O~T|HrU!ly>em@*u}DcyKGeEr(!4xwAa2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)*|@Og->#{B(0ZS_``ny*SU^V diff --git a/bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedisDataController.class b/bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedisDataController.class deleted file mode 100644 index 0c79dc0a510500531729e8a05e435ad420844ebc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1647 zcmb7FT~8B16g>ll(ozbde4~IOv=kXd`G|-KVtguytu`?{P1~U?wmWra3KHXg(!@Zb zi9f&}WxTVkt-uoTVP|%>bMHC#oIBH>zrOtd@Cd76v@xuHIOf@^=eVV3N}0uNm3@`w z1?3t~mCMrO8Ci66eS9vA*lhk1Mu?&BKpYBQ7H)~Z%pb^tVdzo$gN&>y?HJ`9GpwY8 z5WMD&20}f&6}ZMQlBv1IsmPq8oqSntxUMq7ILg&TJFUDD*FNz*PgLZQ^4{^h6t3ob zqF|x9Xa?|&no&oNCySJJP#arr)*oAd4C_~8S`R!QPKi68IId%!GPEa>Ifl@tD#|F@ z(HlcIVhp`$$CcZ)N?v-e1r@~5pH>A?&I!-4>&C~B*>|YI$AN6F;tWxVm!!$af+`Uq z5{zLck#1R4=f0M__~|lXk7SJ0=-s z10=bqNHP}z6%j)RI-{7zOc-|=mV&_k+0!x1B0-$BI3$^pi9md_1 zvAb=)QTtJ2%!k-T$fr2)9pi6PsZ-qAn)`~W`4imfPkyG5I%M46G(>!d32M}bo~#Ep zph3W6NKx)6RWOfx6v?naH3ZSQe+iv+in3}&EQ!>y`>DzX2;6v6KJ+ diff --git a/bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$1.class b/bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$1.class deleted file mode 100644 index 48bfbb750c7b7e546b2f336bea8d50de2342f5d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1274 zcmbVMU2oGc6g_UcmUe-b0UO`rqtLEMgdrqAt@c1wP^D}WE9~7(tkfg3qr{!)&*A|g z@xTw@M$G#`$emLKMeEkOC85$+z7+!vyxPv&6Dtx82dAg?uZ#~!7 z$|O39MB*NZK&I0<)vEh@qrP22fuVN9Pq-U#6}tPwBjKA8iVUt!LN~FV9FaHBb9II^>D8>ls+EK{2$K6;t1)pvqd! zvc=G9dS_*}XOrBvBFh6ADsILJ$varkvE%)zXI~i+ilqGyXeax?N>)&Y#)6_4)=y_? z693B7{$dmh%VVev^f>XwYiX;qk#+H@{(Wo%W%w``-L!$*XG;02dH+LHwWs_@r*zqN zg&FCfgnJCnmuz?kbv$5L4Tag|ahLleinP(33us{My`C@N4B6^4IDJJouN(0+6)Eme zx94fBfYoZY>FF1dqfthM&{eWt(ApxE)}zmGT3>MCQ+DQ}#j+jiEwM&xhkPu0376^3 za0TmhVuS1)u4Zg+GMn}+NgkG@m^tZ;z#g}bQvz#U!*!Z(5IQBd$W1~DxJ6hFw`cU5 S6bcBvi~D#;mX&YC(DM@?>u3)E diff --git a/bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$2.class b/bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$2.class deleted file mode 100644 index 31b6d52b1c8040e194b37854dfa376c0de135e3e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1274 zcmbVMU2hUW6g>kJgsy^BTfaY1C?<{}CTbvkkf0&iwy~JL56fiPx}71jLzSQ9gE8^J zAK;HN-dRwoF)6ai%-%UO_w2bJv)_Mw{RZF}Y6WB%UVfbN{@6q+e5JK*?&r@^l_PN?cq~-N_XkHZum$89xHcg-&Xat&7)ShAjJZ6K z%JMEzPdi2mD~EoRSgE98$lFnrRG*R_e?>tpB56k|vO5gz`pPWZhYY!n9?BvZ&U+}} zTnSl}Jrq%4$kyF~vL7kAH#r_i^G*z6$*|$;K*Wc_L~cC?b1o=`)~aHvO$w?=S)XN# zp;7nG%52vqx#dI_`%$QbofwjLu%u(#|5MMNvNDvW^$%z#{lHpUP=?x)q8K($XK6bA zm8t#ZD3+GTQ0nW63FPa@Rc9;h;#2+m#0ARmej&P91GmnU@>lczhp2K_1+h-(vh7Mc z(!&DoGdy3h;XPFGkYPQPc2|r$A{bGmwfaIpee3S^VgcvKc8|g9DY|)`SR{!|aF@D0 zOJfbJQgKaBzlaQtB1(j=ll6ku4koif(xJ0GZ!6}?l^CQ4O)BTkJgswuXwtjyVg<|3wYoZ3y2MHRIZ5xZ}`>;%wsoR;&?$8vU{7XI< z6CeBm{wU*}1r-vLBAd+Yopa}&J@?L?{qghLcL2{(DTK-xqFAcnwbtg@zV5yA zTwf~_>o63tdng7nnaqh+?LUs{P60WF$}vCXZpc;O9`uieZwkmWxH=Bp*hW%}%OmNY z@W>UXLK(M1)Z@-sB+2i|#0Vu~hP)Zdr23TfcuNXu5=l!cX?7V}^`%+1j~H@oJrG4O zTy#*tg%YwTJ1C;UkgeMdWlt)xKRW4)_&x83f??g$J`az0EbV#<=4?_7&1J<@cPOc% zR?})RH0s{Dm9<4~T9L(`3=}t`nB*NU7})auo@ZAX5s0|?4`?_2z)E_c47CMCF>K6N zX&n8o)WKpD3(I3D_4FwA#T#i)XEW{Mx&D1(6J_`?lij3&o99cJZ{Gh9RqiN1)Cpa- zJz<7=P{0F*7fUw0gDM^}tOmmD@uJGB{mDH?JM?BoPVj zQMYGltbkQ2w(02?k)csUiO^NDUeekkrN-kga2j86>2tbg&0?v?Mt{UQtsRQ7=w)1? zH^WtI(2h;AGq{$ry-jWMS&}R)Nj?qwloHtOHgG~kI1s}tr&WK0iH@|Qvd(} diff --git a/bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$4.class b/bin/main/xy/SpringBoot2NoSQL/controller/Redis/RedissonController$4.class deleted file mode 100644 index 82391486e5431a95f2e1e7cd111f09b224ffd9fc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1274 zcmbVMU2hUW6g>kJgsy^BTfgfE3dO`VhC~gd4-zya+ctvf`>;%wt;-CV9f&;p;@|PX znE2oi@JAW%EU46&6xn2E@0^)?_S}!z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C m%R6k(Bit|MuV0TXAIF{K0y)m_JK3-P?zO&X80+sL>+5eHaNYg@ diff --git a/bin/main/xy/SpringBoot2NoSQL/controller/Solr/SolrController.class b/bin/main/xy/SpringBoot2NoSQL/controller/Solr/SolrController.class deleted file mode 100644 index 3b52997643a2a001731e8d852c5286315d3d1cf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2480 zcmbVNZC4vb6n-WIvV?7$ZULcGYOyZ?v@4X>wn1uuR-q|SQb9zmlk5iM3+5kFsXBdXpt4<)xVnh0}V2iBdxB(BO>-Y?}bFNo1{V@3*kC(-P z>+P8Z!5!b+;YEdS^5zCJTMgU;=?RO%_RLC026GHu>G2JQ_=0PRB)V`)M=z2LXL8aJ zE7fvAcuzRt61kjP0Coqo)t&aUp>bhP(g2Bs$(#`t(}D z7JJGzTdZ}Hix?3iRQB113eMHRCom#%t(g-rXq2W5^Hm%_k$}Ma0vW96g+|V#X zrFtl7eT&vJ8g4UmFYUYPne{w==WGIf68HszL4MO)Ny9}h?gpYJQl87A6kE)lNk$;RgJOg4=gzGR5G zdxTsPLAZPHSjROzsj7Kda(GbnsClxHPSK}1qSBc;>S1a?+g1!#b*y2T80=8*hB+iC znfb$|MTT@cmwNlR%dlEe$DP|0FaM6NC(H7bSph0jN~idOx5#dXFBF{hms?SWo zx-*c%8G6@i4zxN;EBZs=9C@jbr)kws*T6QIkHIkD-xOR0d@=DG-aEoD9b$UX{>123 z*B^889~%YP4ZWgr+-2CN)qu zy~1ZlScqZM_~IABukjcQDGyOj!?;RyxPuYoZ~;$gyjRF}h>L9;Uo<%`VVNX+7{*;H60;%T}ajI=wlol-x`6Or%({3vm@ zEvne+bf@&;fHGZtcm_3DG;-G(Z-+R@sq=CpU@IMG;&%$CbdSlKhSnI<{1x%r+sj=r;2_6OmQvZlg9H=)1T^e}%TePg2seHMCugz9_= z^kaY}UFxtT3}NFJNf#}e>J78$7N{ZIMjHkbXh#R3&sBlURZ4joolCJhe@l1p& z@*7~>T&pr+)BW#TX9-;@+Cff~Y9!6c8>$HHzNnNrINTz+`LYDt)0NPd`@BTL?B9D` ziF#uW#B)X;@z2BZX|Z?8R)h~`lAZBa*yn9a-ZK)*Pe?v89K#TwHs9c)BqtBEm8zFu Y1f%S6F~%^?4I^s;lblVMVlRg2Pe6pTnE(I) diff --git a/bin/main/xy/SpringBoot2NoSQL/exception/GetMappingFailedException.class b/bin/main/xy/SpringBoot2NoSQL/exception/GetMappingFailedException.class deleted file mode 100644 index c7bcf4b80d3b7a662dce96c459e76234fa3e0208..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 677 zcmbVJ+e#xr5IvPdCmG{qlXbnz2)npm*Z~oiCE|mkB8(B8D2Pv;Nvkc%beMEBewI(W zEa(ULQDTjWCW5}$4c%3B>T*u^!{h&Z0IQg_kRbeS-MD@|QsMcA)@G%s{R7XHtw7d| z(xJN}&7P>&8QvDEDl1zrh=mkk@={z0w<^MO_plinRge|p_K-^8;D zJ(1Eyq_0J}Dhmt8gw&?4$TTv9@0*bnMmnAO&e<~o=S)Y=Zdj2mXZ}ZH-ogN3q}zVK zd?^ECV-Uj@hTcH!$ytox3zOqEHDL&U-XV9|!>--1u+S6gNU)JaK8rr|6NWt%%3`xt zmQg8|LdbbK5Y=N5so3uXQ|3Z7c&7KsM=uaED%M^UwdWaK;T=+hzCbh^4373N?mjWW z_H{D~uQ_m}W15nJ1YVwfX=6 diff --git a/bin/main/xy/SpringBoot2NoSQL/exception/IndicesExistsFailedException.class b/bin/main/xy/SpringBoot2NoSQL/exception/IndicesExistsFailedException.class deleted file mode 100644 index e0204f474c3096cc2f742d8c0a5d64d89f1a08b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 669 zcmbVJTQ37a6#hQvOA@ImM0?N2l!Fq ztd>?H9?T>&=X~e#eP`zF{rMHZI%X{-2%GhL$GZttP~OqntQE9(M1rO9jeo6P6a-R-R{Kx_ldQ zauw=3QLM=P;u#^it4p#QJ%mh?KAW45a@osIdJDaT!B)4!;HLF5T!7P zA=YxK!>TZZjbF4}w25gn%rCYy|1;+aJt`>4dO=h_X7wa}OQ{C|YGzdm&} z?v6PS&l)e{%>(mkv3JT=jAxe8-N_f&=N-%56H+UWNIx)~z%ZXS-{7J&Cy%g|ZIoaX XW9)G;#xcPSV`~yqoK2W!FM*j400Xn@ diff --git a/bin/main/xy/SpringBoot2NoSQL/exception/PutMappingFailedException.class b/bin/main/xy/SpringBoot2NoSQL/exception/PutMappingFailedException.class deleted file mode 100644 index de6de663fbc22ce16bb61290b2ac928eff6c9ff2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 674 zcmbVJ+e#xr5Iq&6qhq|q^?qS|ka$^kKo&$IJ}3&p7%!v3vQM2!M_ZEVFzIo#pXHMx z=m+>wVvUI=g1*=d-Bop}>YVC+dcJ=I@Eh|MQiS!!f7h=?D!ka%+N>3{f9$!k5y+ZR zI&_a>b0BIphWCW3$kOf`Vj)eKz7p5Mt%&f#J&8l3s`4Et^lYk7nJvP~lGo1jO~RG$ zh@4(V`kyFPWPbUaklxWH*^55H0&_bpa;N;t?v!=p?1v@UaB_?FoP~bEaJ%6Ozgq3ldsxX9&Pn7-bkk)LNU+xIC^xNpdXa?QrAq;scl!drjl+kH2 z2O;a}Kvd2}q!PasOq)wpXHM^%FP@GfU5v|9IV+q=GQ z*Pqt(j@>lc`kHiIX*C_GuXSC|?ifxQ34!rf@{QEn(rW3Cw_h0zPatMC1tx0YLETdk zD+1YPUCT2&#)j#d+ihdjvTRR!rfs8_uA$B`Z5t?j(lo6?hdqo2BAJBHqo zySt31KXJ^CboL$@dkj6gV>+&9@twd(TOKUqvc(Ni6-X_cmg(ISh!=_*0*N(Nl|dZG zH5|cFfnzn(GS<7DZNqsk38zZ18?wD29aH(e&4l;TB<(`&e>z3JyM@0S@-I8p;>IWh zPHRXarB*o&qrvKohD@+Jt6>b9K+-k5Dw{tUkxUhxYz5~h3&p>43ut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+no&w*Q|uZjc*kcS@GF8qJG98J?!$?G=mpH3}^6Bpei&nQFzZoy7zF%y_8f z<(2OFI|w|yoZisib=a2!8*3S=$%My}Cw4INM?S&vU(R#yNUsG;<$F)6CLJ@vE#JkJE zwWPyNnzewGpFJKyIxD@)t)bkbRD;UjoE4!v7m?bBzG|i^J4`KLRAU AssI20 diff --git a/bin/main/xy/SpringBoot2NoSQL/model/Mongo/Location.class b/bin/main/xy/SpringBoot2NoSQL/model/Mongo/Location.class deleted file mode 100644 index bca1b0b8eccfae85bcb8fd8fec51fa211bed54f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 832 zcma)(%}(1u6otY@+OheDhghXggLR9Tw2bLY&x-?{$t@as2#18iC_1Ufgju78_b5+5U<2zj*G2 zJP%{{qfAE9_2e+fBAHky3N*&Sx4?~qWaNGtjKg6jU|z<-FcfHdvpYXi1rG&^w_%V9 zl#Ze#%6bAjoq5%KrrYPs4`isI0NX|xRe?gM+h2k}-G+&hieA{TP-4c5lJMmEVi2aM z!64QwgpT_`8maRnS0nj)1ZNCN8%K^lL9tS=L`_6Z;5BU+c=HHTONm|p diff --git a/bin/main/xy/SpringBoot2NoSQL/model/Mongo/Person.class b/bin/main/xy/SpringBoot2NoSQL/model/Mongo/Person.class deleted file mode 100644 index 693cf9ce7603fc7cc5c5bfc7bd1274acc0b8931d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2341 zcmbW2eQ(=T6viK?X+l$%j&04>ZmjDHB~42W9UEgQ8BMc^N}-GeRpL)Kxl6q{cH}sN zeJhZtCV|8U;6ovvbL}K zhr369^M{7j_1ns|zVp3~Z#`E*-}my!8o2Vxeq&p%?RBj0PhP23XdvUX4P0%E51OH9 zRSYb@7IdRp#=lP)>I=G}7K6}ntpne62}ze?)O0$Y9S#D@)KZQ18W*La z5&NlBDfnP|3|&cF`^0MbfwH=Gug8p7&m84SK(lXbcR+|NshNsGTlMT9>?)7h+`bT@ zKC=EF2=&?v^^))9_8iX%tE@vQkyNF+%;ihL1y<%%poVUk4zLWZ(xzHsG~vmLb~gJM#3crLOgC5HXP$ZigW{@c0rDMy#=SCdEyhs!b8 zq(5PMntpaEhoVzFU&^<=VL2BV{J4`1>@dWODm%8XNco?|_UW?bdDlJPx`8My{}(v*YibfJ5Spy{C&{JRc zGpv=j&#?X*Pc!(K&mxh)x3W}T#4?pv_`HP;?%s`5@Ciy>QBR{9dM2Lg+{74aMF$1k7jqUvPvYD7Djf)-t=3~EHk&}w)?>%hMZ CEa#a3 diff --git a/bin/main/xy/SpringBoot2NoSQL/model/Redis/User.class b/bin/main/xy/SpringBoot2NoSQL/model/Redis/User.class deleted file mode 100644 index 2e25419ff62313c5405dad4b2839b5d86b5c7f91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1284 zcma)*+fEZv6o&uZBQ1l}(pD*!lLBoyj4|G6xDZ03X)s!8;^hF_vdJ)GW~N5H^~T5W z5j2sIXyOC-F1`Zs-!r9SU`V`}eagSq`qsbq{67Ej3&2C%&m$#p@BIg}`_@xV|B34c z4|d(|i;j8X9!lGMDG!xz?)lQoBO_2cw%%E$Z8?4O`Tnsy2=d4YRKio`nqBEB%T^z) zeOpq@C~kYw^OfuDJ>3=%&jcp6T*nVAC+J!BKxXUbpK{*kFMkBGw%b>ZK)DlF=>{6> zk-*rSfo<4&;u~ub`kG&xY;|3+yJ%FN+N7$YYG_0^eZ@MSgT7 zT+@$mX49OthS$b%iaV3D;GAurq4F)1)i~zD!xCO+U}mcFKgwd#U=dUOJRo zO;IYDhO}HSKGF`PZq>AHLz*f%Vi8LqtXDYpG_cySTv?G0Q=+SeWw`51%I5ZXVvD^d z5XS8!I&n*&t6*4iw_ZJv&KsS)Rd;qtH}`bMQ0rhb;vO1oBv<%P{aAT9+dwFg>BgNi z(z(5M2n;6ChNy~$l1TW`og_Mt6lkkScZV0z*P?{#vaRC(@6G0}RuqWw_^zj1jEQ~} z<=%#pvA+@Xf)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5vEO;Q@0o=M0qDH z2jx=D+x05dvlFl0)!n-|E?3K5vnR**!#xI@sYbod9HT8p;)fCFgsJ^T#b9;&=LmsH z!@uv);Pb0IF%n+EOF1re`WRrZjfF7F_Z4`)r6hBkPYzsJ|2g>@oFwMxi^$1)tW2!33Qt+RsT^tt`wy24?A%fjO9` vd!DQdbQUcvkwXsheTU_j4lCraI)pGy(Q5?H;KNXG*G7;ZpK`8ubAS2|TW&>j diff --git a/bin/main/xy/SpringBoot2NoSQL/repository/ElasticSearch/SampleProductRepository.class b/bin/main/xy/SpringBoot2NoSQL/repository/ElasticSearch/SampleProductRepository.class deleted file mode 100644 index e7804c2a5b37077a581f76325ddc6d94c6fe0c8f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1060 zcmb_bO;5r=5S>-Df**i-^yon^Zeom=8WIVbkTi(y!Sm8x>f*NBY_}>$|B64ugFnC@ zWn3r$f+Ydsp@-MmnfGSq&G*me7XVzqp#y6O8gG3}VlASeu9P`%DRS>&&101aqjVqN zNSYYo6Hc}Ngb58}$=h17)He^~R}K^qRC@G#XPH=WR?F?W`PL_f>KvRtln?gG6;@Oya^#OgAUx&>{n`p#GXiui=aqE5K)tA zoAS6o%9WQlkWeu$XJ#>)f?KmJ)l6A~C%zW35h_B^%3<^7PJ^kCiU_x9z-dSFyjI@- zwcu)vmM1H?j#!f+xXe?v$Y#V!iL1#j5tVA6-wJ7Ma5TroX9Lv;KBjz?8QGn`wq;Gc zy!i! E0qzD_f&c&j diff --git a/bin/main/xy/SpringBoot2NoSQL/repository/Mongo/DepartmentRepository.class b/bin/main/xy/SpringBoot2NoSQL/repository/Mongo/DepartmentRepository.class deleted file mode 100644 index a712f7608c7d594f6d53d453d14552b39c572ed1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 479 zcmbu6!Ab)$5QZmJyS6Iy+BeWk1L8#@B1Jr{Et)4tyJ<+>%`DSY-KX${3_PdxTLAQ^EvDFcSRZ02m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G9L;%%_8^0yhn-}EZUzQ0NM}FkqjZMpq$f*qm~IxG zjLyEr9~k*c9|lHAYGV*^jHEUt1B~MioeXhIkksHKa;F`}7QbQgJMJzm*YPlf7EP4s zfD!t|8dS5sc|b)#JjJsHeGK#TWzhEm5&`{tx@-K{6@48^1HbY73n|;<9B+_M`o>N2 xv4EUWk}m?vbU+yoDC=0IBG>WKz=zJTCn?{lHs*MfIUX<@c+-d^)hzHf@DJWRy6XS{ diff --git a/bin/main/xy/SpringBoot2NoSQL/repository/Redis/UserRepository.class b/bin/main/xy/SpringBoot2NoSQL/repository/Redis/UserRepository.class deleted file mode 100644 index f63522deb3cfed812052c006c3526f693fc4c5e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 427 zcmbVIy-tEb5S-&z5d^WawDTwN5|s*Lq9#^fFoMz_u;L=zlDk9Yv8+rid;lNHc;6Q_ zv9+1GnZ0Co=i~G39l$Y~W#kl&o|n2ecWlS!BH^$jz3W6fnv3TkZmGL8Vy|yKx$du7 zMnR!5F^@)1jUDT&!GwlEp>)EQ!>K}kXSc6VxR4Q5kjH8jMU)ik30vwcW&?6JW-uj% zW+Fo~?Hk9b{x%EYp1ndV`NwK)g-TBrZb+A$25kP_{2*OgVXM2afoIfb&oTGRS_vkw z*ciK?h#PC4RdVOdjGn|jXdlRtgyo!KBR}P|v5k0aY!i`HdSt|MR65f@aqkr?FVV=M c5-}YEHLOLfX76I;S~g$Lu#QIL^xp>X1sT$BrT_o{ diff --git a/bin/main/xy/SpringBoot2NoSQL/repository/Solr/SolrCustomerRepository.class b/bin/main/xy/SpringBoot2NoSQL/repository/Solr/SolrCustomerRepository.class deleted file mode 100644 index 0b8efdb9223e0c3e999db5d4cde7b892d5284b16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 549 zcmbtRJx{|x4E2?d(DEU~%E|x>Cm|*db!Y`s)Cw{%AI&vfN#e?P0s0^Mix~I;{3wKz zw4_1|l^A?F+w$}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fpkP+|!sEhe5-O;bCt|GoDERHYx#8jX6ONftC&ONw(XJLi$vY+CnPSRX; z0ax}62Xmz~l;BnHp@7r)h`LTDOI@cm_^9^6XJ#FZRD~D{JVXL@^?HuWofyrPR%|&b zdAJh8+9!2%Dk9nGYYZzZjm>vFhQ)D9N{;tQ8F%9O<9gOe%6k<)6Pu2ZuekFCv6*Ka zL(m?xmD9?!WJA`isf^59E&m81q#adNllB)z#Bl%@Eew4kES!DU~cPvQMulv&4#))?q#E5;C@f(ALr6TQk@Y z2;~szYm4L{{((XJH;0#gN3=iuGnxZCBX{v?E$nq~gm1q-gE#KtpvRFNwq=P0vLRdc z&b+Ms&McyXky#uYjLbmFBNb3`7|%h^!*sk%I$mbcH5h5nSK~ z+gyB&v-rg3_W+$dPrlBPO=oqJn7@FF6rE4WGez|uq`g#7HMm6YHTcYqN`O|M)B6`> KZ~7>hiSU1w?J_F> diff --git a/bin/main/xy/SpringBoot2NoSQL/utils/ESSearchUtil.class b/bin/main/xy/SpringBoot2NoSQL/utils/ESSearchUtil.class deleted file mode 100644 index 687e35f57995b63beb22a9bde2956bd7f4c610ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6584 zcmcIo340XB5q&MKG-x$4NLa)qHdrw@LMt&b2<#wVLY9PrBtQ!?f;h=&w?PAYF*^$@ zayWJpJ0#%ThZCI3xf2|mLx%~rypAH23bBWr&PqlRS!MwCQL;E5pV~E5oM?>3MD+H|JBFp=&am zFjKRpZHa4jGvX{*d4}G}#@GxoM6FDc7e|X$o>)BJJDIi58a!p@9V?NStc^s<;u*&n zk%ys4pL^U9?hfq=nPVm#E1NOQWZKFYWWh@CyupQ$ymvX_-j=5GGd!QmX7YTf9i7;$ zp^IUA9V$BRMmIx?G(tZ2h7nQZhXoPkK|9`uts3rO*iqF&V7!j^;{yzu@`AyrWk@*{ zm_MZ9zOt0NVQa^B^k}%BAy$<|C76y6;sJ(^oXvBl&E42BEcBj!&+>Ai!1K<*f|W{g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Ue8hxwS#ITAjB<}|+Y#atm)W^McLbZBKz3rQIMIZu{w2(* z#C&Xe;3f@n)9&VBh|E1kS$HBqs>dVMqeyj;3_gxe(9G@h|4EoKm-JdrSLH-*Pg$q&z1DCjAZ{R=HkH1i6YiUy8g1t=mB!3 ziKw>>Rztm;yWr-xA8ZHGfW~9PIUB+lG6;2lYj L;a>#Mgn$1Z4cLT$ diff --git a/bin/main/xy/SpringBoot2NoSQL/utils/IElasticSearchMapping.class b/bin/main/xy/SpringBoot2NoSQL/utils/IElasticSearchMapping.class deleted file mode 100644 index 8e31fd37a12324278d753f5b0327ad0cd5b33d23..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 325 zcmZvYF-rqM5QX0)n$sA;!b-5$#sSgFE}{^Kikyh;x*5(5o84n?PcDDW!XMy|5_gk; zO`4g3d31GvIrfgXXoC6{$Dt{QtEFCTsRJmoeT+wkPhswNs;iVFJULDh9q z71$vh&DE!3t6arT?{m?SFsvkQB!ug;^QjLN%No$E0IdCD;T?C{yC^R5+wFQ7x5myS z+z>_yGI2BMUY4~GjuYnJsf_u`q{>#W5*p(j;dHCjW}U^QZ-bV5V-xUXYov?pF(457 b=`lb*CEUdTIcb5tRo}-jZ3qXc_AvSb{mfm3 diff --git a/bin/main/xy/SpringBoot2NoSQL/utils/RandomUtil.class b/bin/main/xy/SpringBoot2NoSQL/utils/RandomUtil.class deleted file mode 100644 index 526b58d97d208e43af9c510d0f97101be529fddf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2792 zcmb_eTTfJ16#n+i!5M}@ab!@rsfaq<5dkk$T0m5AxX4umtq0}+M`q3$XU-tnCQTdD zrzTC4+9vHoW7^ago7g^#M6AB|u|J?srP`U{!TKik;Ti+Uf zdhzfvfJVIQf>L{E9FVWN;T33F@8-Yw=^gHA&-mF!ziYq*w!EPmy45P+3{;E=C>>@<^T3IG zFY>TmU|Uc(wBAHyQi~0#lVMH9Z%(P<5jCdEb$U~=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P@fy=-et zy(7fZgg8}Yv54ZtJ#WW2VCSNrJC+QQ@h2D~f9}ciysg0;Dj=mnKP|5FRH5fQEO3@Z kpGCOAnUfhQu~VAv zv@vu97;AWphu@f=D>$>(m0T0HVtWYNN<>I3flJNAUo!LV5Yp*ob01rWNn1wnju8OO8a7 z)9xBQtKm63Pa;x|BE_Bx7f5DMo8_`>Q%ET1RpQc&9|G+nT-=0ZJH~8+cfe$|B=#{$ z=xl6VMfIs-zOE-U3}T2uqxAe~hC>yq>$~s{&KK3$tx$TU?Y_0q&=fT_HOyl{ zYU*ZGsit1Q4Yup3($q6jX)5MCO=ZtpDT<|fJx_4rW69Q#2kj>OV}m|bh@;|0n*8kC>YaD_k-U$eM(9{bM^8G>0~_dx&fIhj(I`T9M)&&e z-_iIpJ=7pfS3V6o%Qn+hlLmC(K%*vXL<_y)&L_y4+qHDx$0mkfu%+$s->|y~vr%yF zCb)KT>sSHTf+w(Fz&(ir1oIR<*Pv6to~I`sYq-1TKDuf!+WQlYYDHjSngiK2qD!Fd zk(MqR`QRY>D5yrVi{NRx9wK|5f_&3YZ<=tJ{@3t0pDE`&s^UCM2uA`rk0H8>^B7`+ z^92m}oX5*KUsQ1p5a;ng&SAW?igOqz1?S6n#pgU#&UsqJd5Sns2Xc;Kd==*y&Iry4 zO!}OOa?YfRGfA9Nft=^?>MG82cujD=jyHVHH_JKCt2i$Z=fyzI8KhQm&R|w>8hFd+ zOqX-csW|6}b0Ls3gX}8K403|g!lK)HaT@zQa>?V8%`1E43UOTxE6p@_V=@kgwx?74iovh~e8n YhGl$C$SZe_W!$4T3}4W0QiCu52O}b#$p8QV diff --git a/bin/test/.gitignore b/bin/test/.gitignore new file mode 100644 index 0000000..a1451dd --- /dev/null +++ b/bin/test/.gitignore @@ -0,0 +1 @@ +/xy/ diff --git a/myCache.ehcache/.ehcache-diskstore.lock b/myCache.ehcache/.ehcache-diskstore.lock new file mode 100644 index 0000000..e69de29 diff --git a/myCache.ehcache/users.index b/myCache.ehcache/users.index deleted file mode 100644 index 711006c3d3b5c6d50049e3f48311f3dbe372803d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4 LcmZ4UmVp%j1%Lsc diff --git a/src/main/java/xy/SpringBoot2NoSQL/SpringBoot2NoSqlApplication.java b/src/main/java/xy/spring2nosql/SpringBoot2NoSqlApplication.java similarity index 100% rename from src/main/java/xy/SpringBoot2NoSQL/SpringBoot2NoSqlApplication.java rename to src/main/java/xy/spring2nosql/SpringBoot2NoSqlApplication.java diff --git a/src/main/java/xy/SpringBoot2NoSQL/config/CassandraConfig.java b/src/main/java/xy/spring2nosql/config/CassandraConfig.java similarity index 92% rename from src/main/java/xy/SpringBoot2NoSQL/config/CassandraConfig.java rename to src/main/java/xy/spring2nosql/config/CassandraConfig.java index 78f601b..4be817f 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/config/CassandraConfig.java +++ b/src/main/java/xy/spring2nosql/config/CassandraConfig.java @@ -1,45 +1,45 @@ -package xy.SpringBoot2NoSQL.config; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.core.env.Environment; -import org.springframework.data.cassandra.config.AbstractCassandraConfiguration; -import org.springframework.data.cassandra.config.CassandraClusterFactoryBean; -import org.springframework.data.cassandra.core.mapping.BasicCassandraMappingContext; -import org.springframework.data.cassandra.core.mapping.CassandraMappingContext; -import org.springframework.data.cassandra.repository.config.EnableCassandraRepositories; - -@Configuration -@PropertySource(value = { "classpath:cassandra.properties" }) -@EnableCassandraRepositories(basePackages = "xy.SpringBoot2NoSQL.repository.Cassandra") -public class CassandraConfig extends AbstractCassandraConfiguration { - private static final Log LOGGER = LogFactory.getLog(CassandraConfig.class); - - @Autowired - private Environment environment; - - @Override - protected String getKeyspaceName() { - return environment.getProperty("cassandra.keyspace"); - } - - @Override - @Bean - public CassandraClusterFactoryBean cluster() { - final CassandraClusterFactoryBean cluster = new CassandraClusterFactoryBean(); - cluster.setContactPoints(environment.getProperty("cassandra.contactpoints")); - cluster.setPort(Integer.parseInt(environment.getProperty("cassandra.port"))); - LOGGER.info("Cluster created with contact points [" + environment.getProperty("cassandra.contactpoints") + "] " + "& port [" + Integer.parseInt(environment.getProperty("cassandra.port")) + "]."); - return cluster; - } - - @Override - @Bean - public CassandraMappingContext cassandraMapping() throws ClassNotFoundException { - return new BasicCassandraMappingContext(); - } +package xy.spring2nosql.config; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.env.Environment; +import org.springframework.data.cassandra.config.AbstractCassandraConfiguration; +import org.springframework.data.cassandra.config.CassandraClusterFactoryBean; +import org.springframework.data.cassandra.core.mapping.BasicCassandraMappingContext; +import org.springframework.data.cassandra.core.mapping.CassandraMappingContext; +import org.springframework.data.cassandra.repository.config.EnableCassandraRepositories; + +@Configuration +@PropertySource(value = { "classpath:cassandra.properties" }) +@EnableCassandraRepositories(basePackages = "xy.spring2nosql.repository.Cassandra") +public class CassandraConfig extends AbstractCassandraConfiguration { + private static final Log LOGGER = LogFactory.getLog(CassandraConfig.class); + + @Autowired + private Environment environment; + + @Override + protected String getKeyspaceName() { + return environment.getProperty("cassandra.keyspace"); + } + + @Override + @Bean + public CassandraClusterFactoryBean cluster() { + final CassandraClusterFactoryBean cluster = new CassandraClusterFactoryBean(); + cluster.setContactPoints(environment.getProperty("cassandra.contactpoints")); + cluster.setPort(Integer.parseInt(environment.getProperty("cassandra.port"))); + LOGGER.info("Cluster created with contact points [" + environment.getProperty("cassandra.contactpoints") + "] " + "& port [" + Integer.parseInt(environment.getProperty("cassandra.port")) + "]."); + return cluster; + } + + @Override + @Bean + public CassandraMappingContext cassandraMapping() throws ClassNotFoundException { + return new BasicCassandraMappingContext(); + } } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/config/RedissonConfig.java b/src/main/java/xy/spring2nosql/config/RedissonConfig.java similarity index 96% rename from src/main/java/xy/SpringBoot2NoSQL/config/RedissonConfig.java rename to src/main/java/xy/spring2nosql/config/RedissonConfig.java index 63ea866..77bafe2 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/config/RedissonConfig.java +++ b/src/main/java/xy/spring2nosql/config/RedissonConfig.java @@ -1,263 +1,263 @@ -package xy.SpringBoot2NoSQL.config; - -import org.redisson.Redisson; -import org.redisson.api.RedissonClient; -import org.redisson.client.codec.Codec; -import org.redisson.config.Config; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.util.ClassUtils; - -import io.netty.channel.nio.NioEventLoopGroup; - -/** - * redisson 客户端配置,而不是使用spring data redis - * 这里配置连接的模式是单机模式,如想配置集群模式和哨兵模式,请参考官方wiki - * https://github.com/redisson/redisson/wiki/ - */ -@ConfigurationProperties(prefix = "spring.redisson") -@Configuration -public class RedissonConfig{ - - private String address; - private int connectionMinimumIdleSize = 10; - private int idleConnectionTimeout=10000; - private int pingTimeout=1000; - private int connectTimeout=10000; - private int timeout=3000; - private int retryAttempts=3; - private int retryInterval=1500; - private int reconnectionTimeout=3000; - private int failedAttempts=3; - private String password = null; - private int subscriptionsPerConnection=5; - private String clientName=null; - private int subscriptionConnectionMinimumIdleSize = 1; - private int subscriptionConnectionPoolSize = 50; - private int connectionPoolSize = 64; - private int database = 0; - private boolean dnsMonitoring = false; - private int dnsMonitoringInterval = 5000; - - private int thread; //当前处理核数量 * 2 - - private String codec="org.redisson.codec.JsonJacksonCodec"; - - @Bean(destroyMethod = "shutdown") - @ConditionalOnProperty(name="spring.redisson.address") - RedissonClient redisson() throws Exception { - Config config = new Config(); - config.useSingleServer().setAddress(address) - .setConnectionMinimumIdleSize(connectionMinimumIdleSize) - .setConnectionPoolSize(connectionPoolSize) - .setDatabase(database) - .setDnsMonitoringInterval(dnsMonitoringInterval) - .setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) - .setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) - .setSubscriptionsPerConnection(subscriptionsPerConnection) - .setClientName(clientName) - .setRetryAttempts(retryAttempts) - .setRetryInterval(retryInterval) - .setTimeout(timeout) - .setConnectTimeout(connectTimeout) - .setIdleConnectionTimeout(idleConnectionTimeout) - .setPingTimeout(pingTimeout) - .setPassword(password); - Codec codec=(Codec)ClassUtils.forName(getCodec(),ClassUtils.getDefaultClassLoader()).newInstance(); - config.setCodec(codec); - config.setThreads(thread); - config.setEventLoopGroup(new NioEventLoopGroup()); - return Redisson.create(config); - } - - /** - * 哨兵模式自动装配 - * @return - */ -// @Bean -// @ConditionalOnProperty(name="redisson.master-name") -// RedissonClient redissonSentinel() { -// Config config = new Config(); -// SentinelServersConfig serverConfig = config.useSentinelServers().addSentinelAddress(redssionProperties.getSentinelAddresses()) -// .setMasterName(redssionProperties.getMasterName()) -// .setTimeout(redssionProperties.getTimeout()) -// .setMasterConnectionPoolSize(redssionProperties.getMasterConnectionPoolSize()) -// .setSlaveConnectionPoolSize(redssionProperties.getSlaveConnectionPoolSize()); -// -// if(StringUtils.isNotBlank(redssionProperties.getPassword())) { -// serverConfig.setPassword(redssionProperties.getPassword()); -// } -// return Redisson.create(config); -// } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public int getConnectionMinimumIdleSize() { - return connectionMinimumIdleSize; - } - - public void setConnectionMinimumIdleSize(int connectionMinimumIdleSize) { - this.connectionMinimumIdleSize = connectionMinimumIdleSize; - } - - public int getIdleConnectionTimeout() { - return idleConnectionTimeout; - } - - public void setIdleConnectionTimeout(int idleConnectionTimeout) { - this.idleConnectionTimeout = idleConnectionTimeout; - } - - public int getPingTimeout() { - return pingTimeout; - } - - public void setPingTimeout(int pingTimeout) { - this.pingTimeout = pingTimeout; - } - - public int getConnectTimeout() { - return connectTimeout; - } - - public void setConnectTimeout(int connectTimeout) { - this.connectTimeout = connectTimeout; - } - - public int getTimeout() { - return timeout; - } - - public void setTimeout(int timeout) { - this.timeout = timeout; - } - - public int getRetryAttempts() { - return retryAttempts; - } - - public void setRetryAttempts(int retryAttempts) { - this.retryAttempts = retryAttempts; - } - - public int getRetryInterval() { - return retryInterval; - } - - public void setRetryInterval(int retryInterval) { - this.retryInterval = retryInterval; - } - - public int getReconnectionTimeout() { - return reconnectionTimeout; - } - - public void setReconnectionTimeout(int reconnectionTimeout) { - this.reconnectionTimeout = reconnectionTimeout; - } - - public int getFailedAttempts() { - return failedAttempts; - } - - public void setFailedAttempts(int failedAttempts) { - this.failedAttempts = failedAttempts; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public int getSubscriptionsPerConnection() { - return subscriptionsPerConnection; - } - - public void setSubscriptionsPerConnection(int subscriptionsPerConnection) { - this.subscriptionsPerConnection = subscriptionsPerConnection; - } - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public int getSubscriptionConnectionMinimumIdleSize() { - return subscriptionConnectionMinimumIdleSize; - } - - public void setSubscriptionConnectionMinimumIdleSize(int subscriptionConnectionMinimumIdleSize) { - this.subscriptionConnectionMinimumIdleSize = subscriptionConnectionMinimumIdleSize; - } - - public int getSubscriptionConnectionPoolSize() { - return subscriptionConnectionPoolSize; - } - - public void setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize) { - this.subscriptionConnectionPoolSize = subscriptionConnectionPoolSize; - } - - public int getConnectionPoolSize() { - return connectionPoolSize; - } - - public void setConnectionPoolSize(int connectionPoolSize) { - this.connectionPoolSize = connectionPoolSize; - } - - public int getDatabase() { - return database; - } - - public void setDatabase(int database) { - this.database = database; - } - - public boolean isDnsMonitoring() { - return dnsMonitoring; - } - - public void setDnsMonitoring(boolean dnsMonitoring) { - this.dnsMonitoring = dnsMonitoring; - } - - public int getDnsMonitoringInterval() { - return dnsMonitoringInterval; - } - - public void setDnsMonitoringInterval(int dnsMonitoringInterval) { - this.dnsMonitoringInterval = dnsMonitoringInterval; - } - - public int getThread() { - return thread; - } - - public void setThread(int thread) { - this.thread = thread; - } - - public String getCodec() { - return codec; - } - - public void setCodec(String codec) { - this.codec = codec; - } - -} +package xy.spring2nosql.config; + +import org.redisson.Redisson; +import org.redisson.api.RedissonClient; +import org.redisson.client.codec.Codec; +import org.redisson.config.Config; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.util.ClassUtils; + +import io.netty.channel.nio.NioEventLoopGroup; + +/** + * redisson 客户端配置,而不是使用spring data redis + * 这里配置连接的模式是单机模式,如想配置集群模式和哨兵模式,请参考官方wiki + * https://github.com/redisson/redisson/wiki/ + */ +@ConfigurationProperties(prefix = "spring.redisson") +@Configuration +public class RedissonConfig{ + + private String address; + private int connectionMinimumIdleSize = 10; + private int idleConnectionTimeout=10000; + private int pingTimeout=1000; + private int connectTimeout=10000; + private int timeout=3000; + private int retryAttempts=3; + private int retryInterval=1500; + private int reconnectionTimeout=3000; + private int failedAttempts=3; + private String password = null; + private int subscriptionsPerConnection=5; + private String clientName=null; + private int subscriptionConnectionMinimumIdleSize = 1; + private int subscriptionConnectionPoolSize = 50; + private int connectionPoolSize = 64; + private int database = 0; + private boolean dnsMonitoring = false; + private int dnsMonitoringInterval = 5000; + + private int thread; //当前处理核数量 * 2 + + private String codec="org.redisson.codec.JsonJacksonCodec"; + + @Bean(destroyMethod = "shutdown") + @ConditionalOnProperty(name="spring.redisson.address") + RedissonClient redisson() throws Exception { + Config config = new Config(); + config.useSingleServer().setAddress(address) + .setConnectionMinimumIdleSize(connectionMinimumIdleSize) + .setConnectionPoolSize(connectionPoolSize) + .setDatabase(database) + .setDnsMonitoringInterval(dnsMonitoringInterval) + .setSubscriptionConnectionMinimumIdleSize(subscriptionConnectionMinimumIdleSize) + .setSubscriptionConnectionPoolSize(subscriptionConnectionPoolSize) + .setSubscriptionsPerConnection(subscriptionsPerConnection) + .setClientName(clientName) + .setRetryAttempts(retryAttempts) + .setRetryInterval(retryInterval) + .setTimeout(timeout) + .setConnectTimeout(connectTimeout) + .setIdleConnectionTimeout(idleConnectionTimeout) + .setPingTimeout(pingTimeout) + .setPassword(password); + Codec codec=(Codec)ClassUtils.forName(getCodec(),ClassUtils.getDefaultClassLoader()).newInstance(); + config.setCodec(codec); + config.setThreads(thread); + config.setEventLoopGroup(new NioEventLoopGroup()); + return Redisson.create(config); + } + + /** + * 哨兵模式自动装配 + * @return + */ +// @Bean +// @ConditionalOnProperty(name="redisson.master-name") +// RedissonClient redissonSentinel() { +// Config config = new Config(); +// SentinelServersConfig serverConfig = config.useSentinelServers().addSentinelAddress(redssionProperties.getSentinelAddresses()) +// .setMasterName(redssionProperties.getMasterName()) +// .setTimeout(redssionProperties.getTimeout()) +// .setMasterConnectionPoolSize(redssionProperties.getMasterConnectionPoolSize()) +// .setSlaveConnectionPoolSize(redssionProperties.getSlaveConnectionPoolSize()); +// +// if(StringUtils.isNotBlank(redssionProperties.getPassword())) { +// serverConfig.setPassword(redssionProperties.getPassword()); +// } +// return Redisson.create(config); +// } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public int getConnectionMinimumIdleSize() { + return connectionMinimumIdleSize; + } + + public void setConnectionMinimumIdleSize(int connectionMinimumIdleSize) { + this.connectionMinimumIdleSize = connectionMinimumIdleSize; + } + + public int getIdleConnectionTimeout() { + return idleConnectionTimeout; + } + + public void setIdleConnectionTimeout(int idleConnectionTimeout) { + this.idleConnectionTimeout = idleConnectionTimeout; + } + + public int getPingTimeout() { + return pingTimeout; + } + + public void setPingTimeout(int pingTimeout) { + this.pingTimeout = pingTimeout; + } + + public int getConnectTimeout() { + return connectTimeout; + } + + public void setConnectTimeout(int connectTimeout) { + this.connectTimeout = connectTimeout; + } + + public int getTimeout() { + return timeout; + } + + public void setTimeout(int timeout) { + this.timeout = timeout; + } + + public int getRetryAttempts() { + return retryAttempts; + } + + public void setRetryAttempts(int retryAttempts) { + this.retryAttempts = retryAttempts; + } + + public int getRetryInterval() { + return retryInterval; + } + + public void setRetryInterval(int retryInterval) { + this.retryInterval = retryInterval; + } + + public int getReconnectionTimeout() { + return reconnectionTimeout; + } + + public void setReconnectionTimeout(int reconnectionTimeout) { + this.reconnectionTimeout = reconnectionTimeout; + } + + public int getFailedAttempts() { + return failedAttempts; + } + + public void setFailedAttempts(int failedAttempts) { + this.failedAttempts = failedAttempts; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public int getSubscriptionsPerConnection() { + return subscriptionsPerConnection; + } + + public void setSubscriptionsPerConnection(int subscriptionsPerConnection) { + this.subscriptionsPerConnection = subscriptionsPerConnection; + } + + public String getClientName() { + return clientName; + } + + public void setClientName(String clientName) { + this.clientName = clientName; + } + + public int getSubscriptionConnectionMinimumIdleSize() { + return subscriptionConnectionMinimumIdleSize; + } + + public void setSubscriptionConnectionMinimumIdleSize(int subscriptionConnectionMinimumIdleSize) { + this.subscriptionConnectionMinimumIdleSize = subscriptionConnectionMinimumIdleSize; + } + + public int getSubscriptionConnectionPoolSize() { + return subscriptionConnectionPoolSize; + } + + public void setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize) { + this.subscriptionConnectionPoolSize = subscriptionConnectionPoolSize; + } + + public int getConnectionPoolSize() { + return connectionPoolSize; + } + + public void setConnectionPoolSize(int connectionPoolSize) { + this.connectionPoolSize = connectionPoolSize; + } + + public int getDatabase() { + return database; + } + + public void setDatabase(int database) { + this.database = database; + } + + public boolean isDnsMonitoring() { + return dnsMonitoring; + } + + public void setDnsMonitoring(boolean dnsMonitoring) { + this.dnsMonitoring = dnsMonitoring; + } + + public int getDnsMonitoringInterval() { + return dnsMonitoringInterval; + } + + public void setDnsMonitoringInterval(int dnsMonitoringInterval) { + this.dnsMonitoringInterval = dnsMonitoringInterval; + } + + public int getThread() { + return thread; + } + + public void setThread(int thread) { + this.thread = thread; + } + + public String getCodec() { + return codec; + } + + public void setCodec(String codec) { + this.codec = codec; + } + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/Cassandra/CassandraController.java b/src/main/java/xy/spring2nosql/controller/Cassandra/CassandraController.java similarity index 89% rename from src/main/java/xy/SpringBoot2NoSQL/controller/Cassandra/CassandraController.java rename to src/main/java/xy/spring2nosql/controller/Cassandra/CassandraController.java index 848d389..0b7c7f7 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/Cassandra/CassandraController.java +++ b/src/main/java/xy/spring2nosql/controller/Cassandra/CassandraController.java @@ -1,76 +1,76 @@ -package xy.SpringBoot2NoSQL.controller.Cassandra; - -import java.util.List; -import java.util.Optional; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import xy.SpringBoot2NoSQL.model.Cassandra.Customer; -import xy.SpringBoot2NoSQL.repository.Cassandra.CustomerRepository; - - - -@RestController -@RequestMapping("/cassandra") -public class CassandraController { - - Logger logger = LogManager.getLogger(getClass()); - - @Autowired - CustomerRepository customerRepository; - - @RequestMapping("/add") - public String add(){ - customerRepository.deleteAll(); - - Customer cust_1 = new Customer("Test1", "Test1", "Test1", 20); - Customer cust_2 = new Customer("Test2", "Test2", "Test2", 25); - Customer cust_3 = new Customer("Test3", "Test3", "Test3", 30); - Customer cust_4 = new Customer("Test4", "Test4", "Test4", 35); - Customer cust_5 = new Customer("Test5", "Test5", "Test5", 40); - Customer cust_6 = new Customer("Test6", "Test6", "Test6", 45); - - customerRepository.save(cust_1); - customerRepository.save(cust_2); - customerRepository.save(cust_3); - customerRepository.save(cust_4); - customerRepository.save(cust_5); - customerRepository.save(cust_6); - - return "ok"; - } - - - @RequestMapping("/all") - public Iterable getAll(){ - - return customerRepository.findAll(); - } - - @RequestMapping("/getByID/{id}") - public Optional getByID(@PathVariable("id") String id){ - - return customerRepository.findById(id); - } - - @RequestMapping("/getByName/{name}") - public List getByName(@PathVariable("name") String name){ - - return customerRepository.findByLastname(name); - - } - - @RequestMapping("/getByAge/{age}") - public List getByAge(@PathVariable("age") String age){ - - return customerRepository.findByAgeGreaterThan(Integer.valueOf(age)); - - } - - -} +package xy.spring2nosql.controller.Cassandra; + +import java.util.List; +import java.util.Optional; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import xy.spring2nosql.model.Cassandra.Customer; +import xy.spring2nosql.repository.Cassandra.CustomerRepository; + + + +@RestController +@RequestMapping("/cassandra") +public class CassandraController { + + Logger logger = LogManager.getLogger(getClass()); + + @Autowired + CustomerRepository customerRepository; + + @RequestMapping("/add") + public String add(){ + customerRepository.deleteAll(); + + Customer cust_1 = new Customer("Test1", "Test1", "Test1", 20); + Customer cust_2 = new Customer("Test2", "Test2", "Test2", 25); + Customer cust_3 = new Customer("Test3", "Test3", "Test3", 30); + Customer cust_4 = new Customer("Test4", "Test4", "Test4", 35); + Customer cust_5 = new Customer("Test5", "Test5", "Test5", 40); + Customer cust_6 = new Customer("Test6", "Test6", "Test6", 45); + + customerRepository.save(cust_1); + customerRepository.save(cust_2); + customerRepository.save(cust_3); + customerRepository.save(cust_4); + customerRepository.save(cust_5); + customerRepository.save(cust_6); + + return "ok"; + } + + + @RequestMapping("/all") + public Iterable getAll(){ + + return customerRepository.findAll(); + } + + @RequestMapping("/getByID/{id}") + public Optional getByID(@PathVariable("id") String id){ + + return customerRepository.findById(id); + } + + @RequestMapping("/getByName/{name}") + public List getByName(@PathVariable("name") String name){ + + return customerRepository.findByLastname(name); + + } + + @RequestMapping("/getByAge/{age}") + public List getByAge(@PathVariable("age") String age){ + + return customerRepository.findByAgeGreaterThan(Integer.valueOf(age)); + + } + + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/Couchbase/CouchbaseController.java b/src/main/java/xy/spring2nosql/controller/Couchbase/CouchbaseController.java similarity index 86% rename from src/main/java/xy/SpringBoot2NoSQL/controller/Couchbase/CouchbaseController.java rename to src/main/java/xy/spring2nosql/controller/Couchbase/CouchbaseController.java index 676c2b9..e484e4d 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/Couchbase/CouchbaseController.java +++ b/src/main/java/xy/spring2nosql/controller/Couchbase/CouchbaseController.java @@ -1,53 +1,53 @@ -//package xy.SpringBoot2NoSQL.controller.Couchbase; -// -//import java.util.Arrays; -//import java.util.List; -//import java.util.Optional; -// -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.web.bind.annotation.PathVariable; -//import org.springframework.web.bind.annotation.RequestMapping; -//import org.springframework.web.bind.annotation.RestController; -// -//import xy.SpringBoot2NoSQL.model.Couchbase.Customer; -//import xy.SpringBoot2NoSQL.repository.Couchbase.CouchbaseCustomerRepository; -// -//@RestController -//@RequestMapping("/couchbase") -//public class CouchbaseController { -// -// @Autowired -// CouchbaseCustomerRepository couchbaseCustomerRepository; -// -// @RequestMapping("/add") -// public String add(){ -// -// couchbaseCustomerRepository.deleteAll(); -// couchbaseCustomerRepository.saveAll(Arrays.asList(new Customer("01", "Jack", "Smith"), -// new Customer("02", "Adam", "Johnson"), -// new Customer("03", "Kim", "Smith"), -// new Customer("04", "David", "Williams"), -// new Customer("05", "Peter", "Davis"))); -// -// return "ok"; -// } -// -// @RequestMapping("/all") -// public Iterable getAll(){ -// -// return couchbaseCustomerRepository.findAll(); -// } -// -// @RequestMapping("/getByID/{id}") -// public Optional getByID(@PathVariable("id") String id){ -// -// return couchbaseCustomerRepository.findById(id); -// } -// -// @RequestMapping("/findByLastName/{name}") -// public List findByLastName(@PathVariable("name") String name){ -// -// return couchbaseCustomerRepository.findByLastName(name); -// } -// -//} +//package xy.spring2nosql.controller.Couchbase; +// +//import java.util.Arrays; +//import java.util.List; +//import java.util.Optional; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.web.bind.annotation.PathVariable; +//import org.springframework.web.bind.annotation.RequestMapping; +//import org.springframework.web.bind.annotation.RestController; +// +//import xy.spring2nosql.model.Couchbase.Customer; +//import xy.spring2nosql.repository.Couchbase.CouchbaseCustomerRepository; +// +//@RestController +//@RequestMapping("/couchbase") +//public class CouchbaseController { +// +// @Autowired +// CouchbaseCustomerRepository couchbaseCustomerRepository; +// +// @RequestMapping("/add") +// public String add(){ +// +// couchbaseCustomerRepository.deleteAll(); +// couchbaseCustomerRepository.saveAll(Arrays.asList(new Customer("01", "Jack", "Smith"), +// new Customer("02", "Adam", "Johnson"), +// new Customer("03", "Kim", "Smith"), +// new Customer("04", "David", "Williams"), +// new Customer("05", "Peter", "Davis"))); +// +// return "ok"; +// } +// +// @RequestMapping("/all") +// public Iterable getAll(){ +// +// return couchbaseCustomerRepository.findAll(); +// } +// +// @RequestMapping("/getByID/{id}") +// public Optional getByID(@PathVariable("id") String id){ +// +// return couchbaseCustomerRepository.findById(id); +// } +// +// @RequestMapping("/findByLastName/{name}") +// public List findByLastName(@PathVariable("name") String name){ +// +// return couchbaseCustomerRepository.findByLastName(name); +// } +// +//} diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/Ehcache/EhcacheDataController.java b/src/main/java/xy/spring2nosql/controller/Ehcache/EhcacheDataController.java similarity index 88% rename from src/main/java/xy/SpringBoot2NoSQL/controller/Ehcache/EhcacheDataController.java rename to src/main/java/xy/spring2nosql/controller/Ehcache/EhcacheDataController.java index 43544bb..32acb79 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/Ehcache/EhcacheDataController.java +++ b/src/main/java/xy/spring2nosql/controller/Ehcache/EhcacheDataController.java @@ -1,64 +1,64 @@ -package xy.SpringBoot2NoSQL.controller.Ehcache; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import net.sf.ehcache.CacheManager; -import xy.SpringBoot2NoSQL.model.User; -import xy.SpringBoot2NoSQL.service.Ehcache.UserService; - -@RestController -@RequestMapping("/ehcache") -public class EhcacheDataController { - - Logger logger = LogManager.getLogger(getClass()); - - @Autowired - UserService userService; - - @Autowired - private CacheManager cacheManager; - - /** - * 创建100个测试用户 - * @return - */ - @RequestMapping("/users") - public List getUsers(){ - - logger.info("using cache manager: " + cacheManager.getClass().getName()); - - userService.clearCache(); - - //新建对象 - List users = new ArrayList(); - for (int i=0;i<100;i++){ - users.add(userService.getUser("test"+i)); - } - - for (int i=0;i<100;i++){ - //测试获取对象是否是经过缓存 - userService.getUser("test"+i); - } - - return users; - } - - /** - * 获取测试用户,看看是否经过缓存 - * @return - */ - @RequestMapping("/user/{name}") - public User getUser(@PathVariable("name") String name){ - return userService.getUser(name); - - } - -} +package xy.spring2nosql.controller.Ehcache; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import net.sf.ehcache.CacheManager; +import xy.spring2nosql.model.User; +import xy.spring2nosql.service.Ehcache.UserService; + +@RestController +@RequestMapping("/ehcache") +public class EhcacheDataController { + + Logger logger = LogManager.getLogger(getClass()); + + @Autowired + UserService userService; + + @Autowired + private CacheManager cacheManager; + + /** + * 创建100个测试用户 + * @return + */ + @RequestMapping("/users") + public List getUsers(){ + + logger.info("using cache manager: " + cacheManager.getClass().getName()); + + userService.clearCache(); + + //新建对象 + List users = new ArrayList(); + for (int i=0;i<100;i++){ + users.add(userService.getUser("test"+i)); + } + + for (int i=0;i<100;i++){ + //测试获取对象是否是经过缓存 + userService.getUser("test"+i); + } + + return users; + } + + /** + * 获取测试用户,看看是否经过缓存 + * @return + */ + @RequestMapping("/user/{name}") + public User getUser(@PathVariable("name") String name){ + return userService.getUser(name); + + } + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/ElasticSearch/ESDataController.java b/src/main/java/xy/spring2nosql/controller/ElasticSearch/ESDataController.java similarity index 94% rename from src/main/java/xy/SpringBoot2NoSQL/controller/ElasticSearch/ESDataController.java rename to src/main/java/xy/spring2nosql/controller/ElasticSearch/ESDataController.java index 5a71565..9c468c2 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/ElasticSearch/ESDataController.java +++ b/src/main/java/xy/spring2nosql/controller/ElasticSearch/ESDataController.java @@ -1,186 +1,186 @@ -package xy.SpringBoot2NoSQL.controller.ElasticSearch; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.elasticsearch.action.ActionFuture; -import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; -import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.cluster.health.ClusterHealthStatus; -import org.elasticsearch.index.query.BoolQueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; -import org.springframework.data.elasticsearch.core.query.DeleteQuery; -import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; -import org.springframework.data.elasticsearch.core.query.SearchQuery; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import xy.SpringBoot2NoSQL.model.ElasticSearch.Product; -import xy.SpringBoot2NoSQL.repository.ElasticSearch.SampleProductRepository; - -@RestController -@RequestMapping("/es") -public class ESDataController { - - @Autowired - private ElasticsearchOperations elasticsearchOperations; - - @Autowired - SampleProductRepository sampleProductRepository; - - @Autowired - private ElasticsearchTemplate elasticsearchTemplate; - - //服务情况查询 - @GetMapping("details") - public ResponseEntity> getElasticInformation() { - - Client client = elasticsearchOperations.getClient(); - Map asMap = client.settings().getAsMap(); - return ResponseEntity.ok(asMap); - } - - //健康检查 - @GetMapping("checkHealth") - public String checkHealth() { - - return getHealth(); - } - - @GetMapping("insertProduct") - public Product insert() { - Product product = new Product("1", "测试产品1", "测试产品111111.", true); - return sampleProductRepository.save(product); - } - - @GetMapping("insertProductMore") - public String insertProductMore() { - - List productList = new ArrayList(); - - for (int i = 0; i < 100; i++) { - Product product = new Product(String.valueOf(i), "测试产品" + i, "测试产品描述.", true); - productList.add(product); - } - - // 只需要执行一次批量 - sampleProductRepository.saveAll(productList); - - return "success"; - } - - @GetMapping("insertProduct2/{id}/{name}") - public Product insert2(@PathVariable String name, @PathVariable String id) { - Product product = new Product(id, name, name + "产品描述.", true); - return sampleProductRepository.save(product); - } - - @GetMapping("findByNameProducts/{name}") - public List findByNameProducts(@PathVariable String name) { - List list = sampleProductRepository.findByName(name); - return list; - } - - @GetMapping("findByNameAndIdProducts/{name}/{id}") - public List findByNameAndIdProducts(@PathVariable String name, @PathVariable String id) { - List list = sampleProductRepository.findByNameAndId(name, id); - return list; - } - - @GetMapping("findByNameProductsPage/{name}/{page}/{size}") - public List findByNameProductsPage(@PathVariable String name, @PathVariable int page, - @PathVariable int size) { - List list = sampleProductRepository.findByName(name, PageRequest.of(page, size)); - return list; - } - - @GetMapping("count") - public long CountAllElementsInIndex() { - - long count = sampleProductRepository.count(); - return count; - } - - @GetMapping("searchQueries/{id}/{name}/{page}/{size}") - public Page SearchQueries(@PathVariable String name, @PathVariable String id, @PathVariable int page, - @PathVariable int size) { - - BoolQueryBuilder bqb = QueryBuilders.boolQuery(); - bqb.must(QueryBuilders.termQuery("name", name)); - //bqb.must(QueryBuilders.rangeQuery("id").gt(id));// 大于 - - SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(bqb).withPageable(PageRequest.of(page, size)) - .build(); - - Page products = sampleProductRepository.search(searchQuery); - return products; - } - - //根据id删除 - public boolean deleteById(String id) { - try { - elasticsearchTemplate.delete(getEntityClass(), id); - return true; - } catch (Exception e) { - return false; - } - } - - //根据条件删除 - public boolean deleteByQuery(Map filedContentMap) { - try { - DeleteQuery dq = new DeleteQuery(); - - BoolQueryBuilder query=QueryBuilders. boolQuery(); - if(filedContentMap!=null) - for (String key : filedContentMap.keySet()) {//字段查询 - query.must(QueryBuilders.matchQuery(key,filedContentMap.get(key))); - } - dq.setQuery(query); - elasticsearchTemplate.delete(dq, getEntityClass()); - return true; - } catch (Exception e) { - e.printStackTrace(); - return false; - } - } - - - - //健康检查 - public String getHealth() { - try { - Client client = elasticsearchOperations.getClient(); - ActionFuture health = client.admin() - .cluster().health(new ClusterHealthRequest()); - ClusterHealthStatus status = health.actionGet().getStatus(); - if (status.value() == ClusterHealthStatus.RED.value()) { - return "red"; - } - if (status.value() == ClusterHealthStatus.GREEN.value()) { - return "green"; - } - if (status.value() == ClusterHealthStatus.YELLOW.value()) { - return "yellow"; - } - return "unknow"; - } catch (Exception e) { - - return "unknow"; - } - } - - private Class getEntityClass() { - - return Product.class; - } -} +package xy.spring2nosql.controller.ElasticSearch; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.elasticsearch.action.ActionFuture; +import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; +import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.cluster.health.ClusterHealthStatus; +import org.elasticsearch.index.query.BoolQueryBuilder; +import org.elasticsearch.index.query.QueryBuilders; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; +import org.springframework.data.elasticsearch.core.query.DeleteQuery; +import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; +import org.springframework.data.elasticsearch.core.query.SearchQuery; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import xy.spring2nosql.model.ElasticSearch.Product; +import xy.spring2nosql.repository.ElasticSearch.SampleProductRepository; + +@RestController +@RequestMapping("/es") +public class ESDataController { + + @Autowired + private ElasticsearchOperations elasticsearchOperations; + + @Autowired + SampleProductRepository sampleProductRepository; + + @Autowired + private ElasticsearchTemplate elasticsearchTemplate; + + //服务情况查询 + @GetMapping("details") + public ResponseEntity> getElasticInformation() { + + Client client = elasticsearchOperations.getClient(); + Map asMap = client.settings().getAsMap(); + return ResponseEntity.ok(asMap); + } + + //健康检查 + @GetMapping("checkHealth") + public String checkHealth() { + + return getHealth(); + } + + @GetMapping("insertProduct") + public Product insert() { + Product product = new Product("1", "测试产品1", "测试产品111111.", true); + return sampleProductRepository.save(product); + } + + @GetMapping("insertProductMore") + public String insertProductMore() { + + List productList = new ArrayList(); + + for (int i = 0; i < 100; i++) { + Product product = new Product(String.valueOf(i), "测试产品" + i, "测试产品描述.", true); + productList.add(product); + } + + // 只需要执行一次批量 + sampleProductRepository.saveAll(productList); + + return "success"; + } + + @GetMapping("insertProduct2/{id}/{name}") + public Product insert2(@PathVariable String name, @PathVariable String id) { + Product product = new Product(id, name, name + "产品描述.", true); + return sampleProductRepository.save(product); + } + + @GetMapping("findByNameProducts/{name}") + public List findByNameProducts(@PathVariable String name) { + List list = sampleProductRepository.findByName(name); + return list; + } + + @GetMapping("findByNameAndIdProducts/{name}/{id}") + public List findByNameAndIdProducts(@PathVariable String name, @PathVariable String id) { + List list = sampleProductRepository.findByNameAndId(name, id); + return list; + } + + @GetMapping("findByNameProductsPage/{name}/{page}/{size}") + public List findByNameProductsPage(@PathVariable String name, @PathVariable int page, + @PathVariable int size) { + List list = sampleProductRepository.findByName(name, PageRequest.of(page, size)); + return list; + } + + @GetMapping("count") + public long CountAllElementsInIndex() { + + long count = sampleProductRepository.count(); + return count; + } + + @GetMapping("searchQueries/{id}/{name}/{page}/{size}") + public Page SearchQueries(@PathVariable String name, @PathVariable String id, @PathVariable int page, + @PathVariable int size) { + + BoolQueryBuilder bqb = QueryBuilders.boolQuery(); + bqb.must(QueryBuilders.termQuery("name", name)); + //bqb.must(QueryBuilders.rangeQuery("id").gt(id));// 大于 + + SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(bqb).withPageable(PageRequest.of(page, size)) + .build(); + + Page products = sampleProductRepository.search(searchQuery); + return products; + } + + //根据id删除 + public boolean deleteById(String id) { + try { + elasticsearchTemplate.delete(getEntityClass(), id); + return true; + } catch (Exception e) { + return false; + } + } + + //根据条件删除 + public boolean deleteByQuery(Map filedContentMap) { + try { + DeleteQuery dq = new DeleteQuery(); + + BoolQueryBuilder query=QueryBuilders. boolQuery(); + if(filedContentMap!=null) + for (String key : filedContentMap.keySet()) {//字段查询 + query.must(QueryBuilders.matchQuery(key,filedContentMap.get(key))); + } + dq.setQuery(query); + elasticsearchTemplate.delete(dq, getEntityClass()); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + + + //健康检查 + public String getHealth() { + try { + Client client = elasticsearchOperations.getClient(); + ActionFuture health = client.admin() + .cluster().health(new ClusterHealthRequest()); + ClusterHealthStatus status = health.actionGet().getStatus(); + if (status.value() == ClusterHealthStatus.RED.value()) { + return "red"; + } + if (status.value() == ClusterHealthStatus.GREEN.value()) { + return "green"; + } + if (status.value() == ClusterHealthStatus.YELLOW.value()) { + return "yellow"; + } + return "unknow"; + } catch (Exception e) { + + return "unknow"; + } + } + + private Class getEntityClass() { + + return Product.class; + } +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/ElasticSearch/ESSearchController.java b/src/main/java/xy/spring2nosql/controller/ElasticSearch/ESSearchController.java similarity index 88% rename from src/main/java/xy/SpringBoot2NoSQL/controller/ElasticSearch/ESSearchController.java rename to src/main/java/xy/spring2nosql/controller/ElasticSearch/ESSearchController.java index 2e6eaeb..a761ad6 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/ElasticSearch/ESSearchController.java +++ b/src/main/java/xy/spring2nosql/controller/ElasticSearch/ESSearchController.java @@ -1,67 +1,67 @@ -package xy.SpringBoot2NoSQL.controller.ElasticSearch; - -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import xy.SpringBoot2NoSQL.model.ElasticSearch.Product; -import xy.SpringBoot2NoSQL.repository.ElasticSearch.SampleProductRepository; -import xy.SpringBoot2NoSQL.utils.ESSearchUtil; - -@RestController -@RequestMapping("/essearch") -public class ESSearchController { - - @Autowired - SampleProductRepository sampleProductRepository; - - @GetMapping("search") - public Page search() { - - return sampleProductRepository.search(getBoolQuery(), PageRequest.of(0, 5)); - } - - @GetMapping("searchAll/{page}") - public Page searchAll(@PathVariable int page) { - - return sampleProductRepository.search(ESSearchUtil.matchAllQuery(), PageRequest.of(page, 5)); - } - - @GetMapping("searchProduct/{key}/{value}/{searchtype}") - public Page searchProduct(@PathVariable String key,@PathVariable String value, @PathVariable String searchtype) { - Page products = null; - - if (searchtype.equals("matchQuery")) { - products = sampleProductRepository.search(ESSearchUtil.matchQuery(key, value), PageRequest.of(0, 5)); - } - - if (searchtype.equals("matchPhraseQuery")) { - products = sampleProductRepository.search(ESSearchUtil.matchPhraseQuery(key, value), PageRequest.of(0, 5)); - } - - if (searchtype.equals("fuzzyQuery")) { - products = sampleProductRepository.search(ESSearchUtil.fuzzyQuery(key, value), PageRequest.of(0, 5)); - } - - if (searchtype.equals("termsQuery")) { - products = sampleProductRepository.search(ESSearchUtil.termsQuery(key, value), PageRequest.of(0, 5)); - } - - return products; - } - - public QueryBuilder getBoolQuery() { - - return QueryBuilders.boolQuery() - .must(QueryBuilders.matchPhraseQuery("name", "测试产品1")) - //.mustNot(QueryBuilders.termQuery("enabled", true)); - .must(QueryBuilders.matchPhraseQuery("enabled", true)); - } - -} +package xy.spring2nosql.controller.ElasticSearch; + +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.index.query.QueryBuilders; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import xy.spring2nosql.model.ElasticSearch.Product; +import xy.spring2nosql.repository.ElasticSearch.SampleProductRepository; +import xy.spring2nosql.utils.ESSearchUtil; + +@RestController +@RequestMapping("/essearch") +public class ESSearchController { + + @Autowired + SampleProductRepository sampleProductRepository; + + @GetMapping("search") + public Page search() { + + return sampleProductRepository.search(getBoolQuery(), PageRequest.of(0, 5)); + } + + @GetMapping("searchAll/{page}") + public Page searchAll(@PathVariable int page) { + + return sampleProductRepository.search(ESSearchUtil.matchAllQuery(), PageRequest.of(page, 5)); + } + + @GetMapping("searchProduct/{key}/{value}/{searchtype}") + public Page searchProduct(@PathVariable String key,@PathVariable String value, @PathVariable String searchtype) { + Page products = null; + + if (searchtype.equals("matchQuery")) { + products = sampleProductRepository.search(ESSearchUtil.matchQuery(key, value), PageRequest.of(0, 5)); + } + + if (searchtype.equals("matchPhraseQuery")) { + products = sampleProductRepository.search(ESSearchUtil.matchPhraseQuery(key, value), PageRequest.of(0, 5)); + } + + if (searchtype.equals("fuzzyQuery")) { + products = sampleProductRepository.search(ESSearchUtil.fuzzyQuery(key, value), PageRequest.of(0, 5)); + } + + if (searchtype.equals("termsQuery")) { + products = sampleProductRepository.search(ESSearchUtil.termsQuery(key, value), PageRequest.of(0, 5)); + } + + return products; + } + + public QueryBuilder getBoolQuery() { + + return QueryBuilders.boolQuery() + .must(QueryBuilders.matchPhraseQuery("name", "测试产品1")) + //.mustNot(QueryBuilders.termQuery("enabled", true)); + .must(QueryBuilders.matchPhraseQuery("enabled", true)); + } + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/Mongo/MongoDataController.java b/src/main/java/xy/spring2nosql/controller/Mongo/MongoDataController.java similarity index 89% rename from src/main/java/xy/SpringBoot2NoSQL/controller/Mongo/MongoDataController.java rename to src/main/java/xy/spring2nosql/controller/Mongo/MongoDataController.java index e9e9c4e..6bf22a5 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/Mongo/MongoDataController.java +++ b/src/main/java/xy/spring2nosql/controller/Mongo/MongoDataController.java @@ -1,110 +1,110 @@ -package xy.SpringBoot2NoSQL.controller.Mongo; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import xy.SpringBoot2NoSQL.model.Mongo.Department; -import xy.SpringBoot2NoSQL.model.Mongo.Location; -import xy.SpringBoot2NoSQL.model.Mongo.Person; -import xy.SpringBoot2NoSQL.repository.Mongo.DepartmentRepository; -import xy.SpringBoot2NoSQL.repository.Mongo.PersonRepository; - -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Optional; - -@RestController -@RequestMapping("/mongo") -public class MongoDataController { - - @Autowired - PersonRepository personRepository; - @Autowired - DepartmentRepository departmentRepository; - - @RequestMapping("/persons/{name}") - public Person getPerson(@PathVariable("name") String name){ - return personRepository.findByName(name); - } - - @GetMapping("findAll") - public List getUserList() { - List userInfoList = personRepository.findAll(); - return userInfoList; - } - - @GetMapping("query1") - public Person q1(String name){ - return personRepository.findByName(name); - } - - @GetMapping("query2") - public List q2(Integer age){ - return personRepository.withQueryFindByAge(age); - } - - @GetMapping("delete") - public String delete(String id) { - personRepository.deleteById(id); - return "success"; - } - - @DeleteMapping("/colleagues/{name}") - public ResponseEntity deleteColleague(@PathVariable String name){ - Person person = personRepository.findByName(name); - if(person!=null) { - personRepository.delete(person); - return new ResponseEntity<>(HttpStatus.ACCEPTED); - } - return new ResponseEntity<>(HttpStatus.BAD_REQUEST); - } - - @GetMapping("insert") - public Person insert(Long id, String username, String password) { - Person user = new Person("test2",22); - return personRepository.insert(user); - } - - //要先执行添加部门的操作 - @RequestMapping("saveDepartment") - public Department saveDepartment(){ - Department d = new Department("abc001","研发部"); - return departmentRepository.save(d); - } - - //执行这个之前要先执行”saveDepartment“,因为需要一个部门的引用 - @RequestMapping("save") - public Person save(){ - Person p = new Person("王昕",32); - Collection locations = new LinkedHashSet(); - Location loc1 = new Location("上海","2009"); - Location loc2 = new Location("广州","2011"); - locations.add(loc1); - locations.add(loc2); - - p.setLocations(locations); - - Department d = departmentRepository.findByName("研发部"); - p.setDepartment(d); - - return personRepository.save(p); - } - - - @PostMapping("/formsave") - public ResponseEntity addColleague(@RequestBody Person person){ - personRepository.save(person); - return new ResponseEntity<>(HttpStatus.CREATED); - } - +package xy.spring2nosql.controller.Mongo; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import xy.spring2nosql.model.Mongo.Department; +import xy.spring2nosql.model.Mongo.Location; +import xy.spring2nosql.model.Mongo.Person; +import xy.spring2nosql.repository.Mongo.DepartmentRepository; +import xy.spring2nosql.repository.Mongo.PersonRepository; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Optional; + +@RestController +@RequestMapping("/mongo") +public class MongoDataController { + + @Autowired + PersonRepository personRepository; + @Autowired + DepartmentRepository departmentRepository; + + @RequestMapping("/persons/{name}") + public Person getPerson(@PathVariable("name") String name){ + return personRepository.findByName(name); + } + + @GetMapping("findAll") + public List getUserList() { + List userInfoList = personRepository.findAll(); + return userInfoList; + } + + @GetMapping("query1") + public Person q1(String name){ + return personRepository.findByName(name); + } + + @GetMapping("query2") + public List q2(Integer age){ + return personRepository.withQueryFindByAge(age); + } + + @GetMapping("delete") + public String delete(String id) { + personRepository.deleteById(id); + return "success"; + } + + @DeleteMapping("/colleagues/{name}") + public ResponseEntity deleteColleague(@PathVariable String name){ + Person person = personRepository.findByName(name); + if(person!=null) { + personRepository.delete(person); + return new ResponseEntity<>(HttpStatus.ACCEPTED); + } + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + + @GetMapping("insert") + public Person insert(Long id, String username, String password) { + Person user = new Person("test2",22); + return personRepository.insert(user); + } + + //要先执行添加部门的操作 + @RequestMapping("saveDepartment") + public Department saveDepartment(){ + Department d = new Department("abc001","研发部"); + return departmentRepository.save(d); + } + + //执行这个之前要先执行”saveDepartment“,因为需要一个部门的引用 + @RequestMapping("save") + public Person save(){ + Person p = new Person("王昕",32); + Collection locations = new LinkedHashSet(); + Location loc1 = new Location("上海","2009"); + Location loc2 = new Location("广州","2011"); + locations.add(loc1); + locations.add(loc2); + + p.setLocations(locations); + + Department d = departmentRepository.findByName("研发部"); + p.setDepartment(d); + + return personRepository.save(p); + } + + + @PostMapping("/formsave") + public ResponseEntity addColleague(@RequestBody Person person){ + personRepository.save(person); + return new ResponseEntity<>(HttpStatus.CREATED); + } + } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/Redis/RedisDataController.java b/src/main/java/xy/spring2nosql/controller/Redis/RedisDataController.java similarity index 73% rename from src/main/java/xy/SpringBoot2NoSQL/controller/Redis/RedisDataController.java rename to src/main/java/xy/spring2nosql/controller/Redis/RedisDataController.java index 1343cf3..76ec91a 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/Redis/RedisDataController.java +++ b/src/main/java/xy/spring2nosql/controller/Redis/RedisDataController.java @@ -1,34 +1,34 @@ -package xy.SpringBoot2NoSQL.controller.Redis; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import xy.SpringBoot2NoSQL.model.Redis.User; -import xy.SpringBoot2NoSQL.repository.Redis.ObjectRepository; -import xy.SpringBoot2NoSQL.repository.Redis.StringStringRepository; -import xy.SpringBoot2NoSQL.repository.Redis.UserRepository; - -@RestController -@RequestMapping("/redis") -public class RedisDataController { - - @Autowired - ObjectRepository objRepository; - @Autowired - StringStringRepository stringStringRepository; - - @RequestMapping("/add/{name}") - public String getRecognition(@PathVariable("name") String name){ - User user = new User(name,name); - objRepository.save(user); - - return "add success."; - } - - @RequestMapping("/user/{name}") - public User getUser(@PathVariable("name") String name){ - return (User)objRepository.get(name); - - } -} +package xy.spring2nosql.controller.Redis; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import xy.spring2nosql.model.Redis.User; +import xy.spring2nosql.repository.Redis.ObjectRepository; +import xy.spring2nosql.repository.Redis.StringStringRepository; +import xy.spring2nosql.repository.Redis.UserRepository; + +@RestController +@RequestMapping("/redis") +public class RedisDataController { + + @Autowired + ObjectRepository objRepository; + @Autowired + StringStringRepository stringStringRepository; + + @RequestMapping("/add/{name}") + public String getRecognition(@PathVariable("name") String name){ + User user = new User(name,name); + objRepository.save(user); + + return "add success."; + } + + @RequestMapping("/user/{name}") + public User getUser(@PathVariable("name") String name){ + return (User)objRepository.get(name); + + } +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/Redis/RedissonController.java b/src/main/java/xy/spring2nosql/controller/Redis/RedissonController.java similarity index 95% rename from src/main/java/xy/SpringBoot2NoSQL/controller/Redis/RedissonController.java rename to src/main/java/xy/spring2nosql/controller/Redis/RedissonController.java index 110be44..bdae953 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/Redis/RedissonController.java +++ b/src/main/java/xy/spring2nosql/controller/Redis/RedissonController.java @@ -1,329 +1,329 @@ -package xy.SpringBoot2NoSQL.controller.Redis; - -import java.util.concurrent.TimeUnit; - -import org.redisson.Redisson; -import org.redisson.api.BatchOptions; -import org.redisson.api.BatchResult; -import org.redisson.api.LocalCachedMapOptions; -import org.redisson.api.RAtomicDouble; -import org.redisson.api.RBatch; -import org.redisson.api.RBloomFilter; -import org.redisson.api.RBoundedBlockingQueue; -import org.redisson.api.RBucket; -import org.redisson.api.RHyperLogLog; -import org.redisson.api.RLocalCachedMap; -import org.redisson.api.RLongAdder; -import org.redisson.api.RMapCache; -import org.redisson.api.RScoredSortedSet; -import org.redisson.api.RedissonClient; -import org.redisson.api.TransactionOptions; -import org.redisson.api.map.event.EntryCreatedListener; -import org.redisson.api.map.event.EntryEvent; -import org.redisson.api.map.event.EntryExpiredListener; -import org.redisson.api.map.event.EntryRemovedListener; -import org.redisson.api.map.event.EntryUpdatedListener; -import org.redisson.config.Config; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import io.netty.util.concurrent.Future; -import xy.SpringBoot2NoSQL.config.RedissonConfig; -import xy.SpringBoot2NoSQL.model.Redis.User; -import xy.SpringBoot2NoSQL.utils.RedissonUtil; - - -@RestController -@RequestMapping("/redisson") -public class RedissonController { - - // 单Redis节点模式,默认连接地址 127.0.0.1:6379 - RedissonClient redisson = Redisson.create(); - - - /** - * Map 获取 - * @param name - * @param key - * @return - */ - @RequestMapping("/getMap/{name}/{key}") - public String get(@PathVariable("name") String name,@PathVariable("key") String key){ - - String result = (String) redisson.getMap(name).get(key); - - return result; - } - - /** - * 本地缓存(Local Cache)也叫就近缓存(Near Cache)。 - * 这类映射的使用主要用于在特定的场景下,映射缓存(MapCache)上的高度频繁的读取操作, - * 使网络通信都被视为瓶颈的情况。Redisson与Redis通信的同时,还将部分数据保存在本地内存里。这样的设计的好处是它能将读取速度提高最多 45倍 - * @param name - * @param key - * @return - */ - @RequestMapping("/getLocalCachedMap/{name}/{key}") - public String getLocalCachedMap(@PathVariable("name") String name,@PathVariable("key") String key){ - - LocalCachedMapOptions options = LocalCachedMapOptions.defaults() - .evictionPolicy(LocalCachedMapOptions.EvictionPolicy.LFU) - .cacheSize(100) - .syncStrategy(LocalCachedMapOptions.SyncStrategy.UPDATE) //同步缓存 - .timeToLive(10, TimeUnit.SECONDS) - .maxIdle(10, TimeUnit.SECONDS); - - RLocalCachedMap map = redisson.getLocalCachedMap(name,options); - - map.put(key, "测试值"); - - String result = (String)map.get(key); - - return result; - } - - /** - * 元素淘汰功能(Eviction)和事件监听 - * 带有元素淘汰(Eviction)机制的映射类允许针对一个映射中每个元素单独设定 有效时间 和 最长闲置时间 。 - * @param name - * @param key - * @return - */ - @RequestMapping("/getMapCache/{name}/{key}") - public int getMapCache(@PathVariable("name") String name,@PathVariable("key") String key){ - - RMapCache map = redisson.getMapCache(name); - //LRU有界映射设置 - // 将该映射的最大容量限制设定或更改为10 - map.setMaxSize(10); - - map.put(key, 999); - map.put(key+"_TimeTtoLive", 888, 1, TimeUnit.SECONDS);//有效时间1秒 - - int updateListener = map.addListener(new EntryUpdatedListener() { - @Override - public void onUpdated(EntryEvent event) { -// event.getKey(); // 字段名 -// event.getValue(); // 新值 -// event.getOldValue(); // 旧值 - } - }); - - int createListener = map.addListener(new EntryCreatedListener() { - @Override - public void onCreated(EntryEvent event) { -// event.getKey(); // 字段名 -// event.getValue(); // 值 - } - }); - - int expireListener = map.addListener(new EntryExpiredListener() { - @Override - public void onExpired(EntryEvent event) { -// event.getKey(); // 字段名 -// event.getValue(); // 值 - - } - }); - - int removeListener = map.addListener(new EntryRemovedListener() { - @Override - public void onRemoved(EntryEvent event) { -// event.getKey(); // 字段名 -// event.getValue(); // 值 - } - }); - - map.removeListener(updateListener); - map.removeListener(createListener); - map.removeListener(expireListener); - map.removeListener(removeListener); - try { - Thread.sleep(200);//如果改成1000以上,则无法取出映射的值,因为已删除 - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - int result = map.get(key+"_TimeTtoLive"); - return result; - } - - - /** - * 设置分布式对象桶(Object Bucket) - * @param key - * @param name - * @param value - * @return - */ - @RequestMapping("/setObjectBucket/{key}") - public String setObjectBucket(@PathVariable("key") String key){ - - RBucket bucket = redisson.getBucket(key); - bucket.set(new User("wangxin","王昕")); - - return "objectBucket set success."; - } - - @RequestMapping("/getBucket/{key}") - public User getBucket(@PathVariable("key") String key){ - - User user = (User) RedissonUtil.getRBucket(redisson, key).get(); - - return user; - } - - - /** - * 分布式基数估计算法 - * @param key - * @return - */ - @RequestMapping("/hyperLogLog/{key}") - public Long hyperLogLog(@PathVariable("key") String key){ - - RHyperLogLog log = redisson.getHyperLogLog(key); - - log.add(1); - log.add(2); - log.add(3); - - Long count =log.count(); - - return count; - } - - - /** - * 分布式整长型累加器 - * 基于Redis的Redisson分布式整长型累加器采用了与java.util.concurrent.atomic.LongAdder类似的接口。 - * 通过利用客户端内置的LongAdder对象,为分布式环境下递增和递减操作提供了很高得性能。 - * 据统计其性能最高比分布式AtomicLong对象快 12000 倍。完美适用于分布式统计计量场景。 - * @param key - * @return - */ - @RequestMapping("/longAdder/{key}") - public Long longAdder(@PathVariable("key") String key){ - - RLongAdder atomicLong = redisson.getLongAdder(key); - atomicLong.add(12); - atomicLong.increment(); - atomicLong.increment(); - atomicLong.decrement(); - - Long count =atomicLong.sum(); - - return count; - } - - /** - * 分布式原子双精度浮点 - * 分布式原子双精度浮点RAtomicDouble,弥补了Java自身的不足 - * @param key - * @return - */ - @RequestMapping("/atomicDouble/{key}") - public double atomicDouble(@PathVariable("key") String key){ - - RAtomicDouble atomicDouble = redisson.getAtomicDouble(key); - atomicDouble.set(123.11); - atomicDouble.addAndGet(4.25); - - double value = atomicDouble.get(); - - return value; - } - - /** - * 异步批量执行 - * @param key - * @return - */ - @RequestMapping("/batch") - public String batch(){ - - RBatch batch = redisson.createBatch(BatchOptions.defaults()); - //RTransaction RTransaction = redisson.createTransaction(TransactionOptions.defaults()) - batch.getMap("test").fastPutAsync("1", "2"); - batch.getMap("test").fastPutAsync("2", "3"); - batch.getMap("test").putAsync("2", "新的值"); - - // 将写入操作同步到从节点 - // 同步到2个从节点,等待时间为1秒钟 - //batch.syncSlaves(2, 1, TimeUnit.SECONDS); - - BatchResult res = batch.execute(); - - return res.getResponses().toString(); - } - - - - /** - * 计分排序集(ScoredSortedSet) - * @return - */ - @RequestMapping("/scoredSortedSet") - public String ScoredSortedSet(){ - - RScoredSortedSet set = redisson.getScoredSortedSet("scoredSortedSet"); - set.clear(); - - set.add(3.13, new User("Tom","Tom name")); - set.addAsync(0.123, new User("Dog","Dog name")); - - User user = new User("Cat","Cat name"); - set.add(4.67, user); - set.addScore(user, 0.1); //加分 - - int index = set.rank(user); // 获取元素在集合中的位置 - - Double score = set.getScore(user); // 获取元素的评分 - - return "位置:"+index +",分数:"+score; - } - - - /** - * 有界阻塞队列(Bounded Blocking Queue) - * @return - */ - @RequestMapping("/boundedBlockingQueue") - public String BoundedBlockingQueue(){ - - RBoundedBlockingQueue queue = redisson.getBoundedBlockingQueue("anyQueue"); - queue.clear(); - // 如果初始容量(边界)设定成功则返回`真(true)`, - // 如果初始容量(边界)已近存在则返回`假(false)`。 - queue.trySetCapacity(2); - - queue.offer(new User("Tom","Tom name")); - queue.offer(new User("Cat","Cat name")); - //此时容量已满,add方法会直接阻塞 - //queue.add(new User("Cat2","Cat2 name")); - // 此时容量已满,下面代码将会被阻塞,直到有空闲为止。 - try { - queue.put(new User("Dog","Dog name")); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - User obj = queue.peek();//获取队列第一个元素,但并不从队列中删除 - User obj2 = null; - try { - obj2 = queue.poll(3, TimeUnit.SECONDS);//获取队列第一个元素,并删除 - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - User obj3 = queue.poll(); - return obj.getLogin() +","+ obj2.getLogin()+","+ obj3.getLogin(); - } - - - -} +package xy.spring2nosql.controller.Redis; + +import java.util.concurrent.TimeUnit; + +import org.redisson.Redisson; +import org.redisson.api.BatchOptions; +import org.redisson.api.BatchResult; +import org.redisson.api.LocalCachedMapOptions; +import org.redisson.api.RAtomicDouble; +import org.redisson.api.RBatch; +import org.redisson.api.RBloomFilter; +import org.redisson.api.RBoundedBlockingQueue; +import org.redisson.api.RBucket; +import org.redisson.api.RHyperLogLog; +import org.redisson.api.RLocalCachedMap; +import org.redisson.api.RLongAdder; +import org.redisson.api.RMapCache; +import org.redisson.api.RScoredSortedSet; +import org.redisson.api.RedissonClient; +import org.redisson.api.TransactionOptions; +import org.redisson.api.map.event.EntryCreatedListener; +import org.redisson.api.map.event.EntryEvent; +import org.redisson.api.map.event.EntryExpiredListener; +import org.redisson.api.map.event.EntryRemovedListener; +import org.redisson.api.map.event.EntryUpdatedListener; +import org.redisson.config.Config; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import io.netty.util.concurrent.Future; +import xy.spring2nosql.config.RedissonConfig; +import xy.spring2nosql.model.Redis.User; +import xy.spring2nosql.utils.RedissonUtil; + + +@RestController +@RequestMapping("/redisson") +public class RedissonController { + + // 单Redis节点模式,默认连接地址 127.0.0.1:6379 + RedissonClient redisson = Redisson.create(); + + + /** + * Map 获取 + * @param name + * @param key + * @return + */ + @RequestMapping("/getMap/{name}/{key}") + public String get(@PathVariable("name") String name,@PathVariable("key") String key){ + + String result = (String) redisson.getMap(name).get(key); + + return result; + } + + /** + * 本地缓存(Local Cache)也叫就近缓存(Near Cache)。 + * 这类映射的使用主要用于在特定的场景下,映射缓存(MapCache)上的高度频繁的读取操作, + * 使网络通信都被视为瓶颈的情况。Redisson与Redis通信的同时,还将部分数据保存在本地内存里。这样的设计的好处是它能将读取速度提高最多 45倍 + * @param name + * @param key + * @return + */ + @RequestMapping("/getLocalCachedMap/{name}/{key}") + public String getLocalCachedMap(@PathVariable("name") String name,@PathVariable("key") String key){ + + LocalCachedMapOptions options = LocalCachedMapOptions.defaults() + .evictionPolicy(LocalCachedMapOptions.EvictionPolicy.LFU) + .cacheSize(100) + .syncStrategy(LocalCachedMapOptions.SyncStrategy.UPDATE) //同步缓存 + .timeToLive(10, TimeUnit.SECONDS) + .maxIdle(10, TimeUnit.SECONDS); + + RLocalCachedMap map = redisson.getLocalCachedMap(name,options); + + map.put(key, "测试值"); + + String result = (String)map.get(key); + + return result; + } + + /** + * 元素淘汰功能(Eviction)和事件监听 + * 带有元素淘汰(Eviction)机制的映射类允许针对一个映射中每个元素单独设定 有效时间 和 最长闲置时间 。 + * @param name + * @param key + * @return + */ + @RequestMapping("/getMapCache/{name}/{key}") + public int getMapCache(@PathVariable("name") String name,@PathVariable("key") String key){ + + RMapCache map = redisson.getMapCache(name); + //LRU有界映射设置 + // 将该映射的最大容量限制设定或更改为10 + map.setMaxSize(10); + + map.put(key, 999); + map.put(key+"_TimeTtoLive", 888, 1, TimeUnit.SECONDS);//有效时间1秒 + + int updateListener = map.addListener(new EntryUpdatedListener() { + @Override + public void onUpdated(EntryEvent event) { +// event.getKey(); // 字段名 +// event.getValue(); // 新值 +// event.getOldValue(); // 旧值 + } + }); + + int createListener = map.addListener(new EntryCreatedListener() { + @Override + public void onCreated(EntryEvent event) { +// event.getKey(); // 字段名 +// event.getValue(); // 值 + } + }); + + int expireListener = map.addListener(new EntryExpiredListener() { + @Override + public void onExpired(EntryEvent event) { +// event.getKey(); // 字段名 +// event.getValue(); // 值 + + } + }); + + int removeListener = map.addListener(new EntryRemovedListener() { + @Override + public void onRemoved(EntryEvent event) { +// event.getKey(); // 字段名 +// event.getValue(); // 值 + } + }); + + map.removeListener(updateListener); + map.removeListener(createListener); + map.removeListener(expireListener); + map.removeListener(removeListener); + try { + Thread.sleep(200);//如果改成1000以上,则无法取出映射的值,因为已删除 + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + int result = map.get(key+"_TimeTtoLive"); + return result; + } + + + /** + * 设置分布式对象桶(Object Bucket) + * @param key + * @param name + * @param value + * @return + */ + @RequestMapping("/setObjectBucket/{key}") + public String setObjectBucket(@PathVariable("key") String key){ + + RBucket bucket = redisson.getBucket(key); + bucket.set(new User("wangxin","王昕")); + + return "objectBucket set success."; + } + + @RequestMapping("/getBucket/{key}") + public User getBucket(@PathVariable("key") String key){ + + User user = (User) RedissonUtil.getRBucket(redisson, key).get(); + + return user; + } + + + /** + * 分布式基数估计算法 + * @param key + * @return + */ + @RequestMapping("/hyperLogLog/{key}") + public Long hyperLogLog(@PathVariable("key") String key){ + + RHyperLogLog log = redisson.getHyperLogLog(key); + + log.add(1); + log.add(2); + log.add(3); + + Long count =log.count(); + + return count; + } + + + /** + * 分布式整长型累加器 + * 基于Redis的Redisson分布式整长型累加器采用了与java.util.concurrent.atomic.LongAdder类似的接口。 + * 通过利用客户端内置的LongAdder对象,为分布式环境下递增和递减操作提供了很高得性能。 + * 据统计其性能最高比分布式AtomicLong对象快 12000 倍。完美适用于分布式统计计量场景。 + * @param key + * @return + */ + @RequestMapping("/longAdder/{key}") + public Long longAdder(@PathVariable("key") String key){ + + RLongAdder atomicLong = redisson.getLongAdder(key); + atomicLong.add(12); + atomicLong.increment(); + atomicLong.increment(); + atomicLong.decrement(); + + Long count =atomicLong.sum(); + + return count; + } + + /** + * 分布式原子双精度浮点 + * 分布式原子双精度浮点RAtomicDouble,弥补了Java自身的不足 + * @param key + * @return + */ + @RequestMapping("/atomicDouble/{key}") + public double atomicDouble(@PathVariable("key") String key){ + + RAtomicDouble atomicDouble = redisson.getAtomicDouble(key); + atomicDouble.set(123.11); + atomicDouble.addAndGet(4.25); + + double value = atomicDouble.get(); + + return value; + } + + /** + * 异步批量执行 + * @param key + * @return + */ + @RequestMapping("/batch") + public String batch(){ + + RBatch batch = redisson.createBatch(BatchOptions.defaults()); + //RTransaction RTransaction = redisson.createTransaction(TransactionOptions.defaults()) + batch.getMap("test").fastPutAsync("1", "2"); + batch.getMap("test").fastPutAsync("2", "3"); + batch.getMap("test").putAsync("2", "新的值"); + + // 将写入操作同步到从节点 + // 同步到2个从节点,等待时间为1秒钟 + //batch.syncSlaves(2, 1, TimeUnit.SECONDS); + + BatchResult res = batch.execute(); + + return res.getResponses().toString(); + } + + + + /** + * 计分排序集(ScoredSortedSet) + * @return + */ + @RequestMapping("/scoredSortedSet") + public String ScoredSortedSet(){ + + RScoredSortedSet set = redisson.getScoredSortedSet("scoredSortedSet"); + set.clear(); + + set.add(3.13, new User("Tom","Tom name")); + set.addAsync(0.123, new User("Dog","Dog name")); + + User user = new User("Cat","Cat name"); + set.add(4.67, user); + set.addScore(user, 0.1); //加分 + + int index = set.rank(user); // 获取元素在集合中的位置 + + Double score = set.getScore(user); // 获取元素的评分 + + return "位置:"+index +",分数:"+score; + } + + + /** + * 有界阻塞队列(Bounded Blocking Queue) + * @return + */ + @RequestMapping("/boundedBlockingQueue") + public String BoundedBlockingQueue(){ + + RBoundedBlockingQueue queue = redisson.getBoundedBlockingQueue("anyQueue"); + queue.clear(); + // 如果初始容量(边界)设定成功则返回`真(true)`, + // 如果初始容量(边界)已近存在则返回`假(false)`。 + queue.trySetCapacity(2); + + queue.offer(new User("Tom","Tom name")); + queue.offer(new User("Cat","Cat name")); + //此时容量已满,add方法会直接阻塞 + //queue.add(new User("Cat2","Cat2 name")); + // 此时容量已满,下面代码将会被阻塞,直到有空闲为止。 + try { + queue.put(new User("Dog","Dog name")); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + User obj = queue.peek();//获取队列第一个元素,但并不从队列中删除 + User obj2 = null; + try { + obj2 = queue.poll(3, TimeUnit.SECONDS);//获取队列第一个元素,并删除 + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + User obj3 = queue.poll(); + return obj.getLogin() +","+ obj2.getLogin()+","+ obj3.getLogin(); + } + + + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/controller/Solr/SolrController.java b/src/main/java/xy/spring2nosql/controller/Solr/SolrController.java similarity index 86% rename from src/main/java/xy/SpringBoot2NoSQL/controller/Solr/SolrController.java rename to src/main/java/xy/spring2nosql/controller/Solr/SolrController.java index 5366aae..a285508 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/controller/Solr/SolrController.java +++ b/src/main/java/xy/spring2nosql/controller/Solr/SolrController.java @@ -1,51 +1,51 @@ -package xy.SpringBoot2NoSQL.controller.Solr; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - -import xy.SpringBoot2NoSQL.model.Solr.Customer; -import xy.SpringBoot2NoSQL.repository.Solr.SolrCustomerRepository; - -@RestController -@RequestMapping("/solr") -public class SolrController { - - @Autowired - SolrCustomerRepository customerRepository; - - @RequestMapping("/add") - public String add(){ - - customerRepository.deleteAll(); - customerRepository.saveAll(Arrays.asList(new Customer("1", "Jack", 20), - new Customer("2", "Adam", 24), - new Customer("3", "Kim", 27), - new Customer("4", "David", 30), - new Customer("5", "Peter", 21))); - - return "ok"; - } - - @RequestMapping("/all") - public Iterable getAll(){ - - return customerRepository.findAll(); - } - - @RequestMapping("/getByID/{id}") - public Optional getByID(@PathVariable("id") String id){ - - return customerRepository.findById(id); - } - - @RequestMapping("/findByNameEndsWith/{name}") - public List findByNameEndsWith(@PathVariable("name") String name){ - - return customerRepository.findByNameEndsWith(name); - } -} +package xy.spring2nosql.controller.Solr; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import xy.spring2nosql.model.Solr.Customer; +import xy.spring2nosql.repository.Solr.SolrCustomerRepository; + +@RestController +@RequestMapping("/solr") +public class SolrController { + + @Autowired + SolrCustomerRepository customerRepository; + + @RequestMapping("/add") + public String add(){ + + customerRepository.deleteAll(); + customerRepository.saveAll(Arrays.asList(new Customer("1", "Jack", 20), + new Customer("2", "Adam", 24), + new Customer("3", "Kim", 27), + new Customer("4", "David", 30), + new Customer("5", "Peter", 21))); + + return "ok"; + } + + @RequestMapping("/all") + public Iterable getAll(){ + + return customerRepository.findAll(); + } + + @RequestMapping("/getByID/{id}") + public Optional getByID(@PathVariable("id") String id){ + + return customerRepository.findById(id); + } + + @RequestMapping("/findByNameEndsWith/{name}") + public List findByNameEndsWith(@PathVariable("name") String name){ + + return customerRepository.findByNameEndsWith(name); + } +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/exception/CreateIndexFailedException.java b/src/main/java/xy/spring2nosql/exception/CreateIndexFailedException.java similarity index 84% rename from src/main/java/xy/SpringBoot2NoSQL/exception/CreateIndexFailedException.java rename to src/main/java/xy/spring2nosql/exception/CreateIndexFailedException.java index 8bc5539..52623e5 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/exception/CreateIndexFailedException.java +++ b/src/main/java/xy/spring2nosql/exception/CreateIndexFailedException.java @@ -1,7 +1,7 @@ -package xy.SpringBoot2NoSQL.exception; - -public class CreateIndexFailedException extends RuntimeException { - public CreateIndexFailedException(String indexName, Throwable cause) { - super(String.format("Creating Index '%s' failed", indexName), cause); - } -} +package xy.spring2nosql.exception; + +public class CreateIndexFailedException extends RuntimeException { + public CreateIndexFailedException(String indexName, Throwable cause) { + super(String.format("Creating Index '%s' failed", indexName), cause); + } +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/exception/GetMappingFailedException.java b/src/main/java/xy/spring2nosql/exception/GetMappingFailedException.java similarity index 84% rename from src/main/java/xy/SpringBoot2NoSQL/exception/GetMappingFailedException.java rename to src/main/java/xy/spring2nosql/exception/GetMappingFailedException.java index 1bcfa8d..af8ac81 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/exception/GetMappingFailedException.java +++ b/src/main/java/xy/spring2nosql/exception/GetMappingFailedException.java @@ -1,7 +1,7 @@ -package xy.SpringBoot2NoSQL.exception; - -public class GetMappingFailedException extends RuntimeException { - public GetMappingFailedException(String indexName, Throwable cause) { - super(String.format("Create Mapping failed for Index '%s'", indexName), cause); - } -} +package xy.spring2nosql.exception; + +public class GetMappingFailedException extends RuntimeException { + public GetMappingFailedException(String indexName, Throwable cause) { + super(String.format("Create Mapping failed for Index '%s'", indexName), cause); + } +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/exception/IndicesExistsFailedException.java b/src/main/java/xy/spring2nosql/exception/IndicesExistsFailedException.java similarity index 84% rename from src/main/java/xy/SpringBoot2NoSQL/exception/IndicesExistsFailedException.java rename to src/main/java/xy/spring2nosql/exception/IndicesExistsFailedException.java index f31c8dd..4fefa69 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/exception/IndicesExistsFailedException.java +++ b/src/main/java/xy/spring2nosql/exception/IndicesExistsFailedException.java @@ -1,7 +1,7 @@ -package xy.SpringBoot2NoSQL.exception; - -public class IndicesExistsFailedException extends RuntimeException { - public IndicesExistsFailedException(String indexName, Throwable cause) { - super(String.format("Indices '%s' failed", indexName), cause); - } +package xy.spring2nosql.exception; + +public class IndicesExistsFailedException extends RuntimeException { + public IndicesExistsFailedException(String indexName, Throwable cause) { + super(String.format("Indices '%s' failed", indexName), cause); + } } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/exception/PutMappingFailedException.java b/src/main/java/xy/spring2nosql/exception/PutMappingFailedException.java similarity index 84% rename from src/main/java/xy/SpringBoot2NoSQL/exception/PutMappingFailedException.java rename to src/main/java/xy/spring2nosql/exception/PutMappingFailedException.java index 85c3b65..5920a9d 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/exception/PutMappingFailedException.java +++ b/src/main/java/xy/spring2nosql/exception/PutMappingFailedException.java @@ -1,7 +1,7 @@ -package xy.SpringBoot2NoSQL.exception; - -public class PutMappingFailedException extends RuntimeException { - public PutMappingFailedException(String indexName, Throwable cause) { - super(String.format("Put Mapping failed for Index '%s'", indexName), cause); - } -} +package xy.spring2nosql.exception; + +public class PutMappingFailedException extends RuntimeException { + public PutMappingFailedException(String indexName, Throwable cause) { + super(String.format("Put Mapping failed for Index '%s'", indexName), cause); + } +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/Cassandra/Customer.java b/src/main/java/xy/spring2nosql/model/Cassandra/Customer.java similarity index 92% rename from src/main/java/xy/SpringBoot2NoSQL/model/Cassandra/Customer.java rename to src/main/java/xy/spring2nosql/model/Cassandra/Customer.java index 1c78fd8..757e15d 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/Cassandra/Customer.java +++ b/src/main/java/xy/spring2nosql/model/Cassandra/Customer.java @@ -1,76 +1,76 @@ -package xy.SpringBoot2NoSQL.model.Cassandra; - -import java.util.HashSet; -import java.util.Set; - -import org.springframework.data.cassandra.core.mapping.Column; -import org.springframework.data.cassandra.core.mapping.PrimaryKey; -import org.springframework.data.cassandra.core.mapping.Table; - -@Table -public class Customer { - - @PrimaryKey - private String id; - private String firstname; - private String lastname; - private int age; - -// @Column -// private Set tags = new HashSet<>(); - - public Customer(){} - - public Customer(String id, String firstname, String lastname, int age){ - this.id = id; - this.firstname = firstname; - this.lastname = lastname; - this.age = age; - } - - public void setId(String id){ - this.id = id; - } - - public String getId(){ - return this.id; - } - - public void setFirstname(String firstname){ - this.firstname = firstname; - } - - public String getFirstname(){ - return this.firstname; - } - - public void setLastname(String lastname){ - this.lastname = lastname; - } - - public String getLastname(){ - return this.lastname; - } - - public void setAge(int age){ - this.age = age; - } - - public int getAge(){ - return this.age; - } - -// public Set getTags() { -// return tags; -// } -// -// public void setTags(final Set tags) { -// this.tags = tags; -// } - - @Override - public String toString() { - return String.format("Customer[id=%d, firstName='%s', lastName='%s', age=%d]", this.id, - this.firstname, this.lastname, this.age); - } -} +package xy.spring2nosql.model.Cassandra; + +import java.util.HashSet; +import java.util.Set; + +import org.springframework.data.cassandra.core.mapping.Column; +import org.springframework.data.cassandra.core.mapping.PrimaryKey; +import org.springframework.data.cassandra.core.mapping.Table; + +@Table +public class Customer { + + @PrimaryKey + private String id; + private String firstname; + private String lastname; + private int age; + +// @Column +// private Set tags = new HashSet<>(); + + public Customer(){} + + public Customer(String id, String firstname, String lastname, int age){ + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + this.age = age; + } + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return this.id; + } + + public void setFirstname(String firstname){ + this.firstname = firstname; + } + + public String getFirstname(){ + return this.firstname; + } + + public void setLastname(String lastname){ + this.lastname = lastname; + } + + public String getLastname(){ + return this.lastname; + } + + public void setAge(int age){ + this.age = age; + } + + public int getAge(){ + return this.age; + } + +// public Set getTags() { +// return tags; +// } +// +// public void setTags(final Set tags) { +// this.tags = tags; +// } + + @Override + public String toString() { + return String.format("Customer[id=%d, firstName='%s', lastName='%s', age=%d]", this.id, + this.firstname, this.lastname, this.age); + } +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/Couchbase/Customer.java b/src/main/java/xy/spring2nosql/model/Couchbase/Customer.java similarity index 91% rename from src/main/java/xy/SpringBoot2NoSQL/model/Couchbase/Customer.java rename to src/main/java/xy/spring2nosql/model/Couchbase/Customer.java index 71bff3e..2bc02e6 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/Couchbase/Customer.java +++ b/src/main/java/xy/spring2nosql/model/Couchbase/Customer.java @@ -1,55 +1,55 @@ -//package xy.SpringBoot2NoSQL.model.Couchbase; -// -//import org.springframework.data.couchbase.core.mapping.Document; -// -//import com.couchbase.client.java.repository.annotation.Field; -//import com.couchbase.client.java.repository.annotation.Id; -// -// -//@Document -//public class Customer { -// @Id -// private String id; -// -// @Field -// private String firstName; -// -// @Field -// private String lastName; -// -// public Customer(String id, String firstName, String lastName){ -// this.id = id; -// this.firstName = firstName; -// this.lastName = lastName; -// } -// -// public String getId() { -// return this.id; -// } -// -// public void setId(String id) { -// this.id = id; -// } -// -// public String getFirstName() { -// return this.firstName; -// } -// -// public void setFirstName(String firstName) { -// this.firstName = firstName; -// } -// -// public String getLastName() { -// return this.lastName; -// } -// -// public void setLastName(String lastName) { -// this.lastName = lastName; -// } -// -// @Override -// public String toString() { -// return String.format("Customer[ id=%s, firstName=%s, lastName=%s]", this.id, this.firstName, this.lastName); -// } -//} -// +//package xy.spring2nosql.model.Couchbase; +// +//import org.springframework.data.couchbase.core.mapping.Document; +// +//import com.couchbase.client.java.repository.annotation.Field; +//import com.couchbase.client.java.repository.annotation.Id; +// +// +//@Document +//public class Customer { +// @Id +// private String id; +// +// @Field +// private String firstName; +// +// @Field +// private String lastName; +// +// public Customer(String id, String firstName, String lastName){ +// this.id = id; +// this.firstName = firstName; +// this.lastName = lastName; +// } +// +// public String getId() { +// return this.id; +// } +// +// public void setId(String id) { +// this.id = id; +// } +// +// public String getFirstName() { +// return this.firstName; +// } +// +// public void setFirstName(String firstName) { +// this.firstName = firstName; +// } +// +// public String getLastName() { +// return this.lastName; +// } +// +// public void setLastName(String lastName) { +// this.lastName = lastName; +// } +// +// @Override +// public String toString() { +// return String.format("Customer[ id=%s, firstName=%s, lastName=%s]", this.id, this.firstName, this.lastName); +// } +//} +// diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/ElasticSearch/Product.java b/src/main/java/xy/spring2nosql/model/ElasticSearch/Product.java similarity index 92% rename from src/main/java/xy/SpringBoot2NoSQL/model/ElasticSearch/Product.java rename to src/main/java/xy/spring2nosql/model/ElasticSearch/Product.java index b4b60a0..7bb057f 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/ElasticSearch/Product.java +++ b/src/main/java/xy/spring2nosql/model/ElasticSearch/Product.java @@ -1,57 +1,57 @@ -package xy.SpringBoot2NoSQL.model.ElasticSearch; - -import org.springframework.data.annotation.Id; -import org.springframework.data.elasticsearch.annotations.Document; - -@Document(indexName = "book",type = "book" , shards = 1, replicas = 0, refreshInterval = "-1") -public class Product { - @Id - private String id; - private String name; - private String description; - private boolean enabled; - - public Product() { - } - - public Product(String id, String name, String description, boolean enabled) { - this(); - this.id = id; - this.name = name; - this.description = description; - this.enabled = enabled; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - -} +package xy.spring2nosql.model.ElasticSearch; + +import org.springframework.data.annotation.Id; +import org.springframework.data.elasticsearch.annotations.Document; + +@Document(indexName = "book",type = "book" , shards = 1, replicas = 0, refreshInterval = "-1") +public class Product { + @Id + private String id; + private String name; + private String description; + private boolean enabled; + + public Product() { + } + + public Product(String id, String name, String description, boolean enabled) { + this(); + this.id = id; + this.name = name; + this.description = description; + this.enabled = enabled; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Department.java b/src/main/java/xy/spring2nosql/model/Mongo/Department.java similarity index 87% rename from src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Department.java rename to src/main/java/xy/spring2nosql/model/Mongo/Department.java index 629f9df..399ec41 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Department.java +++ b/src/main/java/xy/spring2nosql/model/Mongo/Department.java @@ -1,35 +1,35 @@ -package xy.SpringBoot2NoSQL.model.Mongo; - -import org.springframework.data.annotation.Id; -import org.springframework.data.mongodb.core.mapping.Document; - -@Document -public class Department { - - @Id - private String id; - - - private String name; - - public Department(String id, String name) { - super(); - this.id = id; - this.name = name; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - -} +package xy.spring2nosql.model.Mongo; + +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; + +@Document +public class Department { + + @Id + private String id; + + + private String name; + + public Department(String id, String name) { + super(); + this.id = id; + this.name = name; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Location.java b/src/main/java/xy/spring2nosql/model/Mongo/Location.java similarity index 84% rename from src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Location.java rename to src/main/java/xy/spring2nosql/model/Mongo/Location.java index b3788de..260825c 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Location.java +++ b/src/main/java/xy/spring2nosql/model/Mongo/Location.java @@ -1,38 +1,38 @@ -package xy.SpringBoot2NoSQL.model.Mongo; - -public class Location { - - private String place; - - private String year; - - - - public Location(String place, String year) { - super(); - this.place = place; - this.year = year; - } - - public String getPlace() { - return place; - } - - public void setPlace(String place) { - this.place = place; - } - - public String getYear() { - return year; - } - - public void setYear(String year) { - this.year = year; - } - - - - - - +package xy.spring2nosql.model.Mongo; + +public class Location { + + private String place; + + private String year; + + + + public Location(String place, String year) { + super(); + this.place = place; + this.year = year; + } + + public String getPlace() { + return place; + } + + public void setPlace(String place) { + this.place = place; + } + + public String getYear() { + return year; + } + + public void setYear(String year) { + this.year = year; + } + + + + + + } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Person.java b/src/main/java/xy/spring2nosql/model/Mongo/Person.java similarity index 92% rename from src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Person.java rename to src/main/java/xy/spring2nosql/model/Mongo/Person.java index f1d0b79..44b7c43 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/Mongo/Person.java +++ b/src/main/java/xy/spring2nosql/model/Mongo/Person.java @@ -1,69 +1,69 @@ -package xy.SpringBoot2NoSQL.model.Mongo; - -import org.springframework.data.annotation.Id; -import org.springframework.data.mongodb.core.mapping.Document; -import org.springframework.data.mongodb.core.mapping.Field; -import org.springframework.data.mongodb.core.mapping.DBRef; - -import java.util.Collection; -import java.util.LinkedHashSet; - -@Document -public class Person { - @Id - private String id; - private String name; - private Integer age; - @Field("locs") - private Collection locations = new LinkedHashSet(); - @DBRef - Department department; - - - public Person(String name, Integer age) { - super(); - this.name = name; - this.age = age; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Integer getAge() { - return age; - } - - public void setAge(Integer age) { - this.age = age; - } - - public Collection getLocations() { - return locations; - } - - public void setLocations(Collection locations) { - this.locations = locations; - } - - public Department getDepartment() { - return department; - } - - public void setDepartment(Department department) { - this.department = department; - } - +package xy.spring2nosql.model.Mongo; + +import org.springframework.data.annotation.Id; +import org.springframework.data.mongodb.core.mapping.Document; +import org.springframework.data.mongodb.core.mapping.Field; +import org.springframework.data.mongodb.core.mapping.DBRef; + +import java.util.Collection; +import java.util.LinkedHashSet; + +@Document +public class Person { + @Id + private String id; + private String name; + private Integer age; + @Field("locs") + private Collection locations = new LinkedHashSet(); + @DBRef + Department department; + + + public Person(String name, Integer age) { + super(); + this.name = name; + this.age = age; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public Collection getLocations() { + return locations; + } + + public void setLocations(Collection locations) { + this.locations = locations; + } + + public Department getDepartment() { + return department; + } + + public void setDepartment(Department department) { + this.department = department; + } + } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/Redis/User.java b/src/main/java/xy/spring2nosql/model/Redis/User.java similarity index 90% rename from src/main/java/xy/SpringBoot2NoSQL/model/Redis/User.java rename to src/main/java/xy/spring2nosql/model/Redis/User.java index 2647b91..aaffd1a 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/Redis/User.java +++ b/src/main/java/xy/spring2nosql/model/Redis/User.java @@ -1,49 +1,49 @@ -package xy.SpringBoot2NoSQL.model.Redis; - -import java.io.Serializable; -import java.util.Date; - -public class User implements Serializable{ - - private static final long serialVersionUID = 1945136152785232109L; - - private String login; - - private String fullName; - - private Date lastLogin; - - public User() {} - - public User(String login, String fullName) { - this.login = login; - this.fullName = fullName; - this.lastLogin = new Date(); - } - - public String getLogin() { - return login; - } - - public void setLogin(String login) { - this.login = login; - } - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public Date getLastLogin() { - return lastLogin; - } - - public void setLastLogin(Date lastLogin) { - this.lastLogin = lastLogin; - } - -} - +package xy.spring2nosql.model.Redis; + +import java.io.Serializable; +import java.util.Date; + +public class User implements Serializable{ + + private static final long serialVersionUID = 1945136152785232109L; + + private String login; + + private String fullName; + + private Date lastLogin; + + public User() {} + + public User(String login, String fullName) { + this.login = login; + this.fullName = fullName; + this.lastLogin = new Date(); + } + + public String getLogin() { + return login; + } + + public void setLogin(String login) { + this.login = login; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public Date getLastLogin() { + return lastLogin; + } + + public void setLastLogin(Date lastLogin) { + this.lastLogin = lastLogin; + } + +} + diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/Solr/Customer.java b/src/main/java/xy/spring2nosql/model/Solr/Customer.java similarity index 90% rename from src/main/java/xy/SpringBoot2NoSQL/model/Solr/Customer.java rename to src/main/java/xy/spring2nosql/model/Solr/Customer.java index 04ac131..db18592 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/Solr/Customer.java +++ b/src/main/java/xy/spring2nosql/model/Solr/Customer.java @@ -1,57 +1,57 @@ -package xy.SpringBoot2NoSQL.model.Solr; - -import org.apache.solr.client.solrj.beans.Field; -import org.springframework.data.annotation.Id; -import org.springframework.data.solr.core.mapping.SolrDocument; - -@SolrDocument(collection = "customer") -public class Customer { - @Id - @Field - private String id; - - @Field - private String name; - - @Field - private Integer age; - - public Customer() { - } - - public Customer(String id, String name, Integer age){ - this.id = id; - this.name = name; - this.age = age; - } - - public void setId(String id){ - this.id = id; - } - - public String getId(){ - return this.id; - } - - public void setName(String name){ - this.name = name; - } - - public String getName(){ - return this.name; - } - - public void setAge(Integer age){ - this.age = age; - } - - public Integer getAge(){ - return this.age; - } - - @Override - public String toString() { - return "Customer [id=" + this.id + ", name=" + this.name + ", age=" + this.age + "]"; - } -} - +package xy.spring2nosql.model.Solr; + +import org.apache.solr.client.solrj.beans.Field; +import org.springframework.data.annotation.Id; +import org.springframework.data.solr.core.mapping.SolrDocument; + +@SolrDocument(collection = "customer") +public class Customer { + @Id + @Field + private String id; + + @Field + private String name; + + @Field + private Integer age; + + public Customer() { + } + + public Customer(String id, String name, Integer age){ + this.id = id; + this.name = name; + this.age = age; + } + + public void setId(String id){ + this.id = id; + } + + public String getId(){ + return this.id; + } + + public void setName(String name){ + this.name = name; + } + + public String getName(){ + return this.name; + } + + public void setAge(Integer age){ + this.age = age; + } + + public Integer getAge(){ + return this.age; + } + + @Override + public String toString() { + return "Customer [id=" + this.id + ", name=" + this.name + ", age=" + this.age + "]"; + } +} + diff --git a/src/main/java/xy/SpringBoot2NoSQL/model/User.java b/src/main/java/xy/spring2nosql/model/User.java similarity index 91% rename from src/main/java/xy/SpringBoot2NoSQL/model/User.java rename to src/main/java/xy/spring2nosql/model/User.java index e81ae3b..9e99e00 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/model/User.java +++ b/src/main/java/xy/spring2nosql/model/User.java @@ -1,54 +1,54 @@ -package xy.SpringBoot2NoSQL.model; - -import java.io.Serializable; -import java.util.Date; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -public class User implements Serializable{ - - private static final long serialVersionUID = -510562806568452731L; - - Logger logger = LogManager.getLogger(getClass()); - - private String login; - - private String fullName; - - private Date lastLogin; - - public User() {} - - public User(String login, String fullName) { - this.login = login; - this.fullName = fullName; - this.lastLogin = new Date(); - } - - public String getLogin() { - return login; - } - - public void setLogin(String login) { - this.login = login; - } - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public Date getLastLogin() { - return lastLogin; - } - - public void setLastLogin(Date lastLogin) { - this.lastLogin = lastLogin; - } - -} - +package xy.spring2nosql.model; + +import java.io.Serializable; +import java.util.Date; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class User implements Serializable{ + + private static final long serialVersionUID = -510562806568452731L; + + Logger logger = LogManager.getLogger(getClass()); + + private String login; + + private String fullName; + + private Date lastLogin; + + public User() {} + + public User(String login, String fullName) { + this.login = login; + this.fullName = fullName; + this.lastLogin = new Date(); + } + + public String getLogin() { + return login; + } + + public void setLogin(String login) { + this.login = login; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public Date getLastLogin() { + return lastLogin; + } + + public void setLastLogin(Date lastLogin) { + this.lastLogin = lastLogin; + } + +} + diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/Cassandra/CustomerRepository.java b/src/main/java/xy/spring2nosql/repository/Cassandra/CustomerRepository.java similarity index 85% rename from src/main/java/xy/SpringBoot2NoSQL/repository/Cassandra/CustomerRepository.java rename to src/main/java/xy/spring2nosql/repository/Cassandra/CustomerRepository.java index 258d394..94cb93d 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/Cassandra/CustomerRepository.java +++ b/src/main/java/xy/spring2nosql/repository/Cassandra/CustomerRepository.java @@ -1,25 +1,25 @@ -package xy.SpringBoot2NoSQL.repository.Cassandra; - -import java.util.List; - -import org.springframework.data.cassandra.repository.AllowFiltering; -import org.springframework.data.cassandra.repository.CassandraRepository; -import org.springframework.data.cassandra.repository.Query; - - -import xy.SpringBoot2NoSQL.model.Cassandra.Customer; - -public interface CustomerRepository extends CassandraRepository { - - @Query(value="SELECT * FROM customer WHERE firstname=?0") - public List findByFirstname(String firstname); - - @Query("SELECT * FROM customer WHERE age > ?0") - public List findCustomerHasAgeGreaterThan(int age); - - @AllowFiltering - public List findByLastname(String lastname); - - @AllowFiltering - public List findByAgeGreaterThan(int age); +package xy.spring2nosql.repository.Cassandra; + +import java.util.List; + +import org.springframework.data.cassandra.repository.AllowFiltering; +import org.springframework.data.cassandra.repository.CassandraRepository; +import org.springframework.data.cassandra.repository.Query; + + +import xy.spring2nosql.model.Cassandra.Customer; + +public interface CustomerRepository extends CassandraRepository { + + @Query(value="SELECT * FROM customer WHERE firstname=?0") + public List findByFirstname(String firstname); + + @Query("SELECT * FROM customer WHERE age > ?0") + public List findCustomerHasAgeGreaterThan(int age); + + @AllowFiltering + public List findByLastname(String lastname); + + @AllowFiltering + public List findByAgeGreaterThan(int age); } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/Couchbase/CouchbaseCustomerRepository.java b/src/main/java/xy/spring2nosql/repository/Couchbase/CouchbaseCustomerRepository.java similarity index 80% rename from src/main/java/xy/SpringBoot2NoSQL/repository/Couchbase/CouchbaseCustomerRepository.java rename to src/main/java/xy/spring2nosql/repository/Couchbase/CouchbaseCustomerRepository.java index de1f756..2f43a46 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/Couchbase/CouchbaseCustomerRepository.java +++ b/src/main/java/xy/spring2nosql/repository/Couchbase/CouchbaseCustomerRepository.java @@ -1,17 +1,17 @@ -//package xy.SpringBoot2NoSQL.repository.Couchbase; -// -//import java.util.List; -// -//import org.springframework.data.couchbase.core.query.N1qlPrimaryIndexed; -//import org.springframework.data.couchbase.core.query.ViewIndexed; -//import org.springframework.data.couchbase.repository.CouchbaseRepository; -// -//import xy.SpringBoot2NoSQL.model.Couchbase.Customer; -// -// -//@N1qlPrimaryIndexed -//@ViewIndexed(designDoc = "customer", viewName = "all") -//public interface CouchbaseCustomerRepository extends CouchbaseRepository { -// -// List findByLastName(String name); -//} +//package xy.spring2nosql.repository.Couchbase; +// +//import java.util.List; +// +//import org.springframework.data.couchbase.core.query.N1qlPrimaryIndexed; +//import org.springframework.data.couchbase.core.query.ViewIndexed; +//import org.springframework.data.couchbase.repository.CouchbaseRepository; +// +//import xy.spring2nosql.model.Couchbase.Customer; +// +// +//@N1qlPrimaryIndexed +//@ViewIndexed(designDoc = "customer", viewName = "all") +//public interface CouchbaseCustomerRepository extends CouchbaseRepository { +// +// List findByLastName(String name); +//} diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/ElasticSearch/SampleProductRepository.java b/src/main/java/xy/spring2nosql/repository/ElasticSearch/SampleProductRepository.java similarity index 80% rename from src/main/java/xy/SpringBoot2NoSQL/repository/ElasticSearch/SampleProductRepository.java rename to src/main/java/xy/spring2nosql/repository/ElasticSearch/SampleProductRepository.java index 681bcc7..96d9629 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/ElasticSearch/SampleProductRepository.java +++ b/src/main/java/xy/spring2nosql/repository/ElasticSearch/SampleProductRepository.java @@ -1,15 +1,15 @@ -package xy.SpringBoot2NoSQL.repository.ElasticSearch; - -import org.springframework.data.domain.Pageable; -import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; - -import xy.SpringBoot2NoSQL.model.ElasticSearch.Product; - -import java.util.List; - -public interface SampleProductRepository extends ElasticsearchRepository { - List findByName(String name); - List findByDescription(String description); - List findByName(String name, Pageable pageable); - List findByNameAndId(String name, String id); -} +package xy.spring2nosql.repository.ElasticSearch; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; + +import xy.spring2nosql.model.ElasticSearch.Product; + +import java.util.List; + +public interface SampleProductRepository extends ElasticsearchRepository { + List findByName(String name); + List findByDescription(String description); + List findByName(String name, Pageable pageable); + List findByNameAndId(String name, String id); +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/Mongo/DepartmentRepository.java b/src/main/java/xy/spring2nosql/repository/Mongo/DepartmentRepository.java similarity index 66% rename from src/main/java/xy/SpringBoot2NoSQL/repository/Mongo/DepartmentRepository.java rename to src/main/java/xy/spring2nosql/repository/Mongo/DepartmentRepository.java index 563d2a1..b5fabaa 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/Mongo/DepartmentRepository.java +++ b/src/main/java/xy/spring2nosql/repository/Mongo/DepartmentRepository.java @@ -1,13 +1,13 @@ -package xy.SpringBoot2NoSQL.repository.Mongo; - -import org.springframework.data.mongodb.repository.MongoRepository; - -import xy.SpringBoot2NoSQL.model.Mongo.Department; - - -public interface DepartmentRepository extends MongoRepository { - - Department findByName(String name); - -} - +package xy.spring2nosql.repository.Mongo; + +import org.springframework.data.mongodb.repository.MongoRepository; + +import xy.spring2nosql.model.Mongo.Department; + + +public interface DepartmentRepository extends MongoRepository { + + Department findByName(String name); + +} + diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/Mongo/PersonRepository.java b/src/main/java/xy/spring2nosql/repository/Mongo/PersonRepository.java similarity index 82% rename from src/main/java/xy/SpringBoot2NoSQL/repository/Mongo/PersonRepository.java rename to src/main/java/xy/spring2nosql/repository/Mongo/PersonRepository.java index 6ff6944..0045cc1 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/Mongo/PersonRepository.java +++ b/src/main/java/xy/spring2nosql/repository/Mongo/PersonRepository.java @@ -1,20 +1,20 @@ -package xy.SpringBoot2NoSQL.repository.Mongo; - - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.mongodb.repository.MongoRepository; -import org.springframework.data.mongodb.repository.Query; -import xy.SpringBoot2NoSQL.model.Mongo.Person; -import java.util.List; - -public interface PersonRepository extends MongoRepository { - - Person findByName(String name); - - @Query("{'age': { '$lt' : ?0}}") - List withQueryFindByAge(Integer age); - - Page findAll(Pageable pageable); - -} +package xy.spring2nosql.repository.Mongo; + + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; +import xy.spring2nosql.model.Mongo.Person; +import java.util.List; + +public interface PersonRepository extends MongoRepository { + + Person findByName(String name); + + @Query("{'age': { '$lt' : ?0}}") + List withQueryFindByAge(Integer age); + + Page findAll(Pageable pageable); + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/Redis/ObjectRepository.java b/src/main/java/xy/spring2nosql/repository/Redis/ObjectRepository.java similarity index 84% rename from src/main/java/xy/SpringBoot2NoSQL/repository/Redis/ObjectRepository.java rename to src/main/java/xy/spring2nosql/repository/Redis/ObjectRepository.java index 34a5be0..ca819b1 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/Redis/ObjectRepository.java +++ b/src/main/java/xy/spring2nosql/repository/Redis/ObjectRepository.java @@ -1,27 +1,27 @@ -package xy.SpringBoot2NoSQL.repository.Redis; - -import javax.annotation.Resource; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.stereotype.Repository; - -import xy.SpringBoot2NoSQL.model.Redis.User; - -@Repository -public class ObjectRepository { - @Autowired - RedisTemplate redisTemplate; - - @Resource(name = "redisTemplate") - ValueOperations valOps; - - public void save(User user) { - valOps.set(user.getLogin(), user); - } - - public User get(String id) { - return (User) valOps.get(id); - } -} +package xy.spring2nosql.repository.Redis; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Repository; + +import xy.spring2nosql.model.Redis.User; + +@Repository +public class ObjectRepository { + @Autowired + RedisTemplate redisTemplate; + + @Resource(name = "redisTemplate") + ValueOperations valOps; + + public void save(User user) { + valOps.set(user.getLogin(), user); + } + + public User get(String id) { + return (User) valOps.get(id); + } +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/Redis/StringStringRepository.java b/src/main/java/xy/spring2nosql/repository/Redis/StringStringRepository.java similarity index 89% rename from src/main/java/xy/SpringBoot2NoSQL/repository/Redis/StringStringRepository.java rename to src/main/java/xy/spring2nosql/repository/Redis/StringStringRepository.java index a454afe..e8213df 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/Redis/StringStringRepository.java +++ b/src/main/java/xy/spring2nosql/repository/Redis/StringStringRepository.java @@ -1,25 +1,25 @@ -package xy.SpringBoot2NoSQL.repository.Redis; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.stereotype.Repository; - -@Repository -public class StringStringRepository { - - @Autowired - private RedisTemplate template; - - public void add(String key, String value) { - template.opsForValue().set(key, value); - } - - public String getValue(String key) { - return template.opsForValue().get(key); - } - - public void delete(String key) { - template.opsForValue().getOperations().delete(key); - } - +package xy.spring2nosql.repository.Redis; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Repository; + +@Repository +public class StringStringRepository { + + @Autowired + private RedisTemplate template; + + public void add(String key, String value) { + template.opsForValue().set(key, value); + } + + public String getValue(String key) { + return template.opsForValue().get(key); + } + + public void delete(String key) { + template.opsForValue().getOperations().delete(key); + } + } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/Redis/UserRepository.java b/src/main/java/xy/spring2nosql/repository/Redis/UserRepository.java similarity index 84% rename from src/main/java/xy/SpringBoot2NoSQL/repository/Redis/UserRepository.java rename to src/main/java/xy/spring2nosql/repository/Redis/UserRepository.java index ccd6fab..5cc4426 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/Redis/UserRepository.java +++ b/src/main/java/xy/spring2nosql/repository/Redis/UserRepository.java @@ -1,30 +1,30 @@ -package xy.SpringBoot2NoSQL.repository.Redis; - -import javax.annotation.Resource; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.stereotype.Repository; - -import xy.SpringBoot2NoSQL.model.Redis.User; - -@Repository -public class UserRepository { - -// @Autowired -// RedisTemplate redisTemplate; -// -// @Resource(name = "redisTemplate") -// ValueOperations valOps; -// -// public void save(User user) { -// valOps.set(user.getLogin(), user); -// } -// -// public User get(String id) { -// return valOps.get(id); -// } - - +package xy.spring2nosql.repository.Redis; + +import javax.annotation.Resource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Repository; + +import xy.spring2nosql.model.Redis.User; + +@Repository +public class UserRepository { + +// @Autowired +// RedisTemplate redisTemplate; +// +// @Resource(name = "redisTemplate") +// ValueOperations valOps; +// +// public void save(User user) { +// valOps.set(user.getLogin(), user); +// } +// +// public User get(String id) { +// return valOps.get(id); +// } + + } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/repository/Solr/SolrCustomerRepository.java b/src/main/java/xy/spring2nosql/repository/Solr/SolrCustomerRepository.java similarity index 70% rename from src/main/java/xy/SpringBoot2NoSQL/repository/Solr/SolrCustomerRepository.java rename to src/main/java/xy/spring2nosql/repository/Solr/SolrCustomerRepository.java index 4b78648..b5fab69 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/repository/Solr/SolrCustomerRepository.java +++ b/src/main/java/xy/spring2nosql/repository/Solr/SolrCustomerRepository.java @@ -1,10 +1,10 @@ -package xy.SpringBoot2NoSQL.repository.Solr; - -import java.util.List; -import org.springframework.data.solr.repository.SolrCrudRepository; -import xy.SpringBoot2NoSQL.model.Solr.Customer; - - -public interface SolrCustomerRepository extends SolrCrudRepository { - List findByNameEndsWith(String name); -} +package xy.spring2nosql.repository.Solr; + +import java.util.List; +import org.springframework.data.solr.repository.SolrCrudRepository; +import xy.spring2nosql.model.Solr.Customer; + + +public interface SolrCustomerRepository extends SolrCrudRepository { + List findByNameEndsWith(String name); +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/service/Ehcache/UserService.java b/src/main/java/xy/spring2nosql/service/Ehcache/UserService.java similarity index 92% rename from src/main/java/xy/SpringBoot2NoSQL/service/Ehcache/UserService.java rename to src/main/java/xy/spring2nosql/service/Ehcache/UserService.java index 3ca2c39..fa5db8c 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/service/Ehcache/UserService.java +++ b/src/main/java/xy/spring2nosql/service/Ehcache/UserService.java @@ -1,49 +1,49 @@ -package xy.SpringBoot2NoSQL.service.Ehcache; - -import org.springframework.cache.annotation.CacheConfig; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.stereotype.Service; -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Element; -import xy.SpringBoot2NoSQL.model.User; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -@Service -@CacheConfig(cacheNames="users") -public class UserService { - - Logger logger = LogManager.getLogger(getClass()); - - @CacheEvict(allEntries = true) - public void clearCache(){} - - public User getUser(String login) { - // 获取缓存实例 - Cache userCache = CacheManager.getInstance().getCache("users"); - - if (userCache.get(login)!=null){ - - User user = (User) userCache.get(login).getObjectValue(); - logger.info("从缓存获取user用户: {}", login); - logger.info("从缓存JVM内存中获取获取user用户: {}-{}",login, userCache.isElementInMemory(login)); - logger.info("从缓存OffHeap内存中获取获取user用户: {}-{}",login, userCache.isElementOffHeap(login)); - logger.info("已持久化磁盘,用户: {}-{}",login, userCache.isElementOnDisk(login)); - - return user; - } - else{ - User user = new User(login,login+"的姓名"); - logger.info("新user用户: {}", login); - // 写入缓存,注意我们故意设置maxElementsInMemory内存最大值是5 - Element element = new Element(login, user); - userCache.put(element); - - return user; - } - - } - -} +package xy.spring2nosql.service.Ehcache; + +import org.springframework.cache.annotation.CacheConfig; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.stereotype.Service; +import net.sf.ehcache.Cache; +import net.sf.ehcache.CacheManager; +import net.sf.ehcache.Element; +import xy.spring2nosql.model.User; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +@Service +@CacheConfig(cacheNames="users") +public class UserService { + + Logger logger = LogManager.getLogger(getClass()); + + @CacheEvict(allEntries = true) + public void clearCache(){} + + public User getUser(String login) { + // 获取缓存实例 + Cache userCache = CacheManager.getInstance().getCache("users"); + + if (userCache.get(login)!=null){ + + User user = (User) userCache.get(login).getObjectValue(); + logger.info("从缓存获取user用户: {}", login); + logger.info("从缓存JVM内存中获取获取user用户: {}-{}",login, userCache.isElementInMemory(login)); + logger.info("从缓存OffHeap内存中获取获取user用户: {}-{}",login, userCache.isElementOffHeap(login)); + logger.info("已持久化磁盘,用户: {}-{}",login, userCache.isElementOnDisk(login)); + + return user; + } + else{ + User user = new User(login,login+"的姓名"); + logger.info("新user用户: {}", login); + // 写入缓存,注意我们故意设置maxElementsInMemory内存最大值是5 + Element element = new Element(login, user); + userCache.put(element); + + return user; + } + + } + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/utils/ESSearchUtil.java b/src/main/java/xy/spring2nosql/utils/ESSearchUtil.java similarity index 91% rename from src/main/java/xy/SpringBoot2NoSQL/utils/ESSearchUtil.java rename to src/main/java/xy/spring2nosql/utils/ESSearchUtil.java index 0e70f5b..449e744 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/utils/ESSearchUtil.java +++ b/src/main/java/xy/spring2nosql/utils/ESSearchUtil.java @@ -1,160 +1,160 @@ -package xy.SpringBoot2NoSQL.utils; - -import java.io.IOException; - -import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder; -import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; -import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse; -import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; -import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse; -import org.elasticsearch.client.Client; -import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.index.query.QueryBuilders; - -import xy.SpringBoot2NoSQL.exception.CreateIndexFailedException; -import xy.SpringBoot2NoSQL.exception.IndicesExistsFailedException; -import xy.SpringBoot2NoSQL.exception.PutMappingFailedException; - -public class ESSearchUtil { - - /** - * 索引是否存在 - * @param client - * @param indexName - * @return - */ - public static IndicesExistsResponse indexExist(Client client, String indexName) { - try { - return client.admin().indices().prepareExists(indexName).execute().actionGet(); - } catch (Exception e) { - - throw new IndicesExistsFailedException(indexName, e); - } - } - - /** - * 创建索引 - * @param client - * @param indexName - * @return - */ - public static CreateIndexResponse createIndex(Client client, String indexName) { - try { - return internalCreateIndex(client, indexName); - } catch (Exception e) { - throw new CreateIndexFailedException(indexName, e); - } - } - - public static PutMappingResponse putMapping(Client client, String indexName, IElasticSearchMapping mapping) { - try { - return internalPutMapping(client, indexName, mapping); - } catch (Exception e) { - - throw new PutMappingFailedException(indexName, e); - } - } - - private static CreateIndexResponse internalCreateIndex(Client client, String indexName) throws IOException { - final CreateIndexRequestBuilder createIndexRequestBuilder = client.admin().indices().prepareCreate(indexName); - - final CreateIndexResponse indexResponse = createIndexRequestBuilder.execute().actionGet(); - - return indexResponse; - } - - private static PutMappingResponse internalPutMapping(Client client, String indexName, IElasticSearchMapping mapping) - throws IOException { - - final PutMappingRequest putMappingRequest = new PutMappingRequest(indexName).type(mapping.getIndexType()) - .source(mapping.getMapping().string()); - - final PutMappingResponse putMappingResponse = client.admin().indices().putMapping(putMappingRequest) - .actionGet(); - - return putMappingResponse; - } - - /** - * 部分匹配查询,包括模糊匹配和短语或邻近查询。 - * - * @param key - * @param value - * @return - */ - public static QueryBuilder matchQuery(String key, String value) { - return QueryBuilders.matchQuery(key, value); - } - - /** - * 完全匹配。 - * - * @param key - * @param value - * @return - */ - public static QueryBuilder matchPhraseQuery(String key, String value) { - return QueryBuilders.matchPhraseQuery(key, value); - } - - /** - * 多字段匹配 - * - * @param text - * @param fieldNames - * @return - */ - public static QueryBuilder multiMatchQuery(Object text, String... fieldNames) { - return QueryBuilders.multiMatchQuery(text, fieldNames); - - } - - /** - * 模糊查询 - * - * @param key - * @param value - * @return - */ - public static QueryBuilder fuzzyQuery(String key, String value) { - return QueryBuilders.fuzzyQuery(key, value); - } - - /** - * 全部查询 - * - * @return - */ - public static QueryBuilder matchAllQuery() { - return QueryBuilders.matchAllQuery(); - } - - /** - * 范围查询 - * - * @param key - * @param from - * @param to - * @return - */ - public static QueryBuilder rangeQuery(String key, Object from, Object to) { - return QueryBuilders.rangeQuery(key).from(from).to(to).includeLower(true) // 包括下界 - .includeUpper(false); // 包括上界 - } - - /** - * 完全匹配查询 - * - * @param key - * @param values - * @return - */ - public static QueryBuilder termsQuery(String key, String... values) { - return QueryBuilders.termsQuery(key, values); - } - - public static QueryBuilder termsQuery(String key, Object values) { - return QueryBuilders.termsQuery(key, values); - } - -} +package xy.spring2nosql.utils; + +import java.io.IOException; + +import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder; +import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; +import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse; +import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; +import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse; +import org.elasticsearch.client.Client; +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.index.query.QueryBuilders; + +import xy.spring2nosql.exception.CreateIndexFailedException; +import xy.spring2nosql.exception.IndicesExistsFailedException; +import xy.spring2nosql.exception.PutMappingFailedException; + +public class ESSearchUtil { + + /** + * 索引是否存在 + * @param client + * @param indexName + * @return + */ + public static IndicesExistsResponse indexExist(Client client, String indexName) { + try { + return client.admin().indices().prepareExists(indexName).execute().actionGet(); + } catch (Exception e) { + + throw new IndicesExistsFailedException(indexName, e); + } + } + + /** + * 创建索引 + * @param client + * @param indexName + * @return + */ + public static CreateIndexResponse createIndex(Client client, String indexName) { + try { + return internalCreateIndex(client, indexName); + } catch (Exception e) { + throw new CreateIndexFailedException(indexName, e); + } + } + + public static PutMappingResponse putMapping(Client client, String indexName, IElasticSearchMapping mapping) { + try { + return internalPutMapping(client, indexName, mapping); + } catch (Exception e) { + + throw new PutMappingFailedException(indexName, e); + } + } + + private static CreateIndexResponse internalCreateIndex(Client client, String indexName) throws IOException { + final CreateIndexRequestBuilder createIndexRequestBuilder = client.admin().indices().prepareCreate(indexName); + + final CreateIndexResponse indexResponse = createIndexRequestBuilder.execute().actionGet(); + + return indexResponse; + } + + private static PutMappingResponse internalPutMapping(Client client, String indexName, IElasticSearchMapping mapping) + throws IOException { + + final PutMappingRequest putMappingRequest = new PutMappingRequest(indexName).type(mapping.getIndexType()) + .source(mapping.getMapping().string()); + + final PutMappingResponse putMappingResponse = client.admin().indices().putMapping(putMappingRequest) + .actionGet(); + + return putMappingResponse; + } + + /** + * 部分匹配查询,包括模糊匹配和短语或邻近查询。 + * + * @param key + * @param value + * @return + */ + public static QueryBuilder matchQuery(String key, String value) { + return QueryBuilders.matchQuery(key, value); + } + + /** + * 完全匹配。 + * + * @param key + * @param value + * @return + */ + public static QueryBuilder matchPhraseQuery(String key, String value) { + return QueryBuilders.matchPhraseQuery(key, value); + } + + /** + * 多字段匹配 + * + * @param text + * @param fieldNames + * @return + */ + public static QueryBuilder multiMatchQuery(Object text, String... fieldNames) { + return QueryBuilders.multiMatchQuery(text, fieldNames); + + } + + /** + * 模糊查询 + * + * @param key + * @param value + * @return + */ + public static QueryBuilder fuzzyQuery(String key, String value) { + return QueryBuilders.fuzzyQuery(key, value); + } + + /** + * 全部查询 + * + * @return + */ + public static QueryBuilder matchAllQuery() { + return QueryBuilders.matchAllQuery(); + } + + /** + * 范围查询 + * + * @param key + * @param from + * @param to + * @return + */ + public static QueryBuilder rangeQuery(String key, Object from, Object to) { + return QueryBuilders.rangeQuery(key).from(from).to(to).includeLower(true) // 包括下界 + .includeUpper(false); // 包括上界 + } + + /** + * 完全匹配查询 + * + * @param key + * @param values + * @return + */ + public static QueryBuilder termsQuery(String key, String... values) { + return QueryBuilders.termsQuery(key, values); + } + + public static QueryBuilder termsQuery(String key, Object values) { + return QueryBuilders.termsQuery(key, values); + } + +} diff --git a/src/main/java/xy/SpringBoot2NoSQL/utils/IElasticSearchMapping.java b/src/main/java/xy/spring2nosql/utils/IElasticSearchMapping.java similarity index 83% rename from src/main/java/xy/SpringBoot2NoSQL/utils/IElasticSearchMapping.java rename to src/main/java/xy/spring2nosql/utils/IElasticSearchMapping.java index eb6b04e..2c29507 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/utils/IElasticSearchMapping.java +++ b/src/main/java/xy/spring2nosql/utils/IElasticSearchMapping.java @@ -1,14 +1,14 @@ -package xy.SpringBoot2NoSQL.utils; - -import org.elasticsearch.Version; -import org.elasticsearch.common.xcontent.XContentBuilder; - -public interface IElasticSearchMapping { - - XContentBuilder getMapping(); - - String getIndexType(); - - Version getVersion(); - +package xy.spring2nosql.utils; + +import org.elasticsearch.Version; +import org.elasticsearch.common.xcontent.XContentBuilder; + +public interface IElasticSearchMapping { + + XContentBuilder getMapping(); + + String getIndexType(); + + Version getVersion(); + } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/utils/RandomUtil.java b/src/main/java/xy/spring2nosql/utils/RandomUtil.java similarity index 95% rename from src/main/java/xy/SpringBoot2NoSQL/utils/RandomUtil.java rename to src/main/java/xy/spring2nosql/utils/RandomUtil.java index b88cafb..a788634 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/utils/RandomUtil.java +++ b/src/main/java/xy/spring2nosql/utils/RandomUtil.java @@ -1,120 +1,120 @@ -package xy.SpringBoot2NoSQL.utils; - -import java.util.Random; - -public class RandomUtil { - public static final String ALLCHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - public static final String LETTERCHAR = "abcdefghijkllmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - public static final String NUMBERCHAR = "0123456789"; - - /** - * 返回一个定长的随机字符串(只包含大小写字母、数字) - * - * @param length - * 随机字符串长度 - * @return 随机字符串 - */ - public static String generateString(int length) { - StringBuffer sb = new StringBuffer(); - Random random = new Random(); - for (int i = 0; i < length; i++) { - sb.append(ALLCHAR.charAt(random.nextInt(ALLCHAR.length()))); - } - return sb.toString(); - } - - /** - * 返回一个定长的随机纯字母字符串(只包含大小写字母) - * - * @param length - * 随机字符串长度 - * @return 随机字符串 - */ - public static String generateMixString(int length) { - StringBuffer sb = new StringBuffer(); - Random random = new Random(); - for (int i = 0; i < length; i++) { - sb.append(ALLCHAR.charAt(random.nextInt(LETTERCHAR.length()))); - } - return sb.toString(); - } - - /** - * 返回一个定长的随机纯大写字母字符串(只包含大小写字母) - * - * @param length - * 随机字符串长度 - * @return 随机字符串 - */ - public static String generateLowerString(int length) { - return generateMixString(length).toLowerCase(); - } - - /** - * 返回一个定长的随机纯小写字母字符串(只包含大小写字母) - * - * @param length - * 随机字符串长度 - * @return 随机字符串 - */ - public static String generateUpperString(int length) { - return generateMixString(length).toUpperCase(); - } - - /** - * 生成一个定长的纯0字符串 - * - * @param length - * 字符串长度 - * @return 纯0字符串 - */ - public static String generateZeroString(int length) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < length; i++) { - sb.append('0'); - } - return sb.toString(); - } - - /** - * 根据数字生成一个定长的字符串,长度不够前面补0 - * - * @param num - * 数字 - * @param fixdlenth - * 字符串长度 - * @return 定长的字符串 - */ - public static String toFixdLengthString(long num, int fixdlenth) { - StringBuffer sb = new StringBuffer(); - String strNum = String.valueOf(num); - if (fixdlenth - strNum.length() >= 0) { - sb.append(generateZeroString(fixdlenth - strNum.length())); - } else { - throw new RuntimeException("将数字" + num + "转化为长度为" + fixdlenth + "的字符串发生异常!"); - } - sb.append(strNum); - return sb.toString(); - } - - /** - * 每次生成的len位数都不相同 - * - * @param param - * @return 定长的数字 - */ - public static int getNotSimple(int[] param, int len) { - Random rand = new Random(); - for (int i = param.length; i > 1; i--) { - int index = rand.nextInt(i); - int tmp = param[index]; - param[index] = param[i - 1]; - param[i - 1] = tmp; - } - int result = 0; - for (int i = 0; i < len; i++) { - result = result * 10 + param[i]; - } - return result; - } +package xy.spring2nosql.utils; + +import java.util.Random; + +public class RandomUtil { + public static final String ALLCHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static final String LETTERCHAR = "abcdefghijkllmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static final String NUMBERCHAR = "0123456789"; + + /** + * 返回一个定长的随机字符串(只包含大小写字母、数字) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateString(int length) { + StringBuffer sb = new StringBuffer(); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(ALLCHAR.charAt(random.nextInt(ALLCHAR.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateMixString(int length) { + StringBuffer sb = new StringBuffer(); + Random random = new Random(); + for (int i = 0; i < length; i++) { + sb.append(ALLCHAR.charAt(random.nextInt(LETTERCHAR.length()))); + } + return sb.toString(); + } + + /** + * 返回一个定长的随机纯大写字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateLowerString(int length) { + return generateMixString(length).toLowerCase(); + } + + /** + * 返回一个定长的随机纯小写字母字符串(只包含大小写字母) + * + * @param length + * 随机字符串长度 + * @return 随机字符串 + */ + public static String generateUpperString(int length) { + return generateMixString(length).toUpperCase(); + } + + /** + * 生成一个定长的纯0字符串 + * + * @param length + * 字符串长度 + * @return 纯0字符串 + */ + public static String generateZeroString(int length) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < length; i++) { + sb.append('0'); + } + return sb.toString(); + } + + /** + * 根据数字生成一个定长的字符串,长度不够前面补0 + * + * @param num + * 数字 + * @param fixdlenth + * 字符串长度 + * @return 定长的字符串 + */ + public static String toFixdLengthString(long num, int fixdlenth) { + StringBuffer sb = new StringBuffer(); + String strNum = String.valueOf(num); + if (fixdlenth - strNum.length() >= 0) { + sb.append(generateZeroString(fixdlenth - strNum.length())); + } else { + throw new RuntimeException("将数字" + num + "转化为长度为" + fixdlenth + "的字符串发生异常!"); + } + sb.append(strNum); + return sb.toString(); + } + + /** + * 每次生成的len位数都不相同 + * + * @param param + * @return 定长的数字 + */ + public static int getNotSimple(int[] param, int len) { + Random rand = new Random(); + for (int i = param.length; i > 1; i--) { + int index = rand.nextInt(i); + int tmp = param[index]; + param[index] = param[i - 1]; + param[i - 1] = tmp; + } + int result = 0; + for (int i = 0; i < len; i++) { + result = result * 10 + param[i]; + } + return result; + } } \ No newline at end of file diff --git a/src/main/java/xy/SpringBoot2NoSQL/utils/RedisCacheUtils.java b/src/main/java/xy/spring2nosql/utils/RedisCacheUtils.java similarity index 96% rename from src/main/java/xy/SpringBoot2NoSQL/utils/RedisCacheUtils.java rename to src/main/java/xy/spring2nosql/utils/RedisCacheUtils.java index b8e3898..f8c3944 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/utils/RedisCacheUtils.java +++ b/src/main/java/xy/spring2nosql/utils/RedisCacheUtils.java @@ -1,649 +1,649 @@ -//package xy.SpringBoot2NoSQL.utils; -// -//import java.util.ArrayList; -//import java.util.List; -//import java.util.Map; -//import java.util.Set; -//import java.util.concurrent.TimeUnit; -// -//import javax.annotation.PostConstruct; -//import javax.annotation.Resource; -// -//import org.springframework.data.redis.connection.RedisZSetCommands; -//import org.springframework.data.redis.core.ListOperations; -//import org.springframework.data.redis.core.RedisCallback; -//import org.springframework.data.redis.core.RedisTemplate; -//import org.springframework.data.redis.core.SetOperations; -//import org.springframework.data.redis.core.ValueOperations; -// -//import com.alibaba.fastjson.JSON; -//import com.alibaba.fastjson.parser.Feature; -// -//public class RedisCacheUtils { -// @Resource -// private RedisTemplate redisTemplate; -// -// private static RedisCacheUtils cacheUtils; -// -// @PostConstruct -// public void init() { -// cacheUtils = this; -// cacheUtils.redisTemplate = this.redisTemplate; -// } -// -// /** -// * 将数据存入缓存 -// * -// * @param key -// * @param val -// * @return -// */ -// public static void saveString(String key, String val) { -// -// ValueOperations vo = cacheUtils.redisTemplate.opsForValue(); -// vo.set(key, val); -// } -// -// /** -// * 将数据存入缓存的集合中 -// * -// * @param key -// * @param val -// * @return -// */ -// public static void saveToSet(String key, String val) { -// -// SetOperations so = cacheUtils.redisTemplate.opsForSet(); -// -// so.add(key, val); -// } -// -// /** -// * key 缓存Key -// * @param key -// * @return -// */ -// public static String getFromSet(String key) { -// return cacheUtils.redisTemplate.opsForSet().pop(key); -// } -// -// /** -// * 将 key的值保存为 value ,当且仅当 key 不存在。 若给定的 key 已经存在,则 SETNX 不做任何动作。 SETNX 是『SET if -// * Not eXists』(如果不存在,则 SET)的简写。
-// * 保存成功,返回 true
-// * 保存失败,返回 false -// */ -// public static boolean saveNX(String key, String val) { -// -// /** 设置成功,返回 1 设置失败,返回 0 **/ -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.setNX(key.getBytes(), val.getBytes()); -// }); -// -// } -// -// /** -// * 将 key的值保存为 value ,当且仅当 key 不存在。 若给定的 key 已经存在,则 SETNX 不做任何动作。 SETNX 是『SET if -// * Not eXists』(如果不存在,则 SET)的简写。
-// * 保存成功,返回 true
-// * 保存失败,返回 false -// * -// * @param key -// * @param val -// * @param expire 超时时间 -// * @return 保存成功,返回 true 否则返回 false -// */ -// public static boolean saveNX(String key, String val, int expire) { -// -// boolean ret = saveNX(key, val); -// if (ret) { -// cacheUtils.redisTemplate.expire(key, expire, TimeUnit.SECONDS); -// } -// return ret; -// } -// -// /** -// * 将数据存入缓存(并设置失效时间) -// * -// * @param key -// * @param val -// * @param seconds -// * @return -// */ -// public static void saveString(String key, String val, int seconds) { -// -// cacheUtils.redisTemplate.opsForValue().set(key, val, seconds, TimeUnit.SECONDS); -// } -// -// /** -// * 将自增变量存入缓存 -// */ -// public static void saveSeq(String key, long seqNo) { -// -// cacheUtils.redisTemplate.delete(key); -// cacheUtils.redisTemplate.opsForValue().increment(key, seqNo); -// } -// -// /** -// * 将递增浮点数存入缓存 -// */ -// public static void saveFloat(String key, float data) { -// -// cacheUtils.redisTemplate.delete(key); -// cacheUtils.redisTemplate.opsForValue().increment(key, data); -// } -// -// /** -// * 保存复杂类型数据到缓存 -// * -// * @param key -// * @param obj -// * @return -// */ -// public static void saveBean(String key, Object obj) { -// -// cacheUtils.redisTemplate.opsForValue().set(key, JSON.toJSONString(obj)); -// } -// -// /** -// * 保存复杂类型数据到缓存(并设置失效时间) -// * -// * @param key -// * @param obj -// * @param seconds -// */ -// public static void saveBean(String key, Object obj, int seconds) { -// -// cacheUtils.redisTemplate.opsForValue().set(key, JSON.toJSONString(obj), seconds, TimeUnit.SECONDS); -// } -// -// /** -// * 存到指定的队列中 -// * @param key -// * @param val -// * @param size -// */ -// public static void saveToQueue(String key, String val, long size) { -// -// ListOperations lo = cacheUtils.redisTemplate.opsForList(); -// -// if (size > 0 && lo.size(key) >= size) { -// lo.rightPop(key); -// } -// lo.leftPush(key, val); -// } -// -// /** -// * 保存到hash集合中 -// * -// * @param hName 集合名 -// * @param key -// * @param value -// */ -// public static void hashSet(String hName, String key, String value) { -// -// cacheUtils.redisTemplate.opsForHash().put(hName, key, value); -// } -// -// /** -// * 根据key获取所以值 -// * -// * @param key -// * @return -// */ -// public static Map hgetAll(String key) { -// -// return cacheUtils.redisTemplate.opsForHash().entries(key); -// } -// -// /** -// * 保存到hash集合中 -// * -// * @param -// * @param hName 集合名 -// * @param key -// * @param t -// */ -// public static void hashSet(String hName, String key, T t) { -// -// hashSet(hName, key, JSON.toJSONString(t)); -// } -// -// /** -// * 取得复杂JSON数据 -// * -// * @param key -// * @param clazz -// * @param clazz -// * @return -// */ -// public static T getBean(String key, Class clazz) { -// -// String value = cacheUtils.redisTemplate.opsForValue().get(key); -// if (value == null) { -// return null; -// } -// return JSON.parseObject(value, clazz); -// } -// -// /** -// * 从缓存中取得字符串数据 -// * -// * @param key -// * @return 数据 -// */ -// public static String getString(String key) { -// cacheUtils.redisTemplate.opsForValue().get(key); -// -// return cacheUtils.redisTemplate.opsForValue().get(key); -// } -// -// /** -// * 从指定队列里取得数据 -// * @param key -// * @param size -// * @return -// */ -// public static List getFromQueue(String key, long size) { -// -// boolean flag = cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.exists(key.getBytes()); -// }); -// -// if (flag) { -// return new ArrayList<>(); -// } -// ListOperations lo = cacheUtils.redisTemplate.opsForList(); -// if (size > 0) { -// return lo.range(key, 0, size - 1); -// } else { -// return lo.range(key, 0, lo.size(key) - 1); -// } -// } -// -// /** -// * 从指定队列里取得数据 -// * @param key -// * @return -// */ -// public static String popQueue(String key) { -// -// return cacheUtils.redisTemplate.opsForList().rightPop(key); -// -// } -// -// /** -// * 取得序列值的下一个 -// * -// * @param key -// * @return -// */ -// public static Long getSeqNext(String key) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// -// return connection.incr(key.getBytes()); -// -// }); -// } -// -// /** -// * 取得序列值的下一个 -// * -// * @param key -// * @return -// */ -// public static Long getSeqNext(String key, long value) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// -// return connection.incrBy(key.getBytes(), value); -// -// }); -// -// } -// -// /** -// * 将序列值回退一个 -// * -// * @param key -// * @return -// */ -// public static void getSeqBack(String key) { -// -// cacheUtils.redisTemplate.execute((RedisCallback) connection -> connection.decr(key.getBytes())); -// -// } -// -// /** -// * 从hash集合里取得 -// * -// * @param hName -// * @param key -// * @return -// */ -// public static Object hashGet(String hName, String key) { -// -// return cacheUtils.redisTemplate.opsForHash().get(hName, key); -// } -// -// public static T hashGet(String hName, String key, Class clazz) { -// -// return JSON.parseObject((String) hashGet(hName, key), clazz); -// } -// -// /** -// * 增加浮点数的值 -// * -// * @param key -// * @return -// */ -// public static Double incrFloat(String key, double incrBy) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// -// return connection.incrBy(key.getBytes(), incrBy); -// -// }); -// } -// -// /** -// * 判断是否缓存了数据 -// * -// * @param key 数据KEY -// * @return 判断是否缓存了 -// */ -// public static boolean isCached(String key) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.exists(key.getBytes()); -// }); -// } -// -// /** -// * 判断hash集合中是否缓存了数据 -// * -// * @param hName -// * @param key 数据KEY -// * @return 判断是否缓存了 -// */ -// public static boolean hashCached(String hName, String key) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.hExists(key.getBytes(), key.getBytes()); -// }); -// } -// -// /** -// * 判断是否缓存在指定的集合中 -// * -// * @param key 数据KEY -// * @param val 数据 -// * @return 判断是否缓存了 -// */ -// public static boolean isMember(String key, String val) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.sIsMember(key.getBytes(), val.getBytes()); -// }); -// } -// -// /** -// * 从缓存中删除数据 -// * -// * @param key -// * @return -// */ -// public static void delKey(String key) { -// -// cacheUtils.redisTemplate.execute((RedisCallback) connection -> connection.del(key.getBytes())); -// } -// -// /** -// * 设置超时时间 -// * -// * @param key -// * @param seconds -// */ -// public static void expire(String key, int seconds) { -// cacheUtils.redisTemplate -// .execute((RedisCallback) connection -> connection.expire(key.getBytes(), seconds)); -// -// } -// -// /** -// * 列出set中所有成员 -// * -// * @param setName set名 -// * @return -// */ -// public static Set listSet(String setName) { -// -// return cacheUtils.redisTemplate.opsForHash().keys(setName); -// -// } -// -// /** -// * 向set中追加一个值 -// * -// * @param setName set名 -// * @param value -// */ -// public static void setSave(String setName, String value) { -// -// cacheUtils.redisTemplate -// .execute((RedisCallback) connection -> connection.sAdd(setName.getBytes(), value.getBytes())); -// -// } -// -// /** -// * 逆序列出sorted set包括分数的set列表 -// * -// * @param key set名 -// * @param start 开始位置 -// * @param end 结束位置 -// * @return 列表 -// */ -// public static Set listSortedsetRev(String key, int start, int end) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback>) connection -> { -// return connection.zRevRangeWithScores(key.getBytes(), start, end); -// }); -// } -// -// /** -// * 逆序取得sorted sort排名 -// * -// * @param key set名 -// * @param member 成员名 -// * @return 排名 -// */ -// public static Long getRankRev(String key, String member) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.zRevRank(key.getBytes(), member.getBytes()); -// }); -// -// } -// -// /** -// * 根据成员名取得sorted sort分数 -// * -// * @param key set名 -// * @param member 成员名 -// * @return 分数 -// */ -// public static Double getMemberScore(String key, String member) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.zScore(key.getBytes(), member.getBytes()); -// }); -// } -// -// /** -// * 向sorted set中追加一个值 -// * -// * @param key set名 -// * @param score 分数 -// * @param member 成员名称 -// */ -// public static void saveToSortedset(String key, Double score, String member) { -// -// cacheUtils.redisTemplate.execute( -// (RedisCallback) connection -> connection.zAdd(key.getBytes(), score, member.getBytes())); -// } -// -// /** -// * 从sorted set删除一个值 -// * -// * @param key set名 -// * @param member 成员名称 -// */ -// public static void delFromSortedset(String key, String member) { -// cacheUtils.redisTemplate -// .execute((RedisCallback) connection -> connection.zRem(key.getBytes(), member.getBytes())); -// -// } -// -// /** -// * 从hash map中取得复杂JSON数据 -// * -// * @param key -// * @param field -// * @param clazz -// */ -// public static T getBeanFromMap(String key, String field, Class clazz) { -// -// byte[] input = cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.hGet(key.getBytes(), field.getBytes()); -// }); -// return JSON.parseObject(input, clazz, Feature.AutoCloseSource); -// } -// -// /** -// * 从hashmap中删除一个值 -// * -// * @param key map名 -// * @param field 成员名称 -// */ -// public static void delFromMap(String key, String field) { -// -// cacheUtils.redisTemplate -// .execute((RedisCallback) connection -> connection.hDel(key.getBytes(), field.getBytes())); -// -// } -// -// /** -// * @param key -// * @return -// * @Description: 根据key增长 ,计数器 -// * @author clg -// * @date 2016年6月30日 下午2:37:52 -// */ -// public static long incr(String key) { -// -// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { -// return connection.incr(key.getBytes()); -// }); -// } -// -// -// /** -// * 根据key获取当前计数结果 -// * @param key -// * @return -// */ -// public static String getCount(String key) { -// -// return cacheUtils.redisTemplate.opsForValue().get(key); -// } -// -// /** -// * 将所有指定的值插入到存于 key 的列表的头部。如果 key 不存在,那么在进行 push 操作前会创建一个空列表 -// * -// * @param -// * @param key -// * @param value -// * @return -// */ -// public static Long lpush(String key, T value) { -// -// return cacheUtils.redisTemplate.opsForList().leftPush(key, JSON.toJSONString(value)); -// } -// -// /** -// * 只有当 key 已经存在并且存着一个 list 的时候,在这个 key 下面的 list 的头部插入 value。 与 LPUSH 相反,当 key -// * 不存在的时候不会进行任何操作 -// * -// * @param key -// * @param value -// * @return -// */ -// public static Long lpushx(String key, T value) { -// -// return cacheUtils.redisTemplate.opsForList().leftPushIfPresent(key, JSON.toJSONString(value)); -// } -// -// /** -// * 返回存储在 key 里的list的长度。 如果 key 不存在,那么就被看作是空list,并且返回长度为 0 -// * -// * @param key -// * @return -// */ -// public static Long llen(String key) { -// -// return cacheUtils.redisTemplate.opsForList().size(key); -// } -// -// /** -// * 返回存储在 key 的列表里指定范围内的元素。 start 和 end -// * 偏移量都是基于0的下标,即list的第一个元素下标是0(list的表头),第二个元素下标是1,以此类推 -// * -// * @param key -// * @return -// */ -// public static List lrange(String key, long start, long end) { -// -// return cacheUtils.redisTemplate.opsForList().range(key, start, end); -// } -// -// /** -// * 移除并且返回 key 对应的 list 的第一个元素 -// * -// * @param key -// * @return -// */ -// public static String lpop(String key) { -// -// return cacheUtils.redisTemplate.opsForList().leftPop(key); -// } -// -// /** -// * 保存到hash集合中 只在 key 指定的哈希集中不存在指定的字段时,设置字段的值。如果 key 指定的哈希集不存在,会创建一个新的哈希集并与 key -// * 关联。如果字段已存在,该操作无效果。 -// * -// * @param hName 集合名 -// * @param key -// * @param value -// */ -// public static void hsetnx(String hName, String key, String value) { -// -// cacheUtils.redisTemplate.execute((RedisCallback) connection -> connection.hSetNX(key.getBytes(), -// key.getBytes(), value.getBytes())); -// -// } -// -// /** -// * 保存到hash集合中 只在 key 指定的哈希集中不存在指定的字段时,设置字段的值。如果 key 指定的哈希集不存在,会创建一个新的哈希集并与 key -// * 关联。如果字段已存在,该操作无效果。 -// * -// * @param hName 集合名 -// * @param key -// * @param t -// * @param -// */ -// public static void hsetnx(String hName, String key, T t) { -// hsetnx(hName, key, JSON.toJSONString(t)); -// } -// -//} +//package xy.spring2nosql.utils; +// +//import java.util.ArrayList; +//import java.util.List; +//import java.util.Map; +//import java.util.Set; +//import java.util.concurrent.TimeUnit; +// +//import javax.annotation.PostConstruct; +//import javax.annotation.Resource; +// +//import org.springframework.data.redis.connection.RedisZSetCommands; +//import org.springframework.data.redis.core.ListOperations; +//import org.springframework.data.redis.core.RedisCallback; +//import org.springframework.data.redis.core.RedisTemplate; +//import org.springframework.data.redis.core.SetOperations; +//import org.springframework.data.redis.core.ValueOperations; +// +//import com.alibaba.fastjson.JSON; +//import com.alibaba.fastjson.parser.Feature; +// +//public class RedisCacheUtils { +// @Resource +// private RedisTemplate redisTemplate; +// +// private static RedisCacheUtils cacheUtils; +// +// @PostConstruct +// public void init() { +// cacheUtils = this; +// cacheUtils.redisTemplate = this.redisTemplate; +// } +// +// /** +// * 将数据存入缓存 +// * +// * @param key +// * @param val +// * @return +// */ +// public static void saveString(String key, String val) { +// +// ValueOperations vo = cacheUtils.redisTemplate.opsForValue(); +// vo.set(key, val); +// } +// +// /** +// * 将数据存入缓存的集合中 +// * +// * @param key +// * @param val +// * @return +// */ +// public static void saveToSet(String key, String val) { +// +// SetOperations so = cacheUtils.redisTemplate.opsForSet(); +// +// so.add(key, val); +// } +// +// /** +// * key 缓存Key +// * @param key +// * @return +// */ +// public static String getFromSet(String key) { +// return cacheUtils.redisTemplate.opsForSet().pop(key); +// } +// +// /** +// * 将 key的值保存为 value ,当且仅当 key 不存在。 若给定的 key 已经存在,则 SETNX 不做任何动作。 SETNX 是『SET if +// * Not eXists』(如果不存在,则 SET)的简写。
+// * 保存成功,返回 true
+// * 保存失败,返回 false +// */ +// public static boolean saveNX(String key, String val) { +// +// /** 设置成功,返回 1 设置失败,返回 0 **/ +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.setNX(key.getBytes(), val.getBytes()); +// }); +// +// } +// +// /** +// * 将 key的值保存为 value ,当且仅当 key 不存在。 若给定的 key 已经存在,则 SETNX 不做任何动作。 SETNX 是『SET if +// * Not eXists』(如果不存在,则 SET)的简写。
+// * 保存成功,返回 true
+// * 保存失败,返回 false +// * +// * @param key +// * @param val +// * @param expire 超时时间 +// * @return 保存成功,返回 true 否则返回 false +// */ +// public static boolean saveNX(String key, String val, int expire) { +// +// boolean ret = saveNX(key, val); +// if (ret) { +// cacheUtils.redisTemplate.expire(key, expire, TimeUnit.SECONDS); +// } +// return ret; +// } +// +// /** +// * 将数据存入缓存(并设置失效时间) +// * +// * @param key +// * @param val +// * @param seconds +// * @return +// */ +// public static void saveString(String key, String val, int seconds) { +// +// cacheUtils.redisTemplate.opsForValue().set(key, val, seconds, TimeUnit.SECONDS); +// } +// +// /** +// * 将自增变量存入缓存 +// */ +// public static void saveSeq(String key, long seqNo) { +// +// cacheUtils.redisTemplate.delete(key); +// cacheUtils.redisTemplate.opsForValue().increment(key, seqNo); +// } +// +// /** +// * 将递增浮点数存入缓存 +// */ +// public static void saveFloat(String key, float data) { +// +// cacheUtils.redisTemplate.delete(key); +// cacheUtils.redisTemplate.opsForValue().increment(key, data); +// } +// +// /** +// * 保存复杂类型数据到缓存 +// * +// * @param key +// * @param obj +// * @return +// */ +// public static void saveBean(String key, Object obj) { +// +// cacheUtils.redisTemplate.opsForValue().set(key, JSON.toJSONString(obj)); +// } +// +// /** +// * 保存复杂类型数据到缓存(并设置失效时间) +// * +// * @param key +// * @param obj +// * @param seconds +// */ +// public static void saveBean(String key, Object obj, int seconds) { +// +// cacheUtils.redisTemplate.opsForValue().set(key, JSON.toJSONString(obj), seconds, TimeUnit.SECONDS); +// } +// +// /** +// * 存到指定的队列中 +// * @param key +// * @param val +// * @param size +// */ +// public static void saveToQueue(String key, String val, long size) { +// +// ListOperations lo = cacheUtils.redisTemplate.opsForList(); +// +// if (size > 0 && lo.size(key) >= size) { +// lo.rightPop(key); +// } +// lo.leftPush(key, val); +// } +// +// /** +// * 保存到hash集合中 +// * +// * @param hName 集合名 +// * @param key +// * @param value +// */ +// public static void hashSet(String hName, String key, String value) { +// +// cacheUtils.redisTemplate.opsForHash().put(hName, key, value); +// } +// +// /** +// * 根据key获取所以值 +// * +// * @param key +// * @return +// */ +// public static Map hgetAll(String key) { +// +// return cacheUtils.redisTemplate.opsForHash().entries(key); +// } +// +// /** +// * 保存到hash集合中 +// * +// * @param +// * @param hName 集合名 +// * @param key +// * @param t +// */ +// public static void hashSet(String hName, String key, T t) { +// +// hashSet(hName, key, JSON.toJSONString(t)); +// } +// +// /** +// * 取得复杂JSON数据 +// * +// * @param key +// * @param clazz +// * @param clazz +// * @return +// */ +// public static T getBean(String key, Class clazz) { +// +// String value = cacheUtils.redisTemplate.opsForValue().get(key); +// if (value == null) { +// return null; +// } +// return JSON.parseObject(value, clazz); +// } +// +// /** +// * 从缓存中取得字符串数据 +// * +// * @param key +// * @return 数据 +// */ +// public static String getString(String key) { +// cacheUtils.redisTemplate.opsForValue().get(key); +// +// return cacheUtils.redisTemplate.opsForValue().get(key); +// } +// +// /** +// * 从指定队列里取得数据 +// * @param key +// * @param size +// * @return +// */ +// public static List getFromQueue(String key, long size) { +// +// boolean flag = cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.exists(key.getBytes()); +// }); +// +// if (flag) { +// return new ArrayList<>(); +// } +// ListOperations lo = cacheUtils.redisTemplate.opsForList(); +// if (size > 0) { +// return lo.range(key, 0, size - 1); +// } else { +// return lo.range(key, 0, lo.size(key) - 1); +// } +// } +// +// /** +// * 从指定队列里取得数据 +// * @param key +// * @return +// */ +// public static String popQueue(String key) { +// +// return cacheUtils.redisTemplate.opsForList().rightPop(key); +// +// } +// +// /** +// * 取得序列值的下一个 +// * +// * @param key +// * @return +// */ +// public static Long getSeqNext(String key) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// +// return connection.incr(key.getBytes()); +// +// }); +// } +// +// /** +// * 取得序列值的下一个 +// * +// * @param key +// * @return +// */ +// public static Long getSeqNext(String key, long value) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// +// return connection.incrBy(key.getBytes(), value); +// +// }); +// +// } +// +// /** +// * 将序列值回退一个 +// * +// * @param key +// * @return +// */ +// public static void getSeqBack(String key) { +// +// cacheUtils.redisTemplate.execute((RedisCallback) connection -> connection.decr(key.getBytes())); +// +// } +// +// /** +// * 从hash集合里取得 +// * +// * @param hName +// * @param key +// * @return +// */ +// public static Object hashGet(String hName, String key) { +// +// return cacheUtils.redisTemplate.opsForHash().get(hName, key); +// } +// +// public static T hashGet(String hName, String key, Class clazz) { +// +// return JSON.parseObject((String) hashGet(hName, key), clazz); +// } +// +// /** +// * 增加浮点数的值 +// * +// * @param key +// * @return +// */ +// public static Double incrFloat(String key, double incrBy) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// +// return connection.incrBy(key.getBytes(), incrBy); +// +// }); +// } +// +// /** +// * 判断是否缓存了数据 +// * +// * @param key 数据KEY +// * @return 判断是否缓存了 +// */ +// public static boolean isCached(String key) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.exists(key.getBytes()); +// }); +// } +// +// /** +// * 判断hash集合中是否缓存了数据 +// * +// * @param hName +// * @param key 数据KEY +// * @return 判断是否缓存了 +// */ +// public static boolean hashCached(String hName, String key) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.hExists(key.getBytes(), key.getBytes()); +// }); +// } +// +// /** +// * 判断是否缓存在指定的集合中 +// * +// * @param key 数据KEY +// * @param val 数据 +// * @return 判断是否缓存了 +// */ +// public static boolean isMember(String key, String val) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.sIsMember(key.getBytes(), val.getBytes()); +// }); +// } +// +// /** +// * 从缓存中删除数据 +// * +// * @param key +// * @return +// */ +// public static void delKey(String key) { +// +// cacheUtils.redisTemplate.execute((RedisCallback) connection -> connection.del(key.getBytes())); +// } +// +// /** +// * 设置超时时间 +// * +// * @param key +// * @param seconds +// */ +// public static void expire(String key, int seconds) { +// cacheUtils.redisTemplate +// .execute((RedisCallback) connection -> connection.expire(key.getBytes(), seconds)); +// +// } +// +// /** +// * 列出set中所有成员 +// * +// * @param setName set名 +// * @return +// */ +// public static Set listSet(String setName) { +// +// return cacheUtils.redisTemplate.opsForHash().keys(setName); +// +// } +// +// /** +// * 向set中追加一个值 +// * +// * @param setName set名 +// * @param value +// */ +// public static void setSave(String setName, String value) { +// +// cacheUtils.redisTemplate +// .execute((RedisCallback) connection -> connection.sAdd(setName.getBytes(), value.getBytes())); +// +// } +// +// /** +// * 逆序列出sorted set包括分数的set列表 +// * +// * @param key set名 +// * @param start 开始位置 +// * @param end 结束位置 +// * @return 列表 +// */ +// public static Set listSortedsetRev(String key, int start, int end) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback>) connection -> { +// return connection.zRevRangeWithScores(key.getBytes(), start, end); +// }); +// } +// +// /** +// * 逆序取得sorted sort排名 +// * +// * @param key set名 +// * @param member 成员名 +// * @return 排名 +// */ +// public static Long getRankRev(String key, String member) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.zRevRank(key.getBytes(), member.getBytes()); +// }); +// +// } +// +// /** +// * 根据成员名取得sorted sort分数 +// * +// * @param key set名 +// * @param member 成员名 +// * @return 分数 +// */ +// public static Double getMemberScore(String key, String member) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.zScore(key.getBytes(), member.getBytes()); +// }); +// } +// +// /** +// * 向sorted set中追加一个值 +// * +// * @param key set名 +// * @param score 分数 +// * @param member 成员名称 +// */ +// public static void saveToSortedset(String key, Double score, String member) { +// +// cacheUtils.redisTemplate.execute( +// (RedisCallback) connection -> connection.zAdd(key.getBytes(), score, member.getBytes())); +// } +// +// /** +// * 从sorted set删除一个值 +// * +// * @param key set名 +// * @param member 成员名称 +// */ +// public static void delFromSortedset(String key, String member) { +// cacheUtils.redisTemplate +// .execute((RedisCallback) connection -> connection.zRem(key.getBytes(), member.getBytes())); +// +// } +// +// /** +// * 从hash map中取得复杂JSON数据 +// * +// * @param key +// * @param field +// * @param clazz +// */ +// public static T getBeanFromMap(String key, String field, Class clazz) { +// +// byte[] input = cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.hGet(key.getBytes(), field.getBytes()); +// }); +// return JSON.parseObject(input, clazz, Feature.AutoCloseSource); +// } +// +// /** +// * 从hashmap中删除一个值 +// * +// * @param key map名 +// * @param field 成员名称 +// */ +// public static void delFromMap(String key, String field) { +// +// cacheUtils.redisTemplate +// .execute((RedisCallback) connection -> connection.hDel(key.getBytes(), field.getBytes())); +// +// } +// +// /** +// * @param key +// * @return +// * @Description: 根据key增长 ,计数器 +// * @author clg +// * @date 2016年6月30日 下午2:37:52 +// */ +// public static long incr(String key) { +// +// return cacheUtils.redisTemplate.execute((RedisCallback) connection -> { +// return connection.incr(key.getBytes()); +// }); +// } +// +// +// /** +// * 根据key获取当前计数结果 +// * @param key +// * @return +// */ +// public static String getCount(String key) { +// +// return cacheUtils.redisTemplate.opsForValue().get(key); +// } +// +// /** +// * 将所有指定的值插入到存于 key 的列表的头部。如果 key 不存在,那么在进行 push 操作前会创建一个空列表 +// * +// * @param +// * @param key +// * @param value +// * @return +// */ +// public static Long lpush(String key, T value) { +// +// return cacheUtils.redisTemplate.opsForList().leftPush(key, JSON.toJSONString(value)); +// } +// +// /** +// * 只有当 key 已经存在并且存着一个 list 的时候,在这个 key 下面的 list 的头部插入 value。 与 LPUSH 相反,当 key +// * 不存在的时候不会进行任何操作 +// * +// * @param key +// * @param value +// * @return +// */ +// public static Long lpushx(String key, T value) { +// +// return cacheUtils.redisTemplate.opsForList().leftPushIfPresent(key, JSON.toJSONString(value)); +// } +// +// /** +// * 返回存储在 key 里的list的长度。 如果 key 不存在,那么就被看作是空list,并且返回长度为 0 +// * +// * @param key +// * @return +// */ +// public static Long llen(String key) { +// +// return cacheUtils.redisTemplate.opsForList().size(key); +// } +// +// /** +// * 返回存储在 key 的列表里指定范围内的元素。 start 和 end +// * 偏移量都是基于0的下标,即list的第一个元素下标是0(list的表头),第二个元素下标是1,以此类推 +// * +// * @param key +// * @return +// */ +// public static List lrange(String key, long start, long end) { +// +// return cacheUtils.redisTemplate.opsForList().range(key, start, end); +// } +// +// /** +// * 移除并且返回 key 对应的 list 的第一个元素 +// * +// * @param key +// * @return +// */ +// public static String lpop(String key) { +// +// return cacheUtils.redisTemplate.opsForList().leftPop(key); +// } +// +// /** +// * 保存到hash集合中 只在 key 指定的哈希集中不存在指定的字段时,设置字段的值。如果 key 指定的哈希集不存在,会创建一个新的哈希集并与 key +// * 关联。如果字段已存在,该操作无效果。 +// * +// * @param hName 集合名 +// * @param key +// * @param value +// */ +// public static void hsetnx(String hName, String key, String value) { +// +// cacheUtils.redisTemplate.execute((RedisCallback) connection -> connection.hSetNX(key.getBytes(), +// key.getBytes(), value.getBytes())); +// +// } +// +// /** +// * 保存到hash集合中 只在 key 指定的哈希集中不存在指定的字段时,设置字段的值。如果 key 指定的哈希集不存在,会创建一个新的哈希集并与 key +// * 关联。如果字段已存在,该操作无效果。 +// * +// * @param hName 集合名 +// * @param key +// * @param t +// * @param +// */ +// public static void hsetnx(String hName, String key, T t) { +// hsetnx(hName, key, JSON.toJSONString(t)); +// } +// +//} diff --git a/src/main/java/xy/SpringBoot2NoSQL/utils/RedissonUtil.java b/src/main/java/xy/spring2nosql/utils/RedissonUtil.java similarity index 94% rename from src/main/java/xy/SpringBoot2NoSQL/utils/RedissonUtil.java rename to src/main/java/xy/spring2nosql/utils/RedissonUtil.java index 3d490f7..0ea52d8 100644 --- a/src/main/java/xy/SpringBoot2NoSQL/utils/RedissonUtil.java +++ b/src/main/java/xy/spring2nosql/utils/RedissonUtil.java @@ -1,157 +1,157 @@ -package xy.SpringBoot2NoSQL.utils; - -import org.redisson.Redisson; -import org.redisson.api.RAtomicLong; -import org.redisson.api.RBucket; -import org.redisson.api.RCountDownLatch; -import org.redisson.api.RDeque; -import org.redisson.api.RList; -import org.redisson.api.RLock; -import org.redisson.api.RMap; -import org.redisson.api.RQueue; -import org.redisson.api.RSet; -import org.redisson.api.RSortedSet; -import org.redisson.api.RTopic; -import org.redisson.api.RedissonClient; - -/** - * Redisson分布式操作类 - * @author 王昕 - * - */ -public class RedissonUtil { - - /** - * 关闭Redisson客户端连接 - * @param redisson - */ - public static void closeRedisson(RedissonClient redisson){ - redisson.shutdown(); - System.out.println("成功关闭Redis Client连接"); - } - - /** - * 获取字符串对象 - * @param redisson - * @param objectName - * @return - */ - public static RBucket getRBucket(RedissonClient redisson,String objectName){ - RBucket bucket=redisson.getBucket(objectName); - return bucket; - } - - /** - * 获取Map对象 - * @param redisson - * @param objectName - * @return - */ - public static RMap getRMap(RedissonClient redisson,String objectName){ - RMap map=redisson.getMap(objectName); - return map; - } - - /** - * 获取有序集合 - * @param redisson - * @param objectName - * @return - */ - public static RSortedSet getRSortedSet(RedissonClient redisson,String objectName){ - RSortedSet sortedSet=redisson.getSortedSet(objectName); - return sortedSet; - } - - /** - * 获取集合 - * @param redisson - * @param objectName - * @return - */ - public static RSet getRSet(RedissonClient redisson,String objectName){ - RSet rSet=redisson.getSet(objectName); - return rSet; - } - - /** - * 获取列表 - * @param redisson - * @param objectName - * @return - */ - public static RList getRList(RedissonClient redisson,String objectName){ - RList rList=redisson.getList(objectName); - return rList; - } - - /** - * 获取队列 - * @param redisson - * @param objectName - * @return - */ - public static RQueue getRQueue(RedissonClient redisson,String objectName){ - RQueue rQueue=redisson.getQueue(objectName); - return rQueue; - } - - /** - * 获取双端队列 - * @param redisson - * @param objectName - * @return - */ - public static RDeque getRDeque(RedissonClient redisson,String objectName){ - RDeque rDeque=redisson.getDeque(objectName); - return rDeque; - } - - - - /** - * 获取锁 - * @param redisson - * @param objectName - * @return - */ - public static RLock getRLock(RedissonClient redisson,String objectName){ - RLock rLock=redisson.getLock(objectName); - return rLock; - } - - /** - * 获取原子数 - * @param redisson - * @param objectName - * @return - */ - public static RAtomicLong getRAtomicLong(RedissonClient redisson,String objectName){ - RAtomicLong rAtomicLong=redisson.getAtomicLong(objectName); - return rAtomicLong; - } - - /** - * 获取记数锁 - * @param redisson - * @param objectName - * @return - */ - public static RCountDownLatch getRCountDownLatch(RedissonClient redisson,String objectName){ - RCountDownLatch rCountDownLatch=redisson.getCountDownLatch(objectName); - return rCountDownLatch; - } - - /** - * 获取消息的Topic - * @param redisson - * @param objectName - * @return - */ - public static RTopic getRTopic(RedissonClient redisson,String objectName){ - RTopic rTopic=redisson.getTopic(objectName); - return rTopic; - - } - -} +package xy.spring2nosql.utils; + +import org.redisson.Redisson; +import org.redisson.api.RAtomicLong; +import org.redisson.api.RBucket; +import org.redisson.api.RCountDownLatch; +import org.redisson.api.RDeque; +import org.redisson.api.RList; +import org.redisson.api.RLock; +import org.redisson.api.RMap; +import org.redisson.api.RQueue; +import org.redisson.api.RSet; +import org.redisson.api.RSortedSet; +import org.redisson.api.RTopic; +import org.redisson.api.RedissonClient; + +/** + * Redisson分布式操作类 + * @author 王昕 + * + */ +public class RedissonUtil { + + /** + * 关闭Redisson客户端连接 + * @param redisson + */ + public static void closeRedisson(RedissonClient redisson){ + redisson.shutdown(); + System.out.println("成功关闭Redis Client连接"); + } + + /** + * 获取字符串对象 + * @param redisson + * @param objectName + * @return + */ + public static RBucket getRBucket(RedissonClient redisson,String objectName){ + RBucket bucket=redisson.getBucket(objectName); + return bucket; + } + + /** + * 获取Map对象 + * @param redisson + * @param objectName + * @return + */ + public static RMap getRMap(RedissonClient redisson,String objectName){ + RMap map=redisson.getMap(objectName); + return map; + } + + /** + * 获取有序集合 + * @param redisson + * @param objectName + * @return + */ + public static RSortedSet getRSortedSet(RedissonClient redisson,String objectName){ + RSortedSet sortedSet=redisson.getSortedSet(objectName); + return sortedSet; + } + + /** + * 获取集合 + * @param redisson + * @param objectName + * @return + */ + public static RSet getRSet(RedissonClient redisson,String objectName){ + RSet rSet=redisson.getSet(objectName); + return rSet; + } + + /** + * 获取列表 + * @param redisson + * @param objectName + * @return + */ + public static RList getRList(RedissonClient redisson,String objectName){ + RList rList=redisson.getList(objectName); + return rList; + } + + /** + * 获取队列 + * @param redisson + * @param objectName + * @return + */ + public static RQueue getRQueue(RedissonClient redisson,String objectName){ + RQueue rQueue=redisson.getQueue(objectName); + return rQueue; + } + + /** + * 获取双端队列 + * @param redisson + * @param objectName + * @return + */ + public static RDeque getRDeque(RedissonClient redisson,String objectName){ + RDeque rDeque=redisson.getDeque(objectName); + return rDeque; + } + + + + /** + * 获取锁 + * @param redisson + * @param objectName + * @return + */ + public static RLock getRLock(RedissonClient redisson,String objectName){ + RLock rLock=redisson.getLock(objectName); + return rLock; + } + + /** + * 获取原子数 + * @param redisson + * @param objectName + * @return + */ + public static RAtomicLong getRAtomicLong(RedissonClient redisson,String objectName){ + RAtomicLong rAtomicLong=redisson.getAtomicLong(objectName); + return rAtomicLong; + } + + /** + * 获取记数锁 + * @param redisson + * @param objectName + * @return + */ + public static RCountDownLatch getRCountDownLatch(RedissonClient redisson,String objectName){ + RCountDownLatch rCountDownLatch=redisson.getCountDownLatch(objectName); + return rCountDownLatch; + } + + /** + * 获取消息的Topic + * @param redisson + * @param objectName + * @return + */ + public static RTopic getRTopic(RedissonClient redisson,String objectName){ + RTopic rTopic=redisson.getTopic(objectName); + return rTopic; + + } + +}