(Configuration conf, String[] args
)
| 268 | } |
| 269 | |
| 270 | static void main(Configuration conf, String[] args |
| 271 | ) throws ParseException { |
| 272 | CommandLine cli = parseCommandLine(args); |
| 273 | if (cli.hasOption('h') || cli.getArgs().length == 0) { |
| 274 | printHelp(); |
| 275 | System.exit(1); |
| 276 | } else { |
| 277 | Optional<Integer> lines = Optional.empty(); |
| 278 | if(cli.hasOption("n")){ |
| 279 | lines = Optional.of( Integer.parseInt(cli.getOptionValue("n"))); |
| 280 | } |
| 281 | |
| 282 | List<String> badFiles = new ArrayList<>(); |
| 283 | for (String file : cli.getArgs()) { |
| 284 | try { |
| 285 | Path path = new Path(file); |
| 286 | Reader reader = FileDump.getReader(path, conf, badFiles); |
| 287 | if (reader == null) { |
| 288 | continue; |
| 289 | } |
| 290 | printJsonData(System.out, reader, lines); |
| 291 | System.out.println(FileDump.SEPARATOR); |
| 292 | } catch (Exception e) { |
| 293 | System.err.println("Unable to dump data for file: " + file); |
| 294 | e.printStackTrace(); |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | } |
no test coverage detected