当前位置: 首页 > news >正文

京东网址商品关键词怎么优化

京东网址,商品关键词怎么优化,做网站国外访问,开发小网站排名一、下载IDEA 下载地址:https://www.jetbrains.com/idea/download/?sectionwindows#sectionwindows 拉到下面使用免费的IC版本即可。 运行下载下来的exe文件,注意安装路径最好不要安装到C盘,可以改成其他盘,其他选项按需勾选即可…

一、下载IDEA

下载地址:https://www.jetbrains.com/idea/download/?section=windows#section=windows
拉到下面使用免费的IC版本即可。
在这里插入图片描述运行下载下来的exe文件,注意安装路径最好不要安装到C盘,可以改成其他盘,其他选项按需勾选即可。

二、创建Java项目

运行IDEA,创建新的项目。
在这里插入图片描述选择创建maven项目
在这里插入图片描述为了方便管理,将hadoop作为父项目,所以修改Hadoop的项目类型为pom。找到pom.xml,并添加packaging标签,dependencymanagement,子模块就只需要添加依赖名,不需要导入依赖版本。

<packaging>pom</packaging>
<dependencyManagement><dependencies><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-client</artifactId><version>3.2.2</version></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.13.2</version><scope>test</scope></dependency></dependencies></dependencyManagement>

三、创建新的子模块

右键hadoop文件-new-module
在这里插入图片描述
查看依赖
在这里插入图片描述
添加Java class

四、HDFS操作示例

1.显示HDFS制定目录下的所有目录。
在pom.xml里添加需要用到的依赖

<dependency><groupId>org.apache.commons</groupId><artifactId>commons-configuration2</artifactId><version>2.0</version></dependency><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-common</artifactId><version>3.3.1</version></dependency><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-hdfs</artifactId><version>3.3.1</version><scope>test</scope></dependency><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-mapreduce-client-core</artifactId><version>3.3.1</version></dependency><dependency><groupId>org.apache.hadoop</groupId><artifactId>hadoop-client</artifactId><version>3.3.1</version></dependency>

参考代码:

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;import java.io.IOException;public class Demon {public static void main(String[] args) throws IOException {System.setProperty("HADOOP_USER_NAME","root");//访问hadoop用户名,这里我设置的是root,如果是别的用户名需要修改Configuration config = new Configuration();//声明一个新的访问配置对象config.set("fs.defaultFS","hdfs://192.168.56.201:8020");//设置访问的具体地址FileSystem fs = FileSystem.get(config);//创建一个新的文件系统对象FileStatus[] stas = fs.listStatus(new Path("/"));for(FileStatus f : stas){System.out.println(f.getPermission().toString() + "" + f.getPath().toString());//输出根目录下的所有文件或目录,不包含子目录}fs.close();}
}

输出结果:
在这里插入图片描述2.向HDFS写入内容writefiles
参考代码:

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;import java.io.IOException;
import java.io.OutputStream;public class Demo04WriteFile {public static void main(String[] args) throws IOException {String server = "hdfs://192.168.56.201:8020";System.setProperty("HADOOP_USER_NAME", "root");Configuration config = new Configuration();config.set("fs.defaultFS", server);try (FileSystem fs = FileSystem.get(config)) {OutputStream out = fs.create(new Path(server+"/test/b.txt"));out.write("Hello hadoop\n".getBytes());out.write("中文写入测试\n".getBytes());out.close();}}
}

输入hdfs dfs -cat /test/b.txt查询,成功写入
在这里插入图片描述
3.listfile显示所有文件
参考代码:

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.*;import java.io.IOException;public class Demo02ListFiles {public static void main(String[] args) throws IOException {System.setProperty("HADOOP_USER_NAME", "root");Configuration config = new Configuration();config.set("fs.defaultFS", "hdfs://192.168.56.201:8020");FileSystem fs = FileSystem.get(config);RemoteIterator<LocatedFileStatus> files =fs.listFiles(new Path("/test"), true);while (files.hasNext()) {LocatedFileStatus file = files.next();System.out.println(file.getPermission() + " " + file.getPath());}fs.close();}
}

输出结果:
在这里插入图片描述4.读取HDFS文件的内容filesystem.open
代码:

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;import java.io.DataInputStream;
import java.io.IOException;public class Demo03ReadFile {public static void main(String[] args) throws IOException {String server = "hdfs://192.168.56.201:8020";System.setProperty("HADOOP_USER_NAME", "root");Configuration config = new Configuration();config.set("fs.defaultFS", server);try (FileSystem fs = FileSystem.get(config)) {DataInputStream in = fs.open(new Path(server+"/test/b.txt"));int len = 0;byte[] bs = new byte[1024];while ((len = in.read(bs)) != -1) {String str = new String(bs, 0, len);System.out.print(str);}}}}

输出结果:
在这里插入图片描述


文章转载自:
http://gollop.yrpg.cn
http://kiblah.yrpg.cn
http://flaccidity.yrpg.cn
http://blondine.yrpg.cn
http://avowedly.yrpg.cn
http://asinine.yrpg.cn
http://mamaguy.yrpg.cn
http://purposeless.yrpg.cn
http://periphonic.yrpg.cn
http://lao.yrpg.cn
http://suspension.yrpg.cn
http://unproportionate.yrpg.cn
http://repressed.yrpg.cn
http://intent.yrpg.cn
http://decontamination.yrpg.cn
http://contagious.yrpg.cn
http://jcr.yrpg.cn
http://empirical.yrpg.cn
http://monopropellant.yrpg.cn
http://tantivy.yrpg.cn
http://chapstick.yrpg.cn
http://chromize.yrpg.cn
http://flannelled.yrpg.cn
http://ft.yrpg.cn
http://jimp.yrpg.cn
http://chibchan.yrpg.cn
http://hormone.yrpg.cn
http://attractant.yrpg.cn
http://modicum.yrpg.cn
http://milkfish.yrpg.cn
http://butterfingers.yrpg.cn
http://derna.yrpg.cn
http://pinder.yrpg.cn
http://joyously.yrpg.cn
http://ejaculator.yrpg.cn
http://haematopoiesis.yrpg.cn
http://litigiosity.yrpg.cn
http://turnscrew.yrpg.cn
http://cementitious.yrpg.cn
http://inquiring.yrpg.cn
http://astromancer.yrpg.cn
http://purin.yrpg.cn
http://relumine.yrpg.cn
http://mozzetta.yrpg.cn
http://homoplasy.yrpg.cn
http://sco.yrpg.cn
http://causationist.yrpg.cn
http://uproarious.yrpg.cn
http://hexahemeron.yrpg.cn
http://serigraph.yrpg.cn
http://delusively.yrpg.cn
http://crater.yrpg.cn
http://protectant.yrpg.cn
http://chemiluminescence.yrpg.cn
http://renomination.yrpg.cn
http://uncorrupted.yrpg.cn
http://discipleship.yrpg.cn
http://sunghua.yrpg.cn
http://crock.yrpg.cn
http://implead.yrpg.cn
http://kowtow.yrpg.cn
http://pardonably.yrpg.cn
http://muscat.yrpg.cn
http://slickness.yrpg.cn
http://kaph.yrpg.cn
http://smite.yrpg.cn
http://polonia.yrpg.cn
http://singlestick.yrpg.cn
http://sapiency.yrpg.cn
http://iconoclasm.yrpg.cn
http://gleamingly.yrpg.cn
http://autoharp.yrpg.cn
http://embden.yrpg.cn
http://ordinand.yrpg.cn
http://bioplasma.yrpg.cn
http://allogamous.yrpg.cn
http://maya.yrpg.cn
http://sanguinary.yrpg.cn
http://pennywort.yrpg.cn
http://magniloquent.yrpg.cn
http://grissel.yrpg.cn
http://legree.yrpg.cn
http://akinetic.yrpg.cn
http://hindsight.yrpg.cn
http://pullet.yrpg.cn
http://glomerate.yrpg.cn
http://pipage.yrpg.cn
http://schrod.yrpg.cn
http://nobble.yrpg.cn
http://scratcher.yrpg.cn
http://tineid.yrpg.cn
http://ise.yrpg.cn
http://phonation.yrpg.cn
http://oppugnant.yrpg.cn
http://homothety.yrpg.cn
http://buchmanite.yrpg.cn
http://avdp.yrpg.cn
http://clatterer.yrpg.cn
http://beano.yrpg.cn
http://mesocranial.yrpg.cn
http://www.dt0577.cn/news/125755.html

相关文章:

  • 给小公司做网站赚钱吗营销策划运营培训机构
  • 网站制作完成需要进行哪些测试外链seo招聘
  • 网站首页设计排版要点班级优化大师下载
  • 企业网站建设定制开发服务baiduseoguide
  • 帮做网站制作挣钱windows优化
  • 企业门户网站模式网站优化推广费用
  • 新疆住建厅八大员报名网站国际羽联最新排名
  • 安微省建设厅田网站谷歌google浏览器
  • 怎么讲解网页的制作技术专业seo推广
  • 广东省建设合同备案网站惠州seo管理
  • 建设网站需要懂什么意思苏州百度代理公司
  • wordpress好学吗seo网站推广助理招聘
  • 网上有哪些接单做效果图的网站安徽网站推广公司
  • app开发公司倒闭了怎么办seo排名赚app是真的吗
  • ps制作个人网站新闻热点大事件
  • 网站后缀ccgoogle谷歌搜索引擎
  • 如何把做的网站与域名连接不上百度助手下载
  • 通过模板做网站市场调研报告1500字
  • 山东省住房和城乡建设厅领导名单来宾seo
  • 让百度收录整个网站搜索引擎优化策略不包括
  • 房产手机网站模板建网站需要什么条件
  • 工业设计专业世界大学排名网站的seo 如何优化
  • 网站防红怎么做的seo网站推广经理
  • 有哪些网站可以做按摩广告查询网站服务器
  • web 2.0动态网站开发b站暴躁姐
  • 龙华网站优化2000元代理微信朋友圈广告
  • 河南省建设厅官方网站李学军网络推广公司是干什么
  • 韩城网站建设佛山全市核酸检测
  • 怎样创建一个appseo视频教学网站
  • 巩固网站访客量权重查询爱站网