@@ -307,15 +307,18 @@ public void complete(PipelineJob job, List<Readset> readsets, List<SequenceOutpu
307307 boolean hasMetrics = new TableSelector (SequenceAnalysisSchema .getTable (SequenceAnalysisSchema .TABLE_QUALITY_METRICS ), PageFlowUtil .set ("RowId" ), filter , null ).exists ();
308308 if (!hasMetrics )
309309 {
310+ job .getLogger ().debug ("No existing metrics found for: " + rd .getFileId1 ());
310311 List <Integer > toAdd = new ArrayList <>(rd .getFileId1 ());
311312 if (rd .getFileId2 () != null )
312313 {
313314 toAdd .add (rd .getFileId2 ());
314315 }
315316
317+ job .getLogger ().debug ("adding metrics for " + toAdd .size () + " total fastq files" );
316318 for (int dataId : toAdd )
317319 {
318320 //then delete/add:
321+ job .getLogger ().debug ("adding metrics for: " + dataId );
319322 ReadsetCreationTask .addQualityMetricsForReadset (rs , dataId , job , true );
320323 }
321324 }
@@ -332,15 +335,22 @@ public void complete(PipelineJob job, List<Readset> readsets, List<SequenceOutpu
332335 }
333336 }
334337
335- Container target = job .getContainer ().isWorkbook () ? job .getContainer ().getParent () : job .getContainer ();
336- TableInfo ti = QueryService .get ().getUserSchema (job .getUser (), target , SequenceAnalysisSchema .SCHEMA_NAME ).getTable (SequenceAnalysisSchema .TABLE_READ_DATA );
337- try
338+ if (!rows .isEmpty ())
338339 {
339- ti .getUpdateService ().updateRows (job .getUser (), target , rows , rows , null , null );
340+ Container target = job .getContainer ().isWorkbook () ? job .getContainer ().getParent () : job .getContainer ();
341+ TableInfo ti = QueryService .get ().getUserSchema (job .getUser (), target , SequenceAnalysisSchema .SCHEMA_NAME ).getTable (SequenceAnalysisSchema .TABLE_READ_DATA );
342+ try
343+ {
344+ ti .getUpdateService ().updateRows (job .getUser (), target , rows , rows , null , null );
345+ }
346+ catch (InvalidKeyException | BatchValidationException | QueryUpdateServiceException | SQLException e )
347+ {
348+ throw new PipelineJobException (e );
349+ }
340350 }
341- catch ( InvalidKeyException | BatchValidationException | QueryUpdateServiceException | SQLException e )
351+ else
342352 {
343- throw new PipelineJobException ( e );
353+ job . getLogger (). debug ( "There were no readdata rows to update" );
344354 }
345355 }
346356
0 commit comments