Author: mreutegg
Date: Mon Feb 24 09:56:28 2014
New Revision: 1571206
URL: http://svn.apache.org/r1571206
Log:
OAK-1461: Merge DocumentNodeState with Node
- release in-progress batch commit as soon as possible
- increase cache share for DocumentNodeState to 25%
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/BatchCommit.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/BatchCommit.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/BatchCommit.java?rev=1571206&r1=1571205&r2=1571206&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/BatchCommit.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/BatchCommit.java
Mon Feb 24 09:56:28 2014
@@ -113,21 +113,26 @@ final class BatchCommit {
Future<NodeDocument> execute(int idx) {
if (idx == 0) {
- UpdateOp combined = UpdateOp.combine(id, ops);
NodeDocument before = null;
try {
+ UpdateOp combined = UpdateOp.combine(id, ops);
+ LOG.debug("Batch committing {} updates", ops.size());
before = queue.getStore().findAndUpdate(NODES, combined);
} catch (Throwable t) {
LOG.warn("BatchCommit failed, will retry individually. " +
t.getMessage());
+ } finally {
+ queue.finished(this);
}
- if (before == null) {
- // batch commit unsuccessful, execute individually
- executeIndividually();
- } else {
- populateResults(before);
+ try {
+ if (before == null) {
+ // batch commit unsuccessful, execute individually
+ executeIndividually();
+ } else {
+ populateResults(before);
+ }
+ } finally {
+ finished.countDown();
}
- queue.finished(this);
- finished.countDown();
} else {
try {
finished.await();
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java?rev=1571206&r1=1571205&r2=1571206&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
Mon Feb 24 09:56:28 2014
@@ -638,7 +638,7 @@ public class DocumentMK implements Micro
}
public Builder memoryCacheSize(long memoryCacheSize) {
- this.nodeCacheSize = memoryCacheSize * 20 / 100;
+ this.nodeCacheSize = memoryCacheSize * 25 / 100;
this.childrenCacheSize = memoryCacheSize * 10 / 100;
this.diffCacheSize = memoryCacheSize * 2 / 100;
this.docChildrenCacheSize = memoryCacheSize * 3 / 100;