Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump org.redisson:redisson from 3.17.3 to 3.30.0 #4924

Merged
merged 7 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: GenerateGrammarSource
run: ./gradlew clean generateGrammarSource --parallel --daemon --scan
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
Expand All @@ -69,14 +69,16 @@ jobs:

# https://docs.gradle.org/current/userguide/performance.html
- name: Build
run: ./gradlew clean build dist jacocoTestReport -x spotlessJava -x generateGrammarSource --parallel --daemon --scan
run: >
./gradlew clean build dist jacocoTestReport --parallel --daemon --scan
-x spotlessJava -x generateGrammarSource -x generateDistLicense -x checkDeniedLicense
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}

- name: Install plugin
run: ./gradlew installPlugin --scan
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}

- name: Upload coverage report to codecov.io
run: bash <(curl -s https://codecov.io/bash) || echo 'Failed to upload coverage report!'
2 changes: 1 addition & 1 deletion .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
if: matrix.language == 'java'
run: ./gradlew clean assemble compileTestJava --parallel --daemon --scan
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
implementation project(":eventmesh-common")
implementation project(":eventmesh-openconnect:eventmesh-openconnect-java")

implementation 'org.redisson:redisson:3.17.3'
implementation 'org.redisson:redisson:3.30.0'

api 'io.cloudevents:cloudevents-json-jackson'

Expand Down
14 changes: 3 additions & 11 deletions eventmesh-storage-plugin/eventmesh-storage-redis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,16 @@ dependencies {
implementation project(":eventmesh-storage-plugin:eventmesh-storage-api")

// redisson
implementation('org.redisson:redisson:3.17.3') {
exclude group: 'io.netty', module: 'netty-common'
exclude group: 'io.netty', module: 'netty-buffer'
exclude group: 'io.netty', module: 'netty-codec'
exclude group: 'io.netty', module: 'netty-transport'
exclude group: 'io.netty', module: 'netty-resolver'
exclude group: 'io.netty', module: 'netty-resolver-dns'
exclude group: 'io.netty', module: 'netty-handler'
}
implementation 'org.redisson:redisson:3.30.0'

// netty
implementation "io.netty:netty-all"
implementation 'io.netty:netty-all'

// auxiliary serialize
api 'io.cloudevents:cloudevents-json-jackson'

// test dependencies
testImplementation 'ai.grakn:redis-mock:0.1.6'
testImplementation 'com.github.fppt:jedis-mock:1.1.1'
testImplementation "org.mockito:mockito-core"

compileOnly 'org.projectlombok:lombok'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,15 @@ private static Redisson create(RedisProperties properties) {
throw new StorageRuntimeException(message, ie);
}

Config config = new Config();
config.setCodec(CloudEventCodec.getInstance());
config.setThreads(properties.getRedissonThreads());
config.setNettyThreads(properties.getRedissonNettyThreads());

String serverAddress = properties.getServerAddress();
String serverPassword = properties.getServerPassword();
String masterName = properties.getServerMasterName();

Config config = OBJECT_MAPPER.convertValue(properties.getRedissonProperties(), Config.class);

if (config == null) {
config = new Config();
}

config.setCodec(CloudEventCodec.getInstance());

switch (serverType) {
case SINGLE:
config.useSingleServer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import org.apache.eventmesh.common.config.Config;
import org.apache.eventmesh.common.config.ConfigField;

import java.util.Properties;

import lombok.Data;

@Data
Expand All @@ -44,7 +42,7 @@ public class RedisProperties {
* The address of the redis server following format -- host1:port1,host2:port2,……
*/
@ConfigField(field = "serverAddress")
private String serverAddress;
private String serverAddress = "redis://127.0.0.1:6379";

/**
* The password for redis authentication.
Expand All @@ -55,8 +53,11 @@ public class RedisProperties {
/**
* The redisson options, redisson properties prefix is `eventMesh.server.redis.redisson`
*/
@ConfigField(field = "redisson")
private Properties redissonProperties;
@ConfigField(field = "redisson.threads")
private int redissonThreads = 16;

@ConfigField(field = "redisson.nettyThreads")
private int redissonNettyThreads = 32;

public enum ServerType {
SINGLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@
# limitations under the License.
#

eventMesh.server.redis.serverAddress=
eventMesh.server.redis.serverAddress=redis://127.0.0.1:6379
eventMesh.server.redis.serverPassword=
eventMesh.server.redis.serverType=SINGLE
eventMesh.server.redis.serverMasterName=master
eventMesh.server.redis.redisson.threads=
eventMesh.server.redis.redisson.nettyThreads=
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,19 @@

package org.apache.eventmesh.storage.redis;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import java.io.IOException;

import ai.grakn.redismock.RedisServer;
import com.github.fppt.jedismock.RedisServer;

public abstract class AbstractRedisServer {

private static RedisServer redisServer;
private static final RedisServer redisServer;

@BeforeAll
public static void setupRedisServer() throws Exception {
redisServer = RedisServer.newRedisServer(6379);
redisServer.start();
}

@AfterAll
public static void shutdownRedisServer() {
if (redisServer != null) {
redisServer.stop();
static {
try {
redisServer = RedisServer.newRedisServer(6379).start();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import org.apache.eventmesh.common.config.ConfigService;

import java.util.Properties;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

Expand All @@ -37,11 +35,7 @@ private void assertConfig(RedisProperties config) {
Assertions.assertEquals("redis://127.0.0.1:6379", config.getServerAddress());
Assertions.assertEquals(RedisProperties.ServerType.SINGLE, config.getServerType());
Assertions.assertEquals("serverMasterName-success!!!", config.getServerMasterName());

Properties properties = new Properties();
properties.put("threads", "2");
properties.put("nettyThreads", "2");
Properties redissonProperties = config.getRedissonProperties();
Assertions.assertEquals(properties, redissonProperties);
Assertions.assertEquals(2, config.getRedissonThreads());
Assertions.assertEquals(2, config.getRedissonNettyThreads());
}
}
Loading