Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Oct 8, 2024
1 parent d992e58 commit 851b4b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
java-version: '21'
distribution: 'temurin'
- name: Test with Maven
run: mvn clean test
run: mvn --update-snapshots test
env:
GITHUB_TOKEN: ${{ github.token }}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class PhenotypeMetaStore {
private TreeMap<String, ColumnMeta> metaStore;

private TreeSet<Integer> patientIds;
private String columnMetaFile;

public TreeMap<String, ColumnMeta> getMetaStore() {
return metaStore;
Expand All @@ -41,27 +40,24 @@ public ColumnMeta getColumnMeta(String columnName) {
}

@Autowired
@SuppressWarnings("unchecked")
public PhenotypeMetaStore(@Value("${HPDS_DATA_DIRECTORY:/opt/local/hpds/}") String hpdsDataDirectory) {
columnMetaFile = hpdsDataDirectory + "columnMeta.javabin";
try (ObjectInputStream objectInputStream = new ObjectInputStream(new GZIPInputStream(new FileInputStream(columnMetaFile)));){
String columnMetaFile = hpdsDataDirectory + "columnMeta.javabin";
try (ObjectInputStream objectInputStream = new ObjectInputStream(new GZIPInputStream(new FileInputStream(columnMetaFile)))){
TreeMap<String, ColumnMeta> _metastore = (TreeMap<String, ColumnMeta>) objectInputStream.readObject();
log.info("columnMetaFile = " + columnMetaFile);
log.info("_metastore.size() = " + _metastore.size());
TreeMap<String, ColumnMeta> metastoreScrubbed = new TreeMap<String, ColumnMeta>();
TreeMap<String, ColumnMeta> metastoreScrubbed = new TreeMap<>();
for(Map.Entry<String,ColumnMeta> entry : _metastore.entrySet()) {
metastoreScrubbed.put(entry.getKey().replaceAll("\\ufffd",""), entry.getValue());
}
metaStore = metastoreScrubbed;
patientIds = (TreeSet<Integer>) objectInputStream.readObject();
log.info("patientIds.size() = " + patientIds.size());
objectInputStream.close();
} catch (IOException | ClassNotFoundException e) {
log.warn("************************************************");
log.warn("Could not load metastore", e);
log.warn("If you meant to include phenotype data of any kind, please check that the file " + columnMetaFile + " exists and is readable by the service.");
log.warn("************************************************");
metaStore = new TreeMap<String, ColumnMeta>();
patientIds = new TreeSet<Integer>();
metaStore = new TreeMap<>();
patientIds = new TreeSet<>();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import edu.harvard.hms.dbmi.avillach.hpds.data.query.Query;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down

0 comments on commit 851b4b8

Please sign in to comment.