You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Xiaoqiao He (Jira)" <ji...@apache.org> on 2020/06/30 14:25:00 UTC
[jira] [Comment Edited] (HDFS-15448) When starting a DataNode, call
BlockPoolManager#startAll() twice.
[ https://issues.apache.org/jira/browse/HDFS-15448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148723#comment-17148723 ]
Xiaoqiao He edited comment on HDFS-15448 at 6/30/20, 2:24 PM:
--------------------------------------------------------------
Thanks [~jianghuazhu], Good catch here. v001 almost LGTM, just one nit, `bpoList` -> `bposList`?.
A. I think we could make the code more clean even the following code segment (`BPServiceActor#start()`) can avoid to start bpThread twice.
{code:java}
//This must be called only by BPOfferService
void start() {
if ((bpThread != null) && (bpThread.isAlive())) {
//Thread is started already
return;
}
bpThread = new Thread(this);
bpThread.setDaemon(true); // needed for JUnit testing
bpThread.start();
if (lifelineSender != null) {
lifelineSender.start();
}
}
{code}
B. It is good practice to submit patch here or PR at Github only one place rather than both.
Let's wait what Jenkins says.
was (Author: hexiaoqiao):
Thanks [~jianghuazhu], Good catch here. v001 almost LGTM, just one nit, `bpoList` -> `bposList`?.
A. I think we could make the code more clean even the following code segment (`BPServiceActor#start()`) can avoid to start bpThread twice.
{quote} //This must be called only by BPOfferService
void start() {
if ((bpThread != null) && (bpThread.isAlive())) {
//Thread is started already
return;
}
bpThread = new Thread(this);
bpThread.setDaemon(true); // needed for JUnit testing
bpThread.start();
if (lifelineSender != null) {
lifelineSender.start();
}
}{quote}
B. It is good practice to submit patch here or PR at Github only one place rather than both.
Let's wait what Jenkins says.
> When starting a DataNode, call BlockPoolManager#startAll() twice.
> -----------------------------------------------------------------
>
> Key: HDFS-15448
> URL: https://issues.apache.org/jira/browse/HDFS-15448
> Project: Hadoop HDFS
> Issue Type: Improvement
> Affects Versions: 3.1.1
> Reporter: jianghua zhu
> Assignee: jianghua zhu
> Priority: Major
> Attachments: HDFS-15448.001.patch
>
>
> When starting a DataNode, call BlockPoolManager#startAll() twice.
> The first call:
> BlockPoolManager#doRefreshNamenodes()
> private void doRefreshNamenodes(
> Map<String, Map<String, InetSocketAddress>> addrMap,
> Map<String, Map<String, InetSocketAddress>> lifelineAddrMap)
> throws IOException {
> ...
> startAll();
> ...
> }
> The second call:
> DataNode#runDatanodeDaemon()
> public void runDatanodeDaemon() throws IOException {
> blockPoolManager.startAll();
> ...
> }
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org