hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yanbo Liang <yanboha...@gmail.com>
Subject Should use Filesystem.setPermission() rather than File.setWritable() to change a file access permission.
Date Mon, 24 Sep 2012 11:09:24 GMT
Hi all,

In the current test case of hadoop, if we want to corrupt or disable one
directory or file,
we use File.setWritable(false) such as in TestStorageRestore.java and

But we all know, the implementation of function setWritable() in Java API
is system-dependent,
and there are some jdk bugs in this function implementation.

In https://issues.apache.org/jira/browse/HADOOP-4824 , the patch had remove
the setWritable() function in 0.18.

We can use the Filesystem.setPermission() to change the file's access
and it supplies native method which invoke the operating system API in
Hadoop source code.

So should we change setWritable() to setPermission()?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message