来源 http://www.open-mpi.org/ 网络连接 SSH连接,保证各台机器之间可以无密码登陆,此处不展开 hosts文件如下 安装第一步 ./configure --prefix=/home/hadoop/openmpi_install 注:prefix后面是安装路径 可能会出现co Read More
挂载硬盘 sudo mount -t ext4 /dev/sdb1 /media/hadoop 自动挂载相关 sudo blkid sudo fdisk -l vim /etc/fstab cat /etc/mtab 虚拟机安装VM tools 初始目录: centOS:/run/media/use Read More
题目来源https://leetcode.com/problems/search-a-2d-matrix/Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the follow... Read More
saveAsTextFilesaveAsTextFile(path,compressionCodecClass=None)aveAsTextFile用于将RDD以文本文件的格式存储到文件系统中, 将每一个元素以string格式存储(结合python的loads和dumps可以很好应用)Paramet... Read More
firstdef first(): Tfirst返回RDD中的第一个元素,不排序。例子:countdef count(): Longcount返回RDD中的元素数量例子:reducedef reduce(f: (T, T) ⇒ T): T根据映射函数f,对RDD中的元素进行二元计算,返回计算结果(可... Read More
map将RDD中的每个数据项,一对一的映射关系,RDD数目不变,分区数也不变例子:数据集:map操作:flatMap和map一样,但是会拆分每一个map之后的list,可以理解为一对多(注:会把字符串当作数组然后拆分)例子:distinct对RDD的数据项进行去重操作例子:coalescedef c... Read More
题目来源https://leetcode.com/problems/excel-sheet-column-title/Given a positive integer, return its corresponding column title as appear in an Excel sheet... Read More
题目来源https://leetcode.com/problems/anagrams/Given an array of strings, group anagrams together.For example, given:["eat", "tea", "tan", "ate", "nat", "... Read More
题目来源https://leetcode.com/problems/minimum-path-sum/Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichmin... Read More
题目来源https://leetcode.com/problems/unique-paths-ii/Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique ... Read More