hadoop

感谢您能抽出几分钟时间来参加本次答题,现在我们就马上开始吧!

Q1:A:大数据的定义是无法由现有软件工具提取,存储,搜索,共享,分析和处理的庞大而复杂的数据集。B:DT:数字处理技术,一种服务于公众并刺激生产力的技术。

 A不正确,B正确
 A和B都正确
 A正确,B不正确
 A和B都不正确

Q2:以下哪个选项不是大数据的显著特征?

 大量数据
 多样化
 速度不快
价值密度低

Q3:关于下面的说法,不正确的是

Hadoop的核心体系结构是MapReduce编程模型和HDFS分布式文件系统。
HIVE是apache的开源KV(Key-Value)数据库,它只能通过行键和行键范围检索数据。
Sqoop允许用户将数据从关系型数据库中抽取数据到Hadoop中,用于进一步处理。
zookeeper 是一个高性能,分布式的,开源分布式应用协调服务,是 storm、hbase 的重要组件。

Q4:以下那个不是Hadoop可以运行的模式?

单机(本地)模式
伪分布式模式
分布式模式
机架模式

Q5:HBase依靠以下哪个框架存储底层数据?

HDFS
Zookeeper
Hive
MapReduce

Q6:以下哪个Hadoop shell命令用于改变文件的拥有者?

cat
chgrp
chmod
chown

Q7:以下对Hadoop shell命令的描述,哪个是错误的?

chgrp用于改变文件的拥有者
get用于复制文件到本地文件系统
put从本地文件系统中复制单个或多个源路径到目标文件系统
rm用于删除指定的文件

Q8:在Hadoop的shell命令中,显示HDFS上/user/niit/data.txt文件内容的命令,正确的是?

hadoop fs -cat /user/niit/data.txt
hadoop -cat /user/niit/data.txt
hadoop dfs -cat /user/niit/data.txt
hadoop cat -fs /user/niit/data.txt

Q9:以下哪个函数可以用于修改HDFS中的文件名?

使用FileSystem.rename()函数
使用FileSystem.move()函数
使用FileSystem.change()函数
使用FileSystem.copy()和FileSystem.delete()函数

Q10:以下哪个函数可以用于删除HDFS中的文件?

 使用FileSystem.rm()函数
使用FileSystem.remove()函数
使用FileSystem.delete()函数
使用FileSystem.expunge()函数

Q11:以下哪个不是Hadoop序列化的特点?

紧凑:即方便网络传输,充分列用存储空间
复杂:能处理各种对象关系
扩展性:即可扩展,协议会随着时间的推移而变化以满足新的要求
互操作性:支持以不同语言编写的客户端到服务器

Q12:以下哪个选项是正确的?

Hadoop中的所有可序列化对象都必须实现Writable接口
Hadoop中的所有可序列化对象都必须实现Serializable接口
Hadoop中的所有可序列化对象都必须实现Serialization接口
Hadoop中的所有可序列化对象都必须实现Comparable接口

Q13:以下哪个选项是错误的?

WritableComparable接口是Writable和Comparable的子接口
Text是UTF-8的Writable。可以将它理解为一种与java.lang.String 相类似的Writable
NullWritable是一种特殊的Writable类型,因为它的序列化的长度是零。可以做占位符。
Hadoop的自定义序列化可以不用实现Writable接口

Q14:在NameNode的数据文件夹中,有几个特定文件名的文件,关于这几个文件的描述正确的是?A:fsimage:元数据镜像文件。存储某一时段NameNode内存元数据信息B:fstime:保存最近一次checkpoint的时间

A正确,B不正确
A不正确,B正确
A和B都正确
A和B都不正确

Q15:15. 关于NameNode的说法,正确的是?A:提供真实文件数据的存储服务,DataNode启动时的上报自身存储的块信息B:Replication:多复本。默认是三个,可通过配置文件配置

A正确,B不正确
A不正确,B正确
A和B都正确
A和B都不正确

Q16:关于ResourceManager的说法,正确的是?A:用户提交的每个应用程序均包含一个ApplicationMaster,主要功能与ResourceManager调度器协商以获取资源B:和资源管理器协商,以获取资源(Container)个,可通过配置文件配置

A正确,B不正确
A不正确,B正确
A和B都正确
A和B都不正确

Q17:关于Container的说法,正确的是?A:Container 是YARN 中的资源抽象,它封装了某个DataNode节点上的资源,如有多少内存、多少个CPUB:ResourceManager以Container的形式来返回NodeManager申请的资源

A正确,B不正确
A不正确,B正确
A和B都正确
A和B都不正确

Q18:关于NodeManager的说法,正确的是?A:它会定时地向 AM 汇报本节点上的资源使用情况和各个 Container 的运行状态B:它接收并处理来自 AM 的 Container 启动/停止等各种请求

A正确,B不正确
A不正确,B正确
A和B都正确
A和B都不正确

Q19:public class FileDecompressor { public static void main(String[] args) throws Exception { String uri = args[0]; Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(URI.create(uri), conf); Path inputPath = new Path(uri); ( ) if (codec == null) { System.err.println(No codec found for + uri); System.exit(1); } String outputUri = CompressionCodecFactory.removeSuffix(uri, codec.getDefaultExtension()); InputStream in = null; OutputStream out = null; try { in = codec.createInputStream(fs.open(inputPath)); out = fs.create(new Path(outputUri)); IOUtils.copyBytes(in, out, conf); } finally { IOUtils.closeStream(in); IOUtils.closeStream(out); } }}以上代码中缺少了创建解码对象codec的语句,下面哪个选项是正确的?

CompressionCodec codec = CompressionCodecFactory.getCodec(inputPath);
CompressionCodecFactory factory = new CompressionCodecFactory(conf);CompressionCodec codec = factory.getCodec(inputPath);
CompressionCodec codec = new CompressionCodec(inputPath);
CompressionCodec codec = CompressionCodecFactory.getCodec(conf);

Q20:以下描述正确的是:(1)Map是映射,负责数据的过滤分发;Reduce是规约,负责数据的计算归并。(2)Reduce的数据来源于Map,Map的输出即是Reduce的输入,Reduce需要通过 Shuffle来获取数据。

(1)对(2)错
(1)错(2)对
(1)和(2)都对
(1)和(2)都错

Q21:请分析以下代码片段:public class WordCount { public static void main(String[] args) throws Exception { Configuration conf = new Configuration();① Job job = Job.getInstance(conf);② job.setJarByClass(WordCount);③ job.setMapperClass(TokenizerMapper.class);④ job.setReducerClass(IntSumReducer.class);…… System.exit(job.waitForCompletion(true) ? 0 : 1); } public static class TokenizerMapper extends MapperObject, Text, Text, IntWritable { …… } public static class IntSumReducer extends ReducerText, IntWritable, Text, IntWritable { …… }}语句①-④中有语法错误的是?

①有语法错误
②有语法错误
③有语法错误
④有语法错误

Q22:以下对RecordReader描述正确的是:(1) RecordReader的目的是把数据解析成记录,它把数据以键值对的形式传递给mapper。(2)通常情况下键是偏移量,值是这条记录的整个字节块。

(1)对(2)错
(1)错(2)对
(1)和(2)都对
(1)和(2)都错

Q23:public class MaxAndMinValue implements WritableComparableMaxAndMinValue {①private LongWritable min;private LongWritable max;private IntWritable total;public MaxAndMinValue() {② this.min=new LongWritable(0); this.max=new LongWritable(0); this.total=new IntWritable(0);}@Overridepublic void write(DataOutput out) throws IOException { min.write(out); max.write(out); total.write(out);}@Overridepublic void readFields(DataInput in) throws IOException { total.readFields(in);③ max.readFields(in); min.readFields(in);}@Overridepublic String toString() { return min.get()+\t+max.get()+\t+total.get();}@Overridepublic int compareTo(MaxAndMinValue o) {④ return 0;} }以上代码实现了Hadoop的自定义序列化,其中有一处错误,以下那个选项的描述是正确的:

①处有错误,应该实现Writable接口
②处有错误,应该定义带参数的构造方法
③处有错误,反序列化应该与序列化顺序一致
 ④处有错误,不应该重写compareTo方法

Q24:class DistinctMapper extends MapperLongWritable, Text, Text, NullWritable {① @Override protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { context.write(value, NullWritable.get()); }}class DistinctReducer extends ReducerText, NullWritable, Text, NullWritable {② @Override protected void reduce(Text key, IterableNullWritable values, Context context) throws IOException, InterruptedException { context.write(key, NullWritable.get()); }}public class DistinctDriver { public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException { Configuration conf = new Configuration(); Job job = Job.getInstance(conf); job.setJarByClass(DistinctDriver.class); job.setMapperClass(DistinctMapper.class); job.setReducerClass(DistinctReducer.class); job.setMapOutputKeyClass(Text.class); job.setMapOutputValueClass(Text.class);③ job.setOutputKeyClass(Text.class); job.setOutputValueClass(NullWritable.class);④ FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); System.exit(job.waitForCompletion(true) ? 0 : 1); }}以上代码实现了去重模式,其中有一处错误,以下那个选项的描述是正确的:

①处有错误, 应该改为Mapper<Object, Text, Text, NullWritable>
②处有错误,应该改为Reducer<NullWritable, Text, Text, NullWritable>
③处有错误,应该改为job.setMapOutputValueClass(NullWritable.class);
 ④处有错误,应该改为job.setOutputValueClass(Text.class);

Q25:使用MR实现过滤模式时,针对以下的输入文件name,agezhangsan,23lisi,46wangwu,67zhaoliu,34张三想实现一个类似如下的sql的逻辑:select * from table where age 30请帮张三完成空白处的代码:static class filterMap extends MapperLongWritable, Text, NullWritable, Text{private String mapRegex=;Pattern pattern = Pattern.compile(mapRegex);@Overrideprotected void map(LongWritable key, Text value,Context context) throws IOException, InterruptedException {if(_____A_____){context.write(NullWritable.get(), ____B___);}}@Overrideprotected void setup(Context context) throws IOException, InterruptedException {mapRegex=context.getConfiguration().get(mapRegex); }

A:Integer.parseInt(key.toString()) >30B:key
A:Integer.parseInt(value.toString()) >30B:value
A:Integer.parseInt(value.toString()) >30B:key
A:Integer.parseInt(key.toString()) >30B:value
问卷网
hadoop
关于
1年前
更新
0
频次
25
题目数
分享