Changeset 3203
- Timestamp:
- 07/27/13 13:44:44 (11 years ago)
- Location:
- vlo/trunk/vlo_importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk/vlo_importer/nbactions.xml
r2883 r3203 8 8 </goals> 9 9 <properties> 10 <exec.args>-DconfigFile=/ Users/keeloo/projects/clarin/vlo/VloConfig.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args>10 <exec.args>-DconfigFile=/home/keeloo/vlo/config/VloConfig.Netbeans.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args> 11 11 <exec.executable>java</exec.executable> 12 12 <exec.classpathScope>runtime</exec.classpathScope> … … 20 20 </goals> 21 21 <properties> 22 <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -DconfigFile=/ Users/keeloo/projects/clarin/vlo/VloConfig.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args>22 <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -DconfigFile=/home/keeloo/vlo/config/VloConfig.Netbeans.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args> 23 23 <exec.executable>java</exec.executable> 24 24 <exec.classpathScope>runtime</exec.classpathScope> … … 33 33 </goals> 34 34 <properties> 35 <exec.args>${profiler.args} -DconfigFile=/ Users/keeloo/projects/clarin/vlo/VloConfig.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args>35 <exec.args>${profiler.args} -DconfigFile=/home/keeloo/vlo/config/VloConfig.Netbeans.xml -classpath %classpath eu.clarin.cmdi.vlo.importer.MetadataImporter</exec.args> 36 36 <exec.executable>${profiler.java}</exec.executable> 37 37 </properties> -
vlo/trunk/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/importer/MetadataImporter.java
r3175 r3203 96 96 97 97 // SOME STATS 98 protected int nrOFDocuments Updated;98 protected int nrOFDocumentsSend; 99 99 protected int nrOfFilesAnalyzed = 0; 100 100 protected int nrOfFilesWithoutId = 0; … … 166 166 LOG.info("Found " + nrOfIgnoredFiles 167 167 + " file(s) that where ignored (files without resources or any link to a search service or landing page are ignored)."); 168 LOG.info("Update of " + nrOFDocuments Updated + " took " + took + " secs. Total nr of files analyzed " + nrOfFilesAnalyzed);168 LOG.info("Update of " + nrOFDocumentsSend + " took " + took + " secs. Total nr of files analyzed " + nrOfFilesAnalyzed); 169 169 } 170 170 … … 377 377 * Send the current list of documents to the SOLR server 378 378 * 379 * @throws SolrServerException 380 * @throws IOException 379 * @throws SolrServerException in case the server does not respond. Ask the 380 * server is asked for a response after 1, 2, 4, 8 ... seconds until the 381 * timeout specified in the configuration file is reached. 382 * 383 * @throws IOException when the waiting for another attempt to send documents 384 * to the server is interrupted. 381 385 */ 382 386 protected void sendDocs() throws SolrServerException, IOException { … … 384 388 boolean done = false; 385 389 386 LOG.info("Sending " + docs.size() + 387 " docs to solr server queue. Number of docs updated till now: " 388 + nrOFDocumentsUpdated); 389 390 nrOFDocumentsUpdated += docs.size(); 391 // add the documents in the list to the solr queue 390 /* Start trying, or keep trying to send documents as long as the 391 * timeout value specified in the VloConfig.xml file has not been 392 * reached. 393 */ 392 394 while (! done && wait <= VloConfig.getSolrTimeOut()){ 393 395 solrServer.add(docs); … … 398 400 LOG.info("Waiting 1 second for the solr server to respond"); 399 401 } else { 400 LOG.info("Waiting " , wait,401 " seconds for the solr server to respond");402 LOG.info("Waiting " + wait + 403 " seconds for the solr server to respond"); 402 404 } 405 // wait for the accumulated amount of time 403 406 Thread.sleep(1000 * wait); 404 407 } catch (InterruptedException e) { 408 // something has interrupted the waiting 405 409 LOG.info(e.toString()); 406 410 } 411 // wait even longer 407 412 wait = wait * 2; 413 // re-initialise the server 414 serverError = null; 415 initSolrServer(); 408 416 } 409 417 } 410 418 411 419 if (done) { 412 // the documents are in the queue now, create a new empty list 420 /* The current list of documents has been added to the queue; update 421 * the number of documents that has been send to the server. 422 */ 423 nrOFDocumentsSend += docs.size(); 424 LOG.info("Send " + docs.size() 425 + " documents to solr server queue. Number that has been " 426 + "send so far: " 427 + nrOFDocumentsSend); 428 /* The documents from the current list are in the queue now, create 429 * a new empty list. 430 */ 413 431 docs = new ArrayList<SolrInputDocument>(); 414 432 } else { 415 433 // the documents haven't reached the queue 416 434 if (wait > VloConfig.getSolrTimeOut()) { 417 LOG.error("Timeout sending list of documentsto solr server queue");435 LOG.error("Timeout sending the current document list to solr server queue"); 418 436 } 419 437 throw new SolrServerException(serverError); -
vlo/trunk/vlo_importer/src/test/java/eu/clarin/cmdi/vlo/importer/MetadataImporterTest.java
r3025 r3203 312 312 LOG.info("Found " + nrOfIgnoredFiles 313 313 + " file(s) that where ignored (files without resources or any link to a search service or landing page are ignored)."); 314 LOG.info("Update of " + nrOFDocuments Updated + " took " + took +314 LOG.info("Update of " + nrOFDocumentsSend + " took " + took + 315 315 " secs. Total nr of files analyzed " + nrOfFilesAnalyzed); 316 316 }
Note: See TracChangeset
for help on using the changeset viewer.