Skip to content

Commit

Permalink
Use PrimaryIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasblum committed Jan 5, 2025
1 parent 5cf70ec commit 1e05a1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class BerkeleyMatchDBService extends AbstractDBService {

private String databasePath;

private SecondaryIndex<String, Long, KVSequenceEntry> secIDX = null;
private PrimaryIndex<String, KVSequenceEntry> index = null;

private int cacheSizeInBytes;

Expand Down Expand Up @@ -65,8 +65,8 @@ protected void finalize() throws Throwable {
shutdown();
}

SecondaryIndex<String, Long, KVSequenceEntry> getMD5Index() {
return secIDX;
PrimaryIndex<String, KVSequenceEntry> getMD5Index() {
return index;
}

private void initializeMD5Index() {
Expand All @@ -89,9 +89,7 @@ private void initializeMD5Index() {
myEnv = new Environment(file, myEnvConfig);
store = new EntityStore(myEnv, "EntityStore", storeConfig);


PrimaryIndex<Long, KVSequenceEntry> primIDX = store.getPrimaryIndex(Long.class, KVSequenceEntry.class);
secIDX = store.getSecondaryIndex(primIDX, String.class, "proteinMD5");
index = store.getPrimaryIndex(String.class, KVSequenceEntry.class);
}

public void displayServerStats(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class BerkeleySiteDBService extends AbstractDBService {

private String databasePath;

private SecondaryIndex<String, Long, KVSequenceEntry> secIDX = null;
private PrimaryIndex<String, KVSequenceEntry> index = null;

private int cacheSizeInBytes;

Expand Down Expand Up @@ -66,8 +66,8 @@ protected void finalize() throws Throwable {
shutdown();
}

SecondaryIndex<String, Long, KVSequenceEntry> getMD5Index() {
return secIDX;
PrimaryIndex<String, KVSequenceEntry> getMD5Index() {
return index;
}

private void initializeMD5Index() {
Expand All @@ -90,9 +90,7 @@ private void initializeMD5Index() {
myEnv = new Environment(file, myEnvConfig);
store = new EntityStore(myEnv, "EntityStore", storeConfig);


PrimaryIndex<Long, KVSequenceEntry> primIDX = store.getPrimaryIndex(Long.class, KVSequenceEntry.class);
secIDX = store.getSecondaryIndex(primIDX, String.class, "proteinMD5");
index = store.getPrimaryIndex(String.class, KVSequenceEntry.class);
}

public void displayServerStats(){
Expand Down

0 comments on commit 1e05a1e

Please sign in to comment.