Skip to content

Commit 8bc4352

Browse files
committed
SCRUM-4066 remove unused imports
1 parent e698c19 commit 8bc4352

File tree

7 files changed

+34
-42
lines changed

7 files changed

+34
-42
lines changed

agr_api/src/main/java/org/alliancegenome/api/controller/GeneController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public class GeneController implements GeneRESTInterface {
5454
@Inject
5555
AlleleService alleleService;
5656

57-
@Inject OrthologyCacheRepository orthologyService;
58-
59-
@Inject OrthologyESService orthologyESService;
57+
@Inject
58+
ExpressionCacheRepository expressionCacheRepository;
6059

61-
@Inject ExpressionCacheRepository expressionCacheRepository;
60+
@Inject
61+
OrthologyESService orthologyESService;
6262

6363
@Inject
6464
DiseaseService diseaseService;

agr_api/src/main/java/org/alliancegenome/api/service/OrthologyESService.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package org.alliancegenome.api.service;
22

33
import java.util.ArrayList;
4-
import java.util.HashMap;
54
import java.util.LinkedHashMap;
65
import java.util.List;
7-
import java.util.Map;
86

97
import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
108

@@ -14,7 +12,6 @@
1412
import org.alliancegenome.cache.repository.helper.JsonResultResponse;
1513
import org.alliancegenome.cache.repository.helper.OrthologyCurationFiltering;
1614
import org.alliancegenome.core.api.service.FilterService;
17-
import org.alliancegenome.curation_api.model.entities.Gene;
1815
import org.alliancegenome.es.index.site.dao.SearchDAO;
1916
import org.alliancegenome.es.model.query.Pagination;
2017
import org.elasticsearch.action.search.SearchResponse;

agr_indexer/src/main/java/org/alliancegenome/indexer/RestConfig.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.alliancegenome.indexer;
22

33
import org.alliancegenome.core.config.ConfigHelper;
4-
import org.alliancegenome.curation_api.model.entities.orthology.GeneToGeneOrthologyGenerated;
54

65
import com.fasterxml.jackson.annotation.JsonInclude.Include;
76
import com.fasterxml.jackson.databind.DeserializationFeature;
@@ -34,7 +33,6 @@ public ObjectMapper createObjectMapper() {
3433
mapper.disable(MapperFeature.DEFAULT_VIEW_INCLUSION);
3534
mapper.setSerializationInclusion(Include.NON_NULL);
3635
mapper.setSerializationInclusion(Include.NON_EMPTY);
37-
3836
return mapper;
3937
}
4038

agr_indexer/src/main/java/org/alliancegenome/indexer/config/IndexerConfig.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public enum IndexerConfig {
3333
ParalogyIndexer("paralogy", GeneToGeneParalogyIndexer.class, 4, 5000, 5000, 8, 1),
3434
PhenotypeAnnotationIndexer("phenotypeAnnotation", PhenotypeAnnotationCurationIndexer.class, 4, 1500, 1500, 2, 1),
3535
ReleaseInfoIndexer("release", ReleaseInfoIndexer.class, 1, 1, 1, 1, 1),
36-
//PhenotypeAnnotationMlIndexer("phenotypeAnnotation", PhenotypeCurationIndexer.class, 1, 1426, 1426, 2, 1),
3736
GeneToGeneOrthologyIndexer("geneToGeneOrthology", GeneToGeneOrthologyIndexer.class, 4, 1426, 1426, 8, 1)
38-
// still not implemented VariantIndexer("variant", VariantIndexer.class, 2, 3000, 400, 4, 4)
3937
;
4038

4139

agr_indexer/src/main/java/org/alliancegenome/indexer/indexers/curation/GeneToGeneOrthologyIndexer.java

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ public GeneToGeneOrthologyIndexer(IndexerConfig config) {
3333
public void index() {
3434
try {
3535
log.info("Getting orthologs");
36-
36+
3737
SearchResponse<GeneToGeneOrthologyGenerated> orthologyResponse = service.getGeneToGeneOrthology(0, 0);
38-
38+
3939
log.info("GeneToGeneParalogy count: " + orthologyResponse.getTotalResults());
40-
41-
int totalPages = (int)(orthologyResponse.getTotalResults() / indexerConfig.getBufferSize());
42-
40+
41+
int totalPages = (int) (orthologyResponse.getTotalResults() / indexerConfig.getBufferSize());
42+
4343
LinkedBlockingDeque<String> queue = new LinkedBlockingDeque<>();
4444
for (int i = 0; i <= totalPages; i++) {
4545
queue.add(String.valueOf(i));
4646
}
47-
47+
4848
initiateThreading(queue);
49-
49+
5050
} catch (Exception e) {
5151
e.printStackTrace();
5252
}
@@ -58,27 +58,28 @@ protected ObjectMapper customizeObjectMapper(ObjectMapper objectMapper) {
5858
return RestConfig.config.getJacksonObjectMapperFactory().createObjectMapper();
5959
}
6060

61-
6261
protected void startSingleThread(LinkedBlockingDeque<String> queue) {
63-
while(true) {
64-
try {
65-
if (queue.isEmpty()) {
66-
return;
67-
}
68-
String page = queue.takeFirst();
69-
SearchResponse<GeneToGeneOrthologyGenerated> resp = service.getGeneToGeneOrthology(Integer.valueOf(page), indexerConfig.getBufferSize());
62+
while (true) {
63+
try {
64+
if (queue.isEmpty()) {
65+
return;
66+
}
67+
String page = queue.takeFirst();
68+
SearchResponse<GeneToGeneOrthologyGenerated> resp = service
69+
.getGeneToGeneOrthology(Integer.valueOf(page), indexerConfig.getBufferSize());
7070
List<GeneToGeneOrthologyDocument> docs = createGeneToGeneOrthologyDocuments(resp.getResults());
71-
72-
indexDocuments(docs);
73-
} catch (Exception e) {
74-
log.error("Error while indexing...", e);
75-
System.exit(-1);
76-
return;
77-
}
78-
}
71+
72+
indexDocuments(docs);
73+
} catch (Exception e) {
74+
log.error("Error while indexing...", e);
75+
System.exit(-1);
76+
return;
77+
}
78+
}
7979
}
8080

81-
private List<GeneToGeneOrthologyDocument> createGeneToGeneOrthologyDocuments(List<GeneToGeneOrthologyGenerated> g2gOrthoList) {
81+
private List<GeneToGeneOrthologyDocument> createGeneToGeneOrthologyDocuments(
82+
List<GeneToGeneOrthologyGenerated> g2gOrthoList) {
8283
List<GeneToGeneOrthologyDocument> documents = new ArrayList<>();
8384
for (GeneToGeneOrthologyGenerated g2gOrtho : g2gOrthoList) {
8485
GeneToGeneOrthologyDocument document = new GeneToGeneOrthologyDocument();
@@ -93,7 +94,6 @@ private List<GeneToGeneOrthologyDocument> createGeneToGeneOrthologyDocuments(Lis
9394
return documents;
9495
}
9596

96-
9797
private void createStringencyFilter(GeneToGeneOrthologyGenerated g2gOrtho, GeneToGeneOrthologyDocument document) {
9898
if (Boolean.TRUE.equals(g2gOrtho.getStrictFilter())) {
9999
document.setStringencyFilter("stringent");
@@ -108,7 +108,7 @@ private void createGeneAnnotations(GeneToGeneOrthologyGenerated g2gOrtho, GeneTo
108108
putGeneInfo(map, g2gOrtho.getObjectGene());
109109
document.setGeneAnnotations(map);
110110
}
111-
111+
112112
private void putGeneInfo(Map<String, Object> map, Gene gene) {
113113
Map<String, Object> data = new HashMap<>();
114114
data.put("hasExpressionAnnotations", hasExpressionAnnotations(gene));
@@ -131,6 +131,4 @@ private void removeAnnotationLists(GeneToGeneOrthologyDocument document) {
131131
document.getGeneToGeneOrthologyGenerated().getObjectGene().setGeneExpressionAnnotations(null);
132132
}
133133

134-
135-
136134
}

agr_indexer/src/main/java/org/alliancegenome/indexer/indexers/curation/service/GeneToGeneOrthologyService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
public class GeneToGeneOrthologyService {
1616
private final GeneToGeneOrthologyGeneratedInterface orthologyApi = RestProxyFactory.createProxy(GeneToGeneOrthologyGeneratedInterface.class, ConfigHelper.getCurationApiUrl(), RestConfig.config);
1717

18-
public SearchResponse<GeneToGeneOrthologyGenerated> getGeneToGeneOrthology(Integer page, Integer limit) {
19-
20-
HashMap<String, Object> params = new HashMap<>();
18+
public SearchResponse<GeneToGeneOrthologyGenerated> getGeneToGeneOrthology(Integer page, Integer limit) {
19+
20+
HashMap<String, Object> params = new HashMap<>();
2121
params.put("internal", false);
2222
params.put("obsolete", false);
2323

agr_java_core/src/main/java/org/alliancegenome/cache/repository/OrthologyCacheRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ public static JsonResultResponse<HomologView> getOrthologyJson(Gene gene, Orthol
190190
public JsonResultResponse<HomologView> getOrthologyMultiGeneJson(List<String> geneIDs, Pagination pagination) {
191191
long start = System.currentTimeMillis();
192192
List<HomologView> homologViewList = repo.getAllOrthologyGenes(geneIDs);
193+
//filtering
193194
FilterService<HomologView> filterService = new FilterService<>(new OrthologyFiltering());
194195
List<HomologView> homologViewFiltered = filterService.filterAnnotations(homologViewList, pagination.getFieldFilterValueMap());
195196

0 commit comments

Comments
 (0)