Skip to content

Commit

Permalink
lib: minor changes, #TASK-5407, #TASK-5387
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Feb 7, 2024
1 parent d9ad898 commit d3ad8c9
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ private void serializeRDB() throws IOException {
// named "iterator"
RocksIterator rocksIterator = rdb.newIterator();

logger.info("Reading from RocksDB index (chrom. {}) and serializing to {}.json.gz", entry.getKey(),
logger.info("Reading from RocksDB index ({}) and serializing to {}.json.gz", dbLocation,
serializer.getOutdir().resolve(serializer.getFileName()));
int counter = 0;
for (rocksIterator.seekToFirst(); rocksIterator.isValid(); rocksIterator.next()) {
Expand All @@ -507,9 +507,6 @@ private void serializeRDB() throws IOException {
}
closeIndex(rdb, dbOption, dbLocation);
}

serializer.close();
logger.info("Done.");
}

private void closeIndex(RocksDB rdb, Options dbOption, String dbLocation) throws IOException {
Expand Down Expand Up @@ -559,7 +556,7 @@ private Object[] getDBConnection(String dbLocation, boolean forceCreate) {
}

private Object[] getRocksDBConnection(String chrom) {
if (!rdbConnectionPerChrom.containsKey(chrom)) {
if (!rdbConnectionPerChrom.containsKey(chrom) || rdbConnectionPerChrom.get(chrom) == null) {
Object[] dbConnection = getDBConnection(pgsDir.resolve("rdb-" + chrom + ".idx").toString(), true);
rdbConnectionPerChrom.put(chrom, dbConnection);
}
Expand Down

0 comments on commit d3ad8c9

Please sign in to comment.