hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Oskin <stas.os...@gmail.com>
Subject Re: Getting free space percentage on DFS
Date Mon, 24 Aug 2009 08:20:21 GMT
Hi.

2009/8/23 Arvind Sharma <arvind321@yahoo.com>

> You can try something like this:
>
>
> if (_FileSystem instanceof DistributedFileSystem)
>        {
>            DistributedFileSystem dfs = (DistributedFileSystem)
> _FileSystems;
>            DiskStatus ds = dfs.getDiskStatus();
>            long capacity = ds.getCapacity();
>            long used = ds.getDfsUsed();
>            long remaining = ds.getRemaining();
>            long presentCapacity = used + remaining;
>
>            hdfsPercentDiskUsed = Math.round((((1.0 * used) /
> presentCapacity) * 100));
>        }
>

 I just tested it, and I'm getting the exception that I'm not the superuser
- "Superuser privilege is required".

Any idea how to bypass this?

Thanks in advance!

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