I want to get the locations i.e., the Data Nodes where the blocks of a file are located in. I am using snakebite to perform administrative operations like snapshot and snapdiff. I am wondering if there are APIs in snakebite or any other python APIs that will give me the block locations of files in HDFS. Getting them through command line:
hdfs fsck -files -locations -blocks
will be my last option.