Book Image

Learning Big Data with Amazon Elastic MapReduce

By : Amarkant Singh, Vijay Rayapati
Book Image

Learning Big Data with Amazon Elastic MapReduce

By: Amarkant Singh, Vijay Rayapati

Overview of this book

<p>Amazon Elastic MapReduce is a web service used to process and store vast amount of data, and it is one of the largest Hadoop operators in the world. With the increase in the amount of data generated and collected by many businesses and the arrival of cost-effective cloud-based solutions for distributed computing, the feasibility to crunch large amounts of data to get deep insights within a short span of time has increased greatly.</p> <p>This book will get you started with AWS so that you can quickly create your own account and explore the services provided, many of which you might be delighted to use. This book covers the architectural details of the MapReduce framework, Apache Hadoop, various job models on EMR, how to manage clusters on EMR, and the command-line tools available with EMR. Each chapter builds on the knowledge of the previous one, leading to the final chapter where you will learn about solving a real-world use case using Apache Hadoop and EMR. This book will, therefore, get you up and running with major Big Data technologies quickly and efficiently.</p>
Table of Contents (18 chapters)
Learning Big Data with Amazon Elastic MapReduce
Credits
About the Authors
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

The map function


Let's design the map function now. A map function takes in a <key,value> pair as input and emits one or more <key,value> pairs. This function operates on the input value in isolation, that is, it has nothing to do with any other input values, which signifies that a map function is stateless. This is desired, as now map functions can be executed against many input data in parallel.

In our case, the map function can take one line in the access log as input value (key can be either null or an autoincrement integer), find the country to which the requesting IP belongs, and emit the output as <Country,1>. So for our set of input lines to map function, we will have the following lines emitted as output:

Input access log

Map output <Key, Value>

T1, IP1

<Country1, 1>

T2, IP2

<Country2, 1>

T3, IP3

<Country3, 1>

T4, IP4

<Country1, 1>

T5, IP5

<Country3, 1>

T6, IP1

<Country1, 1>

T7, IP3...