ilooner commented on a change in pull request #1296: DRILL-5365: Prevent plugin
config from changing default fs. Make DrillFileSystem Immutable.
URL: https://github.com/apache/drill/pull/1296#discussion_r202491880
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/DrillFileSystem.java
##########
@@ -83,28 +87,63 @@
private final OperatorStats operatorStats;
private final CompressionCodecFactory codecFactory;
+ private boolean initialized = false;
+
public DrillFileSystem(Configuration fsConf) throws IOException {
this(fsConf, null);
}
public DrillFileSystem(Configuration fsConf, OperatorStats operatorStats)
throws IOException {
+ Preconditions.checkNotNull(fsConf);
+
+ // Configuration objects are mutable, and the underlying FileSystem object
may directly use a passed in Configuration.
+ // In order to avoid scenarios where a Configuration can change after a
DrillFileSystem is created, we make a copy
+ // of the Configuration.
+ fsConf = new Configuration(fsConf);
this.underlyingFs = FileSystem.get(fsConf);
Review comment:
Added a TODO to the javadoc in DrillFileSystemCache.java and created
https://issues.apache.org/jira/browse/DRILL-6608.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services