Skip to content

Commit

Permalink
Update dependencies (#4036)
Browse files Browse the repository at this point in the history
- Brave 5.13.3 -> 5.13.7
- Bouncy Castle 1.69 -> 1.70
- Bucket4J 6.3.0 -> 7.0.0
- Caffeine 2.9.2 -> 2.9.3
- Dropwizard 2.0.25 -> 2.0.28
- Dropwizard Metrics 4.2.4 -> 4.2.7
- gRPC Java 1.41.1 -> 1.41.2
- gRPC Kotlin 1.1.0 -> 1.2.1
- Jackson 2.13.0 -> 2.13.1
- java-jwt 3.18.2 -> 3.18.3
- jcl-over-slf4j 1.7.32 -> 1.7.33
- jboss-logging 3.4.2 -> 3.4.3
- Kafka 3.0.0 -> 3.1.0
- Kotlin 1.5.32 -> 1.6.10
- Logback 1.2.7 -> 1.2.10
- Micrometer 1.7.6 -> 1.8.2
- Netty 4.1.70 -> 4.1.73
  - io_uring 0.0.1 -> 0.0.11
- Prometheus 0.12.0 -> 0.14.1
- protobuf-jackson 1.2.0 -> 2.0.0
- protobuf-java 3.17.3 -> 3.19.2
- Reactor 3.4.12 -> 3.4.14
- RESTEasy 4.7.3 -> 5.0.2
- Scala 2.13.7 -> 2.13.8, 3.1.1(new)
- scala-collection-compat 2.5.0 -> 2.6.0
- ScalaPB 0.11.6 -> 0.11.8
- SLF4J 1.7.33 -> 1.7.34
- Spring 5.3.13 -> 5.3.15
- Spring Boot 2.5.7 -> 2.6.2
- Tomcat 9.0.55 -> 9.0.56
- Build
  - AssertJ 3.21.0 -> 3.22.0
  - Checkstyle 8.45.1 -> 9.2.1
  - Dagger 2.37 -> 2.40.5
  - Finagle 2.0.25 -> 2.0.28
  - graphql-dgs-client 4.9.10 -> 4.9.16
  - graphql-kotlin 5.1.1 -> 5.3.2
  - gax-grpc 1.67.0 -> 2.10.0
  - JMH 1.33 -> 1.34
  - ktlint 10.2.0 -> 10.2.1
  - Mockito  4.0.0 -> 4.3.0
  - TestNG 7.4.0 -> 7.5
- Fixes #3614
  • Loading branch information
ikhoon authored Jan 25, 2022
1 parent 1284b5e commit 9e5c65a
Show file tree
Hide file tree
Showing 25 changed files with 908 additions and 118 deletions.
4 changes: 3 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
version = "3.0.0-RC6"
version = "3.3.2"

style = default

runner.dialect = scala212source3

maxColumn = 112

align.preset = default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
import com.linecorp.armeria.server.ServiceRequestContext;
import com.linecorp.armeria.server.throttling.ThrottlingStrategy;

import io.github.bucket4j.AsyncBucket;
import io.github.bucket4j.Bucket4j;
import io.github.bucket4j.Bucket;
import io.github.bucket4j.BucketConfiguration;
import io.github.bucket4j.ConfigurationBuilder;
import io.github.bucket4j.TokensInheritanceStrategy;
import io.github.bucket4j.distributed.AsyncBucketProxy;
import io.github.bucket4j.distributed.AsyncBucketProxyAdapter;
import io.github.bucket4j.local.LocalBucketBuilder;

/**
Expand All @@ -50,7 +52,7 @@ public static <T extends Request> TokenBucketThrottlingStrategyBuilder<T> builde
return new TokenBucketThrottlingStrategyBuilder<>(tokenBucket);
}

private final AsyncBucket asyncBucket;
private final AsyncBucketProxy asyncBucket;
private final long minimumBackoffSeconds;
@Nullable
private final ThrottlingHeaders headersScheme;
Expand Down Expand Up @@ -78,12 +80,12 @@ public static <T extends Request> TokenBucketThrottlingStrategyBuilder<T> builde
@Nullable String name) {
super(name);
// construct the bucket builder
final LocalBucketBuilder builder = Bucket4j.builder().withNanosecondPrecision();
final LocalBucketBuilder builder = Bucket.builder().withNanosecondPrecision();
for (BandwidthLimit limit : tokenBucket.limits()) {
builder.addLimit(limit.bandwidth());
}
// build the bucket
asyncBucket = builder.build().asAsync();
asyncBucket = AsyncBucketProxyAdapter.fromSync(builder.build());
minimumBackoffSeconds = (minimumBackoff == null) ? 0L : minimumBackoff.getSeconds();
this.headersScheme = headersScheme;
this.sendQuota = sendQuota;
Expand All @@ -98,7 +100,7 @@ public static <T extends Request> TokenBucketThrottlingStrategyBuilder<T> builde
*/
public CompletableFuture<Void> reconfigure(TokenBucket tokenBucket) {
// construct the configuration builder
final ConfigurationBuilder builder = Bucket4j.configurationBuilder();
final ConfigurationBuilder builder = BucketConfiguration.builder();
for (BandwidthLimit limit : tokenBucket.limits()) {
builder.addLimit(limit.bandwidth());
}
Expand All @@ -112,7 +114,7 @@ public CompletableFuture<Void> reconfigure(TokenBucket tokenBucket) {
* Registers a request with the bucket.
*/
@Override
public CompletionStage<Boolean> accept(final ServiceRequestContext ctx, final T request) {
public CompletionStage<Boolean> accept(ServiceRequestContext ctx, T request) {
return asyncBucket.tryConsumeAndReturnRemaining(1L).thenApply(probe -> {
final boolean accepted = probe.isConsumed();
final long remainingTokens = probe.getRemainingTokens();
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
// If you want to change `org.jetbrains.kotlin.jvm` version,
// you also need to change `org.jetbrains.kotlin:kotlin-allopen` version in `dependencies.yml`.
id 'org.jetbrains.kotlin.jvm' version '1.5.32' apply false
id 'org.jetbrains.kotlin.jvm' version '1.6.10' apply false
id 'org.jlleitschuh.gradle.ktlint' version '10.1.0' apply false

id 'net.ltgt.errorprone' version '2.0.2' apply false
Expand Down
Loading

0 comments on commit 9e5c65a

Please sign in to comment.