How jeffwu0724/illumio-jeff-wu works
Main Components
• Input Files: Represent the two CSV input files – lookup_table.csv and sample_flow_log.csv.
• Lookup Table Loader: A component (or module) that reads the lookup_table.csv and builds a hashmap (or similar data structure) mapping port-protocol pairs to their respective tags.
• Flow Log Parser: A module that reads and parses sample_flow_log.csv. It validates each record (ensuring there are at least 14 fields) and extracts the required port and protocol information.
• Data Processor: The core processing part that uses the lookup hashmap to count the occurrences for each port/protocol combination and associated tag. This includes handling cases where no match is found – labeling them as “Untagged.”
• Report Generator: This module takes the computed counts and writes out two separate CSV files (port_protocol_com_count_report.csv and tag_count_report.csv) into the output directory.
• Main/Driver Class: The Main.java file that orchestrates the process, from reading inputs to processing and report generation.
• Unit Testing: Represent a testing module (e.g., MainTest.java) used to verify the correctness of the business logic.
• Next, indicate that the Data Processor sends data concurrently to the Report Generator, with one stream for port/protocol counts and another for tag counts.
• The Main/Driver class is at the center, coordinating these calls sequentially, so represent it as the central control component linking to all modules.
Architectural Patterns and Design Principles
• Separation of concerns by isolating file input, processing, and output generation.
• Use of a hashing mechanism to quickly map port/protocol pairs to tags, which is essential for performance.
• The design can be interpreted as following a pipeline model, where data flows from input through transformation (processing) to output, and can be represented as a series of modular steps.
Technologies, Frameworks, and Libraries
• Since it’s plain Java (no external frameworks beyond the JDK), mention standard Java I/O for file operations and collections (e.g., HashMap) for lookup.
• JUnit (or similar) for the testing component since there is an example unit test.
Essential Elements
• Input Files → Lookup Table Loader and Flow Log Parser
• Lookup Table Loader → Data Processor
• Flow Log Parser → Data Processor
• Data Processor → Report Generator → Output CSV Files
Extra Details
• If necessary, represent the interaction with the file system (e.g., the root folder and the output subdirectory).