@@ -208,7 +208,7 @@ public TargetedMSRun importRun(RunInfo runInfo, PipelineJob job) throws IOExcept
208208 }
209209
210210 // Skip if run was already fully imported
211- if (runInfo . isAlreadyImported () && run .getStatusId () == SkylineDocImporter .STATUS_SUCCESS )
211+ if (run .getStatusId () == SkylineDocImporter .STATUS_SUCCESS )
212212 {
213213 _log .info (_expData .getName () + " has already been imported so it does not need to be imported again" );
214214 return run ;
@@ -2583,60 +2583,45 @@ protected static void updateRunStatus(long runId, String status, int statusId)
25832583 public static class RunInfo implements Serializable
25842584 {
25852585 private final long _runId ;
2586- private final boolean _alreadyImported ;
25872586
25882587 @ JsonCreator
2589- private RunInfo (@ JsonProperty ("_runId" ) long runId , @ JsonProperty ( "_alreadyImported" ) boolean alreadyImported )
2588+ private RunInfo (@ JsonProperty ("_runId" ) long runId )
25902589 {
25912590 _runId = runId ;
2592-
2593- _alreadyImported = alreadyImported ;
25942591 }
25952592
25962593 public long getRunId ()
25972594 {
25982595 return _runId ;
25992596 }
2600-
2601- public boolean isAlreadyImported ()
2602- {
2603- return _alreadyImported ;
2604- }
26052597 }
26062598
26072599 public RunInfo prepareRun ()
26082600 {
26092601 try (DbScope .Transaction transaction = TargetedMSManager .getSchema ().getScope ().ensureTransaction (_schemaLock ))
26102602 {
2611- boolean alreadyImported = false ;
2612-
26132603 // Don't import if we've already imported this file (undeleted run exists matching this file name)
2614- _runId = getRun ();
2615- if (_runId != -1 )
2616- {
2617- alreadyImported = true ;
2618- }
2619- else
2604+ TargetedMSRun run = getRun ();
2605+ if (run == null )
26202606 {
26212607 _log .info ("Starting import from " + _expData .getName ());
2622- _runId = createRun ();
2608+ run = createRun ();
26232609 }
26242610
26252611 transaction .commit ();
2626- return new RunInfo (_runId , alreadyImported );
2612+ return new RunInfo (run . getRunId () );
26272613 }
26282614 }
26292615
2630- protected long getRun ()
2616+ protected TargetedMSRun getRun ()
26312617 {
26322618 SimpleFilter filter = new SimpleFilter (FieldKey .fromParts ("DataId" ), _expData .getRowId ());
26332619 filter .addCondition (FieldKey .fromParts ("Container" ), _container .getId ());
26342620 filter .addCondition (FieldKey .fromParts ("Deleted" ), Boolean .FALSE );
2635- TargetedMSRun run = new TableSelector (TargetedMSManager .getTableInfoRuns (), filter , null ).getObject (TargetedMSRun .class );
2636- return run != null ? run .getId () : -1 ;
2621+ return new TableSelector (TargetedMSManager .getTableInfoRuns (), filter , null ).getObject (TargetedMSRun .class );
26372622 }
26382623
2639- protected long createRun ()
2624+ protected TargetedMSRun createRun ()
26402625 {
26412626 TargetedMSRun run = TargetedMSManager .getRunByDataId (_expData .getRowId (), _container );
26422627 if (run != null )
@@ -2653,7 +2638,7 @@ protected long createRun()
26532638 run .setRepresentativeDataState (_representative == null ? RunRepresentativeDataState .NotRepresentative : _representative );
26542639
26552640 run = Table .insert (_user , TargetedMSManager .getTableInfoRuns (), run );
2656- return run . getId () ;
2641+ return run ;
26572642 }
26582643
26592644 protected void logError (String message , Exception e )
0 commit comments