Map Reduce Programming Waue Chen. Why ? Moore’s law ?  每隔 18 個月, CPU 的主頻就會增加一倍  2005 開始失效 多核及平行運算時代來臨.

Slides:



Advertisements
Similar presentations
2010/12/12
Advertisements

Divide-and-Conquer. 什麼是 divide-and-conquer ? Divide 就是把問題分割 Conquer 則是把答案結合起來.
Chapter 10 馬可夫鏈 緒言 如果讀者仔細觀察日常生活中所發生的 諸多事件,必然會發現有些事件的未來 發展或演變與該事件現階段的狀況全然 無關,這種事件稱為獨立試行過程 (process of independent trials) ;而另一些 事件則會受到該事件現階段的狀況影響。
Introduction to Java Programming Lecture 13 Classes I OO Programming.
建立使用案例敘述 --Use Case Narrative
EBI European Bioinformatics Institute. EBI The European Bioinformatics Institute (EBI) part of EMBL is a centre for research and services in bioinformatics.
序列分析工具:MDDLogo 謝勝任 林宗慶 指導教授:李宗夷 教授.
CS246 TA Session: Hadoop Tutorial Peyman kazemian 1/11/2011.
Using High and Low Level Communication in Agile Method Presenter: 花金地.
What is static?. Static? 靜態 ? class Test { static int staticX; int instanceX; public Test(int var1, int var2) { this.staticX = var1; this.instanceX =
1 真理大學運輸管理學系 實務實習說明 目錄  實務實習類別  實務實習條例  校外實習單位  實務實習成績計算方式  校外實習甄選 / 自洽申請流程  附錄:相關表格.
真理大學航空運輸管理學系 實務實習說明. 實務實習部份 實務實習 校內實習 校外實習 實習時數必須在 300 小時 ( 含 ) 以上才承認 校內實習時數及實習成績。 二個寒假 各一個月 暑假兩個月.
第 1 章 PC 的基本構造. 本章提要 PC 系統簡介 80x86 系列 CPU 及其暫存器群 記憶體: Memory 80x86 的分節式記憶體管理 80x86 的 I/O 結構 學習組合語言的基本工具.
微帶線濾波器 國立聯合大學 電機工程學系 主講人 : 徐振剛 何奕叡. 目 錄  設計程序理論說明  1. 微波諧振電路  2. 傳輸線特性  3.Chebyshev filter & Butterworth filter  4. 傳輸線殘段設計濾波器和步階阻抗式低通濾波器  設計模型.
最新計算機概論 第 5 章 系統程式. 5-1 系統程式的類型 作業系統 (OS) : 介於電腦硬體與 應用軟體之間的 程式,除了提供 執行應用軟體的 環境,還負責分 配系統資源。
Ubiquitous News(Unews) 的設計與實作 指導教授:黃毅然 教授 學生:葉雅琳 系別:資訊工程學系.
選舉制度、政府結構與政 黨體系 Cox (1997) Electoral institutions, cleavage strucuters, and the number of parties.
電腦優化 黃柏漢 羅元富 黃得瑋.
真理大學航空服務管理學系 實務實習說明. 實務實習部份 實務實習 校內實習 校外實習 實習時數必須在 300 小時 ( 含 ) 以上才承認 校內實習時數及實習成績。 二個寒假 各一個月 暑假兩個月.
CH 15- 元件可靠度之驗證  驗證方法  指數模式之可靠度驗證  韋式模式之可靠度驗證  對數常態模式之可靠度驗證  失效數為零時之可靠度估算  各種失效模式之應用.
An Introduction to MapReduce: Abstractions and Beyond! -by- Timothy Carlstrom Joshua Dick Gerard Dwan Eric Griffel Zachary Kleinfeld Peter Lucia Evan May.
North Point Government Primary PM School 北角官立下午小學 應用 ‘ 基本能力學生評估 ’ 及 ‘ 網上學與教支援系統 ’ 經驗分享.
In Chapter 1 您將學到什麼 ? 了解 Java 語言的特徵 Java 程式的發展過程關係 Java 程式的基本架構.
1-6 動畫的文件屬性 舞台是動畫實際播放的畫面, 所以舞台的大 小與長寬比例對將來動畫的呈現有很大的 影響。 Flash 預設的舞台尺寸是 550 Pixels × 400 Pixels, 背景為白色, 如果要更改舞台大小與 背景色, 請執行『修改 / 文件』命令, 開啟文 件屬性 (Document.
教材名稱:網際網路安全之技術及其應用 (編號: 41 ) 計畫主持人:胡毓忠 副教授 聯絡電話: 教材網址: 執行單位: 政治大學資訊科學系.
資料結構實習-一 參數傳遞.
6-2 認識元件庫與內建元件庫 Flash 的元件庫分兩種, 一種是每個動畫專 屬的元件庫 (Library) ;另一種則是內建元 件庫 (Common Libraries), 兩者皆可透過 『視窗』功能表來開啟, 以下即為您說明。
企二 A 管理程式設計 Visual Basic 6.0 Visual Basic 6.0 Visual Basic 6.0 企二 A 管理程式設計 Visual Basic 6.0 Visual Basic 6.0 Visual Basic 6.0許翠婷
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2008.
計算機概論 演算法與程式語言 李明山.
Teacher : Ing-Jer Huang TA : Chien-Hung Chen 2015/6/25 Course Embedded Systems : Principles and Implementations Weekly Preview Question CH 2.4~CH 2.6 &
資料結構實習-二.
2010 MCML introduction 製作日期: 2010/9/10 製作人 : 胡名霞.
1 第七章 植基於可調整式量化表及離散餘 弦轉換之浮水印技術. 2 Outlines 介紹 介紹 灰階浮水印藏入 灰階浮水印藏入 灰階浮水印取回 灰階浮水印取回 實驗結果 實驗結果.
Linguistics phonetic symbols. 先下載 IPA 字型檔案,執行安裝。 由於這個程式的字型目錄設定錯誤, 所以等重新開機時就會發現字型消失。 所以必須根據以下步驟來讓 Windows 加入 IPA 字型。
Chapter 10 m-way 搜尋樹與B-Tree
: Function Overloading ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11032:Function Overloading 解題者:許智祺 解題日期: 2007 年 5 月 8 日 題意:判對輸入之數字是否為.
概念性產品企劃書 呂學儒 李政翰.
論文研討 2 學分 授課教師:吳俊概. 第一節 論文發表的目的 第二節 論文發表的歷程 第三節 投稿過程 第四節 退稿處理 學術期刊論文的製作與發表.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2009.
程式設計 Visual Basic 6.0 Visual Basic 6.0 Visual Basic 6.0 程式設計 Visual Basic 6.0 Visual Basic 6.0 Visual Basic 6.0許翠婷
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 3: Mapreduce and Hadoop All slides © IG.
Visual C++重點複習.
資料結構實習-六.
1 Introduction to Java Programming Lecture 3 Mathematical Operators Spring 2008.
Microsoft Excel.
第五章IIR數位濾波器設計 濾波器的功能乃對於數位信號進行處理﹐ 以滿足系統的需求規格。其作法為設計一 個系統的轉移函數﹐或者差分方程式﹐使 其頻率響應落在規格的範圍內。本章探討 的是其中一種方法﹐稱為Infinite impulse register(IIR)。 IIR架構說明。 各種不同頻帶(Band)濾波器的設計方法。
計 算 機 概 論 Chapter 10 作業系統. Ch010 作業系統 2 學習目標  描述作業系統的兩個主要任務  定義記憶體及程序管理  解釋邏輯位址與實體位址間的關係  基礎:第 5.2 節 范紐曼 電腦架構  ( 第 5 章講義第 頁 )
1 Introduction to Java Programming Lecture 3 Mathematical Operators Spring 2009.
1 Chemical and Engineering Thermodynamics Chapter 1 Introduction Sandler.
CH 14-可靠度工程之數學基礎 探討重點 失效時間之機率分配 指數模式之可靠度工程.
第 1 章 PC 的基本構造. 本章提要 PC 系統簡介 80x86 系列 CPU 及其暫存器群 記憶體: Memory 80x86 的分節式記憶體管理 80x86 的 I/O 結構 學習組合語言的基本工具.
第七章 計算複雜度概論:排序問題 7.1計算複雜度 7.2插入排序與選擇排序 7.3每次比較至多移除一個導致之演算法的下限
Introduction to Google MapReduce WING Group Meeting 13 Oct 2006 Hendra Setiawan.
Lecture 3-1 Computer Science 425 Distributed Systems CS 425 / ECE 428 Fall 2013 Indranil Gupta (Indy) Sep 3, 2013 Lecture 3 Cloud Computing - 2  2013,
MapReduce Programming Yue-Shan Chang. split 0 split 1 split 2 split 3 split 4 worker Master User Program output file 0 output file 1 (1) fork (2) assign.
Lecture 3-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) Sep 4, 2012 Lecture 3 Cloud Computing -
HAMS Technologies 1
Hadoop&HDFS 1. OUTLINE Introduction Architecture Hadoop Distribution File System – Architecture of HDFS NameNode DataNode HDFS Client – Replica Management.
Java Tutorial /10/21. Java Resource Java SDK –Download from –Install Jdk windows-i586.exe –
DATE: 05/08/2009 Wei-Yu Chen, Yao-Tsung Wang National Center for High-Performance Computing, Taiwan Building ICAS with Hadoop and.
Introduction to Hadoop Owen O’Malley Yahoo!, Grid Team Modified by R. Cook.
Team3: Xiaokui Shu, Ron Cohen CS5604 at Virginia Tech December 6, 2010.
自由軟體實驗室 Map Reduce Programming 王耀聰 陳威宇 楊順發 國家高速網路與計算中心 (NCHC)
子計畫:自動化大量資料切割與整合 國立高雄大學 電機工程學系 賴智錦.  What had been expected to do 了解及熟悉現有分散式語言及工具對於分散式運算元與 資料 reduction/assembly 的處理方式。 資料切割與重組有關之演算法設計。 以 C 或類似語言進行單機系統模擬。
網 站 架 設 新 概 念網 站 架 設 新 概 念. 跟團自由行 國外旅遊 東京廉價航空比較.
HADOOP Priyanshu Jha A.D.Dilip 6 th IT. Map Reduce patented[1] software framework introduced by Google to support distributed computing on large data.
Lecture 4: Mapreduce and Hadoop
Introduction to Google MapReduce
Isolated Word Recognition
Presentation transcript:

Map Reduce Programming Waue Chen

Why ? Moore’s law ?  每隔 18 個月, CPU 的主頻就會增加一倍  2005 開始失效 多核及平行運算時代來臨

What is Hadoop Hadoop 是一個 open source 可運作於大規 模 cluster 上的平行分散式程式框架 提供一個分散式文件系統 HDFS ,用來在各 個節點上存儲數據 高容錯性,自動處理失敗節點 實現了 Google 的 MapReduce 算法

What is MapReduce 把應用程序分割成許多很小的工作單元 每個單元可以在任何節點上執行或運算

MapReduce: Example

MapReduce in Parallel: Example

Thinking in Hadoop:MapReduce HDFS Map Class Reduce Class Overall Configuration

Program prototype Class MR{ Class Map …{ } Class Reduce …{ } main(){ JobConf conf = new JobConf(“MR.class”); conf.setInputPath(“the_path_of_HDFS ”); conf.setMapperClass(Map.class); conf.setReduceClass(Reduce.class); JobClient.runJob(conf); }}

Word Count Sample Class WordCount{ main(){ JobConf conf = new JobConf(WordCount.class); conf.setJobName("wordcount"); // set path conf.setInputPath(new Path(“/user/waue/input”)); conf.setOutputPath(new Path(“counts”)); FileSystem.get(conf).delete(new Path(wc.outputPath)); // set map reduce conf.setOutputKeyClass(Text.class); // set every word as key conf.setOutputValueClass(IntWritable.class); // set 1 as value conf.setMapperClass(MapClass.class); conf.setReducerClass(ReduceClass.class); conf.setNumMapTasks(1); conf.setNumReduceTasks(1); // run JobClient.runJob(conf); }}

Word Count Sample class MapClass extends MapReduceBase implements Mapper { private final static IntWritable one = new IntWritable(1); private Text word = new Text(); public void map( LongWritable key, Text value, OutputCollector output, Reporter reporter) throws IOException { String line = ((Text) value).toString(); StringTokenizer itr = new StringTokenizer(line); while (itr.hasMoreTokens()) { word.set(itr.nextToken()); output.collect(word, one); }}}

Word Count Sample class ReduceClass extends MapReduceBase implements Reducer { IntWritable SumValue = new IntWritable(); public void reduce( Text key, Iterator values, OutputCollector output, Reporter reporter) throws IOException { int sum = 0; while (values.hasNext()) sum += values.next().get(); SumValue.set(sum); output.collect(key, SumValue); }}

Result

MapReduce with HBase prototype Class MR_HBase{ Class Map extends …{ } Class Reduce extends…{ } main(){ JobConf conf = new …; conf.setInputPath(…); conf.setMapperClass( …); conf.setReduceClass( …); JobClient.runJob(conf); } HBase API: TableMap TableReduce

WordCountIntoHbase Sample Class WordCountIntoHbase{ main(){ BuildHTable build_table = new BuildHTable( Table_Name, ColumnF); if (!build_table.checkTableExist(Table_Name)) { if ( !build_table.createTable() ) System.err.println("create table error !"); } else System.out.println("Table existed !"); JobConf conf = new JobConf(WordCount.class); conf.setJobName("wordcount"); conf.setInputPath(new Path(“/user/waue/input”)); //conf.setOutputPath(new Path(“counts”)); //FileSystem.get(conf).delete(new Path(wc.outputPath)); //conf.setOutputKeyClass(Text.class); // set every word as key //conf.setOutputValueClass(IntWritable.class); // set 1 as value //conf.setMapperClass(MapClass.class); conf.setReducerClass(ReduceClass.class); conf.setNumMapTasks(0); conf.setNumReduceTasks(1); JobClient.runJob(conf); }}

class ReduceClass extends TableReduce { Text col = new Text( “word:text” ); private MapWritable map = new MapWritable(); public void reduce( LongWritable key, Iterator values, OutputCollector output, Reporter reporter) throws IOException { ImmutableBytesWritable bytes = new ImmutableBytesWritable(values.next().getBytes()); map.clear(); map.put(col, bytes); output.collect(new Text(key.toString()), map); }} WordCountIntoHbase Sample

result

WordCountFromHbase Word Counting from Hbase after WordCountIntoHbase run. In Trac …  adoop- 0.16/tw/org/nchc/code/WordCountFromHBase.java adoop- 0.16/tw/org/nchc/code/WordCountFromHBase.java

What’s HBaseRecordPro parse your record create Hbase set the first line as column qualify store in HBase Automatically Locally cordPro cordPro

HBaseRecordPro name:locate:years waue:taiwan:1981 rock:taiwan:1981 aso:taiwan:1981 jazz:taiwan:1982 Run HBaseRecordPro.java hql> Select * from Table;

Detailed Code Explanation Apache log parser r r

More.. ? Enjoy  How to code Hadoop in Eclipse  op-eclipse.pdf op-eclipse.pdf  Map Reduce in Hadoop/HBase Manual   My Code sources  adoop-0.16/tw/org/nchc/code adoop-0.16/tw/org/nchc/code

Then.. ? Intrusion-Detection-System log parser  Count => the last  Format => 6 lines / 1 cell Apache Pig  Pig is a platform for analyzing large data sets that consists of a high-level language [**] [1:2189:3] BAD-TRAFFIC IP Proto 103 PIM [**] [Classification: Detection of a non-standard protocol or event] [Priority: 2] 07/08-14:57: > PIM TTL:1 TOS:0xC0 ID:11078 IpLen:20 DgmLen:54 [Xref => bin/cvename.cgi?name= ][Xref =>

References API  api/index.html api/index.html  pi/index.html pi/index.html 用 Hadoop 進行分佈式並行編程 用 Hadoop 進行分佈式並行編程  ource/os-cn-hadoop1/index.html ource/os-cn-hadoop1/index.html