You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "sercanCyberVision (via GitHub)" <gi...@apache.org> on 2023/06/10 21:39:18 UTC

[GitHub] [hive] sercanCyberVision commented on a diff in pull request #4403: HIVE-27317: Temporary (local) session files cleanup improvements

sercanCyberVision commented on code in PR #4403:
URL: https://github.com/apache/hive/pull/4403#discussion_r1225599533


##########
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/session/TestClearDanglingScratchDir.java:
##########
@@ -129,4 +132,68 @@ public void testClearDanglingScratchDir() throws Exception {
     Assert.assertEquals(StringUtils.countMatches(stderr.toString(), "removed"), 1);
     ss.close();
   }
+
+  /**
+   * Testing behaviour of ClearDanglingScratchDir service over local tmp files/dirs
+   * @throws Exception
+   */
+  @Test
+  public void testLocalDanglingFilesCleaning() throws Exception {
+    HiveConf conf = new HiveConf();
+    conf.set("fs.default.name", "file:///");
+    FileSystem fs = FileSystem.get(conf);
+
+    // constants
+    String appId = "appId_" + System.currentTimeMillis();
+    String userName = System.getProperty("user.name");
+    String hdfs = "hdfs";
+    String inuse = "inuse.lck";
+    String l = File.separator;
+
+    // simulating hdfs dangling dir and its inuse.lck file
+    // Note: Give scratch dirs all the write permissions
+    FsPermission allPermissions = new FsPermission((short)00777);
+    Path scratchDir = new Path(HiveConf.getVar(conf, HiveConf.ConfVars.SCRATCHDIR));
+    Utilities.createDirsWithPermission(conf, scratchDir, allPermissions, true);

Review Comment:
   `hdfs` scratch dir is all writable.



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org