Commit acf49f1a authored by Michael Ritter's avatar Michael Ritter
Browse files

Merge branch 'develop' into '28-oom-in-auditthread'

# Conflicts:
#   ace-am/src/main/java/edu/umiacs/ace/monitor/register/IngestThread.java
parents 9f6bb953 0fed3842
......@@ -106,7 +106,7 @@ public class IngestDirectory extends RecursiveAction {
parent = Strings.cleanStringForXml(parent, '_');
createDirectory(pathList.get(i), parent);
if ( numTransactions > 10000 ) {
if ( numTransactions % 30 == 0 ) {
em.flush();
em.clear();
}
......
......@@ -173,16 +173,15 @@ public class IngestThread extends RecursiveAction {
token.setParentCollection(coll);
// Token
// TODO: may be be able to do em.persist(item) and let the token get persisted along w/ it
em.persist(event[1]);
em.persist(token);
// Token
// em.persist(token);
item.setToken(token);
//Finish adding the item
em.persist(event[0]);
em.merge(item);
numTransactions += 4;
em.persist(event[1]);
em.persist(item);
numTransactions += 3;
newTokens.add(identifier);
}else{
......@@ -194,7 +193,7 @@ public class IngestThread extends RecursiveAction {
// With large Token Stores, we get a large number of transactions
// Flushing and Clearing the EM helps to clear some memory
// TODO: W/ fork join this isn't needed anymore, unless we want to flush at a lower number
if ( numTransactions > 7000 ) {
if ( numTransactions > 30 ) {
em.flush();
em.clear();
numTransactions = 0;
......@@ -230,12 +229,13 @@ public class IngestThread extends RecursiveAction {
if ( update ) {
LogEvent event = logManager.createItemEvent(LogEnum.TOKEN_INGEST_UPDATE,
identifier, coll.getDirectory() + identifier);
em.persist(token);
// em.persist(token);
item.setToken(token);
// TODO: Why set 'I'? It's not necessarily invalid, maybe 'R' would be better
item.setState('I');
em.merge(item);
em.persist(event);
numTransactions += 3;
numTransactions += 2;
updatedTokens.add(identifier);
}else{
unchangedTokens.add(identifier);
......@@ -287,10 +287,10 @@ public class IngestThread extends RecursiveAction {
mi.setState(initialState);
mi.setSize(size);
em.persist(mi);
numTransactions++;
// em.persist(mi);
// numTransactions++;
return mi;
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment