google /
thread-weaver
A Java framework for testing multithreaded code.
26/100 healthLoading repository data…
halmber / repository
A multithreaded Java program for processing JSON files with Orders and generating statistics in XML format.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A multithreaded Java program for processing JSON files with Orders and generating statistics in XML format.
The program processes a set of JSON files with orders, collects statistics for the selected attribute, and generates an XML report, sorted from largest to smallest.
, | ; #)The main business entity of the system.
public class Order {
private String id;
private Customer customer;
private String status;
private String tags;
private String paymentMethod;
private double amount;
private long createdAt;
}
Contains the customer's data.
public class Customer {
private String id;
private String fullName;
private String email;
private String phone;
private String city;
}
Represents a single statistics record.
public class StatisticItem {
private String value; // Attribute value (e.g., “Lviv”)
private Integer count; // Number of occurrences
}
The root element of an XML document.
@JacksonXmlRootElement(localName = "statistics")
public class StatisticsWrapper {
@JacksonXmlElementWrapper(localName = "items")
@JacksonXmlProperty(localName = "item")
private List<StatisticItem> items; // List of all statistical records
}
Saves the program settings.
public class ApplicationConfig {
private String inputDirectory;
private String outputDirectory;
private String attribute;
private int threadPoolSize;
}
[
{
"id": "ord-001",
"customer": {
"id": "cust-101",
"fullName": "Vasyl Cotop",
"email": "vasyl@example.com",
"phone": "+380501112233",
"city": "Lviv"
},
"status": "NEW",
"tags": "gift, urgent",
"paymentMethod": "card",
"amount": 499.99,
"createdAt": 1731600000
},
{
"id": "ord-002",
"customer": {
"id": "cust-102",
"fullName": "Petro Poroh",
"email": "petro@example.com",
"phone": "+380501112233",
"city": "Kyiv"
},
"status": "DONE",
"tags": "gift",
"paymentMethod": "card",
"amount": 499.99,
"createdAt": 1731600000
},
{
"id": "ord-003",
"customer": {
"id": "cust-103",
"fullName": "Zelya Boba",
"email": "zelya@example.com",
"phone": "+380501112233",
"city": "Kyiv"
},
"status": "NEW",
"tags": "gift, urgent, newCustomer",
"paymentMethod": "card",
"amount": 499.99,
"createdAt": 1731600000
}
]
<?xml version='1.0' encoding='UTF-8'?>
<statistics>
<items>
<item>
<value>Kyiv</value>
<count>2</count>
</item>
<item>
<value>Lviv</value>
<count>1</count>
</item>
</items>
</statistics>
<?xml version='1.0' encoding='UTF-8'?>
<statistics>
<items>
<item>
<value>gift</value>
<count>3</count>
</item>
<item>
<value>urgent</value>
<count>2</count>
</item>
<item>
<value>newCustomer</value>
<count>1</count>
</item>
</items>
</statistics>
<?xml version='1.0' encoding='UTF-8'?>
<statistics>
<items>
<item>
<value>NEW</value>
<count>2</count>
</item>
<item>
<value>DONE</value>
<count>1</count>
</item>
</items>
</statistics>
| Attribute | Desc | Example |
|---|---|---|
id | Customer ID | cust-101 |
status | Order status | NEW, DONE, CANCELED |
tags | Tags (separated) | gift, urgent, promo |
paymentMethod | Payment method | card, cash, PayPal |
fullName | Customer fullName | Vasyl Cotop |
email | Customer email | vasyl@example.com |
phone | Customer phone | +380501112233 |
city | Customer city | Lviv |
The benchmark was executed on a synthetic dataset designed to simulate large-scale JSON processing:
The following table presents the execution time, memory consumption, and speedup ratio for processing a large JSON dataset using different thread counts:
| Threads | Time (s) | Mem (MB) | Speedup |
|---|---|---|---|
| 1 | 3.462 | 99.904 | 1.00x |
| 2 | 2.169 | 157.668 | 1.60x |
| 4 | 1.587 | 155.025 | 2.18x |
| 6 | 1.540 | 153.367 | 2.25x |
| 8 | 1.591 | 130.650 | 2.18x |
The highest speedup was achieved with 6 threads, after which performance began to plateau due to CPU saturation and increased thread contention.
All benchmarks were executed on the following system configuration:
CPU: AMD Ryzen 5 3550H
Cores: 4
Threads: 8
Base Clock: 2.1 GHz
Boost Clock: 3.7 GHz
Cache: 2MB L2 + 4MB L3
MEM: 16GB DDR4-2400
DISK: NVMe SSD
OS: Linux (kernel 5.x)
JVM: OpenJDK 21
com.halmber
├── config
│ ├── ApplicationConfig # Config
│ └── ConsoleInputHandler # Console Input Handler
├── exception
│ └── InvalidAttributeException # Exception for Invalid Attributes
├── factory
│ └── statistics
│ ├── StatisticItemFactory # Factory for StatisticItem
│ └── StatisticsWrapperFactory # Factory for StatisticsWrapper
├── model
│ ├── Customer # Customer Model
│ ├── Order # Order Model
│ └── statistics
│ ├── StatisticItem # Statistic Item
│ └── StatisticsWrapper # XML Statistics Wrapper
└── service
├── FileService # File Management Service
├── JsonFileReader # JSON Reading
├── XmlFileWriter # XML sorted Writing
└── order
├── ProcessingService # Multi-threaded Processing
├── StatisticProcessor # Statistic Processing
└── StatisticsService # Orchestrator
Input JSON Files
↓
FileService (list files)
↓
ProcessingService (ExecutorService with N threads)
↓
JsonFileReader (parse JSON)
↓
StatisticProcessor (aggregate statistics)
↓
ConcurrentHashMap (thread-safe storage)
↓
XmlFileWriter (sort + serialize)
↓
Output XML File
You can also run the project directly from IntelliJ IDEA:
Main class.All dependencies are automatically resolved by the IDE.
> mvn clean compile exec:java
This command compiles the project and runs it directly using Maven. All dependencies are automatically included.
mvn clean package
Note: This JAR does not include dependencies, so it cannot be run with
java -jardirectly because project relies on external libraries.
java -jar target/java-core-profitsoft-internship-1.0-SNAPSHOT.jar
This will work only if a fat-jar is built, including external dependencies.
After launching the project, follow the instructions in the console.
====== Order Statistics Configuration ======
Available attributes: id | status | tags | paymentMethod | fullName | email | phone | city |
Enter input directory path (default: src/main/resources/):
Enter attribute name (default example: id): city
Enter threads pool size (default: 8): 8
Configuration set:
Input directory: src/main/resources/
Attribute: city
Output directory: src/main/resources/outputFiles
Threads count: 8
====== END Order Statistics Configuration END ======
mvn test
MIT License
halmber
Selected from shared topics, language and repository description—not editorial ratings.
google /
A Java framework for testing multithreaded code.
26/100 healthtakito1812 /
Simple Python 3 script to detect the "Log4j" Java library vulnerability (CVE-2021-44228) for a list of URLs with multithreading
53/100 healthfaiqsohail /
An easy to use open-source, multithreaded Proxy Checker. Allows you to quickly check HTTP and SOCKS proxies in a user friendly GUI, for Windows, Mac OS, Linux.
79/100 healthlinkedin /
Multithreaded, gzip-compatible compression and decompression, available as a platform-independent Java library and command-line utilities.
61/100 healthloulanyue /
💫 帮助你快速掌握多线程与并发编程的实战经验 💫 A practical note repository to help you quickly learn multithreading and concurrent programming
59/100 healthtriippz-tech /
A multithreaded bot for generating YouTube Views using JAVA
69/100 health