This is an automated email from the ASF dual-hosted git repository.

sumitagrawal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 47c58c3dd3 HDDS-10702. Improve Recon startup failure handling and make 
it more resilient. (#6583)
47c58c3dd3 is described below

commit 47c58c3dd3631b6aea127e2c02a7cd0317b2b220
Author: Devesh Kumar Singh <[email protected]>
AuthorDate: Tue May 14 12:37:17 2024 +0530

    HDDS-10702. Improve Recon startup failure handling and make it more 
resilient. (#6583)
---
 .../apache/hadoop/ozone/recon/ReconContext.java    | 146 +++++++++++++++++++++
 .../hadoop/ozone/recon/ReconControllerModule.java  |   1 +
 .../hadoop/ozone/recon/scm/ReconNodeManager.java   |  37 +++++-
 .../scm/ReconStorageContainerManagerFacade.java    |  25 ++--
 .../ozone/recon/scm/TestReconNodeManager.java      |  50 ++++++-
 5 files changed, 243 insertions(+), 16 deletions(-)

diff --git 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconContext.java
 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconContext.java
new file mode 100644
index 0000000000..63fdae252a
--- /dev/null
+++ 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconContext.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership.  The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+
+package org.apache.hadoop.ozone.recon;
+
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * ReconContext is the single source of truth for some key information shared
+ * across multiple modules within Recon, including:
+ * 1) ReconNodeManager
+ * 2) OzoneManagerServiceProviderImpl
+ *
+ * If current Recon is not healthy, isHealthy check will return true/false 
accordingly.
+ * UnHealthyModuleErrorMap will maintain the error info for the module failed 
to load.
+ */
+@Singleton
+public final class ReconContext {
+  private static final Logger LOG = 
LoggerFactory.getLogger(ReconContext.class);
+
+  private final String threadNamePrefix;
+  private String clusterId;
+  private OzoneConfiguration ozoneConfiguration;
+  private ReconUtils reconUtils;
+  private AtomicBoolean isHealthy = new AtomicBoolean(true);
+
+  private Map<ErrorCode, String> errCodeMsgMap = new HashMap<>();
+  private Map<ErrorCode, List<String>> errCodeImpactMap = new HashMap<>();
+  private List<ErrorCode> errors = Collections.synchronizedList(new 
ArrayList<>());
+
+  @Inject
+  public ReconContext(OzoneConfiguration configuration, ReconUtils reconUtils) 
{
+    this.reconUtils = reconUtils;
+    this.ozoneConfiguration = configuration;
+    threadNamePrefix = 
reconUtils.getReconNodeDetails(configuration).threadNamePrefix();
+    initializeErrCodeMetaData();
+  }
+
+  private void initializeErrCodeMetaData() {
+    for (ErrorCode errorCode : ErrorCode.values()) {
+      errCodeMsgMap.put(errorCode, errorCode.getMessage());
+      errCodeImpactMap.put(errorCode, errorCode.getImpacts());
+    }
+  }
+
+  /**
+   * @param healthStatus : update Health Status of Recon.
+   */
+  public void updateHealthStatus(AtomicBoolean healthStatus) {
+    boolean oldHealthStatus = isHealthy.getAndSet(healthStatus.get());
+    LOG.info("Update healthStatus of Recon from {} to {}.", oldHealthStatus, 
isHealthy.get());
+  }
+
+  public AtomicBoolean isHealthy() {
+    return isHealthy;
+  }
+
+  public String threadNamePrefix() {
+    return threadNamePrefix;
+  }
+
+  public Map<ErrorCode, String> getErrCodeMsgMap() {
+    return errCodeMsgMap;
+  }
+
+  public Map<ErrorCode, List<String>> getErrCodeImpactMap() {
+    return errCodeImpactMap;
+  }
+
+  public List<ErrorCode> getErrors() {
+    return errors;
+  }
+
+  public void updateErrors(ErrorCode errorCode) {
+    errors.add(errorCode);
+  }
+
+  public void setClusterId(String clusterId) {
+    this.clusterId = clusterId;
+  }
+
+  public String getClusterId() {
+    return clusterId;
+  }
+
+  /**
+   * Error codes to make it easy to decode these errors in Recon.
+   */
+  public enum ErrorCode {
+    OK("Recon is healthy !!!", Collections.emptyList()),
+    INVALID_NETWORK_TOPOLOGY(
+        "Invalid network topology of datanodes. Failed to register and load 
datanodes. Pipelines may not be " +
+            "healthy !!!", Arrays.asList("Datanodes", "Pipelines")),
+    CERTIFICATE_INIT_FAILED(
+        "Error during initializing Recon certificate !!!",
+        Arrays.asList("Initializing secure Recon")),
+    INTERNAL_ERROR(
+        "Unexpected internal error. Kindly refer ozone-recon.log file for 
details !!!",
+        Arrays.asList("Recon health")),
+    GET_OM_DB_SNAPSHOT_FAILED(
+        "OM DB Snapshot sync failed !!!",
+        Arrays.asList("Overview (OM Data)", "OM DB Insights"));
+
+    private final String message;
+    private final List<String> impacts;
+
+    ErrorCode(String message, List<String> impacts) {
+      this.message = message;
+      this.impacts = impacts;
+    }
+
+    public String getMessage() {
+      return message;
+    }
+
+    public List<String> getImpacts() {
+      return impacts;
+    }
+  }
+}
diff --git 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconControllerModule.java
 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconControllerModule.java
index bb7ba4954d..39f41395bc 100644
--- 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconControllerModule.java
+++ 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconControllerModule.java
@@ -103,6 +103,7 @@ public class ReconControllerModule extends AbstractModule {
     bind(OzoneManagerServiceProvider.class)
         .to(OzoneManagerServiceProviderImpl.class).in(Singleton.class);
     bind(ReconUtils.class).in(Singleton.class);
+    bind(ReconContext.class).in(Singleton.class);
     // Persistence - inject configuration provider
     install(new JooqPersistenceModule(
         getProvider(DataSourceConfiguration.class)));
diff --git 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconNodeManager.java
 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconNodeManager.java
index 6232fb4907..ec86db678f 100644
--- 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconNodeManager.java
+++ 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconNodeManager.java
@@ -25,10 +25,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import com.google.common.annotations.VisibleForTesting;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdds.protocol.DatanodeDetails;
+import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos;
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.CommandQueueReportProto;
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.LayoutVersionProto;
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.NodeReportProto;
@@ -38,11 +40,13 @@ import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolPro
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMVersionRequestProto;
 import org.apache.hadoop.hdds.scm.ha.SCMContext;
 import org.apache.hadoop.hdds.scm.net.NetworkTopology;
+import org.apache.hadoop.hdds.scm.net.NetworkTopology.InvalidTopologyException;
 import org.apache.hadoop.hdds.scm.node.NodeStatus;
 import org.apache.hadoop.hdds.scm.node.SCMNodeManager;
 import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException;
 import org.apache.hadoop.hdds.scm.server.SCMStorageConfig;
 import org.apache.hadoop.hdds.server.events.EventPublisher;
+import org.apache.hadoop.hdds.server.events.EventQueue;
 import org.apache.hadoop.hdds.upgrade.HDDSLayoutVersionManager;
 import org.apache.hadoop.hdds.utils.HddsServerUtil;
 import org.apache.hadoop.hdds.utils.db.Table;
@@ -52,6 +56,7 @@ import 
org.apache.hadoop.ozone.protocol.commands.CommandForDatanode;
 import org.apache.hadoop.ozone.protocol.commands.RegisteredCommand;
 import org.apache.hadoop.ozone.protocol.commands.ReregisterCommand;
 import org.apache.hadoop.ozone.protocol.commands.SCMCommand;
+import org.apache.hadoop.ozone.recon.ReconContext;
 import org.apache.hadoop.util.Time;
 
 import com.google.common.collect.ImmutableSet;
@@ -71,6 +76,7 @@ public class ReconNodeManager extends SCMNodeManager {
       .getLogger(ReconNodeManager.class);
 
   private Table<UUID, DatanodeDetails> nodeDB;
+  private ReconContext reconContext;
   private static final Set<Type> ALLOWED_COMMANDS =
       ImmutableSet.of(reregisterCommand);
 
@@ -98,6 +104,13 @@ public class ReconNodeManager extends SCMNodeManager {
     this.reconDatanodeOutdatedTime = reconStaleDatanodeMultiplier *
         HddsServerUtil.getReconHeartbeatInterval(conf);
     this.nodeDB = nodeDB;
+  }
+
+  public ReconNodeManager(OzoneConfiguration conf, SCMStorageConfig 
scmStorageConfig, EventQueue eventQueue,
+                          NetworkTopology clusterMap, Table<UUID, 
DatanodeDetails> table,
+                          HDDSLayoutVersionManager scmLayoutVersionManager, 
ReconContext reconContext) {
+    this(conf, scmStorageConfig, eventQueue, clusterMap, table, 
scmLayoutVersionManager);
+    this.reconContext = reconContext;
     loadExistingNodes();
   }
 
@@ -276,8 +289,23 @@ public class ReconNodeManager extends SCMNodeManager {
             datanodeDetails.getUuid());
       }
     }
-    return super.register(datanodeDetails, nodeReport, pipelineReportsProto,
-        layoutInfo);
+    try {
+      RegisteredCommand registeredCommand = super.register(datanodeDetails, 
nodeReport, pipelineReportsProto,
+          layoutInfo);
+      reconContext.updateHealthStatus(new AtomicBoolean(true));
+      
reconContext.getErrors().remove(ReconContext.ErrorCode.INVALID_NETWORK_TOPOLOGY);
+      return registeredCommand;
+    } catch (InvalidTopologyException invalidTopologyException) {
+      LOG.error("InvalidTopologyException error occurred : {}", 
invalidTopologyException.getMessage());
+      reconContext.updateHealthStatus(new AtomicBoolean(false));
+      
reconContext.getErrors().add(ReconContext.ErrorCode.INVALID_NETWORK_TOPOLOGY);
+      return RegisteredCommand.newBuilder()
+          .setErrorCode(
+              
StorageContainerDatanodeProtocolProtos.SCMRegisteredResponseProto.ErrorCode.errorNodeNotPermitted)
+          .setDatanode(datanodeDetails)
+          .setClusterID(reconContext.getClusterId())
+          .build();
+    }
   }
 
   public void updateNodeOperationalStateFromScm(HddsProtos.Node scmNode,
@@ -344,4 +372,9 @@ public class ReconNodeManager extends SCMNodeManager {
         datanodeDetails.getUuid());
   }
 
+  @VisibleForTesting
+  public ReconContext getReconContext() {
+    return reconContext;
+  }
+
 }
diff --git 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconStorageContainerManagerFacade.java
 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconStorageContainerManagerFacade.java
index 046662398f..9f6bfcef00 100644
--- 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconStorageContainerManagerFacade.java
+++ 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconStorageContainerManagerFacade.java
@@ -89,6 +89,7 @@ import org.apache.hadoop.hdds.utils.db.DBStoreBuilder;
 import org.apache.hadoop.hdds.utils.db.Table;
 import org.apache.hadoop.hdds.utils.db.Table.KeyValue;
 import org.apache.hadoop.hdds.utils.db.TableIterator;
+import org.apache.hadoop.ozone.recon.ReconContext;
 import org.apache.hadoop.ozone.recon.ReconServerConfigKeys;
 import org.apache.hadoop.ozone.recon.ReconUtils;
 import org.apache.hadoop.ozone.recon.fsck.ContainerHealthTask;
@@ -147,6 +148,9 @@ public class ReconStorageContainerManagerFacade
   private final ReconDatanodeProtocolServer datanodeProtocolServer;
   private final EventQueue eventQueue;
   private final SCMContext scmContext;
+  // This will hold the recon related information like health status and 
errors in initialization of modules if any,
+  // which can later be used for alerts integration or displaying some 
meaningful info to user on Recon UI.
+  private final ReconContext reconContext;
   private final SCMStorageConfig scmStorageConfig;
   private final SCMNodeDetails reconNodeDetails;
   private final SCMHAManager scmhaManager;
@@ -175,18 +179,20 @@ public class ReconStorageContainerManagerFacade
   @Inject
   @SuppressWarnings({"checkstyle:ParameterNumber", "checkstyle:MethodLength"})
   public ReconStorageContainerManagerFacade(OzoneConfiguration conf,
-      StorageContainerServiceProvider scmServiceProvider,
-      ReconTaskStatusDao reconTaskStatusDao,
-      ContainerCountBySizeDao containerCountBySizeDao,
-      UtilizationSchemaDefinition utilizationSchemaDefinition,
-      ContainerHealthSchemaManager containerHealthSchemaManager,
-      ReconContainerMetadataManager reconContainerMetadataManager,
-      ReconUtils reconUtils,
-      ReconSafeModeManager safeModeManager) throws IOException {
+                                            StorageContainerServiceProvider 
scmServiceProvider,
+                                            ReconTaskStatusDao 
reconTaskStatusDao,
+                                            ContainerCountBySizeDao 
containerCountBySizeDao,
+                                            UtilizationSchemaDefinition 
utilizationSchemaDefinition,
+                                            ContainerHealthSchemaManager 
containerHealthSchemaManager,
+                                            ReconContainerMetadataManager 
reconContainerMetadataManager,
+                                            ReconUtils reconUtils,
+                                            ReconSafeModeManager 
safeModeManager,
+                                            ReconContext reconContext) throws 
IOException {
     reconNodeDetails = reconUtils.getReconNodeDetails(conf);
     this.threadNamePrefix = reconNodeDetails.threadNamePrefix();
     this.eventQueue = new EventQueue(threadNamePrefix);
     eventQueue.setSilent(true);
+    this.reconContext = reconContext;
     this.scmContext = new SCMContext.Builder()
         .setIsPreCheckComplete(true)
         .setSCM(this)
@@ -220,10 +226,11 @@ public class ReconStorageContainerManagerFacade
         true, new SCMDBTransactionBufferImpl());
     this.sequenceIdGen = new SequenceIdGenerator(
         conf, scmhaManager, 
ReconSCMDBDefinition.SEQUENCE_ID.getTable(dbStore));
+    reconContext.setClusterId(scmStorageConfig.getClusterID());
     this.nodeManager =
         new ReconNodeManager(conf, scmStorageConfig, eventQueue, clusterMap,
             ReconSCMDBDefinition.NODES.getTable(dbStore),
-            this.scmLayoutVersionManager);
+            this.scmLayoutVersionManager, reconContext);
     placementMetrics = SCMContainerPlacementMetrics.create();
     this.containerPlacementPolicy =
         ContainerPlacementPolicyFactory.getPolicy(conf, nodeManager,
diff --git 
a/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconNodeManager.java
 
b/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconNodeManager.java
index 99bb482cb5..02207f9c62 100644
--- 
a/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconNodeManager.java
+++ 
b/hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/scm/TestReconNodeManager.java
@@ -23,8 +23,11 @@ import static 
org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalSt
 import static 
org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState.IN_SERVICE;
 import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_NAMES;
 import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_METADATA_DIRS;
+import static org.apache.ratis.util.Preconditions.assertTrue;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.mockito.Mockito.eq;
@@ -39,6 +42,7 @@ import java.util.UUID;
 import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdds.protocol.DatanodeDetails;
 import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
+import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos;
 import 
org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.SCMCommandProto;
 import org.apache.hadoop.hdds.scm.net.NetworkTopology;
 import org.apache.hadoop.hdds.scm.net.NetworkTopologyImpl;
@@ -48,9 +52,11 @@ import 
org.apache.hadoop.hdds.upgrade.HDDSLayoutVersionManager;
 import org.apache.hadoop.hdds.utils.db.DBStore;
 import org.apache.hadoop.hdds.utils.db.DBStoreBuilder;
 import org.apache.hadoop.hdds.utils.db.Table;
+import org.apache.hadoop.ozone.protocol.commands.RegisteredCommand;
 import org.apache.hadoop.ozone.protocol.commands.ReregisterCommand;
 import org.apache.hadoop.ozone.protocol.commands.SCMCommand;
 import 
org.apache.hadoop.ozone.protocol.commands.SetNodeOperationalStateCommand;
+import org.apache.hadoop.ozone.recon.ReconContext;
 import org.apache.hadoop.ozone.recon.ReconUtils;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
@@ -69,16 +75,19 @@ public class TestReconNodeManager {
   private DBStore store;
   private ReconStorageConfig reconStorageConfig;
   private HDDSLayoutVersionManager versionManager;
+  private ReconContext reconContext;
 
   @BeforeEach
   public void setUp() throws Exception {
     conf = new OzoneConfiguration();
     conf.set(OZONE_METADATA_DIRS, temporaryFolder.toAbsolutePath().toString());
     conf.set(OZONE_SCM_NAMES, "localhost");
-    reconStorageConfig = new ReconStorageConfig(conf, new ReconUtils());
+    ReconUtils reconUtils = new ReconUtils();
+    reconStorageConfig = new ReconStorageConfig(conf, reconUtils);
     versionManager = new HDDSLayoutVersionManager(
         reconStorageConfig.getLayoutVersion());
     store = DBStoreBuilder.createDBStore(conf, new ReconSCMDBDefinition());
+    reconContext = new ReconContext(conf, reconUtils);
   }
 
   @AfterEach
@@ -86,6 +95,37 @@ public class TestReconNodeManager {
     store.close();
   }
 
+  @Test
+  public void testReconNodeManagerInitWithInvalidNetworkTopology() throws 
IOException {
+    ReconUtils reconUtils = new ReconUtils();
+    ReconStorageConfig scmStorageConfig =
+        new ReconStorageConfig(conf, reconUtils);
+    EventQueue eventQueue = new EventQueue();
+    NetworkTopology clusterMap = new NetworkTopologyImpl(conf);
+    Table<UUID, DatanodeDetails> nodeTable =
+        ReconSCMDBDefinition.NODES.getTable(store);
+    ReconNodeManager reconNodeManager = new ReconNodeManager(conf,
+        scmStorageConfig, eventQueue, clusterMap, nodeTable, versionManager, 
reconContext);
+    assertThat(reconNodeManager.getAllNodes()).isEmpty();
+
+    DatanodeDetails datanodeDetails = randomDatanodeDetails();
+    // Updating the node's topology depth to make it invalid.
+    datanodeDetails.setNetworkLocation("/default-rack/xyz/");
+    String uuidString = datanodeDetails.getUuidString();
+
+    // Register a random datanode.
+    RegisteredCommand register = reconNodeManager.register(datanodeDetails, 
null, null);
+    assertNotNull(register);
+    
assertEquals(StorageContainerDatanodeProtocolProtos.SCMRegisteredResponseProto.ErrorCode.errorNodeNotPermitted,
+        register.getError());
+    assertEquals(reconContext.getClusterId(), register.getClusterID());
+    assertFalse(reconContext.isHealthy().get());
+    
assertTrue(reconContext.getErrors().get(0).equals(ReconContext.ErrorCode.INVALID_NETWORK_TOPOLOGY));
+
+    assertEquals(0, reconNodeManager.getAllNodes().size());
+    assertNull(reconNodeManager.getNodeByUuid(uuidString));
+  }
+
   @Test
   public void testReconNodeDB() throws IOException, NodeNotFoundException {
     ReconStorageConfig scmStorageConfig =
@@ -95,7 +135,7 @@ public class TestReconNodeManager {
     Table<UUID, DatanodeDetails> nodeTable =
         ReconSCMDBDefinition.NODES.getTable(store);
     ReconNodeManager reconNodeManager = new ReconNodeManager(conf,
-        scmStorageConfig, eventQueue, clusterMap, nodeTable, versionManager);
+        scmStorageConfig, eventQueue, clusterMap, nodeTable, versionManager, 
reconContext);
     ReconNewNodeHandler reconNewNodeHandler =
         new ReconNewNodeHandler(reconNodeManager);
     assertThat(reconNodeManager.getAllNodes()).isEmpty();
@@ -162,7 +202,7 @@ public class TestReconNodeManager {
     eventQueue.close();
     reconNodeManager.close();
     reconNodeManager = new ReconNodeManager(conf, scmStorageConfig, eventQueue,
-        clusterMap, nodeTable, versionManager);
+        clusterMap, nodeTable, versionManager, reconContext);
 
     // Verify that the node information was persisted and loaded back.
     assertEquals(1, reconNodeManager.getAllNodes().size());
@@ -179,7 +219,7 @@ public class TestReconNodeManager {
     Table<UUID, DatanodeDetails> nodeTable =
         ReconSCMDBDefinition.NODES.getTable(store);
     ReconNodeManager reconNodeManager = new ReconNodeManager(conf,
-        scmStorageConfig, eventQueue, clusterMap, nodeTable, versionManager);
+        scmStorageConfig, eventQueue, clusterMap, nodeTable, versionManager, 
reconContext);
 
 
     DatanodeDetails datanodeDetails = randomDatanodeDetails();
@@ -213,7 +253,7 @@ public class TestReconNodeManager {
     Table<UUID, DatanodeDetails> nodeTable =
         ReconSCMDBDefinition.NODES.getTable(store);
     ReconNodeManager reconNodeManager = new ReconNodeManager(conf,
-        scmStorageConfig, eventQueue, clusterMap, nodeTable, versionManager);
+        scmStorageConfig, eventQueue, clusterMap, nodeTable, versionManager, 
reconContext);
     ReconNewNodeHandler reconNewNodeHandler =
         new ReconNewNodeHandler(reconNodeManager);
     assertThat(reconNodeManager.getAllNodes()).isEmpty();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to