Unverified Commit d435984e authored by ZackYoung's avatar ZackYoung Committed by GitHub

[BugFix] fix resources (#3129)

parent 69969f4f
......@@ -19,6 +19,8 @@
package org.dinky.url;
import org.dinky.data.model.SystemConfiguration;
import org.apache.flink.core.fs.FileSystem;
import org.apache.flink.core.fs.FileSystemFactory;
......@@ -27,7 +29,10 @@ import java.net.URI;
import com.google.auto.service.AutoService;
import lombok.extern.slf4j.Slf4j;
@AutoService(FileSystemFactory.class)
@Slf4j
public class ResourceFileSystemFactory implements FileSystemFactory {
@Override
public String getScheme() {
......@@ -36,6 +41,11 @@ public class ResourceFileSystemFactory implements FileSystemFactory {
@Override
public FileSystem create(URI fsUri) throws IOException {
Boolean enable = SystemConfiguration.getInstances().getResourcesEnable().getValue();
if (enable == null || !enable) {
log.warn("rs protocol startup failed, not initialized");
return null;
}
return ResourceFileSystem.getSharedInstance();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment