RedisCommandReplicator Native method implementation#3
Open
liqi19950722 wants to merge 34 commits intomicrosphere-projects:dev-prfrom
Open
RedisCommandReplicator Native method implementation#3liqi19950722 wants to merge 34 commits intomicrosphere-projects:dev-prfrom
liqi19950722 wants to merge 34 commits intomicrosphere-projects:dev-prfrom
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
|
|
|
||
| @Override | ||
| public void handleEvent(Method method, Object redisCommandObject, Object... args) throws Throwable { | ||
| int length = args.length; |
|
|
||
| public static MethodHandle getWriteCommandMethodHandle(Method method) { | ||
| String id = buildCommandMethodId(method); | ||
| return writeCommandMethodHandlesCache.get(id); |
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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

