[
https://issues.apache.org/jira/browse/BOOKKEEPER-666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13736501#comment-13736501
]
Sijie Guo commented on BOOKKEEPER-666:
--------------------------------------
{quote}
+ final String thName = "BookKeeperOrderedSafeExecutor-" + i +"-%d";
+ ThreadFactoryBuilder tfb = new ThreadFactoryBuilder()
+ .setNameFormat(thName);
+ threads[i] = Executors.newSingleThreadExecutor(tfb.build());
{quote}
OrderedSafeExecutor is a generic executor. It could be used in other places. We
should not bind its naming. Provide a OrderedSafeExecutor which accepts a
ThreadFactoryBuilder to build threads, so the caller could give meaningful
names.
HierarchialLedgerManagerThread => HierarchialLedgerManagerScheduler
MsLedgerManagerThread => MSLedgerManagerScheduler (it is 'MS' not 'Ms'. it
would be better to keep same naming with the class name)
InMemoryMetastoreTableThread- + name + -%d =>
InMemoryMetastore-Table(name)-Scheduler-%d
{quote}
+ serverChannelFactory = new NioServerSocketChannelFactory(
+ Executors.newCachedThreadPool(tfb.setNameFormat(
+ "PubSubServer-NIOBoss-%d").build()),
+ Executors.newCachedThreadPool(tfb.setNameFormat(
+ "PubSubServer-NIOWorker-%d").build()));
+ clientChannelFactory = new NioClientSocketChannelFactory(
+ Executors.newCachedThreadPool(tfb.setNameFormat(
+ "PubSubServer-NIOBoss-%d").build()),
+ Executors.newCachedThreadPool(tfb.setNameFormat(
+ "PubSubServer-NIOWorker-%d").build()));
{quote}
the client channel factory is different from server channel factory. you should
differentiate them.
> Naming threads of ExecutorService
> ---------------------------------
>
> Key: BOOKKEEPER-666
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-666
> Project: Bookkeeper
> Issue Type: Improvement
> Components: bookkeeper-client, bookkeeper-server, hedwig-client,
> hedwig-server
> Affects Versions: 4.2.1
> Reporter: Rakesh R
> Assignee: Rakesh R
> Fix For: 4.3.0
>
> Attachments: 0001-BOOKKEEPER-666.patch, 0002-BOOKKEEPER-666.patch
>
>
> Useful to provide the naming behavior. Otw executors would create threads
> with default name like 'Thread[pool-1-thread-1]'.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira