spatialhadoop
flyhaifeng
这个作者很懒,什么都没留下…
展开
-
spatialhadoop2.1源码阅读(一) shadoop脚本文件
1. bin/shadoop文件内容如下: bin=`dirname "$0"` bin=`cd "$bin" > /dev/null; pwd` # Call Hadoop with the operations.Main as the main class . "$bin"/hadoop edu.umn.cs.spatialHadoop.operations.Main $@原创 2015-11-18 19:29:40 · 1186 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(十二) GridOutputFormat & GridRecordWriter[Grid Index MapReuce]
1. GridOutputFormat GridOutputFormat的作用是产生RecordWriter,其生成了GridRecordWriter,代码如下: public class GridOutputFormat extends FileOutputFormat { @Override public RecordWriter getRecordWriter(FileSy原创 2015-12-23 11:07:58 · 446 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(十一) ShapeRecordReader & SpatialRecordReader[Grid Index MapReuce]
生成ShapeRecordReader的类ShapeInputFormat,其具体实现已在spatialhadoop2.1源码阅读(三) 自定义InputFormat(SpatialInputFormat & ShapeInputFormat)中介绍,具体可看该文章。本文主要介绍网格索引生成过程中使用的ShapeRecordReader 和SpatialRecordReader 1.Sh原创 2015-12-23 10:03:01 · 513 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(十) TextOutputFormat & LineRecordWriter[FileMBR]
1. TextOutputFormat TextOutputFormat继承自FileOutputFormat,它实现了自己的getRecordWriter方法,代码如下: public RecordWriter getRecordWriter(FileSystem ignored, JobCo原创 2015-12-22 20:21:04 · 615 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(九) ShapeLineInputFormat & ShapeLineRecordReader & SpatialRecordReader[FileMBR]
ShapeLineInputFormat的作用就是生成ShapeLineRecordReader,其具体实现和spatialhadoop2.1源码阅读(三) 自定义InputFormat(SpatialInputFormat & ShapeInputFormat)中介绍的ShapeInputFormat的实现基本相同,具体可看该文章。ShapeLineInputFormat的源码如下: publ原创 2015-12-22 17:23:44 · 458 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(八) RTree索引生成方法(二)
这一章主要介绍MapReduce的具体实现。 1. Map /** * The map class maps each object to the cell with maximum overlap. * @author Ahmed Eldawy * */ public static class RepartitionMapNoReplication extend原创 2015-12-22 15:04:08 · 613 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(八) RTree索引生成方法(一)
SpatialHadoop的索引生成类为edu.umn.cs.spatialHadoop.operations.Repartition。该类的main方法,repartition方法以及repartitionMapReduce的第一部分和第三部分,均与spatialhadoop2.3源码阅读(五) grid 索引生成方法(一)中介绍的相同,本文重点介绍repartitionMapReduce的原创 2015-12-21 19:59:12 · 771 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(七) Sampler类
该类的主要作用是从输入文件中进行随机采样。Sampler类中可以有三种采用方式,分别是根据比例,根据大小以及根据记录数来进行采样。在这三种采用方式中,按比例采样分别实现了本地方法和MapReduce方法,其他两种只有本地方法,具体代码如下: public static void sample(Path[] inputFiles, ResultCollector output, Ope原创 2015-12-18 10:24:44 · 701 阅读 · 0 评论 -
spatialhadoop2.1源码阅读(三) 自定义InputFormat(SpatialInputFormat & ShapeInputFormat)
edu.umn.cs.spatialHadoop.mapred.SpatialInputFormat类继承自hadoop自带的FileInputFormat类。 SpatialInputFormat实现了InputFormat两大功能中的其中一个:getRecordReader。另外一个功能getSplits默认继承了FileInputFormat类的实现。 SpatialInputFor原创 2015-11-30 16:19:15 · 811 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(六) grid 索引生成方法(二)
上一篇主要介绍了grid 索引生成中MapReduce Job 的一些配置信息,接下来将主要介绍Map,Reduce等MapReduce的具体实现。 1. Map 未完待续。。。。。。。。原创 2015-12-15 10:06:39 · 660 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(五) grid 索引生成方法(一)
SpatialHadoop的索引生成类为edu.umn.cs.spatialHadoop.operations.Repartition。其main 方法如下 public static void main(String[] args) throws Exception { OperationsParams params = new OperationsParams(new Generic原创 2015-12-15 09:14:33 · 787 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(四) FileMBR类
edu.umn.cs.spatialHadoop.operations.FileMBR 类主要功能为计算输入数据的最小包围矩形。 该类的核心实现为fileMBRMapReduce方法。该方法使用MapReduce Job进行计算。 FileMBR 主要实现了map,combine和reduce方法。接下来分别介绍这三个方法。 1. FileMBRMapper为Map类,该类map方法位 p原创 2015-12-02 19:43:33 · 719 阅读 · 0 评论 -
spatialhadoop2.1源码阅读(二) bin/shadoop generate命令
edu.umn.cs.spatialHadoop.operations.Main 中关于bin/shadoop generate命令代码如下: pgd.addClass("generate", RandomSpatialGenerator.class, "Generates a random file containing spatial data"); 可知,该命令实现类为原创 2015-11-27 15:53:40 · 779 阅读 · 0 评论 -
spatialhadoop2.3源码阅读(十三) RTreeGridOutputFormat & RTreeGridRecordWriter & RTree[RTree Index MapReuce]
这几个类的调用关系为RTreeGridOutputFormat生成edu.umn.cs.spatialHadoop.mapred.RTreeGridRecordWriter类,edu.umn.cs.spatialHadoop.mapred.RTreeGridRecordWriter类继承自edu.umn.cs.spatialHadoop.core.RTreeGridRecordWriter,edu原创 2015-12-23 17:18:28 · 517 阅读 · 0 评论