-
Notifications
You must be signed in to change notification settings - Fork 11
RedisCommandReplicator Native method implementation #3
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
base: dev-pr
Are you sure you want to change the base?
RedisCommandReplicator Native method implementation #3
Conversation
add PrimitiveType
add ArrayType add VoidType
add ParameterizedType add ClassType
add method getMethodHandleBy add MethodHandleNotFoundException when not found
add testcontainers in the test scope add spring-boot-starter-data-redis in the test scope to autoconfigure in test
unImplement
mock unimplemented
test RedisCommandReplicatedEvent by use MethodHandleEventHandle way
jandex 3.1.6 -> 3.1.7
add writeCommandMethodHandlesCache
add judge eventHandler
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| @Override | ||
| public void handleEvent(Method method, Object redisCommandObject, Object... args) throws Throwable { | ||
| int length = args.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| public static MethodHandle getWriteCommandMethodHandle(Method method) { | ||
| String id = buildCommandMethodId(method); | ||
| return writeCommandMethodHandlesCache.get(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getWriteCommandMethodHandle() can return null (e.g., if initWriteCommandMethodHandleCache() logged an error and returned), which will surface later as an unhelpful NPE at the call site. Consider failing fast with a clearer exception or at least logging when the handle is missing.
🤖 Was this useful? React with 👍 or 👎
| .stream() | ||
| .filter(eventHandle -> eventHandle.name().equals(eventHandleType)) | ||
| .findFirst() | ||
| .orElseThrow(() -> new IllegalStateException("No eventHandle found")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.



实现 #2
新增 dependency org.testcontainers io.smallrye.jandex
microsphere-redis-spring 主要是新增class
microsphere-redis-replicator-spring 接口有变动
RedisCommandReplicatedEventHandler Benchmark 仅供参考

