-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-22930 Set unique name to longCompactions/shortCompactions threads #548
Conversation
💔 -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. |
💔 -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. |
new ThreadPoolExecutor(largeThreads, largeThreads, 60, TimeUnit.SECONDS, stealJobQueue, | ||
new ThreadFactoryBuilder().setNameFormat(n + "-longCompactions-" | ||
+ longCompactionThreadCounter.getAndIncrement() + "-" + System.currentTimeMillis()) | ||
.setDaemon(true).build()); |
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.
Does this work @pankaj72981 ? Each time we create a new thread in ThreadPoolExecutor, does the local longCompactionThreadCounter get a #getAndIncrement call so each thread gets an id? If so, do we need the System.currentTimeMillis thing?
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.
Thanks @saintstack Sir for looking into this issue.
Each time we create a new thread in ThreadPoolExecutor, does the local longCompactionThreadCounter get a #getAndIncrement call so each thread gets an id?
longCompactionThreadCounter works properly, each thread will have incremented ID.
do we need the System.currentTimeMillis thing?
Not so much required, will be better to have.
this.shortCompactions = new ThreadPoolExecutor(smallThreads, smallThreads, 60, TimeUnit.SECONDS, | ||
stealJobQueue.getStealFromQueue(), | ||
new ThreadFactoryBuilder().setNameFormat(n + "-shortCompactions-" | ||
+ shortCompactionThreadCounter.getAndIncrement() + "-" + System.currentTimeMillis()) |
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.
Does the 'n' have a thread number in it? If so, do we need this AtomicInteger? Drop the currentTimeMillis and counter and just decorate with -short or -long compaction addition?
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.
Does the 'n' have a thread number in it?
No, it will be just RS name/ip-port.
May be you can have a look into below discussion,
https://issues.apache.org/jira/browse/HBASE-22930?focusedCommentId=16922548&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16922548
Sorry @pankaj72981 I'm figuring that I do reviews but forget to do the 'submit' step so you don't see them.. they just hang out. My fault. |
…ns threads (apache#548)" This reverts commit d3cb7b4.
…ds (apache#548) (cherry picked from commit d3cb7b4) Change-Id: Ibe941d57377a84847c2a85048742c7e523b8de08
…ns threads (apache#548)" This reverts commit d3cb7b4. (cherry picked from commit 6a778b8) Change-Id: I8f05d4e8aebe5e2f94ca982a53dd46102ccc0f26
Appended the counter in the thread name.