Hadoop Overview
- 54Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- βPrevious card
- βNext card
What are the main reasons for the growth of big data?
Technology enhancement, Internet of Things (IoT), and social media.
Or swipe the card
54 cards
What are the main reasons for the growth of big data?
Technology enhancement, Internet of Things (IoT), and social media.
According to Cisco, what are the three major reasons for the rise of data?
- Adapting to smarter mobile devices
- Cell network advances (2G to 5G)
- Reviewing tiered pricing (unlimited data plans)
What is the social media data generation per 60 seconds?
Facebook: 4 million likes; Twitter: 300,000 tweets; Reddit: 18,000 user cast votes; Instagram: >1 million likes; YouTube: 300 hours of new video.
How is big data defined in the context of traditional systems?
Big data is a problem statement that surrounds the incapabilities of traditional systems to store, process, and manage the large volume, variety, and velocity of data.
What are the 5 V's of big data according to IBM?
Volume, Variety, Velocity, Value, Veracity.
Explain the 'Volume' V of big data.
Volume refers to the huge amount of data (exabytes) that exceeds the storage capacity of traditional systems.
Explain the 'Variety' V of big data.
Variety refers to the different types of data: structured (e.g., databases), semi-structured (e.g., JSON), and unstructured (e.g., images, videos, mp3). About 90% of data is unstructured.
Explain the 'Velocity' V of big data.
Velocity refers to the high speed at which data is generated and must be processed, e.g., millions of events per second from sensors or social media.
Explain the 'Value' V of big data.
Value refers to the need to extract meaningful insights from data; data that does not provide value is garbage.
Explain the 'Veracity' V of big data.
Veracity refers to the trustworthiness and reliability of data; data may contain missing values, inaccuracies, or inconsistencies.
What problem does Hadoop solve?
Hadoop is a framework that allows storing and processing large data sets in a parallel and distributed fashion, addressing both storage (HDFS) and processing (MapReduce) challenges of big data.
What are the two core components of Hadoop?
HDFS (Hadoop Distributed File System) for storage and MapReduce for processing.
Explain Hadoop's master/slave architecture with an analogy.
The master node (like a project manager) supervises slave nodes (like team members). It assigns tasks, tracks progress, and maintains backups in case of failure.
What are the components of HDFS?
NameNode (master), DataNodes (slaves), and Secondary NameNode.
What is the function of the NameNode?
NameNode maintains and manages all DataNodes, stores metadata (FSImage and EditLog), and receives heartbeats from DataNodes.
What is the function of a DataNode?
DataNode stores actual data in data blocks and reports to NameNode via heartbeats. It is a slave daemon.
What is the role of the Secondary NameNode?
It performs periodic checkpointing: combines the FSImage with the EditLog to create a new FSImage, preventing the EditLog from growing too large and aiding faster recovery.
What are FSImage and EditLog in HDFS?
FSImage: a file on disk containing all metadata changes since the NameNode started. EditLog: a file in RAM containing only the most recent changes (since last checkpoint).
What is checkpointing in HDFS?
The process of combining the EditLog with the FSImage to produce an updated FSImage, performed by the Secondary NameNode every hour.
What is the default block size in HDFS?
128 MB.
How does HDFS store a 380 MB file?
It splits the file into three blocks: two of 128 MB and one of 124 MB. The last block uses only the needed space to save HDFS capacity.
What are the three advantages of a distributed file system like HDFS?
- Abstraction of a single large storage from multiple machines.
- Scalability by adding more nodes.
- Parallel processing reduces data reading time.
What is the replication factor in HDFS?
3 (default). Each data block is automatically replicated three times across the cluster.
How does HDFS achieve fault tolerance?
By replicating each data block three times (default) across different DataNodes. Even if one copy is lost, two more remain.
Describe the three steps of HDFS write mechanism for a single block.
- Pipeline setup: Client requests NameNode for DataNode addresses; NameNode returns three DataNodes. Client contacts first DataNode, which contacts the next, and so on, forming a pipeline.
- Actual writing: Data is written sequentially to the first node, then to the second, then to the third.
- Acknowledgments: The last node sends ack to the previous, chain back to the client. Client then informs NameNode of success.
How does HDFS read a file?
Client requests NameNode for the locations of all blocks. NameNode returns the DataNode addresses. Client then fetches each block in parallel from the nearest DataNodes.
What is MapReduce?
MapReduce is the programming unit of Hadoop for parallel and distributed processing of data stored across HDFS. It consists of two tasks: Map and Reduce.
Explain the 'Julius Caesar' example of MapReduce.
A professor wants to count occurrences of 'Julius' in a four-chapter book. Instead of each student reading the whole book (4 hours), each reads one chapter (1 hour) and reports counts. Professor sums the counts in 2 minutes. The parallel chapter reading is the Map phase; summation is the Reduce phase.
In MapReduce, what is the input and output of the Map phase?
Input: a block of data (e.g., a line or record). Output: a list of key-value pairs (intermediate output).
In MapReduce, what is the input and output of the Reduce phase?
Input: a key and a list of values (from multiple mappers). Output: a single key-value pair (aggregated result).
Describe the word count MapReduce example step by step.
- Input: three sentences.
- Split into three map tasks, each tokenizing words and emitting (word, 1).
- Shuffle and sort: all same-key pairs go to the same reducer.
- Reducer sums the 1s for each word and emits (word, total).
- Final output: list of words with counts.
What are the three main parts of a MapReduce program?
Mapper code, Reducer code, and Driver code.
In the Mapper code, what are the input key and value types?
Input key: LongWritable (byte offset). Input value: Text (the line or tuple).
In the Mapper code, what are the output key and value types?
Output key: Text (the word or token). Output value: IntWritable (hardcoded 1).
What does the Driver code in MapReduce contain?
Job configuration details: job name, mapper and reducer classes, input/output key-value types, input and output paths, and optional settings like input format class.
What is YARN?
YARN (Yet Another Resource Negotiator) is the resource management layer of Hadoop (MapReduce v2) that separates resource management from data processing.
What are the four main components of YARN?
ResourceManager, NodeManager, AppMaster, and Container.
What is the function of the ResourceManager in YARN?
It receives job requests from clients, monitors NodeManagers, and allocates resources to applications via AppMasters.
What is the function of the NodeManager in YARN?
It runs on each DataNode, monitors resources (CPU, RAM), and manages AppMasters and Containers on that node.
What is the AppMaster in YARN?
A per-application daemon that negotiates resources from ResourceManager, launches Containers for tasks, and monitors the application execution.
What is a Container in YARN?
A combination of CPU and RAM on a NodeManager where actual tasks (map or reduce) execute.
Describe the MapReduce job workflow in YARN.
- Client submits job to ResourceManager, gets app ID.
- ResourceManager asks a NodeManager to start a container and launch an AppMaster.
- AppMaster negotiates containers from ResourceManager.
- AppMaster launches map and reduce tasks in containers on various NodeManagers.
- Tasks report progress to AppMaster.
- On completion, AppMaster deregisters and releases resources.
What is the default size of the circular memory buffer in a MapTask?
100 MB.
When does a MapTask spill its buffer to disk?
When the buffer reaches 80% of its capacity (default threshold). A background thread spills the contents while the map continues writing, but if the buffer fills completely, the map blocks until spill finishes.
What happens before spilling to disk in MapReduce?
The data is first partitioned by reducer number, and within each partition, an in-memory sort by key is performed.
How are spill files merged after the map task finishes?
All spill files are merged into a single partitioned and sorted output file. The property
mapreduce.task.io.sort.factorcontrols the maximum number of streams to merge at once (default 10).What are the three modes of Hadoop cluster setup?
- Standalone/Local mode: all daemons run on a single JVM; no HDFS or YARN; used for debugging.
- Pseudo-distributed mode: each Hadoop daemon runs on a single machine in separate JVMs; simulates cluster.
- Multi-node cluster mode: multiple machines form a true distributed cluster; used in production.
List five tools from the Hadoop ecosystem and their primary functions.
Flume: ingest unstructured/semi-structured data. Sqoop: ingest structured data (e.g., from databases). Hive: analytics using HQL (SQL-like). Pig: analytics using Pig Latin (10 lines = 200 lines MapReduce). Spark: near real-time processing and machine learning.
What is Pig and its main advantages?
Pig is an analytics tool in Hadoop that uses Pig Latin, a high-level language similar to SQL. It is powerful: 10 lines of Pig = 200 lines of MapReduce code. It has built-in operators for filtering, grouping, joining, sorting.
In the Pig use case, what was the first query performed on the Olympic dataset?
Find the top 10 countries with the highest total medals.
In the Pig use case, how was the data loaded and parsed?
Using:
olympic = LOAD 'olympic/input/olympics_data.csv' USING PigStorage(' ') AS (athlete, age, country, year, closing_date, sport, gold, silver, bronze, total_medals);In Pig, what does the
GROUPoperation do?It groups records with the same key (e.g., country) into a single tuple with a nested bag of records.
In the Pig use case, what was the query for top 10 countries by gold medals?
Similar to total medals but selecting the gold medal field (index 6 instead of 9) and performing same steps: generate, group, count, sort, limit.
In the Pig use case, what was the query for countries with most medals in swimming?
Steps: load data, generate country, sport, total_medals; filter by sport='swimming'; group by country; count total medals; sort descending.

Ask anything
We've read this whole study set, so questions about it get the best answers.