18 |
18 |
19 import java.io.BufferedReader; |
19 import java.io.BufferedReader; |
20 import java.io.FileReader; |
20 import java.io.FileReader; |
21 import java.io.IOException; |
21 import java.io.IOException; |
22 import java.io.InputStreamReader; |
22 import java.io.InputStreamReader; |
|
23 import java.text.SimpleDateFormat; |
23 import java.util.ArrayList; |
24 import java.util.ArrayList; |
|
25 import java.util.Date; |
24 import java.util.List; |
26 import java.util.List; |
25 import java.util.StringTokenizer; |
27 import java.util.StringTokenizer; |
26 import java.util.concurrent.ArrayBlockingQueue; |
28 import java.util.concurrent.ArrayBlockingQueue; |
27 import java.util.concurrent.ThreadPoolExecutor; |
29 import java.util.concurrent.ThreadPoolExecutor; |
28 import java.util.concurrent.TimeUnit; |
30 import java.util.concurrent.TimeUnit; |
29 import java.util.Date; |
|
30 import java.text.SimpleDateFormat; |
|
31 |
31 |
32 /** |
32 /** |
33 * Simple application which will execute each line from a text file |
33 * Simple application which will execute each line from a text file |
34 * as a command. All the command will be executed in parallel. |
34 * as a command. All the command will be executed in parallel. |
35 * Default number of threads is 4. |
35 * Default number of threads is 4. |
36 * |
36 * |
37 * The implementation must not rely on any external dependencies except JVM and owning jar. |
37 * The implementation must not rely on any external dependencies except JVM and owning jar. |
38 * |
38 * |
39 */ |
39 */ |
|
40 @SuppressWarnings("PMD.SystemPrintln") |
40 public final class ParallelExecutor { |
41 public final class ParallelExecutor { |
41 |
42 |
42 /** |
43 /** |
43 * Private constructor - not meant to be instantiated. |
44 * Private constructor - not meant to be instantiated. |
44 */ |
45 */ |