Source:
private synchronized void addCatalogConnector(String catalogName, ConnectorId connectorId, ConnectorFactory factory, Map<String, String> properties) { MaterializedConnector connector = new MaterializedConnector(connectorId, createConnector(connectorId, factory, properties)); MaterializedConnector informationSchemaConnector = new MaterializedConnector( createInformationSchemaConnectorId(connectorId), new InformationSchemaConnector(catalogName, nodeManager, metadataManager, accessControlManager)); ConnectorId systemId = createSystemTablesConnectorId(connectorId); SystemTablesProvider staticProvider = new StaticSystemTablesProvider(connector.getSystemTables()); SystemTablesProvider metadataBasedProvider = new MetadataBasedSystemTablesProvider(metadataManager, catalogName); SystemTablesProvider systemTablesProvider = new DelegatingSystemTablesProvider(staticProvider, metadataBasedProvider); MaterializedConnector systemConnector = new MaterializedConnector(systemId, new SystemConnector( systemId, nodeManager, systemTablesProvider, transactionId -> transactionManager.getConnectorTransaction(transactionId, connectorId))); Catalog catalog = new Catalog( catalogName, connector.getConnectorId(), connector.getConnector(), informationSchemaConnector.getConnectorId(), informationSchemaConnector.getConnector(), systemConnector.getConnectorId(), systemConnector.getConnector()); try { addConnectorInternal(connector); addConnectorInternal(informationSchemaConnector); addConnectorInternal(systemConnector); catalogManager.registerCatalog(catalog); } catch (Throwable e) { catalogManager.removeCatalog(catalog.getCatalogName()); removeConnectorInternal(systemConnector.getConnectorId()); removeConnectorInternal(informationSchemaConnector.getConnectorId()); removeConnectorInternal(connector.getConnectorId()); throw e; } }

Target:
private synchronized void addCatalogConnector(String catalogName, ConnectorId connectorId, ConnectorFactory factory, Map<String, String> properties) { MaterializedConnector connector = new MaterializedConnector(connectorId, createConnector(connectorId, factory, properties)); MaterializedConnector informationSchemaConnector = new MaterializedConnector( createInformationSchemaConnectorId(connectorId), new InformationSchemaConnector(catalogName, nodeManager, metadataManager, accessControlManager)); ConnectorId systemId = createSystemTablesConnectorId(connectorId); SystemTablesProvider systemTablesProvider; if (nodeManager.getCurrentNode().isCoordinator()) { systemTablesProvider = new DelegatingSystemTablesProvider( new StaticSystemTablesProvider(connector.getSystemTables()), new MetadataBasedSystemTablesProvider(metadataManager, catalogName)); } else { systemTablesProvider = new StaticSystemTablesProvider(connector.getSystemTables()); } MaterializedConnector systemConnector = new MaterializedConnector(systemId, new SystemConnector( systemId, nodeManager, systemTablesProvider, transactionId -> transactionManager.getConnectorTransaction(transactionId, connectorId))); Catalog catalog = new Catalog( catalogName, connector.getConnectorId(), connector.getConnector(), informationSchemaConnector.getConnectorId(), informationSchemaConnector.getConnector(), systemConnector.getConnectorId(), systemConnector.getConnector()); try { addConnectorInternal(connector); addConnectorInternal(informationSchemaConnector); addConnectorInternal(systemConnector); catalogManager.registerCatalog(catalog); } catch (Throwable e) { catalogManager.removeCatalog(catalog.getCatalogName()); removeConnectorInternal(systemConnector.getConnectorId()); removeConnectorInternal(informationSchemaConnector.getConnectorId()); removeConnectorInternal(connector.getConnectorId()); throw e; } }