Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%@ page import="org.labkey.api.collections.IntHashMap" %>
<%@ page extends="org.labkey.api.jsp.JspBase" %>

<%!
Expand Down Expand Up @@ -237,7 +238,7 @@

<div id="all-tools" style="clear: both; padding-top: 2px;">
<%
HashMap<Integer, String> toolOwners = new HashMap<>();
HashMap<Integer, String> toolOwners = new IntHashMap<>();
for (SkylineTool tool : tools)
{
final String tableId = "table-" + tool.getName().replaceAll("[^A-Za-z0-9]", "");
Expand Down
2 changes: 1 addition & 1 deletion lincs/src/org/labkey/lincs/DocImportListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void onDocumentImport(Container container, User user, ITargetedMSRun skyl
return;
}

int jobId = PipelineService.get().getJobId(user, container, job.getJobGUID());
long jobId = PipelineService.get().getJobId(user, container, job.getJobGUID());
_log.info("LINCS: Queued job Id " + jobId +" for creating GCT files for " + skylineRun.getFileName() + ". Container: " + container.getPath());

pspJob.setPipelineJobId(jobId);
Expand Down
2 changes: 1 addition & 1 deletion lincs/src/org/labkey/lincs/LincsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ public boolean handlePost(LincsPspJobForm form, BindException errors)
return false;
}

int jobId = PipelineService.get().getJobId(getUser(), container, job.getJobGUID());
long jobId = PipelineService.get().getJobId(getUser(), container, job.getJobGUID());
newPspJob.setPipelineJobId(jobId);
lincsManager.updatePipelineJobId(newPspJob);
return true;
Expand Down
6 changes: 3 additions & 3 deletions lincs/src/org/labkey/lincs/psp/LincsPspJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class LincsPspJob
private int id;
private long _runId;
private Container _container;
private Integer _pipelineJobId;
private Long _pipelineJobId;

private String _pspJobId;
private String pspJobName;
Expand Down Expand Up @@ -59,12 +59,12 @@ public void setContainer(Container container)
_container = container;
}

public Integer getPipelineJobId()
public Long getPipelineJobId()
{
return _pipelineJobId;
}

public void setPipelineJobId(Integer pipelineJobId)
public void setPipelineJobId(Long pipelineJobId)
{
_pipelineJobId = pipelineJobId;
}
Expand Down
2 changes: 1 addition & 1 deletion lincs/src/org/labkey/lincs/psp/LincsPspTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private void postToPsp(LincsPspJobSupport jobSupport, User user, Logger log) thr

if(pspJob.getPipelineJobId() == null)
{
Integer pipelineJobId = (PipelineService.get().getJobId(getJob().getUser(), getJob().getContainer(), getJob().getJobGUID()));
Long pipelineJobId = (PipelineService.get().getJobId(getJob().getUser(), getJob().getContainer(), getJob().getJobGUID()));
pspJob.setPipelineJobId(pipelineJobId);
}

Expand Down
6 changes: 3 additions & 3 deletions nextflow/src/org/labkey/nextflow/NextFlowManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private DbSchema getDbSchema()
return DbSchema.get(SCHEMA_NAME, DbSchemaType.Module);
}

private Integer getJobId(NextFlowPipelineJob job)
private Long getJobId(NextFlowPipelineJob job)
{
PipelineStatusFile file = PipelineService.get().getStatusFile(job.getJobGUID());
return file == null ? null : file.getRowId();
Expand All @@ -185,15 +185,15 @@ public int getInvocationCount(NextFlowPipelineJob job)
return getInvocationCount(getJobId(job));
}

private int getInvocationCount(int jobId)
private int getInvocationCount(long jobId)
{
Integer result = new SqlSelector(getDbSchema(), new SQLFragment("SELECT InvocationCount FROM nextflow.Job WHERE JobId = ?", jobId)).getObject(Integer.class);
return result != null ? result.intValue() : 0;
}

public int incrementInvocationCount(NextFlowPipelineJob job)
{
int jobId = getJobId(job);
long jobId = getJobId(job);
int current = getInvocationCount(jobId);
current++;
if (current == 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ private DataValidation submitValidationJob(@NotNull ExperimentAnnotations experi
validation = DataValidationManager.saveDataValidation(validation, user);
PxDataValidationPipelineJob job = new PxDataValidationPipelineJob(info, root, experimentAnnotations, validation.getId());
PipelineService.get().queueJob(job);
Integer jobId = PipelineService.get().getJobId(user, container, job.getJobGUID());
Long jobId = PipelineService.get().getJobId(user, container, job.getJobGUID());
if (jobId == null)
{
errors.reject(ERROR_MSG, "Data validation job was not submitted for experiment Id: " + experimentAnnotations.getId());
Expand Down Expand Up @@ -3488,7 +3488,7 @@ public ModelAndView getView(PxDataValidationForm form, BindException errors)
return new SimpleErrorView(errors, false);
}

int jobId = validation.getJobId();
long jobId = validation.getJobId();
PipelineStatusFile pipelineJobStatus = PipelineService.get().getStatusFile(jobId);
JournalSubmission js = SubmissionManager.getNewestJournalSubmission(_experimentAnnotations);
JspView view;
Expand Down Expand Up @@ -3586,7 +3586,7 @@ public Object execute(PxDataValidationForm form, BindException errors) throws Ex
DataValidation validation = DataValidationManager.getValidation(form.getValidationId(), getContainer());
if (validation != null)
{
int jobId = validation.getJobId();
long jobId = validation.getJobId();
PipelineStatusFile status = PipelineService.get().getStatusFile(jobId);
if (status != null)
{
Expand Down Expand Up @@ -5810,7 +5810,7 @@ public boolean handlePost(NewExperimentAnnotationsForm form, BindException error

// Add all runs in the folder
List<? extends ExpRun> runsInFolder = ExperimentService.get().getExpRuns(getContainer(), null, null);
int[] runIds = new int[runsInFolder.size()];
long[] runIds = new long[runsInFolder.size()];
int i = 0;
for(ExpRun run: runsInFolder)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.labkey.panoramapublic;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Nullable;
import org.labkey.api.admin.AbstractFolderImportFactory;
Expand Down Expand Up @@ -98,7 +99,7 @@ else if (experiments.size() > 1)
ExperimentAnnotations targetExperiment = createNewExperimentAnnotations(experiment, sourceExperiment, user, log);

// Get a list of all the ExpRuns imported to subfolders of this folder.
int[] runRowIdsInSubfolders = getAllExpRunRowIdsInSubfolders(container);
long[] runRowIdsInSubfolders = getAllExpRunRowIdsInSubfolders(container);
if (runRowIdsInSubfolders.length > 0)
{
// The folder export and import process, creates a new experiment in exp.experiment.
Expand All @@ -119,11 +120,11 @@ else if (experiments.size() > 1)
}
}

private static int[] getAllExpRunRowIdsInSubfolders(Container container)
private static long[] getAllExpRunRowIdsInSubfolders(Container container)
{
Set<Container> children = ContainerManager.getAllChildren(container);
ExperimentService expService = ExperimentService.get();
List<Integer> expRunRowIds = new ArrayList<>();
List<Long> expRunRowIds = new ArrayList<>();
for(Container child: children)
{
if(container.equals(child))
Expand All @@ -136,7 +137,7 @@ private static int[] getAllExpRunRowIdsInSubfolders(Container container)
expRunRowIds.add(run.getRowId());
}
}
int[] intIds = new int[expRunRowIds.size()];
long[] intIds = new long[expRunRowIds.size()];
for(int i = 0; i < expRunRowIds.size(); i++)
{
intIds[i] = expRunRowIds.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/
public class ExperimentAnnotations extends DbEntity
{
private int _experimentId;
private long _experimentId;
private Container _container;
private String _title;
private String _experimentDescription;
Expand Down Expand Up @@ -83,12 +83,12 @@ public class ExperimentAnnotations extends DbEntity

public ExperimentAnnotations() {}

public int getExperimentId()
public long getExperimentId()
{
return _experimentId;
}

public void setExperimentId(int experimentId)
public void setExperimentId(long experimentId)
{
_experimentId = experimentId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class DataValidation extends DbEntity
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-d HH:mm");

private int _experimentAnnotationsId;
private int _jobId;
private long _jobId;
private PxStatus _status;

public DataValidation() {}
Expand All @@ -35,12 +35,12 @@ public void setExperimentAnnotationsId(int experimentAnnotationsId)
_experimentAnnotationsId = experimentAnnotationsId;
}

public int getJobId()
public long getJobId()
{
return _jobId;
}

public void setJobId(int jobId)
public void setJobId(long jobId)
{
_jobId = jobId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void doValidation(PipelineJob job, PxDataValidationJobSupport jobSupport)
jobSupport.getValidationId(), exptAnnotations.getContainer().getPath()));
}
log.info(String.format("Validating data for experiment Id: %d, validation Id: %d", exptAnnotations.getId(), validation.getId()));
Integer pipelineJobId = (PipelineService.get().getJobId(job.getUser(), job.getContainer(), job.getJobGUID()));
Long pipelineJobId = (PipelineService.get().getJobId(job.getUser(), job.getContainer(), job.getJobGUID()));
if (pipelineJobId != null && pipelineJobId != validation.getJobId())
{
throw new PipelineJobException(String.format("Unexpected pipeline job Id %d. Job Id saved in the validation row (Id: %d) is %d.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import org.junit.Test;
import org.labkey.api.collections.LongHashMap;
import org.labkey.api.targetedms.IModification;
import org.labkey.api.targetedms.ITargetedMSRun;
import org.labkey.api.targetedms.TargetedMSService;
Expand Down Expand Up @@ -47,8 +48,8 @@ public static List<PxModification> getModifications(ExperimentAnnotations expAnn
{
List<ITargetedMSRun> runs = ExperimentAnnotationsManager.getTargetedMSRuns(expAnnot);

Map<Long, PxModification> strModMap = new HashMap<>();
Map<Long, PxModification> isoModMap = new HashMap<>();
Map<Long, PxModification> strModMap = new LongHashMap<>();
Map<Long, PxModification> isoModMap = new LongHashMap<>();

UnimodModifications uMods = UnimodUtil.getUnimod(); // Read the UNIMOD modifications

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.logging.log4j.Logger;
import org.json.JSONException;
import org.json.JSONObject;
import org.labkey.api.collections.IntHashMap;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.util.Pair;
import org.labkey.api.util.logging.LogHelper;
Expand Down Expand Up @@ -120,7 +121,7 @@ public static Map<Integer, String> getScientificNames(List<Integer> taxIds) thro
{
String queryUrl = eutilsUrl + "&id=" + StringUtils.join(taxIds, ",");

Map<Integer, String> sciNameMap = new HashMap<>();
Map<Integer, String> sciNameMap = new IntHashMap<>();

HttpURLConnection conn = null;
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Logger;
import org.labkey.api.collections.IntHashMap;
import org.labkey.api.security.User;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.util.logging.LogHelper;
Expand Down Expand Up @@ -181,7 +182,7 @@ void writeSpeciesList(ExperimentAnnotations experimentAnnotations)
}

boolean ncbiLookupError = false;
Map<Integer, String> sciNameMap = new HashMap<>();
Map<Integer, String> sciNameMap = new IntHashMap<>();
try
{
sciNameMap = getScientificNames(taxIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static boolean isPipelineJobRunning(DataValidation validation)

public static PipelineStatusFile getPipelineJobStatus(@NotNull DataValidation validation)
{
int jobId = validation.getJobId();
long jobId = validation.getJobId();
return PipelineService.get().getStatusFile(jobId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static ExperimentAnnotations get(int experimentAnnotationsId, Container c
* @param experimentId FK -> exp.experiment.rowId
* @return ExperimentAnnotations object with the given experimentId
*/
public static ExperimentAnnotations getForExperimentId(int experimentId)
public static ExperimentAnnotations getForExperimentId(long experimentId)
{
return new TableSelector(PanoramaPublicManager.getTableInfoExperimentAnnotations(),
new SimpleFilter(FieldKey.fromParts("ExperimentId"), experimentId), null).getObject(ExperimentAnnotations.class);
Expand Down Expand Up @@ -123,7 +123,7 @@ public static void excludeSubfoldersFromExperiment(ExperimentAnnotations expAnno

// Get all the runs in the experiment.
List<? extends ExpRun> runs = experiment.getRuns();
List<Integer> rowIdsToRemove = new ArrayList<>();
List<Long> rowIdsToRemove = new ArrayList<>();
Container expContainer = experiment.getContainer();
// Get a list of runs that are not in the folder where the experiment is defined.
for(ExpRun run: runs)
Expand All @@ -134,9 +134,9 @@ public static void excludeSubfoldersFromExperiment(ExperimentAnnotations expAnno
}
}

int[] rowIds = new int[rowIdsToRemove.size()];
long[] rowIds = new long[rowIdsToRemove.size()];
int i = 0;
for(Integer rowId: rowIdsToRemove)
for(Long rowId: rowIdsToRemove)
{
rowIds[i++] = rowId;
}
Expand All @@ -152,11 +152,11 @@ public static void excludeSubfoldersFromExperiment(ExperimentAnnotations expAnno
}
}

private static void removeRunIds(ExpExperiment experiment, int[] rowIds, User user)
private static void removeRunIds(ExpExperiment experiment, long[] rowIds, User user)
{
ExperimentService expService = ExperimentService.get();

for(int rowId: rowIds)
for (long rowId: rowIds)
{
ExpRun run = expService.getExpRun(rowId);
if(run != null)
Expand Down Expand Up @@ -187,15 +187,15 @@ public static void includeSubfoldersInExperiment(ExperimentAnnotations expAnnota

// Get a list of runs that already belong to the experiment.
List<? extends ExpRun> existingRuns = experiment.getRuns();
Set<Integer> existingRunRowIds = new HashSet<>();
Set<Long> existingRunRowIds = new HashSet<>();
for(ExpRun run: existingRuns)
{
existingRunRowIds.add(run.getRowId());
}

// Keep runs that do not already belong to the experiment.
runs.removeIf(run -> existingRunRowIds.contains(run.getRowId()));
int[] rowIds = new int[runs.size()];
long[] rowIds = new long[runs.size()];
int i = 0;
for(ExpRun run: runs)
{
Expand All @@ -213,10 +213,10 @@ public static void includeSubfoldersInExperiment(ExperimentAnnotations expAnnota
}
}

public static void addSelectedRunsToExperiment(ExpExperiment experiment, int[] rowIds, User user)
public static void addSelectedRunsToExperiment(ExpExperiment experiment, long[] rowIds, User user)
{
List<ExpRun> runs = new ArrayList<>();
for (int rowId : rowIds)
for (long rowId : rowIds)
{
ExpRun run = ExperimentService.get().getExpRun(rowId);
if (run != null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.labkey.panoramapublic.speclib;

import org.jetbrains.annotations.Nullable;
import org.labkey.api.collections.IntHashMap;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
Expand All @@ -27,7 +29,7 @@ public class BlibReader extends SpecLibReader

List<LibSourceFile> sourceFiles = new ArrayList<>();

Map<Integer, Set<String>> scoreTypes = new HashMap<>(); // file id -> score types
Map<Integer, Set<String>> scoreTypes = new IntHashMap<>(); // file id -> score types
if(hasTable(conn, "ScoreTypes")) // Older .blib files do not have a ScoreTypes table
{
try (Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("SELECT DISTINCT r.fileID, s.scoreType FROM RefSpectra as r JOIN ScoreTypes s ON r.scoreType = s.id"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<%
JspView<PxValidationStatusBean> view = HttpView.currentView();
var bean = view.getModelBean();
int jobId = bean.getDataValidation().getJobId();
long jobId = bean.getDataValidation().getJobId();
var jobStatus = bean.getPipelineJobStatus();
var onPageLoadMsg = jobStatus != null ? (String.format("Data validation job is %s. This page will automatically refresh with the validation progress.",
jobStatus.isActive() ? (PipelineJob.TaskStatus.waiting.matches(jobStatus.getStatus()) ? "in the queue" : "running") : "complete"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
ExperimentAnnotations experimentAnnotations = bean.getExpAnnotations();
int experimentAnnotationsId = experimentAnnotations.getId();
boolean includeSubfolders = experimentAnnotations.isIncludeSubfolders();
int jobId = bean.getDataValidation().getJobId();
long jobId = bean.getDataValidation().getJobId();
Integer journalId = bean.getJournalId();
var submitAction = SpringActionController.getActionName(PanoramaPublicController.PublishExperimentAction.class);
Submission submission = bean.getSubmission();
Expand Down
Loading