[NO ISSUE][*DB][CONTROL] Allow extension of INamespaceResolver

Change-Id: I37231085906ae9929cf715c9fd86af9931a80a65
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18334
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Reviewed-by: Hussain Towaileb <hussainht@gmail.com>
Tested-by: Michael Blow <mblow@apache.org>
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
index b8cd51a..8cd2487 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
@@ -175,7 +175,7 @@
                 ccServiceCtx.getAppConfig().getBoolean(CompilerProperties.Option.COMPILER_ENABLE_DB_RESOLUTION);
         boolean cloudDeployment = ccServiceCtx.getAppConfig().getBoolean(CLOUD_DEPLOYMENT);
         boolean useDatabaseResolution = cloudDeployment && isDbResolutionEnabled;
-        INamespaceResolver namespaceResolver = new NamespaceResolver(useDatabaseResolution);
+        INamespaceResolver namespaceResolver = createNamespaceResolver(useDatabaseResolution);
         INamespacePathResolver namespacePathResolver = new NamespacePathResolver(useDatabaseResolution);
         ccExtensionManager = new CCExtensionManager(new ArrayList<>(getExtensions()), namespaceResolver, ccServiceCtx);
         IGlobalRecoveryManager globalRecoveryManager = createGlobalRecoveryManager();
@@ -218,6 +218,10 @@
         jobCapacityController = new JobCapacityController(controllerService.getResourceManager());
     }
 
+    protected INamespaceResolver createNamespaceResolver(boolean useDatabaseResolution) {
+        return new NamespaceResolver(useDatabaseResolution);
+    }
+
     protected ICloudGuardian getCloudGuardian(CloudProperties cloudProperties) {
         return ICloudGuardian.NoOpCloudGuardian.INSTANCE;
     }
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java
index fc22f45..d5659cf 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/NCApplication.java
@@ -164,7 +164,7 @@
                 ncServiceCtx.getAppConfig().getBoolean(CompilerProperties.Option.COMPILER_ENABLE_DB_RESOLUTION);
         boolean cloudDeployment = ncServiceCtx.getAppConfig().getBoolean(CLOUD_DEPLOYMENT);
         boolean useDatabaseResolution = cloudDeployment && isDbResolutionEnabled;
-        NamespaceResolver namespaceResolver = new NamespaceResolver(useDatabaseResolution);
+        INamespaceResolver namespaceResolver = createNamespaceResolver(useDatabaseResolution);
         NamespacePathResolver namespacePathResolver = new NamespacePathResolver(useDatabaseResolution);
         ncExtensionManager = new NCExtensionManager(new ArrayList<>(getExtensions()), cloudDeployment,
                 namespaceResolver, ncServiceCtx);
@@ -201,6 +201,10 @@
         performLocalCleanUp();
     }
 
+    protected INamespaceResolver createNamespaceResolver(boolean useDatabaseResolution) {
+        return new NamespaceResolver(useDatabaseResolution);
+    }
+
     protected INcApplicationContext createNCApplicationContext(INCServiceContext ncServiceCtx,
             NCExtensionManager ncExtensionManager, IPropertiesFactory propertiesFactory,
             INamespaceResolver namespaceResolver, INamespacePathResolver namespacePathResolver)