AshinGau commented on code in PR #14978: URL: https://github.com/apache/doris/pull/14978#discussion_r1051739236
########## fe/fe-core/src/main/java/org/apache/doris/catalog/Resource.java: ########## @@ -78,6 +107,26 @@ public static Resource fromStmt(CreateResourceStmt stmt) throws DdlException { return resource; } + public synchronized boolean removeReference(String referenceName, ReferenceType type) { + String fullName = referenceName + REFERENCE_SPLIT + type.name(); + if (references.remove(fullName) != null) { + LOG.info("Reference(type={}, name={}) is removed from resource {}, current set: {}", + type, referenceName, name, references); + return true; + } + return false; + } + + public synchronized boolean addReference(String referenceName, ReferenceType type) throws AnalysisException { Review Comment: Different statements may require different parameters even when using the same resource, so some checks are added in `addReference`. -- 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. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org