virajjasani commented on a change in pull request #1351:
URL: https://github.com/apache/phoenix/pull/1351#discussion_r749522713
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/query/PhoenixStatsCacheLoader.java
##########
@@ -43,15 +46,20 @@
public PhoenixStatsCacheLoader(PhoenixStatsLoader statsLoader,
Configuration config) {
this.statsLoader = statsLoader;
- if (this.executor == null) {
+ if (executor == null) {
synchronized (PhoenixStatsCacheLoader.class) {
- if (this.executor == null) {
+ if (executor == null) {
// The size of the thread pool used for refreshing cached
table stats
final int statsCacheThreadPoolSize = config.getInt(
QueryServices.STATS_CACHE_THREAD_POOL_SIZE,
QueryServicesOptions.DEFAULT_STATS_CACHE_THREAD_POOL_SIZE);
-
- this.executor =
Executors.newFixedThreadPool(statsCacheThreadPoolSize);
+ final ThreadFactory threadFactory =
+ new ThreadFactoryBuilder()
+ .setDaemon(true)
+
.setNameFormat("PHOENIX-STATS-CACHE-LOADER" + "-thread-%s")
Review comment:
nit: why not `"PHOENIX-STATS-CACHE-LOADER-thread-%s"` directly?
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/query/PhoenixStatsCacheLoader.java
##########
@@ -43,15 +46,20 @@
public PhoenixStatsCacheLoader(PhoenixStatsLoader statsLoader,
Configuration config) {
this.statsLoader = statsLoader;
- if (this.executor == null) {
+ if (executor == null) {
synchronized (PhoenixStatsCacheLoader.class) {
- if (this.executor == null) {
+ if (executor == null) {
// The size of the thread pool used for refreshing cached
table stats
final int statsCacheThreadPoolSize = config.getInt(
QueryServices.STATS_CACHE_THREAD_POOL_SIZE,
QueryServicesOptions.DEFAULT_STATS_CACHE_THREAD_POOL_SIZE);
-
- this.executor =
Executors.newFixedThreadPool(statsCacheThreadPoolSize);
+ final ThreadFactory threadFactory =
+ new ThreadFactoryBuilder()
+ .setDaemon(true)
Review comment:
This is the main fix right? Looks good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]