How to check total files size in hdfs directory?

Is there a way to calculate the total file size of HDFS file directory in GB or MB? I dont want to use du/df command. Without that is there a way

HDFS 
Directory - /test/my_dir
I dont want to use du/df command. Without that is there a way

Why ?