Skip to content

Commit

Permalink
Add maxProteins argument
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasblum authored Dec 18, 2024
1 parent b103587 commit fdc8d54
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CreateMD5DBFromOracle {
private static final String USER = "IPRSCAN";
private static final String QUERY = "SELECT MD5 FROM " + USER + ".LOOKUP_MD5 ORDER BY MD5";

void buildDatabase(String url, String password, int fetchSize, File outputDirectory) {
void buildDatabase(String url, String password, int fetchSize, File outputDirectory, int maxProteins) {
System.err.println(Utilities.getTimeAlt() + ": starting");
int proteinCount = 0;
try (BerkeleyDBJE bdbje = new BerkeleyDBJE(outputDirectory)) {
Expand All @@ -40,7 +40,9 @@ void buildDatabase(String url, String password, int fetchSize, File outputDirect
index.put(protein);

proteinCount++;
if (proteinCount % 10000000 == 0) {
if (proteinCount == maxProteins) {
break
} else if (proteinCount % 10000000 == 0) {
store.sync();

String msg = String.format("%s: %,d proteins processed", Utilities.getTimeAlt(), proteinCount);
Expand Down

0 comments on commit fdc8d54

Please sign in to comment.