Description
hdfs storagepolicies command fails with HDFS federation.
For storage policies commands, a given user path should be resolved to a HDFS path and
storage policy command should be applied onto the resolved HDFS path.
static DistributedFileSystem getDFS(Configuration conf) throws IOException { FileSystem fs = FileSystem.get(conf); if (!(fs instanceof DistributedFileSystem)) { throw new IllegalArgumentException("FileSystem " + fs.getUri() + " is not an HDFS file system"); } return (DistributedFileSystem)fs; }