From 951d22640b043c3838582ba3eb7099c7442c5d58 Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Mon, 3 Sep 2018 14:22:34 +0300 Subject: [PATCH 01/15] [maven-release-plugin] prepare release redisson-2.13 --- pom.xml | 4 ++-- redisson-all/pom.xml | 4 ++-- redisson-spring-boot-starter/pom.xml | 2 +- redisson-spring-data/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-16/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-17/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-18/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-20/pom.xml | 2 +- redisson-tomcat/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-6/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-7/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-8/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-9/pom.xml | 2 +- redisson/pom.xml | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index e68ae2b09..43270643b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <packaging>pom</packaging> <name>Redisson</name> @@ -27,7 +27,7 @@ <url>scm:git:git@github.com:redisson/redisson.git</url> <connection>scm:git:git@github.com:redisson/redisson.git</connection> <developerConnection>scm:git:git@github.com:redisson/redisson.git</developerConnection> - <tag>HEAD</tag> + <tag>redisson-2.13</tag> </scm> <prerequisites> diff --git a/redisson-all/pom.xml b/redisson-all/pom.xml index 293dab904..02f45181a 100644 --- a/redisson-all/pom.xml +++ b/redisson-all/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> @@ -26,7 +26,7 @@ <url>scm:git:git@github.com:mrniko/redisson.git</url> <connection>scm:git:git@github.com:mrniko/redisson.git</connection> <developerConnection>scm:git:git@github.com:mrniko/redisson.git</developerConnection> - <tag>redisson-parent-0.9.0</tag> + <tag>redisson-2.13</tag> </scm> <prerequisites> diff --git a/redisson-spring-boot-starter/pom.xml b/redisson-spring-boot-starter/pom.xml index 8d453ff4b..2e27bf3fa 100644 --- a/redisson-spring-boot-starter/pom.xml +++ b/redisson-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/pom.xml b/redisson-spring-data/pom.xml index 20056881a..7b2f4fe4f 100644 --- a/redisson-spring-data/pom.xml +++ b/redisson-spring-data/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-16/pom.xml b/redisson-spring-data/redisson-spring-data-16/pom.xml index ec7e161a4..aa0a7c55d 100644 --- a/redisson-spring-data/redisson-spring-data-16/pom.xml +++ b/redisson-spring-data/redisson-spring-data-16/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-17/pom.xml b/redisson-spring-data/redisson-spring-data-17/pom.xml index 45f4939a3..6a34694b2 100644 --- a/redisson-spring-data/redisson-spring-data-17/pom.xml +++ b/redisson-spring-data/redisson-spring-data-17/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-18/pom.xml b/redisson-spring-data/redisson-spring-data-18/pom.xml index 47a35315b..58ae82665 100644 --- a/redisson-spring-data/redisson-spring-data-18/pom.xml +++ b/redisson-spring-data/redisson-spring-data-18/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-20/pom.xml b/redisson-spring-data/redisson-spring-data-20/pom.xml index bb5550834..4f0c6d4a0 100644 --- a/redisson-spring-data/redisson-spring-data-20/pom.xml +++ b/redisson-spring-data/redisson-spring-data-20/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/pom.xml b/redisson-tomcat/pom.xml index 0a35b6b6f..ab0c99f10 100644 --- a/redisson-tomcat/pom.xml +++ b/redisson-tomcat/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-6/pom.xml b/redisson-tomcat/redisson-tomcat-6/pom.xml index 15bbd05af..67c1e9336 100644 --- a/redisson-tomcat/redisson-tomcat-6/pom.xml +++ b/redisson-tomcat/redisson-tomcat-6/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-7/pom.xml b/redisson-tomcat/redisson-tomcat-7/pom.xml index 54bf0d649..6a217b602 100644 --- a/redisson-tomcat/redisson-tomcat-7/pom.xml +++ b/redisson-tomcat/redisson-tomcat-7/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-8/pom.xml b/redisson-tomcat/redisson-tomcat-8/pom.xml index c06ce382f..1485398ed 100644 --- a/redisson-tomcat/redisson-tomcat-8/pom.xml +++ b/redisson-tomcat/redisson-tomcat-8/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-9/pom.xml b/redisson-tomcat/redisson-tomcat-9/pom.xml index a7855b76f..72dd6a4e4 100644 --- a/redisson-tomcat/redisson-tomcat-9/pom.xml +++ b/redisson-tomcat/redisson-tomcat-9/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> diff --git a/redisson/pom.xml b/redisson/pom.xml index 42b3db2c6..56fa79dc2 100644 --- a/redisson/pom.xml +++ b/redisson/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.12.6-SNAPSHOT</version> + <version>2.13</version> <relativePath>../</relativePath> </parent> From 787246b0b50f63f7421aa90efbc8426aaf1df34b Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Mon, 3 Sep 2018 14:22:45 +0300 Subject: [PATCH 02/15] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- redisson-all/pom.xml | 4 ++-- redisson-spring-boot-starter/pom.xml | 2 +- redisson-spring-data/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-16/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-17/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-18/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-20/pom.xml | 2 +- redisson-tomcat/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-6/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-7/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-8/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-9/pom.xml | 2 +- redisson/pom.xml | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 43270643b..854250363 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <packaging>pom</packaging> <name>Redisson</name> @@ -27,7 +27,7 @@ <url>scm:git:git@github.com:redisson/redisson.git</url> <connection>scm:git:git@github.com:redisson/redisson.git</connection> <developerConnection>scm:git:git@github.com:redisson/redisson.git</developerConnection> - <tag>redisson-2.13</tag> + <tag>HEAD</tag> </scm> <prerequisites> diff --git a/redisson-all/pom.xml b/redisson-all/pom.xml index 02f45181a..df4d0ac24 100644 --- a/redisson-all/pom.xml +++ b/redisson-all/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> @@ -26,7 +26,7 @@ <url>scm:git:git@github.com:mrniko/redisson.git</url> <connection>scm:git:git@github.com:mrniko/redisson.git</connection> <developerConnection>scm:git:git@github.com:mrniko/redisson.git</developerConnection> - <tag>redisson-2.13</tag> + <tag>redisson-parent-0.9.0</tag> </scm> <prerequisites> diff --git a/redisson-spring-boot-starter/pom.xml b/redisson-spring-boot-starter/pom.xml index 2e27bf3fa..1f29ca7ce 100644 --- a/redisson-spring-boot-starter/pom.xml +++ b/redisson-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/pom.xml b/redisson-spring-data/pom.xml index 7b2f4fe4f..6071b5fec 100644 --- a/redisson-spring-data/pom.xml +++ b/redisson-spring-data/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-16/pom.xml b/redisson-spring-data/redisson-spring-data-16/pom.xml index aa0a7c55d..d6406190a 100644 --- a/redisson-spring-data/redisson-spring-data-16/pom.xml +++ b/redisson-spring-data/redisson-spring-data-16/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-17/pom.xml b/redisson-spring-data/redisson-spring-data-17/pom.xml index 6a34694b2..69dc476e8 100644 --- a/redisson-spring-data/redisson-spring-data-17/pom.xml +++ b/redisson-spring-data/redisson-spring-data-17/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-18/pom.xml b/redisson-spring-data/redisson-spring-data-18/pom.xml index 58ae82665..21e1cf6a1 100644 --- a/redisson-spring-data/redisson-spring-data-18/pom.xml +++ b/redisson-spring-data/redisson-spring-data-18/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-20/pom.xml b/redisson-spring-data/redisson-spring-data-20/pom.xml index 4f0c6d4a0..9764a1de7 100644 --- a/redisson-spring-data/redisson-spring-data-20/pom.xml +++ b/redisson-spring-data/redisson-spring-data-20/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/pom.xml b/redisson-tomcat/pom.xml index ab0c99f10..2e185815d 100644 --- a/redisson-tomcat/pom.xml +++ b/redisson-tomcat/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-6/pom.xml b/redisson-tomcat/redisson-tomcat-6/pom.xml index 67c1e9336..69b79ed31 100644 --- a/redisson-tomcat/redisson-tomcat-6/pom.xml +++ b/redisson-tomcat/redisson-tomcat-6/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-7/pom.xml b/redisson-tomcat/redisson-tomcat-7/pom.xml index 6a217b602..2e32e70fa 100644 --- a/redisson-tomcat/redisson-tomcat-7/pom.xml +++ b/redisson-tomcat/redisson-tomcat-7/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-8/pom.xml b/redisson-tomcat/redisson-tomcat-8/pom.xml index 1485398ed..aebf236ac 100644 --- a/redisson-tomcat/redisson-tomcat-8/pom.xml +++ b/redisson-tomcat/redisson-tomcat-8/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-9/pom.xml b/redisson-tomcat/redisson-tomcat-9/pom.xml index 72dd6a4e4..9b83ec285 100644 --- a/redisson-tomcat/redisson-tomcat-9/pom.xml +++ b/redisson-tomcat/redisson-tomcat-9/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson/pom.xml b/redisson/pom.xml index 56fa79dc2..7b9698c04 100644 --- a/redisson/pom.xml +++ b/redisson/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13</version> + <version>2.14-SNAPSHOT</version> <relativePath>../</relativePath> </parent> From ca47b2baeb6ad1170924ff80610812a5dc8f8111 Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Mon, 3 Sep 2018 16:27:03 +0300 Subject: [PATCH 03/15] poms fixed --- pom.xml | 3 +-- redisson-all/pom.xml | 33 +++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 854250363..e2684975f 100644 --- a/pom.xml +++ b/pom.xml @@ -144,7 +144,7 @@ <testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory> <sourceDirectory>${basedir}/src/main/java</sourceDirectory> <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory> - <pluginManagement> + <plugins> <plugin> @@ -216,7 +216,6 @@ </configuration> </plugin> </plugins> - </pluginManagement> </build> </project> diff --git a/redisson-all/pom.xml b/redisson-all/pom.xml index df4d0ac24..5e5732c9a 100644 --- a/redisson-all/pom.xml +++ b/redisson-all/pom.xml @@ -171,7 +171,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> - <version>3.0.2</version> + <version>3.1.0</version> <configuration> <archive> <index>true</index> @@ -206,21 +206,22 @@ </plugin> <plugin> - <artifactId>maven-javadoc-plugin</artifactId> - <executions> - <execution> - <id>attach-javadocs</id> - <goals> - <goal>jar</goal> - </goals> - </execution> - </executions> - <configuration> - <includeDependencySources>true</includeDependencySources> - <dependencySourceIncludes> - <dependencySourceInclude>org.redisson:*,org.springframework.transaction:*</dependencySourceInclude> - </dependencySourceIncludes> - </configuration> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.1.0</version> + <executions> + <execution> + <id>empty-javadoc-jar</id> + <phase>package</phase> + <goals> + <goal>jar</goal> + </goals> + <configuration> + <classifier>javadoc</classifier> + <classesDirectory>${basedir}/javadoc</classesDirectory> + </configuration> + </execution> + </executions> </plugin> </plugins> From 98c601fc1d444b37ea97626dd5e57de129ebc48f Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Mon, 3 Sep 2018 16:28:14 +0300 Subject: [PATCH 04/15] version fixed --- pom.xml | 2 +- redisson-all/pom.xml | 2 +- redisson-spring-boot-starter/pom.xml | 2 +- redisson-spring-data/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-16/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-17/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-18/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-20/pom.xml | 2 +- redisson-tomcat/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-6/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-7/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-8/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-9/pom.xml | 2 +- redisson/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index e2684975f..0cc648a8b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <packaging>pom</packaging> <name>Redisson</name> diff --git a/redisson-all/pom.xml b/redisson-all/pom.xml index 5e5732c9a..d3ab443b7 100644 --- a/redisson-all/pom.xml +++ b/redisson-all/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-boot-starter/pom.xml b/redisson-spring-boot-starter/pom.xml index 1f29ca7ce..14fee1f75 100644 --- a/redisson-spring-boot-starter/pom.xml +++ b/redisson-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/pom.xml b/redisson-spring-data/pom.xml index 6071b5fec..49d4fa38a 100644 --- a/redisson-spring-data/pom.xml +++ b/redisson-spring-data/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-16/pom.xml b/redisson-spring-data/redisson-spring-data-16/pom.xml index d6406190a..3ef9251a3 100644 --- a/redisson-spring-data/redisson-spring-data-16/pom.xml +++ b/redisson-spring-data/redisson-spring-data-16/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-17/pom.xml b/redisson-spring-data/redisson-spring-data-17/pom.xml index 69dc476e8..f446c1fa4 100644 --- a/redisson-spring-data/redisson-spring-data-17/pom.xml +++ b/redisson-spring-data/redisson-spring-data-17/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-18/pom.xml b/redisson-spring-data/redisson-spring-data-18/pom.xml index 21e1cf6a1..3db6e879a 100644 --- a/redisson-spring-data/redisson-spring-data-18/pom.xml +++ b/redisson-spring-data/redisson-spring-data-18/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-20/pom.xml b/redisson-spring-data/redisson-spring-data-20/pom.xml index 9764a1de7..adf762f13 100644 --- a/redisson-spring-data/redisson-spring-data-20/pom.xml +++ b/redisson-spring-data/redisson-spring-data-20/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/pom.xml b/redisson-tomcat/pom.xml index 2e185815d..e6ce803c9 100644 --- a/redisson-tomcat/pom.xml +++ b/redisson-tomcat/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-6/pom.xml b/redisson-tomcat/redisson-tomcat-6/pom.xml index 69b79ed31..78ae126ab 100644 --- a/redisson-tomcat/redisson-tomcat-6/pom.xml +++ b/redisson-tomcat/redisson-tomcat-6/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-7/pom.xml b/redisson-tomcat/redisson-tomcat-7/pom.xml index 2e32e70fa..854097b8b 100644 --- a/redisson-tomcat/redisson-tomcat-7/pom.xml +++ b/redisson-tomcat/redisson-tomcat-7/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-8/pom.xml b/redisson-tomcat/redisson-tomcat-8/pom.xml index aebf236ac..68ba856c2 100644 --- a/redisson-tomcat/redisson-tomcat-8/pom.xml +++ b/redisson-tomcat/redisson-tomcat-8/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-9/pom.xml b/redisson-tomcat/redisson-tomcat-9/pom.xml index 9b83ec285..c354d2bbc 100644 --- a/redisson-tomcat/redisson-tomcat-9/pom.xml +++ b/redisson-tomcat/redisson-tomcat-9/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson/pom.xml b/redisson/pom.xml index 7b9698c04..4ae21f479 100644 --- a/redisson/pom.xml +++ b/redisson/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.14-SNAPSHOT</version> + <version>2.13.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> From 3a28b43bcf8c030c318db9d1ddfaef057d97a616 Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Mon, 3 Sep 2018 16:34:50 +0300 Subject: [PATCH 05/15] [maven-release-plugin] prepare release redisson-2.13.0 --- pom.xml | 4 ++-- redisson-all/pom.xml | 4 ++-- redisson-spring-boot-starter/pom.xml | 2 +- redisson-spring-data/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-16/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-17/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-18/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-20/pom.xml | 2 +- redisson-tomcat/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-6/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-7/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-8/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-9/pom.xml | 2 +- redisson/pom.xml | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 0cc648a8b..1b4cb611e 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <packaging>pom</packaging> <name>Redisson</name> @@ -27,7 +27,7 @@ <url>scm:git:git@github.com:redisson/redisson.git</url> <connection>scm:git:git@github.com:redisson/redisson.git</connection> <developerConnection>scm:git:git@github.com:redisson/redisson.git</developerConnection> - <tag>HEAD</tag> + <tag>redisson-2.13.0</tag> </scm> <prerequisites> diff --git a/redisson-all/pom.xml b/redisson-all/pom.xml index d3ab443b7..15f09d933 100644 --- a/redisson-all/pom.xml +++ b/redisson-all/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> @@ -26,7 +26,7 @@ <url>scm:git:git@github.com:mrniko/redisson.git</url> <connection>scm:git:git@github.com:mrniko/redisson.git</connection> <developerConnection>scm:git:git@github.com:mrniko/redisson.git</developerConnection> - <tag>redisson-parent-0.9.0</tag> + <tag>redisson-2.13.0</tag> </scm> <prerequisites> diff --git a/redisson-spring-boot-starter/pom.xml b/redisson-spring-boot-starter/pom.xml index 14fee1f75..70e6fb47b 100644 --- a/redisson-spring-boot-starter/pom.xml +++ b/redisson-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/pom.xml b/redisson-spring-data/pom.xml index 49d4fa38a..49b8c64dd 100644 --- a/redisson-spring-data/pom.xml +++ b/redisson-spring-data/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-16/pom.xml b/redisson-spring-data/redisson-spring-data-16/pom.xml index 3ef9251a3..91fc37d4f 100644 --- a/redisson-spring-data/redisson-spring-data-16/pom.xml +++ b/redisson-spring-data/redisson-spring-data-16/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-17/pom.xml b/redisson-spring-data/redisson-spring-data-17/pom.xml index f446c1fa4..c045ec890 100644 --- a/redisson-spring-data/redisson-spring-data-17/pom.xml +++ b/redisson-spring-data/redisson-spring-data-17/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-18/pom.xml b/redisson-spring-data/redisson-spring-data-18/pom.xml index 3db6e879a..abf1fd9e3 100644 --- a/redisson-spring-data/redisson-spring-data-18/pom.xml +++ b/redisson-spring-data/redisson-spring-data-18/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-20/pom.xml b/redisson-spring-data/redisson-spring-data-20/pom.xml index adf762f13..a3410adc4 100644 --- a/redisson-spring-data/redisson-spring-data-20/pom.xml +++ b/redisson-spring-data/redisson-spring-data-20/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/pom.xml b/redisson-tomcat/pom.xml index e6ce803c9..af00b7bb3 100644 --- a/redisson-tomcat/pom.xml +++ b/redisson-tomcat/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-6/pom.xml b/redisson-tomcat/redisson-tomcat-6/pom.xml index 78ae126ab..ff6c8660d 100644 --- a/redisson-tomcat/redisson-tomcat-6/pom.xml +++ b/redisson-tomcat/redisson-tomcat-6/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-7/pom.xml b/redisson-tomcat/redisson-tomcat-7/pom.xml index 854097b8b..7b10bf84b 100644 --- a/redisson-tomcat/redisson-tomcat-7/pom.xml +++ b/redisson-tomcat/redisson-tomcat-7/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-8/pom.xml b/redisson-tomcat/redisson-tomcat-8/pom.xml index 68ba856c2..8c55d9bd4 100644 --- a/redisson-tomcat/redisson-tomcat-8/pom.xml +++ b/redisson-tomcat/redisson-tomcat-8/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-9/pom.xml b/redisson-tomcat/redisson-tomcat-9/pom.xml index c354d2bbc..f5d0bd07b 100644 --- a/redisson-tomcat/redisson-tomcat-9/pom.xml +++ b/redisson-tomcat/redisson-tomcat-9/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> diff --git a/redisson/pom.xml b/redisson/pom.xml index 4ae21f479..abfa3f182 100644 --- a/redisson/pom.xml +++ b/redisson/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0-SNAPSHOT</version> + <version>2.13.0</version> <relativePath>../</relativePath> </parent> From f65b54404ace6793beef1a388c18eef58131d26c Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Mon, 3 Sep 2018 16:35:01 +0300 Subject: [PATCH 06/15] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- redisson-all/pom.xml | 4 ++-- redisson-spring-boot-starter/pom.xml | 2 +- redisson-spring-data/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-16/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-17/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-18/pom.xml | 2 +- redisson-spring-data/redisson-spring-data-20/pom.xml | 2 +- redisson-tomcat/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-6/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-7/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-8/pom.xml | 2 +- redisson-tomcat/redisson-tomcat-9/pom.xml | 2 +- redisson/pom.xml | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 1b4cb611e..8bea59488 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <packaging>pom</packaging> <name>Redisson</name> @@ -27,7 +27,7 @@ <url>scm:git:git@github.com:redisson/redisson.git</url> <connection>scm:git:git@github.com:redisson/redisson.git</connection> <developerConnection>scm:git:git@github.com:redisson/redisson.git</developerConnection> - <tag>redisson-2.13.0</tag> + <tag>HEAD</tag> </scm> <prerequisites> diff --git a/redisson-all/pom.xml b/redisson-all/pom.xml index 15f09d933..444ef8f5a 100644 --- a/redisson-all/pom.xml +++ b/redisson-all/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> @@ -26,7 +26,7 @@ <url>scm:git:git@github.com:mrniko/redisson.git</url> <connection>scm:git:git@github.com:mrniko/redisson.git</connection> <developerConnection>scm:git:git@github.com:mrniko/redisson.git</developerConnection> - <tag>redisson-2.13.0</tag> + <tag>redisson-parent-0.9.0</tag> </scm> <prerequisites> diff --git a/redisson-spring-boot-starter/pom.xml b/redisson-spring-boot-starter/pom.xml index 70e6fb47b..44ced02de 100644 --- a/redisson-spring-boot-starter/pom.xml +++ b/redisson-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/pom.xml b/redisson-spring-data/pom.xml index 49b8c64dd..b37ec3bca 100644 --- a/redisson-spring-data/pom.xml +++ b/redisson-spring-data/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-16/pom.xml b/redisson-spring-data/redisson-spring-data-16/pom.xml index 91fc37d4f..e879fefbf 100644 --- a/redisson-spring-data/redisson-spring-data-16/pom.xml +++ b/redisson-spring-data/redisson-spring-data-16/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-17/pom.xml b/redisson-spring-data/redisson-spring-data-17/pom.xml index c045ec890..f0d3130d6 100644 --- a/redisson-spring-data/redisson-spring-data-17/pom.xml +++ b/redisson-spring-data/redisson-spring-data-17/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-18/pom.xml b/redisson-spring-data/redisson-spring-data-18/pom.xml index abf1fd9e3..074968db2 100644 --- a/redisson-spring-data/redisson-spring-data-18/pom.xml +++ b/redisson-spring-data/redisson-spring-data-18/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-spring-data/redisson-spring-data-20/pom.xml b/redisson-spring-data/redisson-spring-data-20/pom.xml index a3410adc4..954df8e1c 100644 --- a/redisson-spring-data/redisson-spring-data-20/pom.xml +++ b/redisson-spring-data/redisson-spring-data-20/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-spring-data</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/pom.xml b/redisson-tomcat/pom.xml index af00b7bb3..b8c151ab3 100644 --- a/redisson-tomcat/pom.xml +++ b/redisson-tomcat/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-6/pom.xml b/redisson-tomcat/redisson-tomcat-6/pom.xml index ff6c8660d..3814aa92d 100644 --- a/redisson-tomcat/redisson-tomcat-6/pom.xml +++ b/redisson-tomcat/redisson-tomcat-6/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-7/pom.xml b/redisson-tomcat/redisson-tomcat-7/pom.xml index 7b10bf84b..c0179527a 100644 --- a/redisson-tomcat/redisson-tomcat-7/pom.xml +++ b/redisson-tomcat/redisson-tomcat-7/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-8/pom.xml b/redisson-tomcat/redisson-tomcat-8/pom.xml index 8c55d9bd4..fdad09e92 100644 --- a/redisson-tomcat/redisson-tomcat-8/pom.xml +++ b/redisson-tomcat/redisson-tomcat-8/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson-tomcat/redisson-tomcat-9/pom.xml b/redisson-tomcat/redisson-tomcat-9/pom.xml index f5d0bd07b..9e7bf4809 100644 --- a/redisson-tomcat/redisson-tomcat-9/pom.xml +++ b/redisson-tomcat/redisson-tomcat-9/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-tomcat</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> diff --git a/redisson/pom.xml b/redisson/pom.xml index abfa3f182..2d4a0d31b 100644 --- a/redisson/pom.xml +++ b/redisson/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>org.redisson</groupId> <artifactId>redisson-parent</artifactId> - <version>2.13.0</version> + <version>2.13.1-SNAPSHOT</version> <relativePath>../</relativePath> </parent> From 7b4641c5e155255457a05eb1575c3c904a2bb01d Mon Sep 17 00:00:00 2001 From: Nikita Koksharov <mrniko@users.noreply.github.com> Date: Mon, 3 Sep 2018 18:44:57 +0300 Subject: [PATCH 07/15] Update README.md --- redisson-spring-boot-starter/README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/redisson-spring-boot-starter/README.md b/redisson-spring-boot-starter/README.md index b5e06006f..222ff9673 100644 --- a/redisson-spring-boot-starter/README.md +++ b/redisson-spring-boot-starter/README.md @@ -42,5 +42,24 @@ Usage compile 'org.redisson:redisson-spring-boot-starter:2.13.0' ``` +### 2. Add settings into `application.settings` file -### 2. Get access to Redisson through spring bean with `RedissonClient` interface +```properties +# common spring boot settings + +spring.redis.database= +spring.redis.host= +spring.redis.port= +spring.redis.password= +spring.redis.ssl= +spring.redis.timeout= +spring.redis.cluster.nodes= +spring.redis.sentinel.master= +spring.redis.sentinel.nodes= + +# Redisson settings + +spring.redis.redisson.config=classpath:redisson.yaml +``` + +### 3. Get access to Redisson through spring bean with `RedissonClient` interface From cdfe8fe10d86cc378676024ce981d392745a9cd2 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov <mrniko@users.noreply.github.com> Date: Mon, 3 Sep 2018 18:54:52 +0300 Subject: [PATCH 08/15] Update README.md --- README.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index fe96f9517..45ccd438e 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Based on high-performance async and lock-free Java Redis client and [Netty](http | Stable <br/> Release Version | Release Date | JDK Version<br/> compatibility | `CompletionStage` <br/> support | `ProjectReactor` version<br/> compatibility | | ------------- | ------------- | ------------| -----------| -----------| -| 3.7.5 | 19.07.2018 | 1.8, 1.9, 1.10+ | Yes | 3.1.x | -| 2.12.5 | 19.07.2018 | 1.6, 1.7, 1.8, 1.9, 1.10, Android | No | 2.0.8 | +| 3.8.0 | 03.09.2018 | 1.8, 1.9, 1.10+ | Yes | 3.1.x | +| 2.13.0 | 03.09.2018 | 1.6, 1.7, 1.8, 1.9, 1.10, Android | No | 2.0.8 | Features @@ -40,6 +40,8 @@ Features * [Spring Framework](https://github.com/redisson/redisson/wiki/14.-Integration%20with%20frameworks#141-spring-framework) * [Spring Cache](https://github.com/redisson/redisson/wiki/14.-Integration%20with%20frameworks/#142-spring-cache) implementation * [Spring Transaction API](https://github.com/redisson/redisson/wiki/14.-Integration-with-frameworks/#147-spring-transaction-manager) implementation +* [Spring Data Redis](https://github.com/redisson/redisson/wiki/14.-Integration-with-frameworks/#148-spring-data-redis) integration +* [Spring Boot Starter](https://github.com/redisson/redisson/wiki/14.-Integration-with-frameworks/#149-spring-boot-starter) implementation * [Hibernate Cache](https://github.com/redisson/redisson/wiki/14.-Integration%20with%20frameworks/#143-hibernate-cache) implementation * [Transactions API](https://github.com/redisson/redisson/wiki/10.-Additional-features#104-transactions) * [XA Transaction API](https://github.com/redisson/redisson/wiki/10.-additional-features/#105-xa-transactions) implementation @@ -106,23 +108,23 @@ Quick start <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> - <version>3.7.5</version> + <version>3.8.0</version> </dependency> <!-- JDK 1.6+ compatible --> <dependency> <groupId>org.redisson</groupId> <artifactId>redisson</artifactId> - <version>2.12.5</version> + <version>2.13.0</version> </dependency> #### Gradle // JDK 1.8+ compatible - compile 'org.redisson:redisson:3.7.5' + compile 'org.redisson:redisson:3.8.0' // JDK 1.6+ compatible - compile 'org.redisson:redisson:2.12.5' + compile 'org.redisson:redisson:2.13.0' #### Java @@ -147,11 +149,11 @@ RExecutorService executor = redisson.getExecutorService("myExecutorService"); Downloads =============================== -[Redisson 3.7.5](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson&v=3.7.5&e=jar), -[Redisson node 3.7.5](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.7.5&e=jar) +[Redisson 3.8.0](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson&v=3.8.0&e=jar), +[Redisson node 3.8.0](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.8.0&e=jar) -[Redisson 2.12.5](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson&v=2.12.5&e=jar), -[Redisson node 2.12.5](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=2.12.5&e=jar) +[Redisson 2.13.0](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson&v=2.13.0&e=jar), +[Redisson node 2.13.0](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=2.13.0&e=jar) FAQs =============================== From bd7d85490c99348c41f3f80837fb7522b5735fb2 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov <mrniko@users.noreply.github.com> Date: Mon, 3 Sep 2018 19:11:51 +0300 Subject: [PATCH 09/15] Update CHANGELOG.md --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 990c96b79..178632e12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,24 @@ Redisson Releases History Try __[Redisson PRO](https://redisson.pro)__ version. +### 03-Sep-2018 - versions 2.13.0 and 3.8.0 released +Feature - Spring Data Redis integration. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-spring-data#spring-data-redis-integration) for more details +Feature - Spring Boot Starter implementation. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter#spring-boot-starter) for more details +Feature - `RBlockingDequeReactive` object added +Improvement - Redis request/response handling performance improvement +Improvement - CompositeIterator decoupled from CompositeIterable (thanks to Pepe-Lu) +Fixed - task scheduled with time more than 1 hour is not executed +Fixed - RScheduledExecutorService doesn't handle delayed tasks correctly +Fixed - `RMapCache` and `RSetCache` objects should implement `RDestroyable` +Fixed - `RBucket.set` method with ttl throws NPE if value is null +Fixed - false HashedWheelTimer resource leak message +Fixed - `RExecutorService` task execution performance regression +Fixed - locking in multiple parallel transactions created with the same thread +Fixed - `JCache.removeAll` doesn't work +Fixed - Batch in `ExecutionMode.REDIS_WRITE_ATOMIC` and `ExecutionMode.REDIS_READ_ATOMIC` returns `QUEUED` instead of real result +Fixed - tasks scheduled with cron expression don't work in different timezones (thanks to Arpit Agrawal) +Fixed - global config codec is not registered in codec cache for reference objects (thanks to Rui Gu) + ### 19-Jul-2018 - versions 2.12.5 and 3.7.5 released Feature - `RScoredSortedSetReactive`, `RSetReactive`, `RListReactive` objects implement `RSortableReactive` interface Feature - `RGeoReactive` object added From ee1c91b4c1a6be97519b4d61ae7858dbd7a2336f Mon Sep 17 00:00:00 2001 From: Nikita Koksharov <mrniko@users.noreply.github.com> Date: Tue, 4 Sep 2018 15:47:21 +0300 Subject: [PATCH 10/15] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 178632e12..db2a7e5fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Try __[Redisson PRO](https://redisson.pro)__ version. Feature - Spring Data Redis integration. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-spring-data#spring-data-redis-integration) for more details Feature - Spring Boot Starter implementation. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter#spring-boot-starter) for more details Feature - `RBlockingDequeReactive` object added +Feature - `sharedSession` setting for Tomcat Session Manager. Appropriate solution for migration of EAR based application with multiple WARs hosted previously on JBoss, WebLogic. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-tomcat) for more details Improvement - Redis request/response handling performance improvement Improvement - CompositeIterator decoupled from CompositeIterable (thanks to Pepe-Lu) Fixed - task scheduled with time more than 1 hour is not executed From d8c8ba54fe1ef82a4fc93081e042da77544a6aa0 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov <mrniko@users.noreply.github.com> Date: Tue, 4 Sep 2018 15:48:01 +0300 Subject: [PATCH 11/15] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db2a7e5fa..d07f22555 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ Fixed - `RExecutorService` task execution performance regression Fixed - locking in multiple parallel transactions created with the same thread Fixed - `JCache.removeAll` doesn't work Fixed - Batch in `ExecutionMode.REDIS_WRITE_ATOMIC` and `ExecutionMode.REDIS_READ_ATOMIC` returns `QUEUED` instead of real result -Fixed - tasks scheduled with cron expression don't work in different timezones (thanks to Arpit Agrawal) +Fixed - tasks scheduled with cron expression don't work in different timezones (thanks to Arpit Agrawal) Fixed - global config codec is not registered in codec cache for reference objects (thanks to Rui Gu) ### 19-Jul-2018 - versions 2.12.5 and 3.7.5 released From 61438568176f3d1401cbbc0b6a6fa52ec017c3ac Mon Sep 17 00:00:00 2001 From: Nikita Koksharov <mrniko@users.noreply.github.com> Date: Tue, 4 Sep 2018 16:12:28 +0300 Subject: [PATCH 12/15] Update README.md --- redisson-spring-boot-starter/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/redisson-spring-boot-starter/README.md b/redisson-spring-boot-starter/README.md index 222ff9673..79c06b4b0 100644 --- a/redisson-spring-boot-starter/README.md +++ b/redisson-spring-boot-starter/README.md @@ -59,6 +59,7 @@ spring.redis.sentinel.nodes= # Redisson settings +#path to redisson.yaml or redisson.json spring.redis.redisson.config=classpath:redisson.yaml ``` From 635607af43ea2f81eccb07cc4dfed51881a7be24 Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Wed, 5 Sep 2018 12:27:25 +0300 Subject: [PATCH 13/15] Avoid to create connection per RRemoteService/RScheduledExecutorService worker #1623 --- .../org/redisson/RedissonRemoteService.java | 105 ++++++++++++------ .../executor/RedissonExecutorServiceTest.java | 2 +- 2 files changed, 71 insertions(+), 36 deletions(-) diff --git a/redisson/src/main/java/org/redisson/RedissonRemoteService.java b/redisson/src/main/java/org/redisson/RedissonRemoteService.java index 391a470ec..36afbdd1e 100644 --- a/redisson/src/main/java/org/redisson/RedissonRemoteService.java +++ b/redisson/src/main/java/org/redisson/RedissonRemoteService.java @@ -17,12 +17,11 @@ package org.redisson; import java.lang.reflect.Method; import java.util.Arrays; -import java.util.Collections; import java.util.Map; -import java.util.Set; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import org.redisson.api.RBlockingQueue; @@ -65,10 +64,33 @@ import io.netty.util.internal.PlatformDependent; */ public class RedissonRemoteService extends BaseRemoteService implements RRemoteService { + public static class Entry { + + RFuture<String> future; + final AtomicInteger counter; + + public Entry(int workers) { + counter = new AtomicInteger(workers); + } + + public void setFuture(RFuture<String> future) { + this.future = future; + } + + public RFuture<String> getFuture() { + return future; + } + + public AtomicInteger getCounter() { + return counter; + } + + } + private static final Logger log = LoggerFactory.getLogger(RedissonRemoteService.class); private final Map<RemoteServiceKey, RemoteServiceMethod> beans = PlatformDependent.newConcurrentHashMap(); - private final Map<Class<?>, Set<RFuture<String>>> futures = PlatformDependent.newConcurrentHashMap(); + private final Map<Class<?>, Entry> remoteMap = PlatformDependent.newConcurrentHashMap(); public RedissonRemoteService(Codec codec, RedissonClient redisson, String name, CommandExecutor commandExecutor, String executorId, ConcurrentMap<String, ResponseEntry> responses) { super(codec, redisson, name, commandExecutor, executorId, responses); @@ -110,20 +132,19 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS beans.remove(key); } - Set<RFuture<String>> removedFutures = futures.remove(remoteInterface); - if (removedFutures == null) { - return; - } - - for (RFuture<String> future : removedFutures) { - future.cancel(false); + Entry entry = remoteMap.remove(remoteInterface); + if (entry != null && entry.getFuture() != null) { + entry.getFuture().cancel(false); } } @Override public int getFreeWorkers(Class<?> remoteInterface) { - Set<RFuture<String>> futuresSet = futures.get(remoteInterface); - return futuresSet.size(); + Entry entry = remoteMap.remove(remoteInterface); + if (entry == null) { + return 0; + } + return entry.getCounter().get(); } @Override @@ -144,32 +165,28 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS } } - Set<RFuture<String>> values = Collections.newSetFromMap(PlatformDependent.<RFuture<String>, Boolean>newConcurrentHashMap()); - futures.put(remoteInterface, values); + remoteMap.put(remoteInterface, new Entry(workers)); String requestQueueName = getRequestQueueName(remoteInterface); RBlockingQueue<String> requestQueue = redisson.getBlockingQueue(requestQueueName, StringCodec.INSTANCE); - for (int i = 0; i < workers; i++) { - subscribe(remoteInterface, requestQueue, executor); - } + subscribe(remoteInterface, requestQueue, executor); } private <T> void subscribe(final Class<T> remoteInterface, final RBlockingQueue<String> requestQueue, final ExecutorService executor) { - Set<RFuture<String>> futuresSet = futures.get(remoteInterface); - if (futuresSet == null) { + final Entry entry = remoteMap.get(remoteInterface); + if (entry == null) { return; } final RFuture<String> take = requestQueue.takeAsync(); - futuresSet.add(take); + entry.setFuture(take); take.addListener(new FutureListener<String>() { @Override - public void operationComplete(Future<String> future) throws Exception { - Set<RFuture<String>> futuresSet = futures.get(remoteInterface); - if (futuresSet == null) { + public void operationComplete(Future<String> future) throws Exception { + Entry entry = remoteMap.get(remoteInterface); + if (entry == null) { return; } - futuresSet.remove(take); if (!future.isSuccess()) { if (future.cause() instanceof RedissonShutdownException) { @@ -184,6 +201,14 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS // do not subscribe now, see // https://github.com/mrniko/redisson/issues/493 // subscribe(remoteInterface, requestQueue); + + if (entry.getCounter().get() == 0) { + return; + } + + if (entry.getCounter().decrementAndGet() > 0) { + subscribe(remoteInterface, requestQueue, executor); + } final String requestId = future.getNow(); RMap<String, RemoteServiceRequest> tasks = redisson.getMap(requestQueue.getName() + ":tasks", new CompositeCodec(StringCodec.INSTANCE, codec, codec)); @@ -197,16 +222,18 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS return; } log.error("Can't process the remote service request with id " + requestId, future.cause()); + // re-subscribe after a failed takeAsync - subscribe(remoteInterface, requestQueue, executor); + resubscribe(remoteInterface, requestQueue, executor); return; } final RemoteServiceRequest request = future.getNow(); if (request == null) { log.debug("Task can't be found for request: {}", requestId); + // re-subscribe after a skipped ackTimeout - subscribe(remoteInterface, requestQueue, executor); + resubscribe(remoteInterface, requestQueue, executor); return; } @@ -215,8 +242,9 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS if (request.getOptions().isAckExpected() && elapsedTime > request .getOptions().getAckTimeoutInMillis()) { log.debug("request: {} has been skipped due to ackTimeout. Elapsed time: {}ms", request.getId(), elapsedTime); + // re-subscribe after a skipped ackTimeout - subscribe(remoteInterface, requestQueue, executor); + resubscribe(remoteInterface, requestQueue, executor); return; } @@ -247,13 +275,14 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS return; } log.error("Can't send ack for request: " + request, future.cause()); + // re-subscribe after a failed send (ack) - subscribe(remoteInterface, requestQueue, executor); + resubscribe(remoteInterface, requestQueue, executor); return; } if (!future.getNow()) { - subscribe(remoteInterface, requestQueue, executor); + resubscribe(remoteInterface, requestQueue, executor); return; } @@ -269,13 +298,14 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS return; } log.error("Can't send ack for request: " + request, future.cause()); + // re-subscribe after a failed send (ack) - subscribe(remoteInterface, requestQueue, executor); + resubscribe(remoteInterface, requestQueue, executor); return; } if (!future.getNow()) { - subscribe(remoteInterface, requestQueue, executor); + resubscribe(remoteInterface, requestQueue, executor); return; } @@ -374,7 +404,7 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS @Override public void operationComplete(Future<Void> future) throws Exception { // interface has been deregistered - if (futures.get(remoteInterface) == null) { + if (!remoteMap.containsKey(remoteInterface)) { return; } @@ -386,12 +416,17 @@ public class RedissonRemoteService extends BaseRemoteService implements RRemoteS future.cause()); } - // re-subscribe anyways (fail or success) after the send - // (response) - subscribe(remoteInterface, requestQueue, executor); + resubscribe(remoteInterface, requestQueue, executor); } }); } else { + resubscribe(remoteInterface, requestQueue, executor); + } + } + + private <T> void resubscribe(Class<T> remoteInterface, RBlockingQueue<String> requestQueue, + ExecutorService executor) { + if (remoteMap.get(remoteInterface).getCounter().getAndIncrement() == 0) { // re-subscribe anyways after the method invocation subscribe(remoteInterface, requestQueue, executor); } diff --git a/redisson/src/test/java/org/redisson/executor/RedissonExecutorServiceTest.java b/redisson/src/test/java/org/redisson/executor/RedissonExecutorServiceTest.java index 61f685dcf..fbe9d254b 100644 --- a/redisson/src/test/java/org/redisson/executor/RedissonExecutorServiceTest.java +++ b/redisson/src/test/java/org/redisson/executor/RedissonExecutorServiceTest.java @@ -299,7 +299,7 @@ public class RedissonExecutorServiceTest extends BaseTest { e.execute(new RunnableTask()); } e.shutdown(); - assertThat(e.awaitTermination(1000, TimeUnit.MILLISECONDS)).isTrue(); + assertThat(e.awaitTermination(1500, TimeUnit.MILLISECONDS)).isTrue(); } @Test From 7ed8fa6db9ddc753136c21f1c0ebf54d9655dbd9 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov <mrniko@users.noreply.github.com> Date: Wed, 5 Sep 2018 13:04:34 +0300 Subject: [PATCH 14/15] Update CHANGELOG.md --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d07f22555..4829c7ca9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,10 @@ Redisson Releases History Try __[Redisson PRO](https://redisson.pro)__ version. ### 03-Sep-2018 - versions 2.13.0 and 3.8.0 released -Feature - Spring Data Redis integration. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-spring-data#spring-data-redis-integration) for more details -Feature - Spring Boot Starter implementation. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter#spring-boot-starter) for more details +Feature - __Spring Data Redis__ integration. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-spring-data#spring-data-redis-integration) for more details +Feature - __Spring Boot Starter__ implementation. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter#spring-boot-starter) for more details Feature - `RBlockingDequeReactive` object added -Feature - `sharedSession` setting for Tomcat Session Manager. Appropriate solution for migration of EAR based application with multiple WARs hosted previously on JBoss, WebLogic. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-tomcat) for more details +Feature - `sharedSession` setting for Tomcat Session Manager. Appropriate solution for migration of EAR based application with multiple WARs hosted previously on WebLogic or other servers. Please refer to [documentation](https://github.com/redisson/redisson/tree/master/redisson-tomcat) for more details Improvement - Redis request/response handling performance improvement Improvement - CompositeIterator decoupled from CompositeIterable (thanks to Pepe-Lu) Fixed - task scheduled with time more than 1 hour is not executed From f529d30e5ddc2e6aa8267328055cc83d7bde02fc Mon Sep 17 00:00:00 2001 From: Nikita <abracham.mitchell@gmail.com> Date: Wed, 5 Sep 2018 18:10:00 +0300 Subject: [PATCH 15/15] Fixed compilation using JDK 10 --- pom.xml | 2 + .../org/redisson/RedissonDoubleAdder.java | 15 +- .../java/org/redisson/RedissonLongAdder.java | 11 +- .../redisson/cache/LocalCacheListener.java | 5 +- .../client/protocol/RedisCommands.java | 4 +- .../java/org/redisson/misc/DoubleAdder.java | 215 ----------- .../java/org/redisson/misc/LongAdder.java | 216 ----------- .../java/org/redisson/misc/Striped64.java | 348 ------------------ 8 files changed, 19 insertions(+), 797 deletions(-) delete mode 100644 redisson/src/main/java/org/redisson/misc/DoubleAdder.java delete mode 100644 redisson/src/main/java/org/redisson/misc/LongAdder.java delete mode 100644 redisson/src/main/java/org/redisson/misc/Striped64.java diff --git a/pom.xml b/pom.xml index 8bea59488..354f1f516 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ <maven.test.skip>true</maven.test.skip> <source.version>1.6</source.version> <test.source.version>1.8</test.source.version> + <release.version>7</release.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> @@ -178,6 +179,7 @@ <configuration> <source>${source.version}</source> <target>${source.version}</target> + <release>${release.version}</release> <optimize>true</optimize> <showDeprecations>true</showDeprecations> </configuration> diff --git a/redisson/src/main/java/org/redisson/RedissonDoubleAdder.java b/redisson/src/main/java/org/redisson/RedissonDoubleAdder.java index 54e22e6bf..4ef7750fd 100644 --- a/redisson/src/main/java/org/redisson/RedissonDoubleAdder.java +++ b/redisson/src/main/java/org/redisson/RedissonDoubleAdder.java @@ -20,7 +20,6 @@ import org.redisson.api.RDoubleAdder; import org.redisson.api.RFuture; import org.redisson.api.RedissonClient; import org.redisson.command.CommandAsyncExecutor; -import org.redisson.misc.DoubleAdder; /** * @@ -29,7 +28,7 @@ import org.redisson.misc.DoubleAdder; */ public class RedissonDoubleAdder extends RedissonBaseAdder<Double> implements RDoubleAdder { - private final DoubleAdder counter = new DoubleAdder(); + private double counter; private final RAtomicDouble atomicDouble; public RedissonDoubleAdder(CommandAsyncExecutor connectionManager, String name, RedissonClient redisson) { @@ -39,13 +38,13 @@ public class RedissonDoubleAdder extends RedissonBaseAdder<Double> implements RD } @Override - protected void doReset() { - counter.reset(); + protected synchronized void doReset() { + counter = 0; } @Override - protected RFuture<Double> addAndGetAsync() { - return atomicDouble.getAndAddAsync(counter.sum()); + protected synchronized RFuture<Double> addAndGetAsync() { + return atomicDouble.getAndAddAsync(counter); } @Override @@ -54,8 +53,8 @@ public class RedissonDoubleAdder extends RedissonBaseAdder<Double> implements RD } @Override - public void add(double x) { - counter.add(x); + public synchronized void add(double x) { + counter += x; } @Override diff --git a/redisson/src/main/java/org/redisson/RedissonLongAdder.java b/redisson/src/main/java/org/redisson/RedissonLongAdder.java index 0d4a1c511..fd60d795e 100644 --- a/redisson/src/main/java/org/redisson/RedissonLongAdder.java +++ b/redisson/src/main/java/org/redisson/RedissonLongAdder.java @@ -15,12 +15,13 @@ */ package org.redisson; +import java.util.concurrent.atomic.AtomicLong; + import org.redisson.api.RAtomicLong; import org.redisson.api.RFuture; import org.redisson.api.RLongAdder; import org.redisson.api.RedissonClient; import org.redisson.command.CommandAsyncExecutor; -import org.redisson.misc.LongAdder; /** * @@ -30,7 +31,7 @@ import org.redisson.misc.LongAdder; public class RedissonLongAdder extends RedissonBaseAdder<Long> implements RLongAdder { private final RAtomicLong atomicLong; - private final LongAdder counter = new LongAdder(); + private final AtomicLong counter = new AtomicLong(); public RedissonLongAdder(CommandAsyncExecutor connectionManager, String name, RedissonClient redisson) { super(connectionManager, name, redisson); @@ -40,12 +41,12 @@ public class RedissonLongAdder extends RedissonBaseAdder<Long> implements RLongA @Override protected void doReset() { - counter.reset(); + counter.set(0); } @Override protected RFuture<Long> addAndGetAsync() { - return atomicLong.getAndAddAsync(counter.sum()); + return atomicLong.getAndAddAsync(counter.get()); } @Override @@ -55,7 +56,7 @@ public class RedissonLongAdder extends RedissonBaseAdder<Long> implements RLongA @Override public void add(long x) { - counter.add(x); + counter.addAndGet(x); } @Override diff --git a/redisson/src/main/java/org/redisson/cache/LocalCacheListener.java b/redisson/src/main/java/org/redisson/cache/LocalCacheListener.java index d9949c6a2..af0206c70 100644 --- a/redisson/src/main/java/org/redisson/cache/LocalCacheListener.java +++ b/redisson/src/main/java/org/redisson/cache/LocalCacheListener.java @@ -19,9 +19,9 @@ import java.io.IOException; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; -import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeUnit; import org.redisson.RedissonListMultimapCache; @@ -38,7 +38,6 @@ import org.redisson.api.RScoredSortedSet; import org.redisson.api.RTopic; import org.redisson.api.listener.BaseStatusListener; import org.redisson.api.listener.MessageListener; -import org.redisson.client.ChannelName; import org.redisson.client.codec.ByteArrayCodec; import org.redisson.client.codec.Codec; import org.redisson.command.CommandAsyncExecutor; @@ -64,7 +63,7 @@ public abstract class LocalCacheListener { public static final String DISABLED_KEYS_SUFFIX = "disabled-keys"; public static final String DISABLED_ACK_SUFFIX = ":topic"; - private Map<CacheKey, String> disabledKeys = new ConcurrentHashMap<CacheKey, String>(); + private ConcurrentMap<CacheKey, String> disabledKeys = new ConcurrentHashMap<CacheKey, String>(); private static final Logger log = LoggerFactory.getLogger(LocalCacheListener.class); diff --git a/redisson/src/main/java/org/redisson/client/protocol/RedisCommands.java b/redisson/src/main/java/org/redisson/client/protocol/RedisCommands.java index f06a39d3e..c83063fd5 100644 --- a/redisson/src/main/java/org/redisson/client/protocol/RedisCommands.java +++ b/redisson/src/main/java/org/redisson/client/protocol/RedisCommands.java @@ -45,6 +45,7 @@ import org.redisson.client.protocol.convertor.VoidReplayConvertor; import org.redisson.client.protocol.decoder.ClusterNodesDecoder; import org.redisson.client.protocol.decoder.ListFirstObjectDecoder; import org.redisson.client.protocol.decoder.ListMultiDecoder; +import org.redisson.client.protocol.decoder.ListObjectDecoder; import org.redisson.client.protocol.decoder.ListResultReplayDecoder; import org.redisson.client.protocol.decoder.ListScanResult; import org.redisson.client.protocol.decoder.ListScanResultReplayDecoder; @@ -58,7 +59,6 @@ import org.redisson.client.protocol.decoder.ObjectMapEntryReplayDecoder; import org.redisson.client.protocol.decoder.ObjectMapJoinDecoder; import org.redisson.client.protocol.decoder.ObjectMapReplayDecoder; import org.redisson.client.protocol.decoder.ObjectSetReplayDecoder; -import org.redisson.client.protocol.decoder.ListObjectDecoder; import org.redisson.client.protocol.decoder.ScoredSortedSetPolledObjectDecoder; import org.redisson.client.protocol.decoder.ScoredSortedSetReplayDecoder; import org.redisson.client.protocol.decoder.ScoredSortedSetScanDecoder; @@ -261,7 +261,7 @@ public interface RedisCommands { RedisStrictCommand<Void> AUTH = new RedisStrictCommand<Void>("AUTH", new VoidReplayConvertor()); RedisStrictCommand<Void> SELECT = new RedisStrictCommand<Void>("SELECT", new VoidReplayConvertor()); - RedisStrictCommand<Boolean> CLIENT_SETNAME = new RedisStrictCommand<Boolean>("CLIENT", "SETNAME", new BooleanReplayConvertor()); + RedisStrictCommand<Void> CLIENT_SETNAME = new RedisStrictCommand<Void>("CLIENT", "SETNAME", new VoidReplayConvertor()); RedisStrictCommand<String> CLIENT_GETNAME = new RedisStrictCommand<String>("CLIENT", "GETNAME", new StringDataDecoder()); RedisStrictCommand<Void> FLUSHDB = new RedisStrictCommand<Void>("FLUSHDB", new VoidReplayConvertor()); RedisStrictCommand<Void> FLUSHALL = new RedisStrictCommand<Void>("FLUSHALL", new VoidReplayConvertor()); diff --git a/redisson/src/main/java/org/redisson/misc/DoubleAdder.java b/redisson/src/main/java/org/redisson/misc/DoubleAdder.java deleted file mode 100644 index e795995ec..000000000 --- a/redisson/src/main/java/org/redisson/misc/DoubleAdder.java +++ /dev/null @@ -1,215 +0,0 @@ -/** - * Copyright 2018 Nikita Koksharov - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Written by Doug Lea with assistance from members of JCP JSR-166 - * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/publicdomain/zero/1.0/ - */ -package org.redisson.misc; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * One or more variables that together maintain an initially zero - * {@code double} sum. When updates (method {@link #add}) are - * contended across threads, the set of variables may grow dynamically - * to reduce contention. Method {@link #sum} (or, equivalently {@link - * #doubleValue}) returns the current total combined across the - * variables maintaining the sum. - * - * <p>This class extends {@link Number}, but does <em>not</em> define - * methods such as {@code equals}, {@code hashCode} and {@code - * compareTo} because instances are expected to be mutated, and so are - * not useful as collection keys. - * - * <p><em>jsr166e note: This class is targeted to be placed in - * java.util.concurrent.atomic.</em> - * - * @since 1.8 - * @author Doug Lea - */ -public class DoubleAdder extends Striped64 implements Serializable { - private static final long serialVersionUID = 7249069246863182397L; - - /** - * Update function. Note that we must use "long" for underlying - * representations, because there is no compareAndSet for double, - * due to the fact that the bitwise equals used in any CAS - * implementation is not the same as double-precision equals. - * However, we use CAS only to detect and alleviate contention, - * for which bitwise equals works best anyway. In principle, the - * long/double conversions used here should be essentially free on - * most platforms since they just re-interpret bits. - * - * Similar conversions are used in other methods. - */ - final long fn(long v, long x) { - return Double.doubleToRawLongBits - (Double.longBitsToDouble(v) + - Double.longBitsToDouble(x)); - } - - /** - * Creates a new adder with initial sum of zero. - */ - public DoubleAdder() { - } - - /** - * Adds the given value. - * - * @param x the value to add - */ - public void add(double x) { - Cell[] as; long b, v; int[] hc; Cell a; int n; - if ((as = cells) != null || - !casBase(b = base, - Double.doubleToRawLongBits - (Double.longBitsToDouble(b) + x))) { - boolean uncontended = true; - if ((hc = threadHashCode.get()) == null || - as == null || (n = as.length) < 1 || - (a = as[(n - 1) & hc[0]]) == null || - !(uncontended = a.cas(v = a.value, - Double.doubleToRawLongBits - (Double.longBitsToDouble(v) + x)))) - retryUpdate(Double.doubleToRawLongBits(x), hc, uncontended); - } - } - - /** - * Returns the current sum. The returned value is <em>NOT</em> an - * atomic snapshot; invocation in the absence of concurrent - * updates returns an accurate result, but concurrent updates that - * occur while the sum is being calculated might not be - * incorporated. Also, because floating-point arithmetic is not - * strictly associative, the returned result need not be identical - * to the value that would be obtained in a sequential series of - * updates to a single variable. - * - * @return the sum - */ - public double sum() { - Cell[] as = cells; - double sum = Double.longBitsToDouble(base); - if (as != null) { - int n = as.length; - for (int i = 0; i < n; ++i) { - Cell a = as[i]; - if (a != null) - sum += Double.longBitsToDouble(a.value); - } - } - return sum; - } - - /** - * Resets variables maintaining the sum to zero. This method may - * be a useful alternative to creating a new adder, but is only - * effective if there are no concurrent updates. Because this - * method is intrinsically racy, it should only be used when it is - * known that no threads are concurrently updating. - */ - public void reset() { - internalReset(0L); - } - - /** - * Equivalent in effect to {@link #sum} followed by {@link - * #reset}. This method may apply for example during quiescent - * points between multithreaded computations. If there are - * updates concurrent with this method, the returned value is - * <em>not</em> guaranteed to be the final value occurring before - * the reset. - * - * @return the sum - */ - public double sumThenReset() { - Cell[] as = cells; - double sum = Double.longBitsToDouble(base); - base = 0L; - if (as != null) { - int n = as.length; - for (int i = 0; i < n; ++i) { - Cell a = as[i]; - if (a != null) { - long v = a.value; - a.value = 0L; - sum += Double.longBitsToDouble(v); - } - } - } - return sum; - } - - /** - * Returns the String representation of the {@link #sum}. - * @return the String representation of the {@link #sum} - */ - public String toString() { - return Double.toString(sum()); - } - - /** - * Equivalent to {@link #sum}. - * - * @return the sum - */ - public double doubleValue() { - return sum(); - } - - /** - * Returns the {@link #sum} as a {@code long} after a - * narrowing primitive conversion. - */ - public long longValue() { - return (long)sum(); - } - - /** - * Returns the {@link #sum} as an {@code int} after a - * narrowing primitive conversion. - */ - public int intValue() { - return (int)sum(); - } - - /** - * Returns the {@link #sum} as a {@code float} - * after a narrowing primitive conversion. - */ - public float floatValue() { - return (float)sum(); - } - - private void writeObject(ObjectOutputStream s) throws IOException { - s.defaultWriteObject(); - s.writeDouble(sum()); - } - - private void readObject(ObjectInputStream s) - throws IOException, ClassNotFoundException { - s.defaultReadObject(); - busy = 0; - cells = null; - base = Double.doubleToRawLongBits(s.readDouble()); - } - -} \ No newline at end of file diff --git a/redisson/src/main/java/org/redisson/misc/LongAdder.java b/redisson/src/main/java/org/redisson/misc/LongAdder.java deleted file mode 100644 index 4e0f6ff37..000000000 --- a/redisson/src/main/java/org/redisson/misc/LongAdder.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * Copyright 2018 Nikita Koksharov - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Written by Doug Lea with assistance from members of JCP JSR-166 - * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/publicdomain/zero/1.0/ - */ -package org.redisson.misc; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.concurrent.atomic.AtomicLong; - -/** - * One or more variables that together maintain an initially zero - * {@code long} sum. When updates (method {@link #add}) are contended - * across threads, the set of variables may grow dynamically to reduce - * contention. Method {@link #sum} (or, equivalently, {@link - * #longValue}) returns the current total combined across the - * variables maintaining the sum. - * - * <p>This class is usually preferable to {@link AtomicLong} when - * multiple threads update a common sum that is used for purposes such - * as collecting statistics, not for fine-grained synchronization - * control. Under low update contention, the two classes have similar - * characteristics. But under high contention, expected throughput of - * this class is significantly higher, at the expense of higher space - * consumption. - * - * <p>This class extends {@link Number}, but does <em>not</em> define - * methods such as {@code equals}, {@code hashCode} and {@code - * compareTo} because instances are expected to be mutated, and so are - * not useful as collection keys. - * - * <p><em>jsr166e note: This class is targeted to be placed in - * java.util.concurrent.atomic.</em> - * - * @since 1.8 - * @author Doug Lea - */ -public class LongAdder extends Striped64 implements Serializable { - private static final long serialVersionUID = 7249069246863182397L; - - /** - * Version of plus for use in retryUpdate - */ - final long fn(long v, long x) { return v + x; } - - /** - * Creates a new adder with initial sum of zero. - */ - public LongAdder() { - } - - /** - * Adds the given value. - * - * @param x the value to add - */ - public void add(long x) { - Cell[] as; long b, v; int[] hc; Cell a; int n; - if ((as = cells) != null || !casBase(b = base, b + x)) { - boolean uncontended = true; - if ((hc = threadHashCode.get()) == null || - as == null || (n = as.length) < 1 || - (a = as[(n - 1) & hc[0]]) == null || - !(uncontended = a.cas(v = a.value, v + x))) - retryUpdate(x, hc, uncontended); - } - } - - /** - * Equivalent to {@code add(1)}. - */ - public void increment() { - add(1L); - } - - /** - * Equivalent to {@code add(-1)}. - */ - public void decrement() { - add(-1L); - } - - /** - * Returns the current sum. The returned value is <em>NOT</em> an - * atomic snapshot; invocation in the absence of concurrent - * updates returns an accurate result, but concurrent updates that - * occur while the sum is being calculated might not be - * incorporated. - * - * @return the sum - */ - public long sum() { - long sum = base; - Cell[] as = cells; - if (as != null) { - int n = as.length; - for (int i = 0; i < n; ++i) { - Cell a = as[i]; - if (a != null) - sum += a.value; - } - } - return sum; - } - - /** - * Resets variables maintaining the sum to zero. This method may - * be a useful alternative to creating a new adder, but is only - * effective if there are no concurrent updates. Because this - * method is intrinsically racy, it should only be used when it is - * known that no threads are concurrently updating. - */ - public void reset() { - internalReset(0L); - } - - /** - * Equivalent in effect to {@link #sum} followed by {@link - * #reset}. This method may apply for example during quiescent - * points between multithreaded computations. If there are - * updates concurrent with this method, the returned value is - * <em>not</em> guaranteed to be the final value occurring before - * the reset. - * - * @return the sum - */ - public long sumThenReset() { - long sum = base; - Cell[] as = cells; - base = 0L; - if (as != null) { - int n = as.length; - for (int i = 0; i < n; ++i) { - Cell a = as[i]; - if (a != null) { - sum += a.value; - a.value = 0L; - } - } - } - return sum; - } - - /** - * Returns the String representation of the {@link #sum}. - * @return the String representation of the {@link #sum} - */ - public String toString() { - return Long.toString(sum()); - } - - /** - * Equivalent to {@link #sum}. - * - * @return the sum - */ - public long longValue() { - return sum(); - } - - /** - * Returns the {@link #sum} as an {@code int} after a narrowing - * primitive conversion. - */ - public int intValue() { - return (int)sum(); - } - - /** - * Returns the {@link #sum} as a {@code float} - * after a widening primitive conversion. - */ - public float floatValue() { - return (float)sum(); - } - - /** - * Returns the {@link #sum} as a {@code double} after a widening - * primitive conversion. - */ - public double doubleValue() { - return (double)sum(); - } - - private void writeObject(ObjectOutputStream s) throws IOException { - s.defaultWriteObject(); - s.writeLong(sum()); - } - - private void readObject(ObjectInputStream s) - throws IOException, ClassNotFoundException { - s.defaultReadObject(); - busy = 0; - cells = null; - base = s.readLong(); - } - -} \ No newline at end of file diff --git a/redisson/src/main/java/org/redisson/misc/Striped64.java b/redisson/src/main/java/org/redisson/misc/Striped64.java deleted file mode 100644 index 75e34f6b1..000000000 --- a/redisson/src/main/java/org/redisson/misc/Striped64.java +++ /dev/null @@ -1,348 +0,0 @@ -/** - * Copyright 2018 Nikita Koksharov - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Written by Doug Lea with assistance from members of JCP JSR-166 - * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/publicdomain/zero/1.0/ - */ -package org.redisson.misc; - -import java.util.Random; - -/** - * A package-local class holding common representation and mechanics - * for classes supporting dynamic striping on 64bit values. The class - * extends Number so that concrete subclasses must publicly do so. - */ -abstract class Striped64 extends Number { - /* - * This class maintains a lazily-initialized table of atomically - * updated variables, plus an extra "base" field. The table size - * is a power of two. Indexing uses masked per-thread hash codes. - * Nearly all declarations in this class are package-private, - * accessed directly by subclasses. - * - * Table entries are of class Cell; a variant of AtomicLong padded - * to reduce cache contention on most processors. Padding is - * overkill for most Atomics because they are usually irregularly - * scattered in memory and thus don't interfere much with each - * other. But Atomic objects residing in arrays will tend to be - * placed adjacent to each other, and so will most often share - * cache lines (with a huge negative performance impact) without - * this precaution. - * - * In part because Cells are relatively large, we avoid creating - * them until they are needed. When there is no contention, all - * updates are made to the base field. Upon first contention (a - * failed CAS on base update), the table is initialized to size 2. - * The table size is doubled upon further contention until - * reaching the nearest power of two greater than or equal to the - * number of CPUS. Table slots remain empty (null) until they are - * needed. - * - * A single spinlock ("busy") is used for initializing and - * resizing the table, as well as populating slots with new Cells. - * There is no need for a blocking lock; when the lock is not - * available, threads try other slots (or the base). During these - * retries, there is increased contention and reduced locality, - * which is still better than alternatives. - * - * Per-thread hash codes are initialized to random values. - * Contention and/or table collisions are indicated by failed - * CASes when performing an update operation (see method - * retryUpdate). Upon a collision, if the table size is less than - * the capacity, it is doubled in size unless some other thread - * holds the lock. If a hashed slot is empty, and lock is - * available, a new Cell is created. Otherwise, if the slot - * exists, a CAS is tried. Retries proceed by "double hashing", - * using a secondary hash (Marsaglia XorShift) to try to find a - * free slot. - * - * The table size is capped because, when there are more threads - * than CPUs, supposing that each thread were bound to a CPU, - * there would exist a perfect hash function mapping threads to - * slots that eliminates collisions. When we reach capacity, we - * search for this mapping by randomly varying the hash codes of - * colliding threads. Because search is random, and collisions - * only become known via CAS failures, convergence can be slow, - * and because threads are typically not bound to CPUS forever, - * may not occur at all. However, despite these limitations, - * observed contention rates are typically low in these cases. - * - * It is possible for a Cell to become unused when threads that - * once hashed to it terminate, as well as in the case where - * doubling the table causes no thread to hash to it under - * expanded mask. We do not try to detect or remove such cells, - * under the assumption that for long-running instances, observed - * contention levels will recur, so the cells will eventually be - * needed again; and for short-lived ones, it does not matter. - */ - - /** - * Padded variant of AtomicLong supporting only raw accesses plus CAS. - * The value field is placed between pads, hoping that the JVM doesn't - * reorder them. - * - * JVM intrinsics note: It would be possible to use a release-only - * form of CAS here, if it were provided. - */ - static final class Cell { - volatile long p0, p1, p2, p3, p4, p5, p6; - volatile long value; - volatile long q0, q1, q2, q3, q4, q5, q6; - Cell(long x) { value = x; } - - final boolean cas(long cmp, long val) { - return UNSAFE.compareAndSwapLong(this, valueOffset, cmp, val); - } - - // Unsafe mechanics - private static final sun.misc.Unsafe UNSAFE; - private static final long valueOffset; - static { - try { - UNSAFE = getUnsafe(); - Class<?> ak = Cell.class; - valueOffset = UNSAFE.objectFieldOffset - (ak.getDeclaredField("value")); - } catch (Exception e) { - throw new Error(e); - } - } - - } - - /** - * ThreadLocal holding a single-slot int array holding hash code. - * Unlike the JDK8 version of this class, we use a suboptimal - * int[] representation to avoid introducing a new type that can - * impede class-unloading when ThreadLocals are not removed. - */ - static final ThreadLocal<int[]> threadHashCode = new ThreadLocal<int[]>(); - - /** - * Generator of new random hash codes - */ - static final Random rng = new Random(); - - /** Number of CPUS, to place bound on table size */ - static final int NCPU = Runtime.getRuntime().availableProcessors(); - - /** - * Table of cells. When non-null, size is a power of 2. - */ - transient volatile Cell[] cells; - - /** - * Base value, used mainly when there is no contention, but also as - * a fallback during table initialization races. Updated via CAS. - */ - transient volatile long base; - - /** - * Spinlock (locked via CAS) used when resizing and/or creating Cells. - */ - transient volatile int busy; - - /** - * Package-private default constructor - */ - Striped64() { - } - - /** - * CASes the base field. - */ - final boolean casBase(long cmp, long val) { - return UNSAFE.compareAndSwapLong(this, baseOffset, cmp, val); - } - - /** - * CASes the busy field from 0 to 1 to acquire lock. - */ - final boolean casBusy() { - return UNSAFE.compareAndSwapInt(this, busyOffset, 0, 1); - } - - /** - * Computes the function of current and new value. Subclasses - * should open-code this update function for most uses, but the - * virtualized form is needed within retryUpdate. - * - * @param currentValue the current value (of either base or a cell) - * @param newValue the argument from a user update call - * @return result of the update function - */ - abstract long fn(long currentValue, long newValue); - - /** - * Handles cases of updates involving initialization, resizing, - * creating new Cells, and/or contention. See above for - * explanation. This method suffers the usual non-modularity - * problems of optimistic retry code, relying on rechecked sets of - * reads. - * - * @param x the value - * @param hc the hash code holder - * @param wasUncontended false if CAS failed before call - */ - final void retryUpdate(long x, int[] hc, boolean wasUncontended) { - int h; - if (hc == null) { - threadHashCode.set(hc = new int[1]); // Initialize randomly - int r = rng.nextInt(); // Avoid zero to allow xorShift rehash - h = hc[0] = (r == 0) ? 1 : r; - } - else - h = hc[0]; - boolean collide = false; // True if last slot nonempty - for (;;) { - Cell[] as; Cell a; int n; long v; - if ((as = cells) != null && (n = as.length) > 0) { - if ((a = as[(n - 1) & h]) == null) { - if (busy == 0) { // Try to attach new Cell - Cell r = new Cell(x); // Optimistically create - if (busy == 0 && casBusy()) { - boolean created = false; - try { // Recheck under lock - Cell[] rs; int m, j; - if ((rs = cells) != null && - (m = rs.length) > 0 && - rs[j = (m - 1) & h] == null) { - rs[j] = r; - created = true; - } - } finally { - busy = 0; - } - if (created) - break; - continue; // Slot is now non-empty - } - } - collide = false; - } - else if (!wasUncontended) // CAS already known to fail - wasUncontended = true; // Continue after rehash - else if (a.cas(v = a.value, fn(v, x))) - break; - else if (n >= NCPU || cells != as) - collide = false; // At max size or stale - else if (!collide) - collide = true; - else if (busy == 0 && casBusy()) { - try { - if (cells == as) { // Expand table unless stale - Cell[] rs = new Cell[n << 1]; - for (int i = 0; i < n; ++i) - rs[i] = as[i]; - cells = rs; - } - } finally { - busy = 0; - } - collide = false; - continue; // Retry with expanded table - } - h ^= h << 13; // Rehash - h ^= h >>> 17; - h ^= h << 5; - hc[0] = h; // Record index for next time - } - else if (busy == 0 && cells == as && casBusy()) { - boolean init = false; - try { // Initialize table - if (cells == as) { - Cell[] rs = new Cell[2]; - rs[h & 1] = new Cell(x); - cells = rs; - init = true; - } - } finally { - busy = 0; - } - if (init) - break; - } - else if (casBase(v = base, fn(v, x))) - break; // Fall back on using base - } - } - - - /** - * Sets base and all cells to the given value. - */ - final void internalReset(long initialValue) { - Cell[] as = cells; - base = initialValue; - if (as != null) { - int n = as.length; - for (int i = 0; i < n; ++i) { - Cell a = as[i]; - if (a != null) - a.value = initialValue; - } - } - } - - // Unsafe mechanics - private static final sun.misc.Unsafe UNSAFE; - private static final long baseOffset; - private static final long busyOffset; - static { - try { - UNSAFE = getUnsafe(); - Class<?> sk = Striped64.class; - baseOffset = UNSAFE.objectFieldOffset - (sk.getDeclaredField("base")); - busyOffset = UNSAFE.objectFieldOffset - (sk.getDeclaredField("busy")); - } catch (Exception e) { - throw new Error(e); - } - } - - /** - * Returns a sun.misc.Unsafe. Suitable for use in a 3rd party package. - * Replace with a simple call to Unsafe.getUnsafe when integrating - * into a jdk. - * - * @return a sun.misc.Unsafe - */ - private static sun.misc.Unsafe getUnsafe() { - try { - return sun.misc.Unsafe.getUnsafe(); - } catch (SecurityException tryReflectionInstead) {} - try { - return java.security.AccessController.doPrivileged - (new java.security.PrivilegedExceptionAction<sun.misc.Unsafe>() { - public sun.misc.Unsafe run() throws Exception { - Class<sun.misc.Unsafe> k = sun.misc.Unsafe.class; - for (java.lang.reflect.Field f : k.getDeclaredFields()) { - f.setAccessible(true); - Object x = f.get(null); - if (k.isInstance(x)) - return k.cast(x); - } - throw new NoSuchFieldError("the Unsafe"); - }}); - } catch (java.security.PrivilegedActionException e) { - throw new RuntimeException("Could not initialize intrinsics", - e.getCause()); - } - } -} \ No newline at end of file