-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-24718 : Generic NamedQueue framework for multiple use-cases (Refactor SlowLog responses) #2052
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
Conversation
…factor SlowLog responses)
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
wchevreuil
left a comment
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.
Since we are working on refactoring, could we make leg event handler/log service generic enough for further additions of other possible log services in the future?
hbase-server/src/main/java/org/apache/hadoop/hbase/namequeues/LogEventHandler.java
Show resolved
Hide resolved
| // If NamedQueue of specific type is enabled, corresponding Queue will be used to | ||
| // insert and retrieve records. | ||
| // Individual queue sizes should be determined based on their individual configs. | ||
| private final Map<NamedQueuePayload.NamedQueueEvent, Queue> namedQueues = new HashMap<>(); |
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.
For example, the caller should be able to determine which queue implementations (and its related services) should be loaded. That would isolate LogEventHandler from being constantly modified by additional services requiring this type of loggings.
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.
Strategy pattern is good thought but we don't have common payload coming from client so far. Specifically when admin client will talk to RSRpcServer and that will talk to LogEventHandler, they expect specific payload for specific use-case. However, this fits well for strategy pattern and we should have common request payload. Let me try this one. Thanks for the suggestion @wchevreuil .
hbase-server/src/main/java/org/apache/hadoop/hbase/namequeues/SlowLogPersistentService.java
Show resolved
Hide resolved
virajjasani
left a comment
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.
While not all service could use interface e.g persistence will only be used for specific use-cases, but service layer that stores actual queue implementation can have well defined strategy pattern. Let me try this.
hbase-server/src/main/java/org/apache/hadoop/hbase/namequeues/SlowLogPersistentService.java
Show resolved
Hide resolved
| // If NamedQueue of specific type is enabled, corresponding Queue will be used to | ||
| // insert and retrieve records. | ||
| // Individual queue sizes should be determined based on their individual configs. | ||
| private final Map<NamedQueuePayload.NamedQueueEvent, Queue> namedQueues = new HashMap<>(); |
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.
Strategy pattern is good thought but we don't have common payload coming from client so far. Specifically when admin client will talk to RSRpcServer and that will talk to LogEventHandler, they expect specific payload for specific use-case. However, this fits well for strategy pattern and we should have common request payload. Let me try this one. Thanks for the suggestion @wchevreuil .
virajjasani
left a comment
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.
Updated PR with requested changes for Queue service implementation with strategy pattern
hbase-server/src/main/java/org/apache/hadoop/hbase/namequeues/LogEventHandler.java
Show resolved
Hide resolved
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
|
||
| LogEventHandler(final Configuration conf) { | ||
| // add all service mappings here | ||
| namedQueueServices |
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.
How about define a String collection property for all implementations of NamedQueueService? So that this handler can load those dynamically, without requiring code changes once new implementations are added.
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.
Your suggestion is to use reflection to find all implementors of NamedQueueService interface? Or some separate string collection? If we have separate immutable string(classname) collection, even that will require changes once we implement new implementor. Or I am missing something?
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.
Use reflection and avoid changing this class with every new implementation added, something similar to what we do for SaslServerAuthenticationProviders
hbase-server/src/main/java/org/apache/hadoop/hbase/namequeues/SlowLogPersistentService.java
Show resolved
Hide resolved
…ng to update LogEventHandler
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
…factor SlowLog responses) Closes #2052 Signed-off-by: Wellington Chevreuil <[email protected]>
…factor SlowLog responses) (#2109) Closes #2052 Signed-off-by: Wellington Chevreuil <[email protected]>
…factor SlowLog responses) (#2110) Closes #2052 Signed-off-by: Wellington Chevreuil <[email protected]>
…factor SlowLog responses) Closes apache#2052 Signed-off-by: Wellington Chevreuil <[email protected]>
…factor SlowLog responses) (apache#2110) Closes apache#2052 Signed-off-by: Wellington Chevreuil <[email protected]>
No description provided.