mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 22:58:36 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
@@ -30,26 +30,24 @@ import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* The Main class serves as the entry point for executing the MapReduce program.
|
||||
* It processes a list of text inputs, applies the MapReduce pattern, and prints the results.
|
||||
* The Main class serves as the entry point for executing the MapReduce program. It processes a list
|
||||
* of text inputs, applies the MapReduce pattern, and prints the results.
|
||||
*/
|
||||
public class Main {
|
||||
private static final Logger logger = Logger.getLogger(Main.class.getName());
|
||||
|
||||
/**
|
||||
* The main method initiates the MapReduce process and displays the word count results.
|
||||
*
|
||||
* @param args Command-line arguments (not used).
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
List<String> inputs = Arrays.asList(
|
||||
"Hello world hello",
|
||||
"MapReduce is fun",
|
||||
"Hello from the other side",
|
||||
"Hello world"
|
||||
);
|
||||
List<String> inputs =
|
||||
Arrays.asList(
|
||||
"Hello world hello", "MapReduce is fun", "Hello from the other side", "Hello world");
|
||||
List<Map.Entry<String, Integer>> result = MapReduce.mapReduce(inputs);
|
||||
for (Map.Entry<String, Integer> entry : result) {
|
||||
logger.info(entry.getKey() + ": " + entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user