Author: chetanm
Date: Wed Oct 19 15:12:38 2016
New Revision: 1765650
URL: http://svn.apache.org/viewvc?rev=1765650&view=rev
Log:
OAK-1312 - [bundling] Bundle nodes into a document
Changes per Marcel's feedback
- Switch config to disable mode i.e. by default bundling is enabled and config
is provided to disable that
- Do away with bundlingEnabled instance field in DocumentNodeStore as its only
used in constructor
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/DocumentNodeStoreConfigTest.groovy
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=1765650&r1=1765649&r2=1765650&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
Wed Oct 19 15:12:38 2016
@@ -583,7 +583,7 @@ public class DocumentMK {
private DocumentNodeStoreStatsCollector nodeStoreStatsCollector;
private Map<CacheType, PersistentCacheStats> persistentCacheStats =
new EnumMap<CacheType, PersistentCacheStats>(CacheType.class);
- private boolean bundlingEnabled = true;
+ private boolean bundlingDisabled;
public Builder() {
}
@@ -1029,13 +1029,13 @@ public class DocumentMK {
return disableBranches;
}
- public Builder setBundlingEnabled(boolean enabled) {
- bundlingEnabled = enabled;
+ public Builder setBundlingDisabled(boolean enabled) {
+ bundlingDisabled = enabled;
return this;
}
- public boolean isBundlingEnabled() {
- return bundlingEnabled;
+ public boolean isBundlingDisabled() {
+ return bundlingDisabled;
}
public Builder setPrefetchExternalChanges(boolean b) {
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java?rev=1765650&r1=1765649&r2=1765650&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
Wed Oct 19 15:12:38 2016
@@ -86,7 +86,6 @@ import org.apache.jackrabbit.oak.plugins
import org.apache.jackrabbit.oak.plugins.blob.ReferencedBlob;
import org.apache.jackrabbit.oak.plugins.document.Branch.BranchCommit;
import
org.apache.jackrabbit.oak.plugins.document.bundlor.BundlingConfigHandler;
-import org.apache.jackrabbit.oak.plugins.document.bundlor.BundlingHandler;
import
org.apache.jackrabbit.oak.plugins.document.persistentCache.PersistentCache;
import
org.apache.jackrabbit.oak.plugins.document.persistentCache.broadcast.DynamicBroadcastConfig;
import
org.apache.jackrabbit.oak.plugins.document.util.ReadOnlyDocumentStoreWrapperFactory;
@@ -420,8 +419,6 @@ public final class DocumentNodeStore
private final BundlingConfigHandler bundlingConfigHandler = new
BundlingConfigHandler();
- private final boolean bundlingEnabled;
-
public DocumentNodeStore(DocumentMK.Builder builder) {
this.blobStore = builder.getBlobStore();
this.statisticsProvider = builder.getStatisticsProvider();
@@ -578,8 +575,7 @@ public final class DocumentNodeStore
LOG.info("Initialized DocumentNodeStore with clusterNodeId: {} ({})",
clusterId,
getClusterNodeInfoDisplayString());
- bundlingEnabled = builder.isBundlingEnabled();
- if (bundlingEnabled) {
+ if (!builder.isBundlingDisabled()) {
bundlingConfigHandler.initialize(this, executor);
}
}
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java?rev=1765650&r1=1765649&r2=1765650&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
(original)
+++
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
Wed Oct 19 15:12:38 2016
@@ -378,12 +378,12 @@ public class DocumentNodeStoreService {
)
public static final String PROP_DS_TYPE = "documentStoreType";
- private static final boolean DEFAULT_BUNDLING_ENABLED = true;
- @Property(boolValue = DEFAULT_BUNDLING_ENABLED,
- label = "Bundling Enabled",
- description = "Boolean value indicating that Node bundling is
enabled"
+ private static final boolean DEFAULT_BUNDLING_DISABLED = false;
+ @Property(boolValue = DEFAULT_BUNDLING_DISABLED,
+ label = "Bundling Disabled",
+ description = "Boolean value indicating that Node bundling is
disabled"
)
- public static final String PROP_BUNDLING_ENABLED = "bundlingEnabled";
+ private static final String PROP_BUNDLING_DISABLED = "bundlingDisabled";
private DocumentStoreType documentStoreType;
@@ -440,7 +440,7 @@ public class DocumentNodeStoreService {
String journalCache = getPath(PROP_JOURNAL_CACHE,
DEFAULT_JOURNAL_CACHE);
int cacheSegmentCount = toInteger(prop(PROP_CACHE_SEGMENT_COUNT),
DEFAULT_CACHE_SEGMENT_COUNT);
int cacheStackMoveDistance =
toInteger(prop(PROP_CACHE_STACK_MOVE_DISTANCE),
DEFAULT_CACHE_STACK_MOVE_DISTANCE);
- boolean bundlingEnabled = toBoolean(prop(PROP_BUNDLING_ENABLED),
DEFAULT_BUNDLING_ENABLED);
+ boolean bundlingDisabled = toBoolean(prop(PROP_BUNDLING_DISABLED),
DEFAULT_BUNDLING_DISABLED);
boolean prefetchExternalChanges =
toBoolean(prop(PROP_PREFETCH_EXTERNAL_CHANGES), false);
DocumentMK.Builder mkBuilder =
new DocumentMK.Builder().
@@ -453,7 +453,7 @@ public class DocumentNodeStoreService {
diffCachePercentage).
setCacheSegmentCount(cacheSegmentCount).
setCacheStackMoveDistance(cacheStackMoveDistance).
- setBundlingEnabled(bundlingEnabled).
+ setBundlingDisabled(bundlingDisabled).
setLeaseCheck(true /* OAK-2739: enabled by default */).
setLeaseFailureHandler(new LeaseFailureHandler() {
@@ -842,7 +842,7 @@ public class DocumentNodeStoreService {
ds.getClass().getSimpleName()));
}
- if (mkBuilder.isBundlingEnabled()){
+ if (!mkBuilder.isBundlingDisabled()){
registrations.add(registerMBean(whiteboard,
BackgroundObserverMBean.class,
store.getBundlingConfigHandler().getMBean(),
Modified:
jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/DocumentNodeStoreConfigTest.groovy
URL:
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/DocumentNodeStoreConfigTest.groovy?rev=1765650&r1=1765649&r2=1765650&view=diff
==============================================================================
---
jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/DocumentNodeStoreConfigTest.groovy
(original)
+++
jackrabbit/oak/trunk/oak-pojosr/src/test/groovy/org/apache/jackrabbit/oak/run/osgi/DocumentNodeStoreConfigTest.groovy
Wed Oct 19 15:12:38 2016
@@ -296,7 +296,7 @@ class DocumentNodeStoreConfigTest extend
createConfig([
'org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService': [
documentStoreType: 'RDB',
- bundlingEnabled : false
+ bundlingDisabled : true
]
])