2424import org .labkey .api .assay .AssayProvider ;
2525import org .labkey .api .assay .AssayService ;
2626import org .labkey .api .collections .CaseInsensitiveHashMap ;
27+ import org .labkey .api .collections .IntHashMap ;
28+ import org .labkey .api .collections .IntHashSet ;
2729import org .labkey .api .data .ColumnInfo ;
2830import org .labkey .api .data .CompareType ;
2931import org .labkey .api .data .Container ;
@@ -118,8 +120,8 @@ public Pair<List<Long>, List<Long>> cacheAnalyses(final ViewContext ctx, final E
118120 AssayProtocolSchema schema = ap .createProtocolSchema (u , ctx .getContainer (), protocol , null );
119121 final TableInfo assayDataTable = schema .getTable (AssayProtocolSchema .DATA_TABLE_NAME );
120122
121- final Map <Integer , List <Map <String , Object >>> rowHash = new HashMap <>();
122- final Map <Integer , Set <Integer >> toDeleteByAnalysis = new HashMap <>();
123+ final Map <Integer , List <Map <String , Object >>> rowHash = new IntHashMap <>();
124+ final Map <Integer , Set <Integer >> toDeleteByAnalysis = new IntHashMap <>();
123125
124126 TableSelector tsAlignments = new TableSelector (tableAlignments , cols .values (), new SimpleFilter (FieldKey .fromString ("key" ), Arrays .asList (pks ), CompareType .IN ), null );
125127 tsAlignments .forEach (new Selector .ForEachBlock <ResultSet >()
@@ -139,7 +141,7 @@ public void exec(ResultSet object) throws SQLException
139141 filter .addCondition (FieldKey .fromString ("Run/assayType" ), SBT_LINEAGE_ASSAY_TYPE );
140142
141143 TableSelector ts = new TableSelector (assayDataTable , PageFlowUtil .set ("RowId" ), filter , null );
142- Set <Integer > existing = new HashSet <> (ts .getArrayList (Integer .class ));
144+ Set <Integer > existing = new IntHashSet (ts .getArrayList (Integer .class ));
143145 if (!existing .isEmpty ())
144146 {
145147 Set <Integer > toDelete = toDeleteByAnalysis .containsKey (analysisId ) ? toDeleteByAnalysis .get (analysisId ) : new HashSet <Integer >();
@@ -196,8 +198,8 @@ public Pair<List<Long>, List<Long>> cacheHaplotypes(final ViewContext ctx, final
196198 fieldKeys .add (FieldKey .fromString ("readset/subjectid" ));
197199 fieldKeys .add (FieldKey .fromString ("readset/sampledate" ));
198200
199- Set <Integer > analysisIds = new HashSet <> ();
200- final Map <Integer , List <JSONObject >> haploMap = new HashMap <>();
201+ Set <Integer > analysisIds = new IntHashSet ();
202+ final Map <Integer , List <JSONObject >> haploMap = new IntHashMap <>();
201203 for (JSONObject row : JsonUtil .toJSONObjectList (data ))
202204 {
203205 Integer analysisId = row .getInt ("analysisId" );
@@ -217,8 +219,8 @@ public Pair<List<Long>, List<Long>> cacheHaplotypes(final ViewContext ctx, final
217219 AssayProtocolSchema schema = ap .createProtocolSchema (u , ctx .getContainer (), protocol , null );
218220 final TableInfo assayDataTable = schema .getTable (AssayProtocolSchema .DATA_TABLE_NAME );
219221
220- final Map <Integer , List <Map <String , Object >>> rowHash = new HashMap <>();
221- final Map <Integer , Set <Integer >> toDeleteByAnalysis = new HashMap <>();
222+ final Map <Integer , List <Map <String , Object >>> rowHash = new IntHashMap <>();
223+ final Map <Integer , Set <Integer >> toDeleteByAnalysis = new IntHashMap <>();
222224
223225 TableSelector tsAlignments = new TableSelector (tableAnalyses , cols .values (), new SimpleFilter (FieldKey .fromString ("rowid" ), analysisIds , CompareType .IN ), null );
224226 tsAlignments .forEach (new Selector .ForEachBlock <ResultSet >()
@@ -244,10 +246,10 @@ public void exec(ResultSet object) throws SQLException
244246 filter .addCondition (FieldKey .fromString ("Run/assayType" ), HAPLOTYPE_ASSAY_TYPE );
245247
246248 TableSelector ts = new TableSelector (assayDataTable , PageFlowUtil .set ("RowId" ), filter , null );
247- Set <Integer > existing = new HashSet <> (ts .getArrayList (Integer .class ));
249+ Set <Integer > existing = new IntHashSet (ts .getArrayList (Integer .class ));
248250 if (!existing .isEmpty ())
249251 {
250- Set <Integer > toDelete = toDeleteByAnalysis .containsKey (analysisId ) ? toDeleteByAnalysis .get (analysisId ) : new HashSet <> ();
252+ Set <Integer > toDelete = toDeleteByAnalysis .containsKey (analysisId ) ? toDeleteByAnalysis .get (analysisId ) : new IntHashSet ();
251253 toDelete .addAll (existing );
252254 toDeleteByAnalysis .put (analysisId , toDelete );
253255 }
0 commit comments