Path fpath = new Path(context.getConfiguration()
.get(cacheFileIndex));
FileSystem hdfs = fpath.getFileSystem(context.getConfiguration());
System.out.println("cache path:"+fpath);
FSDataInputStream in = hdfs.open(fpath);
BufferedReader br=new BufferedReader(new InputStreamReader(in,"UTF-8"));
.get(cacheFileIndex));
FileSystem hdfs = fpath.getFileSystem(context.getConfiguration());
System.out.println("cache path:"+fpath);
FSDataInputStream in = hdfs.open(fpath);
BufferedReader br=new BufferedReader(new InputStreamReader(in,"UTF-8"));
本文介绍了一种使用Hadoop文件系统(HDFS)进行缓存文件读取的方法。具体步骤包括通过配置获取路径,打开文件系统连接,并使用缓冲输入流读取指定的缓存文件。
1134

被折叠的 条评论
为什么被折叠?



