davidradl commented on code in PR #27605:
URL: https://github.com/apache/flink/pull/27605#discussion_r2895863522
##########
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/resource/ClientResourceManager.java:
##########
@@ -48,15 +48,27 @@ public ClientResourceManager(Configuration config,
MutableURLClassLoader userCla
}
@Nullable
- public URL unregisterJarResource(String jarPath) {
- Path path = new Path(jarPath);
+ public URL unregisterResource(String resourcePath) {
+ Path path = new Path(resourcePath);
try {
- checkPath(path, ResourceType.JAR);
- return resourceInfos.remove(
- new ResourceUri(ResourceType.JAR,
getURLFromPath(path).getPath()));
+ String urlPath = getURLFromPath(path).getPath();
+
+ // Check if it exists as JAR first
+ ResourceUri jarUri = new ResourceUri(ResourceType.JAR, urlPath);
+ if (resourceInfos.containsKey(jarUri)) {
+ checkPath(path, ResourceType.JAR);
+ return resourceInfos.remove(jarUri);
+ }
+
+ // Check if it exists as ARTIFACT
+ ResourceUri artifactUri = new ResourceUri(ResourceType.ARTIFACT,
urlPath);
+ if (resourceInfos.containsKey(artifactUri)) {
+ checkPath(path, ResourceType.ARTIFACT);
+ return resourceInfos.remove(artifactUri);
+ }
Review Comment:
should we have an error is there is an attempt to unregister something that
is not a jar or an artifact? Or at least a log entry.
Can a file or archive resource type come to this method?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]