You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to mount and use hdfs using jnr-fuse. but iam getting below error.
-bash: cd: mydirectory: Input/output error
publicclassHdfsFuseWrapperextendsFuseStubFS{
@Overridepublicintgetxattr(Stringpath, Stringname, Pointervalue, @size_tlongsize) {
try {
// Get the extended attribute from HDFSSystem.out.println("getxpath:"+path+" "+name);
org.apache.hadoop.fs.FileStatusfileStatus = fileSystem.getFileStatus(newPath(path));
// String attrValue = fileStatus.getExtendedAttribute(name);System.out.println("prin::"+fileStatus.toString());
StringattrValue = "abc";
if (attrValue == null) {
return -ErrorCodes.ENODATA(); // No data available error
}
// Convert the attribute value to bytesbyte[] attrBytes = attrValue.getBytes();
if (attrBytes.length > size) {
return -ErrorCodes.ERANGE(); // Insufficient buffer error
}
// Copy the attribute value to the buffervalue.put(0, attrBytes, 0, attrBytes.length);
returnattrBytes.length; // Return the length of the attribute value
} catch (Exceptione) {
return -ErrorCodes.ENOENT(); // File not found error
}
}
@Overridepublicintgetattr(Stringpath, FileStatstat) {
try {
// Get the file status from HDFSorg.apache.hadoop.fs.FileStatusfileStatus = fileSystem.getFileStatus(newPath(path));
System.out.println("permis:"+fileStatus.getPermission());
// Set the file attributes in the stat structurestat.st_mode.set(fileStatus.getPermission().toShort());
stat.st_nlink.set(1); // Number of hard linksstat.st_size.set(fileStatus.getLen());
stat.st_atim.tv_sec.set(fileStatus.getAccessTime()/1000L);
stat.st_mtim.tv_sec.set(fileStatus.getModificationTime()/1000L);
//stat.st_mtime.set(fileStatus.getModificationTime() / 1000L); // Convert milliseconds to seconds//stat.st_ctime.set(fileStatus.getModificationTime() / 1000L);//stat.st_atime.set(fileStatus.getAccessTime() / 1000L);return0; // Success
} catch (Exceptione) {
return -ErrorCodes.ENOENT(); // File not found error
}
}
}
can someone help on this please?
The text was updated successfully, but these errors were encountered:
I am trying to mount and use hdfs using jnr-fuse. but iam getting below error.
-bash: cd: mydirectory: Input/output error
can someone help on this please?
The text was updated successfully, but these errors were encountered: