Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into 8.11
  • Loading branch information
vladimir-bukhtoyarov committed Apr 24, 2024
2 parents 413103c + b047aca commit e9f7cde
Show file tree
Hide file tree
Showing 57 changed files with 192 additions and 120 deletions.
6 changes: 5 additions & 1 deletion .run/Build MAVEN CENTRAL.run.xml
Expand Up @@ -5,14 +5,15 @@
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="install" />
<option value="-Dmaven.test.skip=true" />
<option value="-DskipTests" />
</list>
</option>
<option name="pomFileName" />
Expand All @@ -21,6 +22,9 @@
<entry key="release" value="true" />
</map>
</option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters>
Expand Down
33 changes: 33 additions & 0 deletions .run/Build SkipTests .run.xml
@@ -0,0 +1,33 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build SkipTests " type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="install" />
<option value="-DskipTests" />
</list>
</option>
<option name="pomFileName" />
<option name="profilesMap">
<map />
</option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
20 changes: 10 additions & 10 deletions README.md
Expand Up @@ -13,7 +13,7 @@ The Bucket4j is distributed through [Maven Central](http://search.maven.org/):
<dependency>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j_jdk17-core</artifactId>
<version>8.11.0</version>
<version>8.11.1</version>
</dependency>
```
##### Java 11 dependency
Expand All @@ -22,7 +22,7 @@ The Bucket4j is distributed through [Maven Central](http://search.maven.org/):
<dependency>
<groupId>com.bucket4j</groupId>
<artifactId>bucket4j_jdk11-core</artifactId>
<version>8.11.0</version>
<version>8.11.1</version>
</dependency>
```
##### Java 8 dependency
Expand All @@ -46,11 +46,11 @@ private void doSomethingProtected() {
}
}
```
More examples [can be found there](https://bucket4j.github.io/8.11.0/toc.html#quick-start-examples)
More examples [can be found there](https://bucket4j.github.io/8.11.1/toc.html#quick-start-examples)

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

## Bucket4j basic features
Expand Down Expand Up @@ -95,11 +95,11 @@ In addition to local in-memory buckets, the Bucket4j supports clustered usage sc
### JDBC back-ends
| Back-end | Documentation link |
|:---------------------------|:-------------------------------------------------------------------------------------------:|
| ```MySQL``` | [bucket4j-mysql](https://bucket4j.github.io/8.11.0/toc.html#mysql-integration) |
| ```PostgreSQL``` | [bucket4j-postgresql](https://bucket4j.github.io/8.11.0/toc.html#postgresql-integration) |
| ```Oracle``` | [bucket4j-oracle](https://bucket4j.github.io/8.11.0/toc.html#oracle-integration) |
| ```Microsoft SQL Server``` | [bucket4j-mssql](https://bucket4j.github.io/8.11.0/toc.html#microsoftsqlserver-integration) |
| ```MariaDB``` | [bucket4j-mariadb](https://bucket4j.github.io/8.11.0/toc.html#mariadb-integration) |
| ```MySQL``` | [bucket4j-mysql](https://bucket4j.github.io/8.11.1/toc.html#mysql-integration) |
| ```PostgreSQL``` | [bucket4j-postgresql](https://bucket4j.github.io/8.11.1/toc.html#postgresql-integration) |
| ```Oracle``` | [bucket4j-oracle](https://bucket4j.github.io/8.11.1/toc.html#oracle-integration) |
| ```Microsoft SQL Server``` | [bucket4j-mssql](https://bucket4j.github.io/8.11.1/toc.html#microsoftsqlserver-integration) |
| ```MariaDB``` | [bucket4j-mariadb](https://bucket4j.github.io/8.11.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_jdk17-parent</artifactId>
<version>8.11.0</version>
<version>8.11.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<artifactId>asciidoc</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions asciidoc/src/main/docs/asciidoc/release-notes.adoc
Expand Up @@ -14,6 +14,6 @@ Now, the version of target JDK become a part of artifact name. For example `com.
Support for Redis has been splitted by individual modules(Jedis, Lettuce, Redisson). +
See docs for your library

* https://bucket4j.com/8.11.0/toc.html#dependencies-5[Lettuce]
* https://bucket4j.com/8.11.0/toc.html#dependencies-6[Redisson]
* https://bucket4j.com/8.11.0/toc.html#dependencies-7[Jedis]
* https://bucket4j.com/8.11.1/toc.html#dependencies-5[Lettuce]
* https://bucket4j.com/8.11.1/toc.html#dependencies-6[Redisson]
* https://bucket4j.com/8.11.1/toc.html#dependencies-7[Jedis]
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.11.0</version>
<version>8.11.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_jdk17-core</artifactId>
<version>8.11.0</version>
<version>8.11.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.11.0</version>
<version>8.11.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.11.0</current.version>
<current.version>8.11.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_jdk17-parent</artifactId>
<groupId>com.bucket4j</groupId>
<version>8.11.0</version>
<version>8.11.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.11.0</version>
<version>8.11.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_jdk17-parent</artifactId>
<version>8.11.0</version>
<version>8.11.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<artifactId>bucket4j_jdk17-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_jdk17-parent</artifactId>
<version>8.11.0</version>
<version>8.11.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<artifactId>bucket4j_jdk17-caffeine</artifactId>
Expand Down
Expand Up @@ -57,6 +57,11 @@ public CaffeineProxyManager<K> build() {
return new CaffeineProxyManager<>(this);
}

@Override
public boolean isExpireAfterWriteSupported() {
return true;
}

}

}
Expand Up @@ -51,19 +51,19 @@ public class CaffeineProxyManager<K> extends AbstractProxyManager<K> {

@Override
public long expireAfterCreate(K key, RemoteBucketState bucketState, long currentTime) {
long ttlNanos = expiration.calculateTimeToLiveMillis(bucketState, currentTimeNanos());
long ttlNanos = expiration.calculateTimeToLiveMillis(bucketState, currentTimeNanos()) * 1_000_000;
return ttlNanos < 0 ? Long.MAX_VALUE : ttlNanos;
}

@Override
public long expireAfterUpdate(K key, RemoteBucketState bucketState, long currentTime, long currentDuration) {
long ttlNanos = expiration.calculateTimeToLiveMillis(bucketState, currentTimeNanos());
long ttlNanos = expiration.calculateTimeToLiveMillis(bucketState, currentTimeNanos()) * 1_000_000;
return ttlNanos < 0 ? Long.MAX_VALUE : ttlNanos;
}

@Override
public long expireAfterRead(K key, RemoteBucketState bucketState, long currentTime, long currentDuration) {
long ttlNanos = expiration.calculateTimeToLiveMillis(bucketState, currentTimeNanos());
long ttlNanos = expiration.calculateTimeToLiveMillis(bucketState, currentTimeNanos()) * 1_000_000;
return ttlNanos < 0 ? Long.MAX_VALUE : ttlNanos;
}
})
Expand Down Expand Up @@ -110,6 +110,11 @@ public long expireAfterRead(K key, RemoteBucketState bucketState, long currentTi
.build();
}

@Override
public boolean isExpireAfterWriteSupported() {
return true;
}

/**
* Returns the cache that is used for storing the buckets
*
Expand Down
Expand Up @@ -22,7 +22,7 @@ public static void initParams() {
"CaffeineProxyManager",
() -> UUID.randomUUID().toString(),
() -> Bucket4jCaffeine.builderFor(Caffeine.newBuilder().maximumSize(100))
)
).checkExpiration()
);
}

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_jdk17-parent</artifactId>
<version>8.11.0</version>
<version>8.11.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_jdk17-parent</artifactId>
<version>8.11.0</version>
<version>8.11.1</version>
<relativePath>../bucket4j-parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down

0 comments on commit e9f7cde

Please sign in to comment.