Skip to content

deliagorgan/Parallel-News-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parallel-News-Engine | Multithreaded Data Ingestion & Analytics

A Java processing engine designed to aggregate and analyze large-scale datasets of news articles. The system utilizes advanced concurrency patterns to handle intensive I/O operations and complex data filtering in parallel.

Overview

This project implements a staged pipeline where multiple worker threads collaborate to parse, clean, and categorize data, significantly reducing execution time compared to serial processing.

Key Features

The engine follows a multithreaded architecture built for maximum CPU utilization:

  • Workload Partitioning: Uses a start/end index formula to ensure every thread processes an equal number of input files.
  • Staged Execution: Uses a $CyclicBarrier$ to synchronize threads between the ingestion, processing, and final reporting phases.
  • Memory-Efficient Ingestion: Threads operate on local data buffers to minimize synchronization overhead and prevent global lock contention.

Technical Challenges

  • Race Condition Prevention: Resolved initial synchronization errors by transitioning from standard collections to $ConcurrentHashMap$ and $AtomicInteger$ for global statistics.
  • Lock Contention Optimization: Minimized bottlenecks by using a staged parallel architecture, allowing threads to work on local buffers before synchronized global aggregation.

Performance & Scalability Results

  • Testing Hardware: Apple M1 (8 cores), 8GB RAM.
  • Speedup Achieved: Up to 2.16x on 4 performance cores, reducing processing time for ~8,300 articles from 12.5s to 5.7s.
  • Efficiency Analysis: Identified the optimal thread count ($P=4$) for the M1 architecture to balance speed and resource utilization.

Setup & Execution

Build & Run

cd src
make
# Usage: java NewsAggregator <thread_count> <input_articles_path> <config_files>
java NewsAggregator 4 your/path/to/the/articles your/path/to/the/config/file

Testing

 ./test/result_validator.sh

About

Java data engine utilizing multithreading (CyclicBarrier, ConcurrentHashMap) to parallelize large-scale JSON ingestion and analytics. Achieved 2.16x speedup on ARM architecture by optimizing lock contention and workload partitioning.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors