Hadoop入门-WordCount示例

2023-05-16

WordCount的过程如图,这里记录下入门的过程,虽然有很多地方理解的只是皮毛。


Hadoop的安装

安装比较简单,安装完成后进行单机环境的配置。

hadoop-env.sh:指定JAVA_HOME。

# The only required environment variable is JAVA_HOME.  All others are
# optional.  When running a distributed configuration it is best to
# set JAVA_HOME in this file, so that it is correctly defined on
# remote nodes.

# The java implementation to use.
export JAVA_HOME="$(/usr/libexec/java_home)"

core-site.xml:设置Hadoop使用的临时目录,NameNode的地址。

<configuration>
    <property>
        <name>hadoop.tmp.dir</name>
        <value>/usr/local/Cellar/hadoop/hdfs/tmp</value>
    </property>
    <property>
        <name>fs.default.name</name>
        <value>hdfs://localhost:9000</value>
    </property>
</configuration>

hdfs-site.xml:一个节点,副本个数设为1。

<configuration>
    <property>
        <name>dfs.replication</name>
        <value>1</value>
    </property>
</configuration>

mapred-site.xml:指定JobTracker的地址。

<configuration>
    <property>
        <name>mapred.job.tracker</name>
        <value>localhost:9010</value>
    </property>
</configuration>

启动Hadoop相关的所有进程。

➜  sbin git:(master) ./start-all.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
16/12/03 19:32:18 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [localhost]
Password:
localhost: starting namenode, logging to /usr/local/Cellar/hadoop/2.7.1/libexec/logs/hadoop-vonzhou-namenode-vonzhoudeMacBook-Pro.local.out
Password:
localhost: starting datanode, logging to /usr/local/Cellar/hadoop/2.7.1/libexec/logs/hadoop-vonzhou-datanode-vonzhoudeMacBook-Pro.local.out
Starting secondary namenodes [0.0.0.0]
Password:
0.0.0.0: starting secondarynamenode, logging to /usr/local/Cellar/hadoop/2.7.1/libexec/logs/hadoop-vonzhou-secondarynamenode-vonzhoudeMacBook-Pro.local.out
16/12/03 19:33:27 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
starting yarn daemons
starting resourcemanager, logging to /usr/local/Cellar/hadoop/2.7.1/libexec/logs/yarn-vonzhou-resourcemanager-vonzhoudeMacBook-Pro.local.out
Password:
localhost: starting nodemanager, logging to /usr/local/Cellar/hadoop/2.7.1/libexec/logs/yarn-vonzhou-nodemanager-vonzhoudeMacBook-Pro.local.out

(可以配置ssh无密码登录方式,否则启动hadoop的时候总是要密码。)

看看启动了哪些组件。

➜  sbin git:(master) jps -l
5713 org.apache.hadoop.hdfs.server.namenode.NameNode
6145 org.apache.hadoop.yarn.server.nodemanager.NodeManager
6044 org.apache.hadoop.yarn.server.resourcemanager.ResourceManager
5806 org.apache.hadoop.hdfs.server.datanode.DataNode
5918 org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode

访问http://localhost:50070/可以看到DFS的一些状态。

WordCount 单词计数

WordCount就是Hadoop学习的hello world,代码如下:

public class WordCount {

    public static class Map extends Mapper<LongWritable, Text, Text, IntWritable> {
        private final static IntWritable one = new IntWritable(1);
        private Text word = new Text();

        public void map(LongWritable key, Text value, Context context)
                throws IOException, InterruptedException {
            String line = value.toString();
            StringTokenizer tokenizer = new StringTokenizer(line);
            while (tokenizer.hasMoreTokens()) {
                word.set(tokenizer.nextToken());
                context.write(word, one);
            }
        }
    }

    public static class Reduce extends
            Reducer<Text, IntWritable, Text, IntWritable> {

        public void reduce(Text key, Iterable<IntWritable> values,
                           Context context) throws IOException, InterruptedException {
            int sum = 0;
            for (IntWritable val : values) {
                sum += val.get();
            }
            context.write(key, new IntWritable(sum));
        }
    }

    public static void main(String[] args) throws Exception {
        Configuration conf = new Configuration();

        Job job = new Job(conf, "wordcount");
        job.setJarByClass(WordCount.class);

        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(IntWritable.class);

        job.setMapperClass(Map.class);
        job.setReducerClass(Reduce.class);
        /**
         * 设置一个本地combine,可以极大的消除本节点重复单词的计数,减小网络传输的开销
         */
        job.setCombinerClass(Reduce.class);

        job.setInputFormatClass(TextInputFormat.class);
        job.setOutputFormatClass(TextOutputFormat.class);

        FileInputFormat.addInputPath(job, new Path(args[0]));
        FileOutputFormat.setOutputPath(job, new Path(args[1]));

        job.waitForCompletion(true);
    }
}

构造两个文本文件, 把本地的两个文件拷贝到HDFS中:

➜  hadoop-examples git:(master) ✗ ln /usr/local/Cellar/hadoop/2.7.1/bin/hadoop hadoop
➜  hadoop-examples git:(master) ✗ ./hadoop dfs -put wordcount-input/file* input
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

16/12/03 23:17:10 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
➜  hadoop-examples git:(master) ✗ ./hadoop dfs -ls input/      
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

16/12/03 23:21:08 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 2 items
-rw-r--r--   1 vonzhou supergroup         42 2016-12-03 23:17 input/file1
-rw-r--r--   1 vonzhou supergroup         43 2016-12-03 23:17 input/file2

编译程序得到jar:

mvn clean package

运行程序(指定main class的时候需要全包名限定):

➜  hadoop-examples git:(master) ./hadoop jar target/hadoop-examples-1.0-SNAPSHOT.jar com.vonzhou.learnhadoop.simple.WordCount input output
16/12/03 23:31:19 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/12/03 23:31:20 INFO Configuration.deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
16/12/03 23:31:20 INFO jvm.JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
16/12/03 23:33:21 WARN mapreduce.JobResourceUploader: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
16/12/03 23:33:21 INFO input.FileInputFormat: Total input paths to process : 2
16/12/03 23:33:21 INFO mapreduce.JobSubmitter: number of splits:2
16/12/03 23:33:22 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_local524341653_0001
16/12/03 23:33:22 INFO mapreduce.Job: The url to track the job: http://localhost:8080/
16/12/03 23:33:22 INFO mapreduce.Job: Running job: job_local524341653_0001
16/12/03 23:33:22 INFO mapred.LocalJobRunner: OutputCommitter set in config null
16/12/03 23:33:22 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 1
16/12/03 23:33:22 INFO mapred.LocalJobRunner: OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
16/12/03 23:33:22 INFO mapred.LocalJobRunner: Waiting for map tasks
16/12/03 23:33:22 INFO mapred.LocalJobRunner: Starting task: attempt_local524341653_0001_m_000000_0
16/12/03 23:33:22 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 1
16/12/03 23:33:22 INFO util.ProcfsBasedProcessTree: ProcfsBasedProcessTree currently is supported only on Linux.
16/12/03 23:33:22 INFO mapred.Task:  Using ResourceCalculatorProcessTree : null
16/12/03 23:33:22 INFO mapred.MapTask: Processing split: hdfs://localhost:9000/user/vonzhou/input/file2:0+43
16/12/03 23:33:22 INFO mapred.MapTask: (EQUATOR) 0 kvi 26214396(104857584)
16/12/03 23:33:22 INFO mapred.MapTask: mapreduce.task.io.sort.mb: 100
16/12/03 23:33:22 INFO mapred.MapTask: soft limit at 83886080
16/12/03 23:33:22 INFO mapred.MapTask: bufstart = 0; bufvoid = 104857600
16/12/03 23:33:22 INFO mapred.MapTask: kvstart = 26214396; length = 6553600
16/12/03 23:33:22 INFO mapred.MapTask: Map output collector class = org.apache.hadoop.mapred.MapTask$MapOutputBuffer
16/12/03 23:33:22 INFO mapred.LocalJobRunner: 
16/12/03 23:33:22 INFO mapred.MapTask: Starting flush of map output
16/12/03 23:33:22 INFO mapred.MapTask: Spilling map output
16/12/03 23:33:22 INFO mapred.MapTask: bufstart = 0; bufend = 71; bufvoid = 104857600
16/12/03 23:33:22 INFO mapred.MapTask: kvstart = 26214396(104857584); kvend = 26214372(104857488); length = 25/6553600
16/12/03 23:33:22 INFO mapred.MapTask: Finished spill 0
16/12/03 23:33:22 INFO mapred.Task: Task:attempt_local524341653_0001_m_000000_0 is done. And is in the process of committing
16/12/03 23:33:22 INFO mapred.LocalJobRunner: map
16/12/03 23:33:22 INFO mapred.Task: Task 'attempt_local524341653_0001_m_000000_0' done.
16/12/03 23:33:22 INFO mapred.LocalJobRunner: Finishing task: attempt_local524341653_0001_m_000000_0
16/12/03 23:33:22 INFO mapred.LocalJobRunner: Starting task: attempt_local524341653_0001_m_000001_0
16/12/03 23:33:22 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 1
16/12/03 23:33:22 INFO util.ProcfsBasedProcessTree: ProcfsBasedProcessTree currently is supported only on Linux.
16/12/03 23:33:22 INFO mapred.Task:  Using ResourceCalculatorProcessTree : null
16/12/03 23:33:22 INFO mapred.MapTask: Processing split: hdfs://localhost:9000/user/vonzhou/input/file1:0+42
16/12/03 23:33:22 INFO mapred.MapTask: (EQUATOR) 0 kvi 26214396(104857584)
16/12/03 23:33:22 INFO mapred.MapTask: mapreduce.task.io.sort.mb: 100
16/12/03 23:33:22 INFO mapred.MapTask: soft limit at 83886080
16/12/03 23:33:22 INFO mapred.MapTask: bufstart = 0; bufvoid = 104857600
16/12/03 23:33:22 INFO mapred.MapTask: kvstart = 26214396; length = 6553600
16/12/03 23:33:22 INFO mapred.MapTask: Map output collector class = org.apache.hadoop.mapred.MapTask$MapOutputBuffer
16/12/03 23:33:22 INFO mapred.LocalJobRunner: 
16/12/03 23:33:22 INFO mapred.MapTask: Starting flush of map output
16/12/03 23:33:22 INFO mapred.MapTask: Spilling map output
16/12/03 23:33:22 INFO mapred.MapTask: bufstart = 0; bufend = 70; bufvoid = 104857600
16/12/03 23:33:22 INFO mapred.MapTask: kvstart = 26214396(104857584); kvend = 26214372(104857488); length = 25/6553600
16/12/03 23:33:22 INFO mapred.MapTask: Finished spill 0
16/12/03 23:33:22 INFO mapred.Task: Task:attempt_local524341653_0001_m_000001_0 is done. And is in the process of committing
16/12/03 23:33:22 INFO mapred.LocalJobRunner: map
16/12/03 23:33:22 INFO mapred.Task: Task 'attempt_local524341653_0001_m_000001_0' done.
16/12/03 23:33:22 INFO mapred.LocalJobRunner: Finishing task: attempt_local524341653_0001_m_000001_0
16/12/03 23:33:22 INFO mapred.LocalJobRunner: map task executor complete.
16/12/03 23:33:22 INFO mapred.LocalJobRunner: Waiting for reduce tasks
16/12/03 23:33:22 INFO mapred.LocalJobRunner: Starting task: attempt_local524341653_0001_r_000000_0
16/12/03 23:33:22 INFO output.FileOutputCommitter: File Output Committer Algorithm version is 1
16/12/03 23:33:22 INFO util.ProcfsBasedProcessTree: ProcfsBasedProcessTree currently is supported only on Linux.
16/12/03 23:33:22 INFO mapred.Task:  Using ResourceCalculatorProcessTree : null
16/12/03 23:33:22 INFO mapred.ReduceTask: Using ShuffleConsumerPlugin: org.apache.hadoop.mapreduce.task.reduce.Shuffle@64accbd9
16/12/03 23:33:23 INFO mapreduce.Job: Job job_local524341653_0001 running in uber mode : false
16/12/03 23:33:23 INFO mapreduce.Job:  map 100% reduce 0%
16/12/03 23:33:53 INFO reduce.MergeManagerImpl: MergerManager: memoryLimit=334338464, maxSingleShuffleLimit=83584616, mergeThreshold=220663392, ioSortFactor=10, memToMemMergeOutputsThreshold=10
16/12/03 23:33:53 INFO reduce.EventFetcher: attempt_local524341653_0001_r_000000_0 Thread started: EventFetcher for fetching Map Completion Events
16/12/03 23:33:53 INFO reduce.LocalFetcher: localfetcher#1 about to shuffle output of map attempt_local524341653_0001_m_000001_0 decomp: 86 len: 90 to MEMORY
16/12/03 23:33:53 INFO reduce.InMemoryMapOutput: Read 86 bytes from map-output for attempt_local524341653_0001_m_000001_0
16/12/03 23:33:53 INFO reduce.MergeManagerImpl: closeInMemoryFile -> map-output of size: 86, inMemoryMapOutputs.size() -> 1, commitMemory -> 0, usedMemory ->86
16/12/03 23:33:53 INFO reduce.LocalFetcher: localfetcher#1 about to shuffle output of map attempt_local524341653_0001_m_000000_0 decomp: 87 len: 91 to MEMORY
16/12/03 23:33:53 INFO reduce.InMemoryMapOutput: Read 87 bytes from map-output for attempt_local524341653_0001_m_000000_0
16/12/03 23:33:53 INFO reduce.MergeManagerImpl: closeInMemoryFile -> map-output of size: 87, inMemoryMapOutputs.size() -> 2, commitMemory -> 86, usedMemory ->173
16/12/03 23:33:53 INFO reduce.EventFetcher: EventFetcher is interrupted.. Returning
16/12/03 23:33:53 INFO mapred.LocalJobRunner: 2 / 2 copied.
16/12/03 23:33:53 INFO reduce.MergeManagerImpl: finalMerge called with 2 in-memory map-outputs and 0 on-disk map-outputs
16/12/03 23:33:53 INFO mapred.Merger: Merging 2 sorted segments
16/12/03 23:33:53 INFO mapred.Merger: Down to the last merge-pass, with 2 segments left of total size: 162 bytes
16/12/03 23:33:53 INFO reduce.MergeManagerImpl: Merged 2 segments, 173 bytes to disk to satisfy reduce memory limit
16/12/03 23:33:53 INFO reduce.MergeManagerImpl: Merging 1 files, 175 bytes from disk
16/12/03 23:33:53 INFO reduce.MergeManagerImpl: Merging 0 segments, 0 bytes from memory into reduce
16/12/03 23:33:53 INFO mapred.Merger: Merging 1 sorted segments
16/12/03 23:33:53 INFO mapred.Merger: Down to the last merge-pass, with 1 segments left of total size: 165 bytes
16/12/03 23:33:53 INFO mapred.LocalJobRunner: 2 / 2 copied.
16/12/03 23:33:53 INFO Configuration.deprecation: mapred.skip.on is deprecated. Instead, use mapreduce.job.skiprecords
16/12/03 23:33:53 INFO mapred.Task: Task:attempt_local524341653_0001_r_000000_0 is done. And is in the process of committing
16/12/03 23:33:53 INFO mapred.LocalJobRunner: 2 / 2 copied.
16/12/03 23:33:53 INFO mapred.Task: Task attempt_local524341653_0001_r_000000_0 is allowed to commit now
16/12/03 23:33:53 INFO output.FileOutputCommitter: Saved output of task 'attempt_local524341653_0001_r_000000_0' to hdfs://localhost:9000/user/vonzhou/output/_temporary/0/task_local524341653_0001_r_000000
16/12/03 23:33:53 INFO mapred.LocalJobRunner: reduce > reduce
16/12/03 23:33:53 INFO mapred.Task: Task 'attempt_local524341653_0001_r_000000_0' done.
16/12/03 23:33:53 INFO mapred.LocalJobRunner: Finishing task: attempt_local524341653_0001_r_000000_0
16/12/03 23:33:53 INFO mapred.LocalJobRunner: reduce task executor complete.
16/12/03 23:33:54 INFO mapreduce.Job:  map 100% reduce 100%
16/12/03 23:33:54 INFO mapreduce.Job: Job job_local524341653_0001 completed successfully
16/12/03 23:33:54 INFO mapreduce.Job: Counters: 35
        File System Counters
                FILE: Number of bytes read=54188
                FILE: Number of bytes written=917564
                FILE: Number of read operations=0
                FILE: Number of large read operations=0
                FILE: Number of write operations=0
                HDFS: Number of bytes read=213
                HDFS: Number of bytes written=89
                HDFS: Number of read operations=22
                HDFS: Number of large read operations=0
                HDFS: Number of write operations=5
        Map-Reduce Framework
                Map input records=5
                Map output records=14
                Map output bytes=141
                Map output materialized bytes=181
                Input split bytes=222
                Combine input records=0
                Combine output records=0
                Reduce input groups=11
                Reduce shuffle bytes=181
                Reduce input records=14
                Reduce output records=11
                Spilled Records=28
                Shuffled Maps =2
                Failed Shuffles=0
                Merged Map outputs=2
                GC time elapsed (ms)=7
                Total committed heap usage (bytes)=946864128
        Shuffle Errors
                BAD_ID=0
                CONNECTION=0
                IO_ERROR=0
                WRONG_LENGTH=0
                WRONG_MAP=0
                WRONG_REDUCE=0
        File Input Format Counters 
                Bytes Read=85
        File Output Format Counters 
                Bytes Written=89
➜  hadoop-examples git:(master)

查看执行的结果:

➜  hadoop-examples git:(master)./hadoop dfs -ls output
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

16/12/03 23:36:42 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 2 items
-rw-r--r--   1 vonzhou supergroup          0 2016-12-03 23:33 output/_SUCCESS
-rw-r--r--   1 vonzhou supergroup         89 2016-12-03 23:33 output/part-r-00000
➜  hadoop-examples git:(master) ✗ ./hadoop dfs -cat output/part-r-00000
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

16/12/03 23:37:03 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
big     1
by      1
data    1
google  1
hadoop  2
hello   2
learning        1
papers  1
step    2
vonzhou 1
world   1
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Hadoop入门-WordCount示例 的相关文章

随机推荐

  • go 依赖管理利器 -- govendor

    长期以来 xff0c golang 对外部依赖都没有很好的管理方式 xff0c 只能从 GOPATH 下查找依赖 这就造成不同用户在安装同一个项目适合可能从外部获取到不同的依赖库版本 xff0c 同时当无法联网时 xff0c 无法编译依赖缺
  • 1、ROS服务PID调试;

    首先查看代码内容 ub 64 ub span class token operator span span class token operator span span class token operator span omniWheel
  • 嵌入式之总线协议:1、UART

    嵌入式之总线协议 xff1a 1 UART 目录 第一章 UART 帧格式讲解 第二章 UART 寄存器讲解 第三章 UART 编程 第四章 输出重定向 第五章 RS232 RS485协议原理与应用 第一章 UART 嵌入式之总线协议 xf
  • Ubuntu18.04分辨率只有1024*768的多种解决办法

    文章目录 前言一 检查驱动1 1 检查驱动1 2 解决办法 二 其他解决办法2 1 修改Grub文件的方法2 2 通过xrandr指令操作 前言 关机 xff0c 再开机以后 xff0c 进入系统界面自动变成了1024x768的分辨率 xf
  • 梦想机器人实验室:第一节嵌入式学习指导

    参考资料 xff1a 实验室集训回放 嵌入式入门与进阶之旅 哔哩哔哩 bilibili 2条消息 单片机 嵌入式 最完整学习路线 单片机学习 嵌入式修行者的博客 CSDN博客 1 联合培训资料 大纲 电路设计训练营 xff08 四期 xff
  • java代码编写菜鸟心得(一)

    1 代码艺术之一 xff1a High Cohesion Low Coupling 函数功能要明确 xff0c 若此函数内部内容太多 xff0c 称其为大函数 xff0c 则可以从中抽取一些小函数 小函数的要求 xff1a 完成独立的功能
  • 在linux下真机调试android程序

    在linux里面 xff0c 模拟器可以直接识别 xff0c 使用adb也没有限制 xff0c 但是手机插上usb之后 xff0c adb并不识别 xff0c 显示的是问号 xff0c 在eclipse里面也是这样 解决方法如下 xff1a
  • 【号外】拳王阿里去世 头部一生遭受29000次重击

    74岁的一代拳王穆罕默德 阿里因病辞世 职业拳击生涯中 xff0c 阿里头部受到的29000多次的重击 新浪娱乐讯 6月4日消息 xff0c 据外国媒体报道 xff0c 74岁的一代拳王穆罕默德 阿里与美国菲尼克斯当地时间本周五 3日 去世
  • maven报错: ‘parent.relativePath‘ of POM xxx

    错误信息 xff1a 39 parent relativePath 39 of POM io renren renren fast 3 0 0 D renren fast pom xml points at com gwh gulimall
  • 嗯,春招两次腾讯面试都挂二面了,分享下我失败+傻傻的面试经历

    今天给大家转载一篇朋友的文章 xff0c 朋友是一位非常优秀的公众号作者 xff0c 也是一名在校生 文章讲述了他的春招面试经历 xff0c 很多东西值得大家学习 废话不多说 xff0c 下面开始正文 xff08 互联网侦察做了一些注释 x
  • 记一次Linux被入侵,服务器变“矿机”全过程

    周一早上刚到办公室 xff0c 就听到同事说有一台服务器登陆不上了 xff0c 我也没放在心上 xff0c 继续边吃早点 xff0c 边看币价是不是又跌了 不一会运维的同事也到了 xff0c 气喘吁吁的说 xff1a 我们有台服务器被阿里云
  • 二分搜索只能用来查找元素吗?

    预计阅读时间 xff1a 6 分钟 二分查找到底能运用在哪里 xff1f 最常见的就是教科书上的例子 xff0c 在有序数组中搜索给定的某个目标值的索引 再推广一点 xff0c 如果目标值存在重复 xff0c 修改版的二分查找可以返回目标值
  • 2020员工数将超阿里腾讯!字节创始人张一鸣说:当下更需专注,未来值得期待...

    刚刚 xff0c 有一家互联网公司宣布2020年员工人数要超过阿里 腾讯 xff0c 这就是字节跳动 xff01 张一鸣近日发了一封全员信 xff1a 字节跳动8周年 xff1a 往事可以回首 xff0c 当下更需专注 xff0c 未来值得
  • 字节跳动 前端面经(4轮技术面+hr面)

    作者 xff1a 甘先森 https juejin im post 5e6a14b1f265da572978a1d3 笔者读大三 xff0c 前端小白一枚 xff0c 正在准备春招 xff0c 人生第一次面试 xff0c 投了头条前端 xf
  • 就是你把所有代码全写在一个类里的?

    来源 https urlify cn 6jQRN3 最近 xff0c 在对已有项目进行扩展的时候 xff0c 发现要改动的一个类它长900行 xff0c 开放了近40个public接口 xff0c 我流着泪把它给改完了 为了防止这样的惨剧再
  • 如何实现一个高性能可渲染大数据的Tree组件

    作者 xff1a jayzou https segmentfault com a 1190000021228976 背景 项目中需要渲染一个5000 43 节点的树组件 xff0c 但是在引入element Tree组件之后发现性能非常差
  • 白剽,2020年最牛AI技术,各个都有代码

    来源 xff1a Reddit 编辑 xff1a 科雨 2020年 xff0c 想必各国的人民都被新冠病毒支配得瑟瑟发抖 不过 xff0c 这并不影响科研工作者的工作态度和产出质量 疫情之下 xff0c 通过各种方式 xff0c 全球的研究
  • 图解:卷积神经网络数学原理解析

    原标题 Gentle Dive into Math Behind Convolutional Neural Networks 作 者 Piotr Skalski 编 辑 Pita 翻 译 通夜 xff08 中山大学 xff09 had in
  • 【第二弹】这可能是进达摩院最好的机会了!

    很长时间没有更新公众号了 xff0c 最近在准备一些其他节目 xff0c 和小伙伴们说声抱歉了 但是 xff0c 虽然近期没有文章 xff0c 福利是不能少的 早在半年前 xff0c 我发过一篇文章 xff1a 这可能是进达摩院最好的机会了
  • Hadoop入门-WordCount示例

    WordCount的过程如图 xff0c 这里记录下入门的过程 xff0c 虽然有很多地方理解的只是皮毛 Hadoop的安装 安装比较简单 xff0c 安装完成后进行单机环境的配置 hadoop env sh 指定JAVA HOME spa