GlenGeng commented on a change in pull request #1936:
URL: https://github.com/apache/ozone/pull/1936#discussion_r582761554
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/BackgroundService.java
##########
@@ -43,14 +43,14 @@
LoggerFactory.getLogger(BackgroundService.class);
// Executor to launch child tasks
- private final ScheduledExecutorService exec;
+ private ScheduledExecutorService exec;
private final ThreadGroup threadGroup;
private final String serviceName;
private final long interval;
private final long serviceTimeoutInNanos;
private final TimeUnit unit;
private final PeriodicalTask service;
-
+ private final int threadPoolSize;
Review comment:
is this used ?
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/states/ContainerStateMap.java
##########
@@ -114,11 +114,7 @@ public void addContainer(final ContainerInfo info)
Preconditions.checkNotNull(info, "Container Info cannot be null");
final ContainerID id = info.containerID();
if (!contains(id)) {
- containerMap.put(id, info);
- lifeCycleStateMap.insert(info.getState(), id);
- ownerMap.insert(info.getOwner(), id);
- factorMap.insert(info.getReplicationFactor(), id);
- typeMap.insert(info.getReplicationType(), id);
+ build(info);
Review comment:
Can we have a better function name ?
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/DeletedBlockLogImplV2.java
##########
@@ -277,6 +277,12 @@ public int getNumOfValidTransactions() throws IOException {
}
}
+ @Override
+ public void reinitialize(
+ Table<Long, DeletedBlocksTransaction> deletedBlocksTXTable) {
+ this.deletedBlocksTXTable = deletedBlocksTXTable;
Review comment:
indent. Do you need to handle `deletedBlockLogStateManager` and
`transactionToDNsCommitMap` ?
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/SCMBlockDeletingService.java
##########
@@ -248,4 +248,9 @@ public boolean shouldRun() {
public String getServiceName() {
return SCMBlockDeletingService.class.getSimpleName();
}
+
+ @Override
+ public void stop() {
Review comment:
A shutdown thread pool can not be reused again, since after calling
shutdown on a ExecutorService, no new Task will be accepted.
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/states/ContainerStateMap.java
##########
@@ -128,6 +124,21 @@ public void addContainer(final ContainerInfo info)
}
}
+ /**
+ * The idea here is to rebuild the containerStateMap once the SCM
StateMachine
+ * reloads from the the DBCheckpoint downloaded from leader SCM.
+ *
+ * Replica Map won't be rebuild but will remain as it is.
+ */
+ public void build(final ContainerInfo info) throws SCMException {
Review comment:
Will it be used at other place than `addContainer` ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]