[
https://issues.apache.org/jira/browse/JENA-1222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15429885#comment-15429885
]
ASF GitHub Bot commented on JENA-1222:
--------------------------------------
Github user ajs6f commented on a diff in the pull request:
https://github.com/apache/jena/pull/164#discussion_r75602598
--- Diff:
jena-tdb/src/main/java/org/apache/jena/tdb/transaction/TransactionManager.java
---
@@ -613,21 +652,43 @@ public void flush() {
}
// -- The main operations to undertake when a transaction finishes.
- // Called from TSM_WriteBackEndTxn but the worker code is shere so all
+ // Called from TSM_WriteBackEndTxn but the worker code is here so all
// related code, including queue flushing is close together.
private void readerFinishesWorker(Transaction txn) {
- if ( queue.size() >= QueueBatchSize )
+ if ( checkForJournalFlush() )
processDelayedReplayQueue(txn) ;
}
-
+
private void writerAbortsWorker(Transaction txn) {
- if ( queue.size() >= QueueBatchSize )
+ if ( checkForJournalFlush() )
processDelayedReplayQueue(txn) ;
}
+ // Whether to try to flush the journal. We may stil find that we are
blocked
+ // from doing so by another transaction.
+ private boolean checkForJournalFlush() {
+// System.err.printf("checkForJournalFlush: queue size=%d; journal
size = %d\n", queue.size(), journal.size()) ;
+// System.err.printf("checkForJournalFlush: QueueBatchSize=%d;
MaxQueueThreshold=%d; JournalThresholdSize=%d\n",
+// QueueBatchSize, MaxQueueThreshold,
JournalThresholdSize) ;
+ if ( QueueBatchSize == 0 )
--- End diff --
I'm probably missing something, but it seems like this is part of the next
case (isn't `queue.size() >= 0` an invariant?). Is this called out just to
emphasize that setting `0` => "no queuing"?
> Control the flushing of the commit log based on journal size.
> -------------------------------------------------------------
>
> Key: JENA-1222
> URL: https://issues.apache.org/jira/browse/JENA-1222
> Project: Apache Jena
> Issue Type: Improvement
> Components: TDB
> Reporter: Andy Seaborne
> Assignee: Andy Seaborne
>
> See discussion in thread:
> https://lists.apache.org/thread.html/b992db7e843e1444d2c4835ac9ece41bee2b251a60785d8881452b95@%3Cusers.jena.apache.org%3E
> TDB batches commits to save on overheads of small updates. However, if the
> application is continually making large commits then batching saves little,
> and causes more temporary resource consumption (RAM especially). It may also
> cause jitters in performance due to a large updates to the main database.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)