Skip to content

Commit

Permalink
Merge pull request #4 from yc-huang/mph
Browse files Browse the repository at this point in the history
use modified MPH class name to load hash function
  • Loading branch information
yc-huang authored Dec 29, 2023
2 parents 10a394d + 6207785 commit ebf4cc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/tech/bsdb/read/Reader.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import it.unimi.dsi.fastutil.io.BinIO;
import it.unimi.dsi.sux4j.mph.GOVMinimalPerfectHashFunction;
import it.unimi.dsi.sux4j.mph.GOVMinimalPerfectHashFunctionModified;
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.configuration2.builder.fluent.Configurations;
import org.apache.commons.configuration2.ex.ConfigurationException;
Expand All @@ -21,12 +22,12 @@ public abstract class Reader {
protected File kvFile;
protected long idxCapacity;
protected boolean approximateMode;
protected GOVMinimalPerfectHashFunction<byte[]> hashFunction;
protected GOVMinimalPerfectHashFunctionModified<byte[]> hashFunction;
private Configuration config;
private Field[] valueSchema;

public Reader(File basePath, boolean approximate) throws IOException, ClassNotFoundException {
this.hashFunction = (GOVMinimalPerfectHashFunction<byte[]>) BinIO.loadObject(new File(basePath, Common.FILE_NAME_KEY_HASH));
this.hashFunction = (GOVMinimalPerfectHashFunctionModified<byte[]>) BinIO.loadObject(new File(basePath, Common.FILE_NAME_KEY_HASH));
this.approximateMode = approximate;
this.idxFile = new File(basePath, approximate ? Common.FILE_NAME_KV_APPROXIMATE_INDEX : Common.FILE_NAME_KV_INDEX);
this.kvFile = new File(basePath, Common.FILE_NAME_KV_DATA);
Expand Down

0 comments on commit ebf4cc5

Please sign in to comment.