xinghuayu007 commented on a change in pull request #5578:
URL: https://github.com/apache/incubator-doris/pull/5578#discussion_r605645006
##########
File path:
fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/FileSystemManager.java
##########
@@ -268,7 +268,17 @@ public BrokerFileSystem getDistributedFileSystem(String
path, Map<String, String
long currentTime = System.currentTimeMillis();
Random random = new Random(currentTime);
int randNumber = random.nextInt(10000);
- tmpFilePath = "/tmp/." + Long.toString(currentTime) +
"_" + Integer.toString(randNumber);
+ // different kerberos account has different file
+ tmpFilePath = "/tmp/." + principal + "_" +
Long.toString(currentTime) + "_" + Integer.toString(randNumber);
+ // before write keytab content into a tmp file, delete
if in case of old file confusion
+ try {
+ File file = new File(tmpFilePath);
+ if(!file.delete()){
+ logger.warn("delete tmp file:" + tmpFilePath
+ " failed");
+ }
+ } catch (Exception e) {
Review comment:
I think it again. It is no need to delete file. Because the file name
contains the principal name, kerberos account never be duplicate. Therefore `
tmpFilePath = "/tmp/." + principal + "_" + Long.toString(currentTime) + "_" +
Integer.toString(randNumber);` will make the file name unique.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]