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

[BugFix] fix resources (#3129)

parent 69969f4f
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
package org.dinky.url; package org.dinky.url;
import org.dinky.data.model.SystemConfiguration;
import org.apache.flink.core.fs.FileSystem; import org.apache.flink.core.fs.FileSystem;
import org.apache.flink.core.fs.FileSystemFactory; import org.apache.flink.core.fs.FileSystemFactory;
...@@ -27,7 +29,10 @@ import java.net.URI; ...@@ -27,7 +29,10 @@ import java.net.URI;
import com.google.auto.service.AutoService; import com.google.auto.service.AutoService;
import lombok.extern.slf4j.Slf4j;
@AutoService(FileSystemFactory.class) @AutoService(FileSystemFactory.class)
@Slf4j
public class ResourceFileSystemFactory implements FileSystemFactory { public class ResourceFileSystemFactory implements FileSystemFactory {
@Override @Override
public String getScheme() { public String getScheme() {
...@@ -36,6 +41,11 @@ public class ResourceFileSystemFactory implements FileSystemFactory { ...@@ -36,6 +41,11 @@ public class ResourceFileSystemFactory implements FileSystemFactory {
@Override @Override
public FileSystem create(URI fsUri) throws IOException { 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(); 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