Changeset 31451 for other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures/PerVolumeJSON.java
- Timestamp:
- 2017-03-02T23:28:38+13:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures/PerVolumeJSON.java
r31450 r31451 32 32 protected String _langmap_directory; 33 33 34 protected String _solr_url; 34 protected final ArrayList<String> _solr_endpoints; 35 protected final int _solr_endpoints_len; 36 37 //protected String _solr_url; 35 38 protected String _output_dir; 36 39 … … 44 47 45 48 public PerVolumeJSON(String input_dir, String whitelist_filename, String langmap_directory, 46 String solr_url, String output_dir, int verbosity,49 ArrayList<String> solr_endpoints, String output_dir, int verbosity, 47 50 boolean icu_tokenize, boolean strict_file_io) 48 51 { … … 53 56 _langmap_directory = langmap_directory; 54 57 55 _solr_url = solr_url; 58 _solr_endpoints = solr_endpoints; 59 _solr_endpoints_len = solr_endpoints.size(); 60 61 //_solr_url = solr_url; 56 62 _output_dir = output_dir; 57 63 _verbosity = verbosity; … … 77 83 int ef_num_pages = 0; 78 84 85 String solr_url = null; 86 if (_solr_endpoints_len > 0) { 87 int random_choice = (int)(_solr_endpoints_len * Math.random()); 88 solr_url = _solr_endpoints.get(random_choice); 89 } 90 79 91 try { 80 92 … … 125 137 126 138 127 if ( _solr_url != null) {139 if (solr_url != null) { 128 140 if ((_verbosity >=2) && (i==20)) { 129 141 System.out.println("=================="); 130 System.out.println("Posting to: " + _solr_url);142 System.out.println("Posting to: " + solr_url); 131 143 System.out.println("=================="); 132 144 } 133 SolrDocJSON.postSolrDoc( _solr_url, solr_add_doc_json);145 SolrDocJSON.postSolrDoc(solr_url, solr_add_doc_json); 134 146 } 135 147
Note:
See TracChangeset
for help on using the changeset viewer.