摘要: spark的block管理是通过BlockTransferService定义的方法从远端获取block、将block存储到远程节点。shuffleclient生成过程就会引入blockTransferService。 类的定义如下: 定义了目标节点的主机名和端口号,还定义了批量获取,批量保存,单个b 阅读全文
posted @ 2018-08-21 10:55 天添 阅读(716) 评论(0) 推荐(0) 编辑
摘要: spark的持久化机制做的相对隐晦一些,没有一个显示的调用入口。 首先通过rdd.persist(newLevel: StorageLevel)对此rdd的StorageLevel进行赋值,同checkpoint一样,本身没有进行之久化操作。真正进行持久化操作实在之后的第一个action 中通过it 阅读全文
posted @ 2018-08-17 14:51 天添 阅读(1029) 评论(0) 推荐(0) 编辑
摘要: RDD本身presist可以是本地存储,本地存储级别的持久化实现方式如下: DiskBlockManager负责管理和维护block和磁盘存储的映射关系,通过blockId作为文件名称,然后如果是多个目录通过blcokId的hash值进行分发。 包括创建目录,删除,读取文件,以及一些退出删除文件的机 阅读全文
posted @ 2018-08-17 14:34 天添 阅读(1138) 评论(0) 推荐(0) 编辑
摘要: 首先rdd.checkpoint()本身并没有执行任何的写操作,只是做checkpointDir是否为空,然后生成一个ReliableRDDCheckpointData对象checkpointData,这个对象完成checkpoint的大部分工作。 真正触发checkpoint操作的是rdd调用完c 阅读全文
posted @ 2018-08-14 10:43 天添 阅读(296) 评论(0) 推荐(0) 编辑
摘要: /** Splits files returned by {@link #listStatus(JobConf)} when * they're too big.*/ public InputSplit[] getSplits(JobConf job, int numSplits) throws IOException { //计时器, StopWatch ... 阅读全文
posted @ 2018-07-21 15:17 天添 阅读(584) 评论(0) 推荐(0) 编辑
摘要: /** * * @param job 配置信息 * @param split split * @param recordDelimiter 分列的字符 * @throws IOException */ public LineRecordReader(Configuration job, FileSplit split, byte[] r... 阅读全文
posted @ 2018-07-21 13:02 天添 阅读(710) 评论(0) 推荐(0) 编辑
摘要: /** A section of an input file. Returned by {@link * InputFormat#getSplits(JobContext)} and passed to * {@link InputFormat#createRecordReader(InputSplit,TaskAttemptContext)}. * * 文件的一部分,通过InputForm... 阅读全文
posted @ 2018-07-20 10:49 天添 阅读(941) 评论(0) 推荐(0) 编辑
摘要: /** * InputSplit represents the data to be processed by an * individual {@link Mapper}. * InputSplit 代表可以被Mapper处理的数据 * Typically, it presents a byte-oriented view on the input and is the * r... 阅读全文
posted @ 2018-07-20 10:40 天添 阅读(638) 评论(0) 推荐(0) 编辑
摘要: /** * Basic hash bin node, used for most entries. (See below for * TreeNode subclass, and in LinkedHashMap for its Entry subclass.) */ static class Node implements Map.Entry { ... 阅读全文
posted @ 2018-07-19 18:06 天添 阅读(304) 评论(0) 推荐(0) 编辑
摘要: /* * Implementation notes. * 使用说明 * * This map usually acts as a binned (bucketed) hash table, but * when bins get too large, they are transformed into bins of * Tre... 阅读全文
posted @ 2018-07-11 16:44 天添 阅读(625) 评论(1) 推荐(1) 编辑