I am given an assignment to parse from multiple files and count the occurrence of a letter in each file. I am not sure what the best approach would be. I have come up with following possible solutions:
- Use ExecutorService to create a thread pool, and use callables to divided up the work (process 20 files per thread) and then merge the results.
- Maybe use something like Blocking Queue to read from server the file content, and have another thread access the content to do the parsing and counting.
I want to make it as performant as possible while avoiding making the app too complicated and error-prone. Thanks.