Skip to content

Commit c4ac23e

Browse files
checkpoint - migrate to using long/Long to represent any integer ID value (rowId, objectId, etc).
1 parent 026e061 commit c4ac23e

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public ApiResponse execute(CacheAnalysesForm form, BindException errors)
130130
return null;
131131
}
132132

133-
Pair<List<Integer>, List<Integer>> ret = GenotypeAssaysManager.get().cacheAnalyses(getViewContext(), protocol, form.getAlleleNames());
133+
Pair<List<Long>, List<Long>> ret = GenotypeAssaysManager.get().cacheAnalyses(getViewContext(), protocol, form.getAlleleNames());
134134
resultProperties.put("runsCreated", ret.first);
135135
resultProperties.put("runsDeleted", ret.second);
136136
}
@@ -209,7 +209,7 @@ public ApiResponse execute(CacheAnalysesForm form, BindException errors)
209209
return null;
210210
}
211211

212-
Pair<List<Integer>, List<Integer>> ret = GenotypeAssaysManager.get().cacheHaplotypes(getViewContext(), protocol, new JSONArray(form.getJson()));
212+
Pair<List<Long>, List<Long>> ret = GenotypeAssaysManager.get().cacheHaplotypes(getViewContext(), protocol, new JSONArray(form.getJson()));
213213
resultProperties.put("runsCreated", ret.first);
214214
resultProperties.put("runsDeleted", ret.second);
215215
}

GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysManager.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public static GenotypeAssaysManager get()
8888
}
8989

9090

91-
public Pair<List<Integer>, List<Integer>> cacheAnalyses(final ViewContext ctx, final ExpProtocol protocol, String[] pks) throws IllegalArgumentException
91+
public Pair<List<Long>, List<Long>> cacheAnalyses(final ViewContext ctx, final ExpProtocol protocol, String[] pks) throws IllegalArgumentException
9292
{
9393
final User u = ctx.getUser();
94-
final List<Integer> runsCreated = new ArrayList<>();
95-
final List<Integer> runsDeleted = new ArrayList<>();
94+
final List<Long> runsCreated = new ArrayList<>();
95+
final List<Long> runsDeleted = new ArrayList<>();
9696

9797
try (DbScope.Transaction transaction = DbScope.getLabKeyScope().ensureTransaction())
9898
{
@@ -178,11 +178,11 @@ public void exec(ResultSet object) throws SQLException
178178
}
179179
}
180180

181-
public Pair<List<Integer>, List<Integer>> cacheHaplotypes(final ViewContext ctx, final ExpProtocol protocol, JSONArray data) throws IllegalArgumentException
181+
public Pair<List<Long>, List<Long>> cacheHaplotypes(final ViewContext ctx, final ExpProtocol protocol, JSONArray data) throws IllegalArgumentException
182182
{
183183
final User u = ctx.getUser();
184-
final List<Integer> runsCreated = new ArrayList<>();
185-
final List<Integer> runsDeleted = new ArrayList<>();
184+
final List<Long> runsCreated = new ArrayList<>();
185+
final List<Long> runsDeleted = new ArrayList<>();
186186

187187
//next identify a build up the results
188188
TableInfo tableAnalyses = QueryService.get().getUserSchema(u, ctx.getContainer(), SEQUENCEANALYSIS_SCHEMA).getTable("sequence_analyses");
@@ -288,7 +288,7 @@ public void exec(ResultSet object) throws SQLException
288288
return Pair.of(runsCreated, runsDeleted);
289289
}
290290

291-
private void processSet(String assayType, Map<Integer, List<Map<String, Object>>> rowHash, TableInfo assayDataTable, User u, ViewContext ctx, Map<Integer, Set<Integer>> toDeleteByAnalysis, AssayProvider ap, ExpProtocol protocol, List<Integer> runsCreated)
291+
private void processSet(String assayType, Map<Integer, List<Map<String, Object>>> rowHash, TableInfo assayDataTable, User u, ViewContext ctx, Map<Integer, Set<Integer>> toDeleteByAnalysis, AssayProvider ap, ExpProtocol protocol, List<Long> runsCreated)
292292
{
293293
for (Integer analysisId : rowHash.keySet())
294294
{

primeseq/src/org/labkey/primeseq/pipeline/BismarkWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ else if (getProvider().getParameterByName("siteReport") != null && getProvider()
511511
@Override
512512
public Output performAnalysisPerSampleLocal(AnalysisModel model, File inputBam, File referenceFasta, File outDir) throws PipelineJobException
513513
{
514-
Integer runId = SequenceAnalysisService.get().getExpRunIdForJob(getPipelineCtx().getJob(), true);
514+
Long runId = SequenceAnalysisService.get().getExpRunIdForJob(getPipelineCtx().getJob(), true);
515515

516516
Set<SequenceOutputFile> toCreate = new HashSet<>();
517517
SequenceOutputTracker sot = ((SequenceOutputTracker)getPipelineCtx().getJob());

primeseq/src/org/labkey/primeseq/pipeline/MhcMigrationPipelineJob.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,9 @@ else if (r.getValue("dataid/Run/JobId/FilePath") != null)
648648
private final Map<Integer, Integer> libraryMap = new HashMap<>();
649649
private final Map<Integer, Integer> outputFileMap = new HashMap<>();
650650
private final Map<Integer, Integer> sequenceMap = new HashMap<>();
651-
private final Map<Integer, Integer> runIdMap = new HashMap<>(5000);
651+
private final Map<Long, Long> runIdMap = new HashMap<>(5000);
652652
private final Map<Integer, Integer> jobIdMap = new HashMap<>(5000);
653-
private final Map<URI, Integer> expDataMap = new HashMap<>(10000);
653+
private final Map<URI, Long> expDataMap = new HashMap<>(10000);
654654

655655
private void createLibraryMembers(Set<String> preExisting)
656656
{
@@ -970,7 +970,7 @@ private void createOutputFiles()
970970
//Create run:
971971
if (rd.getValue("runid") != null && rd.getValue("runid/JobId") != null)
972972
{
973-
int runId = createExpRun(Integer.parseInt(String.valueOf(rd.getValue("runid"))), targetWorkbook, String.valueOf(rd.getValue("runid/Name")), jobId);
973+
long runId = createExpRun(Integer.parseInt(String.valueOf(rd.getValue("runid"))), targetWorkbook, String.valueOf(rd.getValue("runid/Name")), jobId);
974974
toCreate.put("runid", runId);
975975
}
976976
else
@@ -1126,7 +1126,7 @@ private void createAnalyses()
11261126
//Create run:
11271127
if (rd.getValue("runid") != null && rd.getValue("runid/JobId") != null)
11281128
{
1129-
int runId = createExpRun(Integer.parseInt(String.valueOf(rd.getValue("runid"))), targetWorkbook, String.valueOf(rd.getValue("runid/Name")), jobId);
1129+
long runId = createExpRun(Integer.parseInt(String.valueOf(rd.getValue("runid"))), targetWorkbook, String.valueOf(rd.getValue("runid/Name")), jobId);
11301130
toCreate.put("runid", runId);
11311131
}
11321132
else
@@ -1293,7 +1293,7 @@ else if (srr.getRowCount().intValue() == 0)
12931293
//Create run:
12941294
if (rd.getValue("runid") != null && jobId != null)
12951295
{
1296-
int runId = createExpRun(Integer.parseInt(String.valueOf(rd.getValue("runid"))), targetWorkbook, String.valueOf(rd.getValue("runid/Name")), jobId);
1296+
long runId = createExpRun(Integer.parseInt(String.valueOf(rd.getValue("runid"))), targetWorkbook, String.valueOf(rd.getValue("runid/Name")), jobId);
12971297
toCreate.put("runid", runId);
12981298
}
12991299
else
@@ -1359,7 +1359,7 @@ private File inferLogForFile(String path)
13591359
private int createdExpData = 0;
13601360
private int expDataCacheHits = 0;
13611361

1362-
private int getOrCreateExpData(URI uri, Container workbook, String fileName)
1362+
private long getOrCreateExpData(URI uri, Container workbook, String fileName)
13631363
{
13641364
if (uri.toString().contains("/C:/"))
13651365
{
@@ -1473,7 +1473,7 @@ private void createReadsets()
14731473
{
14741474
int remoteJobId = Integer.parseInt(String.valueOf(rs.getValue("runid/JobId")));
14751475
int jobId = getOrCreateJob(remoteJobId, targetWorkbook);
1476-
int runid = createExpRun(Integer.parseInt(String.valueOf(rs.getValue("runid"))), targetWorkbook, String.valueOf(rs.getValue("runid/Name")), jobId);
1476+
long runid = createExpRun(Integer.parseInt(String.valueOf(rs.getValue("runid"))), targetWorkbook, String.valueOf(rs.getValue("runid/Name")), jobId);
14771477
toCreate.put("runid", runid);
14781478
}
14791479
else if (rs.getValue("totalForwardReads") != null)
@@ -1670,7 +1670,7 @@ else if (filepath.contains("sequenceAnalysis"))
16701670
}
16711671
}
16721672

1673-
private int createExpRun(int remoteId, Container c, String name, int localJobId) throws Exception
1673+
private long createExpRun(long remoteId, Container c, String name, long localJobId) throws Exception
16741674
{
16751675
if (runIdMap.containsKey(remoteId))
16761676
{
@@ -1681,7 +1681,7 @@ private int createExpRun(int remoteId, Container c, String name, int localJobId)
16811681
TableSelector ts = new TableSelector(ExperimentService.get().getTinfoExperimentRun(), PageFlowUtil.set("RowId"), new SimpleFilter(FieldKey.fromString("JobId"), localJobId), null);
16821682
if (ts.exists())
16831683
{
1684-
List<Integer> rowIds = ts.getArrayList(Integer.class);
1684+
List<Long> rowIds = ts.getArrayList(Long.class);
16851685
Collections.sort(rowIds, Comparator.reverseOrder());
16861686
runIdMap.put(remoteId, rowIds.get(0));
16871687

tcrdb/src/org/labkey/tcrdb/pipeline/CellRangerVDJUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public CellRangerVDJUtils(Logger log)
6666
_log = log;
6767
}
6868

69-
public void importAssayData(PipelineJob job, AnalysisModel model, File vLoupeFile, File outDir, Integer assayId, @Nullable Integer runId, boolean deleteExisting) throws PipelineJobException
69+
public void importAssayData(PipelineJob job, AnalysisModel model, File vLoupeFile, File outDir, Integer assayId, @Nullable Long runId, boolean deleteExisting) throws PipelineJobException
7070
{
7171
File cellRangerOutDir = vLoupeFile.getParentFile();
7272

@@ -617,7 +617,7 @@ private static class AssayModel
617617
private String coalescedContigName;
618618
}
619619

620-
private Map<String, Object> processRow(AssayModel assayModel, AnalysisModel model, Map<Integer, CDNA_Library> cDNAMap, Integer runId, Map<Integer, Set<String>> totalCellsBySample, Map<String, String> sequenceMap) throws PipelineJobException
620+
private Map<String, Object> processRow(AssayModel assayModel, AnalysisModel model, Map<Integer, CDNA_Library> cDNAMap, Long runId, Map<Integer, Set<String>> totalCellsBySample, Map<String, String> sequenceMap) throws PipelineJobException
621621
{
622622
CDNA_Library cDNARecord = cDNAMap.get(assayModel.cdna);
623623
if (cDNARecord == null)
@@ -665,7 +665,7 @@ private String removeNone(String input)
665665
return "None".equals(input) ? null : StringUtils.trimToNull(input);
666666
}
667667

668-
private void saveRun(PipelineJob job, ExpProtocol protocol, AnalysisModel model, List<Map<String, Object>> rows, File outDir, Integer runId, boolean deleteExisting) throws PipelineJobException
668+
private void saveRun(PipelineJob job, ExpProtocol protocol, AnalysisModel model, List<Map<String, Object>> rows, File outDir, Long runId, boolean deleteExisting) throws PipelineJobException
669669
{
670670
ViewBackgroundInfo info = job.getInfo();
671671
ViewContext vc = ViewContext.getMockViewContext(info.getUser(), info.getContainer(), info.getURL(), false);

tcrdb/src/org/labkey/tcrdb/pipeline/MiXCRAnalysis.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ private TableInfo getCdnaTable()
12211221

12221222
private void parseCloneOutput(Map<String, RunData> runMap, File table, AnalysisModel model, File inputBam) throws PipelineJobException
12231223
{
1224-
Integer runId = SequencePipelineService.get().getExpRunIdForJob(getPipelineCtx().getJob());
1224+
Long runId = SequencePipelineService.get().getExpRunIdForJob(getPipelineCtx().getJob());
12251225
ExpRun run = ExperimentService.get().getExpRun(runId);
12261226

12271227
List<? extends ExpData> cloneDatas = run.getInputDatas(CLONES_FILE, ExpProtocol.ApplicationType.ExperimentRunOutput);
@@ -1328,7 +1328,7 @@ private void parseCloneOutput(Map<String, RunData> runMap, File table, AnalysisM
13281328
}
13291329
}
13301330

1331-
private Map<String, Object> getBaseRow(AnalysisModel model, Integer runId, TableInfo cDNATable) throws PipelineJobException
1331+
private Map<String, Object> getBaseRow(AnalysisModel model, Long runId, TableInfo cDNATable) throws PipelineJobException
13321332
{
13331333
Map<String, Object> row = new CaseInsensitiveHashMap<>();
13341334
if (model.getReadset() != null)
@@ -1563,7 +1563,7 @@ private void importRun(RunData rd, File outDir, AnalysisModel model, ExpProtocol
15631563
runProps.put("Name", "Analysis: " + model.getAnalysisId());
15641564
runProps.put("analysisId", model.getAnalysisId());
15651565

1566-
Integer runId = SequencePipelineService.get().getExpRunIdForJob(getPipelineCtx().getJob());
1566+
Long runId = SequencePipelineService.get().getExpRunIdForJob(getPipelineCtx().getJob());
15671567
runProps.put("pipelineRunId", runId);
15681568

15691569
runProps.put("totalAlignments", rd.totalAlignments);

0 commit comments

Comments
 (0)