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: [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]

Reply via email to