You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/04/21 15:15:03 UTC
[GitHub] [hadoop] virajjasani commented on a change in pull request #2945: HADOOP-17653. Do not use guava's Files.createTempDir().
virajjasani commented on a change in pull request #2945:
URL: https://github.com/apache/hadoop/pull/2945#discussion_r617639135
##########
File path: hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/impl/StateStoreFileImpl.java
##########
@@ -88,7 +88,16 @@ protected String getRootDir() {
if (this.rootDirectory == null) {
String dir = getConf().get(FEDERATION_STORE_FILE_DIRECTORY);
if (dir == null) {
- File tempDir = Files.createTempDir();
+ File tempDirBase =
+ new File(System.getProperty("java.io.tmpdir"));
+ File tempDir = null;
+ try {
+ tempDir = java.nio.file.Files.createTempDirectory(
+ tempDirBase.toPath(), System.currentTimeMillis() + "-").toFile();
+ } catch (IOException e) {
+ // fallback to the base upon exception.
Review comment:
Maybe a debug log would be good since this is rare anyways?
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org