MCPcopy Index your code
hub / github.com/apache/orc / main

Method main

java/tools/src/java/org/apache/orc/tools/PrintData.java:270–298  ·  view source on GitHub ↗
(Configuration conf, String[] args
                   )

Source from the content-addressed store, hash-verified

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}

Callers 2

mainMethod · 0.95
mainMethod · 0.95

Calls 6

parseCommandLineMethod · 0.95
printHelpMethod · 0.95
getReaderMethod · 0.95
printJsonDataMethod · 0.95
ofMethod · 0.80
parseIntMethod · 0.80

Tested by

no test coverage detected