把你从写繁琐的Map-reduce Job中解放出来,写分布式跟写本地程序没两样,Scala真真代表着先进生产力的方向啊。

好的,今天开始直播基于Scala的Scalding啦,循序渐进地看以下页面:

https://github.com/twitter/scalding#scalding

https://github.com/twitter/scalding/wiki/Getting-Started

https://github.com/willf/scalding_cookbook

看到scalding-cookbook的时候,可以开始尝试写比Word Count更酷的Scalding程序了

 import com.twitter.scalding._
// input (tsv) // 0 1 2 3 4 5 6 // 22 kinds of love nn2 io nn1 // 12 large green eyes jj jj nn2 //
// output (tsv) // 22 of kinds/nn2_love/nn1 // 12 green large/jj_eyes/nn2 class contextCountJob(args : Args) extends Job(args) { val inSchema = ('count, 'w1 ,'w2, 'w3, 'pos1, 'pos2, 'pos3)
val outSchema = ('count, 'word, 'context)
Tsv(args("input"),inSchema) .mapTo(inSchema -> outSchema) { parts : (String, String, String, String, String, String, String) => { val (count, w1, w2, w3, pos1, pos2, pos3) = parts val context = "%s/%s_%s/%s".format(w1,pos1,w3,pos3) (count, w2, context) } } .write(Tsv(args("output"))) }

比较糟糕的是Scala语言新潮到博客园插件都不支持。。。

http://docs.kiji.org/userguides/express/1.0.1/basic-scala-scalding/

http://sujitpal.blogspot.com/2012/08/scalding-for-impatient.html

https://github.com/sujitpal/hia-examples/tree/master/scala/scalding-impatient/src/main/scala/com/mycompany/impatient

https://github.com/twitter/scalding/wiki/Fields-based-API-Reference

https://github.com/twitter/scalding/wiki/Scalding-Sources

https://github.com/twitter/scalding/wiki/Field-rules

https://github.com/twitter/scalding/wiki/API-Reference

https://github.com/twitter/scalding/wiki

http://twitter.github.io/scalding/com/twitter/scalding/package.html

https://github.com/deanwampler/scalding-workshop

推荐Twitter公开课的PPT(此处应有翻墙)

可以对比下其他Hadoop框架

 
 

Scalding初探之一:基于Scala的Hadoop利器的更多相关文章

  1. 搭建基于MyEclipse的Hadoop开发环境

    不多说,直接上干货! 前面我们已经搭建了一个伪分布模式的Hadoop运行环境.请移步, hadoop-2.2.0.tar.gz的伪分布集群环境搭建(单节点) 我们绝大多数都习惯在Eclipse或MyE ...

  2. 基于Eclipse的Hadoop应用开发环境配置

    基于Eclipse的Hadoop应用开发环境配置 我的开发环境: 操作系统ubuntu11.10 单机模式 Hadoop版本:hadoop-0.20.1 Eclipse版本:eclipse-java- ...

  3. 基于Eclipse搭建Hadoop源码环境

    Hadoop使用ant+ivy组织工程,无法直接导入Eclipse中.本文将介绍如何基于Eclipse搭建Hadoop源码环境. 准备工作 本文使用的操作系统为CentOS.需要的软件版本:hadoo ...

  4. scala写算法-List、Stream、以及剑指Offer里部分题目基于scala解法

    Stream(immutable) Stream是惰性列表.实现细节涉及到lazy懒惰求值.传名参数等等技术(具体细节详见维基百科-求值策略). Stream和List是scala中严格求值和非严格求 ...

  5. 基于centos6.5 hadoop 集群搭建

    1.修改Linux主机名2.修改IP3.修改主机名和IP的映射关系 ######注意######如果你们公司是租用的服务器或是使用的云主机(如华为用主机.阿里云主机等) /etc/hosts里面要配置 ...

  6. 基于伪分布式Hadoop搭建Hive平台详细教程

    一.搭建环境的前提条件 环境:Linux系统 Hadoop-2.6.0 MySQL 5.6 apache-hive-2.3.7 这里的环境不一定需要和我一样,基本版本差不多都ok的,所需安装包和压缩包 ...

  7. 基于Docker搭建Hadoop+Hive

    为配合生产hadoop使用,在本地搭建测试环境,使用docker环境实现(主要是省事~),拉取阿里云已有hadoop镜像基础上,安装hive组件,参考下面两个专栏文章: 克里斯:基于 Docker 构 ...

  8. macbook安装scala、hadoop、saprk环境

    一.scala安装 1. 安装jdk 有mac专用的jdk安装包,这里下载安装jdk1.8 2. 安装scala 2.1下载scala 2.2解压到指定目录 tar -zxvf /Users/lode ...

  9. Scalding初探之三:Hadoop实战

    Java版本 如果在Scala工程中混入Java类导致java版本不match,可能会抛错 java.lang.UnsupportedClassVersionError: XXX Unsupporte ...

随机推荐

  1. [HIHO1079]离散化(线段树、染色)

    题目链接:http://hihocoder.com/problemset/problem/1079 MD坑爹,线段查询的时候左闭右开.插完挨个点找一遍扔set里,注意没染色的情况. #include ...

  2. Java开发中经典的小实例-(能被3整除,并且十个数换一行)

    import java.util.Scanner;public class Test15 {    public static void main(String[] args) {        // ...

  3. BZOJ 3229: [Sdoi2008]石子合并

    3229: [Sdoi2008]石子合并 时间限制: 3 Sec  内存限制: 128 MB提交: 497  解决: 240[提交][][] 题目描述 在一个操场上摆放着一排N堆石子.现要将石子有次序 ...

  4. php : 匿名函数(闭包) [二]

    摘自: http://www.cnblogs.com/yjf512/archive/2012/10/29/2744702.html php的闭包(Closure)也就是匿名函数.是PHP5.3引入的. ...

  5. [luogu2982][USACO10FEB]慢下来Slowing down(树状数组+dfs序)

    题目描述 Every day each of Farmer John's N (1 <= N <= 100,000) cows conveniently numbered 1..N mov ...

  6. 19 Using Optimizer Hints

    19.1 Overview of Optimizer Hints A hint is an instruction to the optimizer. In a test or development ...

  7. remot debug

    哎,首先吐槽一下,尼玛这是什么编辑器居然不能直接复制粘贴我写好的东西,废话不多说.为什么可以远程调试呢?首先JAVA运行依赖JVM,所以你可以把这种 远程debug想象成两个或者多个JVM之间按照约定 ...

  8. Retrofit 2.0使用

    最近在想能不能把之前项目里的网络请求改下 想通过Retrofit重构下,因为Retrofit完美兼容Rxjava后面会用到Rxjava 所以 开个坑写点 由于网上Retrofit 2.0的架构介绍很详 ...

  9. SPSS数据分析——t检验

    SPSS中t检验全都集中在分析—比较均值菜单中.关于t检验再简单说一下,我们知道一个统计结果需要表达三部分内容,即集中性.变异性.显著性. 集中性的表现指标是均值变异的的表现指标是方差.标准差或标准误 ...

  10. WC2015 酱油记

    这是真·酱油记! Day0 因为我们在上海,所以只要坐高铁就可以了2333.到了火车站以后我们坐大巴到学军中学恩,结果坐大巴的时间和做坐高铁的时间差不做←_←. 吐槽了一下住宿环境和课程表就已经晚上了 ...