-
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-22880 Move the DirScanPool out and do not use static field #527
Conversation
// Start log cleaner thread | ||
int cleanerInterval = conf.getInt("hbase.master.cleaner.interval", 600 * 1000); | ||
this.logCleaner = new LogCleaner(cleanerInterval, this, conf, | ||
getMasterFileSystem().getOldLogDir().getFileSystem(conf), getMasterFileSystem().getOldLogDir(), cleanerPool); |
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.
nit: two indents
//start the hfile archive cleaner thread | ||
Path archiveDir = HFileArchiveUtil.getArchivePath(conf); | ||
Map<String, Object> params = new HashMap<String, Object>(); | ||
params.put(MASTER, this); | ||
this.hfileCleaner = new HFileCleaner(cleanerInterval, this, conf, getMasterFileSystem() | ||
.getFileSystem(), archiveDir, params); | ||
.getFileSystem(), archiveDir, cleanerPool, params); |
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.
nit, usually don't start with '.'
FileSystem fs, Path oldFileDir, String confKey) { | ||
this(name, sleepPeriod, s, conf, fs, oldFileDir, confKey, null); | ||
FileSystem fs, Path oldFileDir, String confKey, DirScanPool pool) { | ||
this(name, sleepPeriod, s, conf, fs, oldFileDir, confKey,pool, null); |
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.
nit, space between ,pool
@Override | ||
public synchronized void onConfigurationChange(Configuration conf) { | ||
int newSize = CleanerChore.calculatePoolSize( | ||
conf.get(CleanerChore.CHORE_POOL_SIZE, CleanerChore.DEFAULT_CHORE_POOL_SIZE)); |
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.
Ditto, indents style.
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.
There're numbers of style problem, please fix. BTW, all the indents in DirScanPool.java is wrong. Indents should be two.
import org.apache.hadoop.conf.Configuration; | ||
import org.apache.hadoop.hbase.classification.InterfaceAudience; | ||
import org.apache.hadoop.hbase.conf.ConfigurationObserver; | ||
import org.slf4j.Logger; |
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.
In branch-1, we use package org.apache.commons.logging
* Checks if pool can be updated. If so, mark for update later. | ||
* @param conf configuration | ||
*/ | ||
@Override public synchronized void onConfigurationChange(Configuration conf) { |
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.
A new line after @Override
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.
Still unresolved?
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.*; |
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.
Avoid import *
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.
LGTM overall, left few comments.
💔 -1 overall
This message was automatically generated. |
/** | ||
* The thread pool used for scan directories | ||
*/ | ||
@InterfaceAudience.Private public class DirScanPool implements ConfigurationObserver { |
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.
A new line after @InterfaceAudience.Private
public static void tearDown() { | ||
POOL.shutdownNow(); | ||
} | ||
|
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.
nit, just keep one empty line.
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.
Only one nit.
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.
+1, let's wait QA results.
💔 -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. |
HBASE-22880