-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-3566]add thread factory in BoundedInMemoryExecutor #4926
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
|
@hudi-bot run azure |
|
@leesf : Can you help w/ reviewing this patch please |
| import java.util.concurrent.atomic.AtomicLong; | ||
|
|
||
| /** | ||
| * A factory to named thread |
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.
sorry, I am a little confused about the description.
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 "A thread factory for custom creation of threads" ?
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.
@scxwhite A thread factory for creation of threads should be ok, and would you please create a jira ticket and change the PR title accordingly?
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.
@leesf done.
|
|
||
| // Executor service used for launching writer thread. | ||
| private final ExecutorService executorService; | ||
| // Executor service used for launching read thread. |
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.
producerExecutorService should be write thread and consumerExecutorService should be read thread?
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.
I'm careless, I'll change it
|
@hudi-bot run azure |
|
@leesf please review again. |
| } | ||
|
|
||
| @Test | ||
| public void defaultThreadPrefixTest() throws ExecutionException, InterruptedException { |
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.
here please use testDefaultThreadPrefix
| } | ||
|
|
||
| @Test | ||
| public void daemonThreadTest() throws ExecutionException, InterruptedException { |
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.
testDaemonThread
|
@hudi-bot run azure |
|
@hudi-bot run azure |
Co-authored-by: 苏承祥 <[email protected]>
Co-authored-by: 苏承祥 <[email protected]>
Tips
What is the purpose of the pull request
This pull request adds thread factory in BoundedInMemoryExecutor.
Under the old code, we could not clearly distinguish the role of each thread in the thread dump during the data merging phase of the MOR table. So I added a CustomizedThreadFactory class. And added a thread pool factory name that can be used to identify the role of the thread for BoundedInMemoryExecutor.
Brief change log
(for example:)
Verify this pull request
(Please pick either of the following options)
This pull request is a trivial rework / code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.