Hadoop Library is imported but cannot set the “get” method in FyleSystem

Hadoop Library is imported but cannot set the “get” method in FyleSystem

I'm trying to setting up a call to HDFS to get a file from it using FileSystem to do so:

I'm trying to setting up a call to HDFS to get a file from it using FileSystem to do so:

FileSystem fs = new FileSystem.get(new URI.create(uri), conf);

But I getting this two errors even so I called all the libraries

    Error:(46, 39) java: cannot find symbol
    symbol:   class get
    location: class org.apache.hadoop.fs.FileSystem

Error:(46, 47) java: cannot find symbol
symbol:   method create(java.lang.String)
location: class org.apache.commons.httpclient.URI

This is for hadoop 2.7.7 version. I already tried imported the hole library org.apache.hadoop.fs.;but still the method get and create is not there when I'm trying to use them in the line as follow: FileSystem fs = new FileSystem.get(URI.create(usi), conf)

import org.apache.commons.httpclient.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;   

public class Test { public static void main(String []args) {

String uri = "hdfs://localhost:9000/data.json";
Configuration conf = new Configuration();

//cannot find symbol get
//Cannot find symbol create
FileSystem fs = new FileSystem.get(new URI.create(uri), conf);

InputStream in = null;

try {
    in = fs.open(new Path(uri));
    IOUtils.copyBytes(in, System.out, 4096, false);
} catch (IOException e) {
    e.printStackTrace();
} finally {
    IOUtils.closeStream(in);
}

} }

And here is my POM.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.boeing.bedl</groupId> <artifactId>IngestionData</artifactId> <version>1.0-SNAPSHOT</version>

<dependencies> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>2.7.7</version> </dependency>

&lt;dependency&gt;
    &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
    &lt;artifactId&gt;hadoop-yarn-common&lt;/artifactId&gt;
    &lt;version&gt;2.7.7&lt;/version&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
    &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
    &lt;artifactId&gt;hadoop-mapreduce-client-core&lt;/artifactId&gt;
    &lt;version&gt;2.7.7&lt;/version&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
    &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
    &lt;artifactId&gt;hadoop-mapreduce-client-common&lt;/artifactId&gt;
    &lt;version&gt;2.7.7&lt;/version&gt;
&lt;/dependency&gt;

</dependencies> </project>


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Hadoop vs Spark | Hadoop MapReduce vs Spark

🔥Intellipaat Big Data Hadoop Course: https://intellipaat.com/big-data-hadoop-training/ In this video on Hadoop vs Spark you will understand about the top Big...

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!