hadoop - Read default block size of HDFS using Java API -


i want read default block size value hdfs-site.xml using java program ? can in ?

<property>     <name>dfs.blocksize</name>     <value>134217728</value>   </property> 

you can try using get method of configuration parameter (or other). first need add resource, did in comment posted, , parameter:

configuration conf = getconf(); conf.addresource(new path("/etc/hadoop/conf/hdfs-site.xml")); system.out.println(conf.get("dfs.blocksize")); 

hope helps.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -