26
Taste Java in the Clouds 朱朱朱 Jacky Chu

Taste Java In The Clouds

Embed Size (px)

Citation preview

Page 1: Taste Java In The Clouds

Taste Java in the Clouds

朱仲傑Jacky Chu

Page 2: Taste Java In The Clouds

Agenda

• Evolution of computing with the network

• What is Cloud Computing

• Cloud Computing in the world

• How to develop a cloud application

• Hadoop Overview

• Your First Cloud Program

• Who needs Cloud Computing

Page 3: Taste Java In The Clouds

Evolution of Computing with the Network

Page 4: Taste Java In The Clouds

Internet Services around the World

Page 5: Taste Java In The Clouds

What is Cloud Computing

松下問童子,

言師採藥去。

只在此山中,

雲深不知處。

尋隱者不遇

唐賈島

Page 6: Taste Java In The Clouds

Cloud Computing is …

• Services and data in the cloud

• Accessible with any device

• Connected to the cloud with a browser

Page 7: Taste Java In The Clouds

The Key Technical Issue for Developers is …

Page 8: Taste Java In The Clouds

Cloud vs. Grid

Cloud Computing Grid Computing

Leading Service Provider Academic Circles

Standard No Yes

Open Source Partial Fully

Hardware PC Heterogeneous

Characteristic Small data for each processA large number of repeat process

Huge data for once process

Page 9: Taste Java In The Clouds

Cloud Computing in the World

Page 10: Taste Java In The Clouds

How to Develop a Cloud Application

Page 11: Taste Java In The Clouds

MapReduce

Storage

Database

http://www.gridgainsystems.com/wiki/display/GG15UG/MapReduce+Overview

Page 12: Taste Java In The Clouds

MapReduce

DataData

(Key1, Value)(Key2, Value)

…(Key n, Value)

(Key1, Value)(Key2, Value)

…(Key n, Value)

(Key1, Value)(Key3, Value)

…(Key m, Value)

(Key1, Value)(Key3, Value)

…(Key m, Value)

(Key2, Value)(Key3, Value)

…(Key n, Value)

(Key2, Value)(Key3, Value)

…(Key n, Value)

(Key1, Value)(Key2, Value)(Key3, Value)

…(Key m, Value)(Key n, Value)

(Key1, Value)(Key2, Value)(Key3, Value)

…(Key m, Value)(Key n, Value)

Map Reduce

Page 13: Taste Java In The Clouds

Hadoop History

Doug Cutting

Page 14: Taste Java In The Clouds

Hadoop Overview

HDFS

Page 15: Taste Java In The Clouds

Map Class

• Extends MapReduceBase

• Implements Mapper– <K1, V1, K2, V2>– <WritableComparable, Writable,

WritableComparable, Writable>

• map– K1, V1– OutputCollector<K2, V2>– Reporter

Page 16: Taste Java In The Clouds

Key Class

• org.apache.hadoop.io.WritableComparable

• BooleanWritable, BytesWritable

• IntWritable, LongWritable– VIntWritable, VLongWritable

• FloatWritable

• Text, UTF8

• NullWritable

Page 17: Taste Java In The Clouds

Value Class

• org.apache.hadoop.io.Writable

• Super Interface of WritableComparatable

• ArrayWritable, MapWritable

• ObjectWritable

Page 18: Taste Java In The Clouds

Reduce Class

• Extends MapReduceBase

• Implements Reducer– <K2, V2, K3, V3>– <WritableComparable, Writable,

WritableComparable, Writable>

• reduce– K2, Iterator<V2>– OutputCollector<K3, V3>– Reporter

Page 19: Taste Java In The Clouds

Job Configuration

• org.apache.hadoop.mapred.JobConf• new JobConf(Class)• setJobName(String)• setMapperClass(Class <? extends Mapper>)• setCombinerClass(Class <? extends Reducer>)• setReducerClass(Class <? extends Reducer>)• setInputFormat(Class <? extends InputFormat>)• setOutputFormat(Class <? extends OutputFormat>)

Page 20: Taste Java In The Clouds

Input/Output Format

• org.apache.hadoop.mapred.*

• FileInputFormat– setInputPath(JobConf, Path...)– The array of Paths– org.apache.hadoop.fs.Path

• FileOutputFormat– setOutputPath(JobConf, Path)

Page 21: Taste Java In The Clouds

Run Job

• JobClient– runJob(JobConf)

Page 22: Taste Java In The Clouds

DEMO

Page 23: Taste Java In The Clouds

Who needs Cloud Computing

• ASP (Application Service Provider)

• SaaS (Software as a Service)

• PaaS (Platform as a Service)

Page 24: Taste Java In The Clouds

The Key is …

Page 25: Taste Java In The Clouds

References

• Google AppEngine– http://code.google.com/appengine

• Hadoop– http://hadoop.apache.org

• Amazon Web Services– http://aws.amazon.com

• Windows Azure– http://www.microsoft.com/azure/default.mspx

Page 26: Taste Java In The Clouds