public synchronized void registerCatalog(Catalog catalog) { requireNonNull(catalog, "catalog is null"); checkState(catalogs.put(catalog.getCatalogName(), catalog) == null, "Catalog '%s' is already registered", catalog.getCatalogName()); }
public synchronized void registerCatalog(Catalog catalog) { requireNonNull(catalog, "catalog is null"); checkState(catalogs.put(catalog.getCatalogName(), catalog) == null, "Catalog '%s' is already registered", catalog.getCatalogName()); }
private synchronized Map<String, ConnectorId> getCatalogNames() { // todo if repeatable read, this must be recorded Map<String, ConnectorId> catalogNames = new HashMap<>(); catalogByName.values().stream() .filter(Optional::isPresent) .map(Optional::get) .forEach(catalog -> catalogNames.put(catalog.getCatalogName(), catalog.getConnectorId())); catalogManager.getCatalogs().stream() .forEach(catalog -> catalogNames.putIfAbsent(catalog.getCatalogName(), catalog.getConnectorId())); return ImmutableMap.copyOf(catalogNames); }
private synchronized Map<String, ConnectorId> getCatalogNames() { // todo if repeatable read, this must be recorded Map<String, ConnectorId> catalogNames = new HashMap<>(); catalogByName.values().stream() .filter(Optional::isPresent) .map(Optional::get) .forEach(catalog -> catalogNames.put(catalog.getCatalogName(), catalog.getConnectorId())); catalogManager.getCatalogs().stream() .forEach(catalog -> catalogNames.putIfAbsent(catalog.getCatalogName(), catalog.getConnectorId())); return ImmutableMap.copyOf(catalogNames); }
catalogManager.removeCatalog(catalog.getCatalogName()); removeConnectorInternal(systemConnector.getConnectorId()); removeConnectorInternal(informationSchemaConnector.getConnectorId());
catalogManager.removeCatalog(catalog.getCatalogName()); removeConnectorInternal(systemConnector.getConnectorId()); removeConnectorInternal(informationSchemaConnector.getConnectorId());