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

怎么自己在微信上做网站内部建设网站需要什么条件

怎么自己在微信上做网站,内部建设网站需要什么条件,短网址还原工具,自贸区注册公司1.需求 主播数据--按照观众人数降序排序#xff0c;如果观众人数相同#xff0c;按照直播时长降序 # 案例数据 用户id 观众人数 直播时长 团团 300 1000 小黑 200 2000 哦吼 400 7000 卢本伟 100 6000 八戒 250 5000 悟空 100 4000 唐僧 100 3000 # 期望结果 哦吼 4…1.需求 主播数据--按照观众人数降序排序如果观众人数相同按照直播时长降序 # 案例数据 用户id 观众人数 直播时长 团团 300 1000 小黑 200 2000 哦吼 400 7000 卢本伟 100 6000 八戒 250 5000 悟空 100 4000 唐僧 100 3000 # 期望结果 哦吼 400 7000 团团 300 1000 八戒 250 5000 小黑 200 2000 卢本伟 100 6000 悟空 100 4000 唐僧 100 3000 2.将数据上传到hdfs 3.Idea代码 package demo6;import org.apache.hadoop.io.WritableComparable;import java.io.DataInput; import java.io.DataOutput; import java.io.IOException;public class PlayWritable implements WritableComparablePlayWritable {private int viewer;private int length;public PlayWritable() {}public PlayWritable(int viewer, int length) {this.viewer viewer;this.length length;}public int getViewer() {return viewer;}public void setViewer(int viewer) {this.viewer viewer;}public int getLength() {return length;}public void setLength(int length) {this.length length;}Overridepublic String toString() {return viewer length;}Overridepublic void write(DataOutput out) throws IOException {out.writeInt(viewer);out.writeInt(length);}Overridepublic void readFields(DataInput in) throws IOException {this.viewer in.readInt();this.length in.readInt();}Overridepublic int compareTo(PlayWritable o) {if (this.viewer ! o.viewer){return this.viewer o.viewer ? -1 : 1;}return this.length o.length ? -1 : (this.length o.length ? 0 : 1);} }package demo6;import demo5.DescIntWritable; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Reducer; import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; import org.checkerframework.checker.units.qual.Length;import java.io.IOException;public class Sort3Job {public static void main(String[] args) throws IOException, InterruptedException, ClassNotFoundException {Configuration conf new Configuration();conf.set(fs.defaultFS,hdfs://hadoop10:8020);Job job Job.getInstance(conf);job.setJarByClass(Sort3Job.class);job.setInputFormatClass(TextInputFormat.class);job.setOutputFormatClass(TextOutputFormat.class);TextInputFormat.addInputPath(job,new Path(/mapreduce/demo6/sort3.txt));TextOutputFormat.setOutputPath(job,new Path(/mapreduce/demo6/out));job.setMapperClass(Sort3Mapper.class);job.setReducerClass(Sort3Reducer.class);//map输出的键与值类型job.setMapOutputKeyClass(PlayWritable.class);job.setMapOutputValueClass(Text.class);//reducer输出的键与值类型job.setOutputKeyClass(Text.class);job.setOutputValueClass(PlayWritable.class);boolean b job.waitForCompletion(true);System.out.println(b);}static class Sort3Mapper extends MapperLongWritable, Text, PlayWritable,Text {Overrideprotected void map(LongWritable key, Text value,Context context) throws IOException, InterruptedException {String[] arr value.toString().split(\t);context.write(new PlayWritable(Integer.parseInt(arr[1]),Integer.parseInt(arr[2])),new Text(arr[0]));}}static class Sort3Reducer extends ReducerPlayWritable,Text,Text,PlayWritable{Overrideprotected void reduce(PlayWritable key, IterableText values, Context context) throws IOException, InterruptedException {for (Text name : values) {context.write(name,key);}}} }4.在hdfs查看结果 请好好爱自己~ 想和你做朋友~
http://www.hkea.cn/news/14422110/

相关文章:

  • 学做网站零基础阿里云 网站备案
  • 佛山新网站制作代理商网站建设类的职位
  • 福建富通建设有限公司网站重庆网络安全公司
  • wifi管理网站会计证继续教育在哪个网站做
  • 企业门户网站建设流程重庆网站排名公司
  • wordpress最大发布大小排名优化seo
  • 建设的招标网站创建论坛网站需要多少钱
  • 中山论坛建站模板重庆seo网站运营
  • 手机端视频网站模板下载网站更新的意义
  • 国家重点项目建设部网站机械网站建设中心
  • 网站集约化后如何建设励志响亮的建筑公司名
  • 租用微信做拍卖网站家装公司报价
  • 自己有网站怎么推广iis管理器添加网站
  • 网站域名不合法西安网站建设g
  • 做网站有哪些项目南宁平台公司
  • 学校网站结构图快速做网站
  • 网站原型用wampserver搭建网站
  • asp网站伪静态规则银川做网站服务
  • 电子商务网站是什么意思网站建设现状分析
  • 电子商务网站建设计划如何维护自己公司网站
  • 做网站卖专业卖文玩建筑网站汇总
  • 江西省建设工程安全质量监督管理局网站免费企业静态网站模板
  • 网站的市场如何制作做网站怎么弄
  • 怎么自己做彩票网站吗股票交易平台app排行榜
  • 苏州网站建设方案物联网云平台
  • 用凡科帮别人做网站北京网站建设 网站维护
  • 企业网站 梦织个人网页设计作品html文件夹
  • 青岛市建设监理协会网站衡水外贸网站建设
  • 宜昌市建设工程质量监督站网站广州 网站建设 行价
  • 闸北网站建设php电子商务网站开发实例