import java.util.Date;
import java.util.List;
-public class JpredParserLocalFile {
+public class JpredParserLocalFile implements JpredParser {
private CassandraCreate cc = new CassandraCreate();
private String dirprefix;
-
+
public void setSource (String newsourceprefix) {
this.dirprefix = newsourceprefix;
}
int year = cal.get(Calendar.YEAR);
int day = cal.get(Calendar.DATE);
String date = year + "/" + month + "/" + day;
- ParsingForDate(source, date);
+ if (0 < ParsingForDate(source, date)) {
+ cc.flushData();
+ }
}
}
- private void ParsingForDate(String input, String date) {
+ private int ParsingForDate(String input, String date) {
int totalcount = 0;
int countNoData = 0;
int countUnclearFASTAid = 0;
int countinserted = 0;
int counAlignments = 0;
int countStrange = 0;
+ int njobs = 0;
System.out.println("Inserting jobs for " + date);
try {
}
cc.InsertData(dateWork1, table[0], table[1], table[2], id, "OK", "OK", newprotein, seqs);
++countinsertions;
- // flush every 100 insertions
- if (0 == countinsertions % 100) {
+ ++njobs;
+ // flush every 50 insertions
+ if (0 == countinsertions % 50) {
cc.flushData();
+ njobs -= 50;
}
}
+ fr.close();
} catch (IOException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
+ return njobs;
}
}