zuston commented on code in PR #53:
URL: https://github.com/apache/incubator-uniffle/pull/53#discussion_r949989631
##########
storage/src/main/java/org/apache/uniffle/storage/handler/impl/HdfsFileWriter.java:
##########
@@ -39,35 +39,37 @@ public class HdfsFileWriter implements Closeable {
private static final Logger LOG =
LoggerFactory.getLogger(HdfsFileWriter.class);
+ private final FileSystem fileSystem;
+
private Path path;
private Configuration hadoopConf;
private FSDataOutputStream fsDataOutputStream;
private long nextOffset;
- public HdfsFileWriter(Path path, Configuration hadoopConf) throws
IOException, IllegalStateException {
- // init fsDataOutputStream
+ public HdfsFileWriter(FileSystem fileSystem, Path path, Configuration
hadoopConf) throws IOException {
this.path = path;
this.hadoopConf = hadoopConf;
+ this.fileSystem = fileSystem;
initStream();
}
private void initStream() throws IOException, IllegalStateException {
- FileSystem fileSystem = ShuffleStorageUtils.getFileSystemForPath(path,
hadoopConf);
- if (fileSystem.isFile(path)) {
+ final FileSystem writerFs = fileSystem;
+ if (writerFs.isFile(path)) {
if (hadoopConf.getBoolean("dfs.support.append", true)) {
- fsDataOutputStream = fileSystem.append(path);
+ fsDataOutputStream = writerFs.append(path);
Review Comment:
> With delegation mode(proxy user delegate real user), the security
FileSystem will write data with real user?
Yes. The data file's owner is real user.
> Do we need create a new UserGroupInformation, and wapper the action in
ugi.doAs()?
No need to wrap operation in `ugi.doAs().` Once secured filesystem is
created, all secured data operation are all handled by it. I have tested it.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]