0

As mentioned here: https://hadoop.apache.org/docs/r2.4.1/api/org/apache/hadoop/fs/FileSystem.html

"All user code that may potentially use the Hadoop Distributed File System should be written to use a FileSystem object."

Does it mean: if we used the java.io.File class then we are not using the HDFS of Hadoop and instead we are using the hosting file system like NTFS on Windows to access the file.

Please Notice: I am not talking about Java concepts or perspective(i.e. difference between File and FileSystem classes) I am talking about the effect of using the java.io.File on HDFS.

Mosab Shaheen
  • 1,114
  • 10
  • 25
  • Possible duplicate of [What does it mean to "program to an interface"?](http://stackoverflow.com/questions/383947/what-does-it-mean-to-program-to-an-interface) – Thomas Jungblut Nov 29 '16 at 10:56
  • No dear, it is completely different from what you suggested to me. I am taking here about Hadoop concepts&packages not about software engineering. – Mosab Shaheen Nov 29 '16 at 17:38
  • I'm pretty sure that this is what your quoted line means. Regardless of your filesystem implementation (Local, HDFS, S3), always use the interface/abstract class. – Thomas Jungblut Nov 29 '16 at 18:51
  • Dear, see the answer below @user7005835 – Mosab Shaheen Dec 02 '16 at 18:00

1 Answers1

-1

If I understand your question correctly, the answer is: Yes

If you are using Java.io.File then you are not using HDFS file system. Java.io.File will be a filesystem like windows or linux etc.

To create a file in HDFS you need to use FileSystem object and using FileSystem object you can create a file in HDFS.

Hope this helps!