Skip to content

Commit

Permalink
Merge branch '8.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-bukhtoyarov committed Mar 21, 2024
2 parents 69bab18 + 9762a9b commit 5a112cd
Show file tree
Hide file tree
Showing 38 changed files with 96 additions and 108 deletions.
22 changes: 11 additions & 11 deletions README.md
Expand Up @@ -11,14 +11,14 @@ The Bucket4j is distributed through [Maven Central](http://search.maven.org/):
<dependency>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-core</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
</dependency>

<!-- For java 8 -->
<dependency>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j_jdk8-core</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
</dependency>
```
#### Quick start
Expand All @@ -42,8 +42,8 @@ private void doSomethingProtected() {
More examples [can be found there](https://bucket4j.github.io/8.3.0/toc.html#quick-start-examples)

## [Documentation](https://bucket4j.github.io)
* [Reference](https://bucket4j.github.io/8.9.0/toc.html)
* [Quick start examples](https://bucket4j.github.io/8.9.0/toc.html#quick-start-examples)
* [Reference](https://bucket4j.github.io/8.10.1/toc.html)
* [Quick start examples](https://bucket4j.github.io/8.10.1/toc.html#quick-start-examples)
* [Third-party articles](https://bucket4j.github.io/#third-party-articles)

## Bucket4j basic features
Expand Down Expand Up @@ -81,13 +81,13 @@ In addition to local in-memory buckets, the Bucket4j supports clustered usage sc
| ```Redis/Lettuce``` | Yes | Yes | [bucket4j-redis/Lettuce](https://bucket4j.github.io/8.7.0/toc.html#example-of-bucket-instantiation-via-lettucebasedproxymanager) |

### JDBC back-ends
| Back-end | Documentation link |
|:---------------------------|:------------------------------------------------------------------------------------------:|
| ```MySQL``` | [bucket4j-mysql](https://bucket4j.github.io/8.9.0/toc.html#mysql-integration) |
| ```PostgreSQL``` | [bucket4j-postgresql](https://bucket4j.github.io/8.9.0/toc.html#postgresql-integration) |
| ```Oracle``` | [bucket4j-oracle](https://bucket4j.github.io/8.9.0/toc.html#oracle-integration) |
| ```Microsoft SQL Server``` | [bucket4j-mssql](https://bucket4j.github.io/8.9.0/toc.html#microsoftsqlserver-integration) |
| ```MariaDB``` | [bucket4j-mariadb](https://bucket4j.github.io/8.9.0/toc.html#mariadb-integration) |
| Back-end | Documentation link |
|:---------------------------|:-------------------------------------------------------------------------------------------:|
| ```MySQL``` | [bucket4j-mysql](https://bucket4j.github.io/8.10.1/toc.html#mysql-integration) |
| ```PostgreSQL``` | [bucket4j-postgresql](https://bucket4j.github.io/8.10.1/toc.html#postgresql-integration) |
| ```Oracle``` | [bucket4j-oracle](https://bucket4j.github.io/8.10.1/toc.html#oracle-integration) |
| ```Microsoft SQL Server``` | [bucket4j-mssql](https://bucket4j.github.io/8.10.1/toc.html#microsoftsqlserver-integration) |
| ```MariaDB``` | [bucket4j-mariadb](https://bucket4j.github.io/8.10.1/toc.html#mariadb-integration) |


### Local caches support
Expand Down
2 changes: 1 addition & 1 deletion asciidoc/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<artifactId>asciidoc</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions backward-compatibility-tests/common/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>backward-compatibility-tests</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../../backward-compatibility-tests</relativePath>
</parent>
<artifactId>backward-compatibility-tests-common</artifactId>
Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-core</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<scope>compile</scope>
</dependency>

Expand Down
4 changes: 2 additions & 2 deletions backward-compatibility-tests/current/pom.xml
Expand Up @@ -8,15 +8,15 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>backward-compatibility-tests</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../../backward-compatibility-tests</relativePath>
</parent>
<artifactId>backward-compatibility-tests-current</artifactId>
<name>backward-compatibility-tests-current</name>

<properties>
<modular-name>backward_compatibility_tests_current</modular-name>
<current.version>8.10.0</current.version>
<current.version>8.10.1</current.version>
<maven.deploy.skip>true</maven.deploy.skip>
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion backward-compatibility-tests/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bucket4j-parent</artifactId>
<groupId>com.bucket4j</groupId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion backward-compatibility-tests/previous/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>backward-compatibility-tests</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../../backward-compatibility-tests</relativePath>
</parent>
<artifactId>backward-compatibility-tests-prevoius</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-benchmarks/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<artifactId>bucket4j-benchmarks</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-caffeine/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<artifactId>bucket4j-caffeine</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-coherence/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion bucket4j-core/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-examples/pom.xml
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-hazelcast-all/bucket4j-hazelcast-4/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-hazelcast-all</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../../bucket4j-hazelcast-all</relativePath>
</parent>
<artifactId>bucket4j-hazelcast-4</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-hazelcast-all/bucket4j-hazelcast/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-hazelcast-all</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../../bucket4j-hazelcast-all</relativePath>
</parent>
<artifactId>bucket4j-hazelcast</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-hazelcast-all/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>bucket4j-parent</artifactId>
<groupId>com.bucket4j</groupId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-ignite/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<artifactId>bucket4j-ignite</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-infinispan-all/bucket4j-infinispan/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-infinispan-all</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../../bucket4j-infinispan-all</relativePath>
</parent>
<artifactId>bucket4j-infinispan</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-infinispan-all/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>bucket4j-parent</artifactId>
<groupId>com.bucket4j</groupId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-jcache/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-mariadb/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>

Expand Down
Expand Up @@ -62,15 +62,7 @@ public class MariaDBSelectForUpdateBasedProxyManager<K> extends AbstractSelectFo
* @param configuration {@link SQLProxyConfiguration} configuration.
*/
public MariaDBSelectForUpdateBasedProxyManager(SQLProxyConfiguration<K> configuration) {
this(configuration, ClientSideConfig.getDefault());
}

/**
*
* @param configuration {@link SQLProxyConfiguration} configuration.
*/
public MariaDBSelectForUpdateBasedProxyManager(SQLProxyConfiguration<K> configuration, ClientSideConfig clientSideConfig) {
super(clientSideConfig);
super(configuration.getClientSideConfig());
this.dataSource = Objects.requireNonNull(configuration.getDataSource());
this.configuration = configuration;
this.removeSqlQuery = MessageFormat.format("DELETE FROM {0} WHERE {1} = ?", configuration.getTableName(), configuration.getIdName());
Expand Down
Expand Up @@ -38,20 +38,23 @@ public static void initializeInstance() throws SQLException {
statement.execute(query);
}
}
SQLProxyConfiguration<Long> configuration = SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.build(dataSource);

specs = Arrays.asList(
new ProxyManagerSpec<>(
"MariaDBSelectForUpdateBasedProxyManager",
() -> ThreadLocalRandom.current().nextLong(1_000_000_000),
clientConfig -> new MariaDBSelectForUpdateBasedProxyManager<>(configuration, clientConfig)
clientConfig -> new MariaDBSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.withClientSideConfig(clientConfig)
.build(dataSource))
),
new ProxyManagerSpec<>(
"MariaDBSelectForUpdateBasedProxyManager_withTimeout",
() -> ThreadLocalRandom.current().nextLong(1_000_000_000),
clientConfig -> new MariaDBSelectForUpdateBasedProxyManager<>(configuration, clientConfig.withRequestTimeout(Duration.ofSeconds(3)))
clientConfig -> new MariaDBSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.withClientSideConfig(clientConfig.withRequestTimeout(Duration.ofSeconds(3)))
.build(dataSource))
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-mssql/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>

Expand Down
Expand Up @@ -54,8 +54,8 @@ public class MSSQLSelectForUpdateBasedProxyManager<K> extends AbstractSelectForU
*
* @param configuration {@link SQLProxyConfiguration} configuration.
*/
public MSSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration<K> configuration, ClientSideConfig clientSideConfig) {
super(clientSideConfig);
public MSSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration<K> configuration) {
super(configuration.getClientSideConfig());
this.dataSource = Objects.requireNonNull(configuration.getDataSource());
this.configuration = configuration;
this.removeSqlQuery = MessageFormat.format("DELETE FROM {0} WHERE {1} = ?", configuration.getTableName(), configuration.getIdName());
Expand All @@ -66,14 +66,6 @@ public MSSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration<K> configurat
this.selectSqlQuery = MessageFormat.format("SELECT {0} FROM {1} WITH(ROWLOCK, UPDLOCK) WHERE {2} = ?", configuration.getStateName(), configuration.getTableName(), configuration.getIdName());
}

/**
*
* @param configuration {@link SQLProxyConfiguration} configuration.
*/
public MSSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration<K> configuration) {
this(configuration, ClientSideConfig.getDefault());
}

@Override
protected SelectForUpdateBasedTransaction allocateTransaction(K key, Optional<Long> requestTimeoutNanos) {
Connection connection;
Expand Down
Expand Up @@ -47,20 +47,23 @@ public static void initializeInstance() throws SQLException {
statement.execute(query);
}
}
SQLProxyConfiguration<Long> configuration = SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.build(dataSource);

specs = Arrays.asList(
new ProxyManagerSpec<>(
"MSSQLSelectForUpdateBasedProxyManager",
() -> ThreadLocalRandom.current().nextLong(1_000_000_000),
clientConfig -> new MSSQLSelectForUpdateBasedProxyManager<>(configuration, clientConfig)
clientConfig -> new MSSQLSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.withClientSideConfig(clientConfig)
.build(dataSource))
),
new ProxyManagerSpec<>(
"MSSQLSelectForUpdateBasedProxyManager_withTimeout",
() -> ThreadLocalRandom.current().nextLong(1_000_000_000),
clientConfig -> new MSSQLSelectForUpdateBasedProxyManager<>(configuration, clientConfig.withRequestTimeout(Duration.ofSeconds(3)))
clientConfig -> new MSSQLSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.withClientSideConfig(clientConfig.withRequestTimeout(Duration.ofSeconds(3)))
.build(dataSource))
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion bucket4j-mysql/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion bucket4j-oracle/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j-parent</artifactId>
<version>8.10.0</version>
<version>8.10.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>

Expand Down
Expand Up @@ -58,11 +58,7 @@ public class OracleSelectForUpdateBasedProxyManager<K> extends AbstractSelectFor
* @param configuration {@link SQLProxyConfiguration} configuration.
*/
public OracleSelectForUpdateBasedProxyManager(SQLProxyConfiguration<K> configuration) {
this(configuration, ClientSideConfig.getDefault());
}

public OracleSelectForUpdateBasedProxyManager(SQLProxyConfiguration<K> configuration, ClientSideConfig clientSideConfig) {
super(clientSideConfig);
super(configuration.getClientSideConfig());
this.dataSource = Objects.requireNonNull(configuration.getDataSource());
this.configuration = configuration;
this.removeSqlQuery = MessageFormat.format("DELETE FROM {0} WHERE {1} = ?", configuration.getTableName(), configuration.getIdName());
Expand Down
Expand Up @@ -38,20 +38,23 @@ public static void initializeInstance() throws SQLException {
statement.execute(query);
}
}
SQLProxyConfiguration<Long> configuration = SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.build(dataSource);

specs = Arrays.asList(
new ProxyManagerSpec<>(
"OracleSelectForUpdateBasedProxyManager",
() -> ThreadLocalRandom.current().nextLong(1_000_000_000),
clientConfig -> new OracleSelectForUpdateBasedProxyManager<>(configuration, clientConfig)
clientConfig -> new OracleSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.withClientSideConfig(clientConfig)
.build(dataSource))
),
new ProxyManagerSpec<>(
"OracleSelectForUpdateBasedProxyManager_withTimeout",
() -> ThreadLocalRandom.current().nextLong(1_000_000_000),
clientConfig -> new OracleSelectForUpdateBasedProxyManager<>(configuration, clientConfig.withRequestTimeout(Duration.ofSeconds(3)))
clientConfig -> new OracleSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder()
.withTableSettings(tableSettings)
.withClientSideConfig(clientConfig.withRequestTimeout(Duration.ofSeconds(3)))
.build(dataSource))
)
);
}
Expand Down

0 comments on commit 5a112cd

Please sign in to comment.