private boolean updateMetricsFromNotification(Run source, Run target) { if (source.getMetrics() != null && source.getMetrics().equals(target.getMetrics())) return false; if (source.getMetrics() == null) { return false; if (source.getMetrics() != null && target.getMetrics() == null) { target.setMetrics(source.getMetrics()); return true; ArrayNode sourceMetrics; try { sourceMetrics = mapper.readValue(source.getMetrics(), ArrayNode.class); } catch (IOException e) { log.error("Impossible junk metrics were passed in for run " + target.getId(), e); targetMetrics = mapper.readValue(target.getMetrics(), ArrayNode.class); } catch (IOException e) { log.error("The database is full of garbage metrics for run " + target.getId(), e);
private void applyChanges(Run target, Run source) throws IOException { validateChanges(target, source); target.setAlias(source.getAlias()); target.setAccession(source.getAccession()); target.setDescription(source.getDescription()); target.setFilePath(source.getFilePath()); target.setHealth(source.getHealth()); target.setStartDate(source.getStartDate()); target.setCompletionDate(source.getCompletionDate()); target.setMetrics(source.getMetrics()); makeContainerChangesChangeLog(target, target.getSequencerPartitionContainers(), source.getSequencerPartitionContainers()); applyContainerChanges(target, source); target.setSequencingParameters(source.getSequencingParameters()); target.setSequencer(source.getSequencer()); if (isIlluminaRun(target)) { applyIlluminaChanges((IlluminaRun) target, (IlluminaRun) source); } else if (isLS454Run(target)) { applyLS454Changes((LS454Run) target, (LS454Run) source); } else if (isSolidRun(target)) { applySolidChanges((SolidRun) target, (SolidRun) source); } else if (isOxfordNanoporeRun(target)) { applyOxfordNanoporeChanges((OxfordNanoporeRun) target, (OxfordNanoporeRun) source); } }