Changeset 30985 for other-projects/hathitrust/solr-extracted-features/trunk/src/main/java/org/hathitrust/PrepareForIngest.java
- Timestamp:
- 2016-10-29T16:17:22+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/hathitrust/solr-extracted-features/trunk/src/main/java/org/hathitrust/PrepareForIngest.java
r30984 r30985 51 51 52 52 DoubleAccumulator progress_accum = jsc.sc().doubleAccumulator("ProgressPercent"); 53 54 //sc.parallelize(Arrays.asList(1, 2, 3, 4)).foreach(x -> accum.add(x));55 // ...56 // 10/09/29 18:41:08 INFO SparkContext: Tasks finished in 0.317106 s57 58 //accum.value();59 53 60 54 PagedJSON paged_json = new PagedJSON(_input_dir,_solr_url,_output_dir,_verbosity, progress_accum,per_vol); 61 JavaRDD<String> json_ids = json_list_data.flatMap(paged_json).cache();55 //JavaRDD<String> json_ids = json_list_data.flatMap(paged_json).cache(); 62 56 63 long num_ids = json_ids.count(); 57 json_list_data.foreach(paged_json); 58 59 60 //long num_ids = json_ids.count(); 61 long num_ids = num_volumes; 62 64 63 System.out.println(""); 65 64 System.out.println("############"); … … 68 67 System.out.println(""); 69 68 69 /* 70 70 if (_output_dir != null) { 71 71 String rdd_save_file = "rdd-solr-json-page-files"; … … 77 77 System.out.println(""); 78 78 } 79 */ 79 80 80 81 jsc.close(); … … 89 90 90 91 Options options = new Options(); 91 92 //.withType(Integer.class)93 /*94 options.addOption(OptionBuilder.withLongOpt("verbosity")95 .withDescription("Set to control the level of debugging output [0=none, 1=some, 2=lots]")96 .hasArg()97 .withArgName("v")98 .isRequired(false)99 .create());100 */101 //Option num_cores_opt = new Option("n", "num-cores", true, "Number of cores to use");102 //num_cores_opt.setRequired(false);103 //options.addOption(num_cores_opt);104 92 105 93 Option verbosity_opt = new Option("v", "verbosity", true, … … 137 125 print_usage(formatter,options); 138 126 System.exit(1); 139 //return; // prevents 'cmd may not be assigned' compiler error in Eclipse140 127 } 141 128 142 //value = ((Integer)cmdLine.getParsedOptionValue("num-cores")).intValue();143 //value = ((Integer)cmdLine.getOptionValue("num-cores","2")).intValue();144 145 //cmd.hasOption("json-filelist")146 129 147 130 String verbosity_str = cmd.getOptionValue("verbosity","0"); … … 167 150 String input_dir = filtered_args[0]; 168 151 String json_list_filename = filtered_args[1]; 169 //String output_dir = filtered_args[2]; 170 152 171 153 PrepareForIngest prep_for_ingest 172 154 = new PrepareForIngest(input_dir,json_list_filename,solr_url,output_dir,verbosity);
Note:
See TracChangeset
for help on using the changeset viewer.