Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hdfs federation #441

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix hdfs federation #441

wants to merge 1 commit into from

Conversation

YunKillerE
Copy link

When hdfs use Federation will Exception:

09-25-2018 17:56:06 ERROR [Thread-6] com.linkedin.drelephant.ElephantRunner : getDefaultBlockSize on path `/' is not within a mount point
09-25-2018 17:56:06 ERROR [Thread-6] com.linkedin.drelephant.ElephantRunner : org.apache.hadoop.fs.viewfs.NotInMountpointException: getDefaultBlockSize on path `/' is not within a mount point
        at org.apache.hadoop.fs.viewfs.ViewFileSystem$InternalDirOfViewFs.getDefaultBlockSize(ViewFileSystem.java:928)
        at org.apache.hadoop.fs.viewfs.ViewFileSystem.getDefaultBlockSize(ViewFileSystem.java:658)
        at com.linkedin.drelephant.analysis.HDFSContext.load(HDFSContext.java:44)
        at com.linkedin.drelephant.ElephantRunner$1.run(ElephantRunner.java:101)
        at com.linkedin.drelephant.ElephantRunner$1.run(ElephantRunner.java:98)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:360)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1900)
        at com.linkedin.drelephant.security.HadoopSecurity.doAs(HadoopSecurity.java:109)
        at com.linkedin.drelephant.ElephantRunner.run(ElephantRunner.java:98)
        at com.linkedin.drelephant.DrElephant.run(DrElephant.java:34)

try {
HDFS_BLOCK_SIZE = FileSystem.get(new Configuration()).getDefaultBlockSize(new Path("/tmp"));
} catch (IOException e1) {
e1.printStackTrace();
Copy link
Contributor

@pralabhkumar pralabhkumar Dec 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please log the error , instead of printStackTrace

/**
* Currently most companies use 128M as the default block size
*/
HDFS_BLOCK_SIZE = 128 * 1024 * 1024;
Copy link
Contributor

@pralabhkumar pralabhkumar Dec 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its better to have 64MB as default (as thats HDFS default block size) . There should be property from the configuration file for defaultblocksize (or the path which is mounted instead of looking for / or /tmp), if getDefaultBlockSize gives exception then user provided default size can be taken (or other way round check if user have provided default block size , if not then go for getDefaultBlockSize and if that also gives exception then by default 64MB should be taken).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants