Skip to content

Commit

Permalink
OAK-7658: Allow to decide whether the composite node store checks sho…
Browse files Browse the repository at this point in the history
…uld be enabled

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1836700 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
trekawek committed Jul 26, 2018
1 parent 682f75e commit 5f389fc
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public class CompositeNodeStoreService {
)
private static final String PROP_IGNORE_READ_ONLY_WRITES = "ignoreReadOnlyWrites";

@Property(label = "Enable node store checks",
description = "Whether the composite node store constraints should be checked before start",
boolValue = true
)
private static final String ENABLE_CHECKS = "enableChecks";

@Property(label = "Read-only mounts",
description = "The partial stores should be configured as read-only",
boolValue = true
Expand Down Expand Up @@ -120,13 +126,16 @@ public class CompositeNodeStoreService {

private boolean pathStats;

private boolean enableChecks;

@Activate
protected void activate(ComponentContext context, Map<String, ?> config) throws IOException, CommitFailedException {
this.context = context;
ignoreReadOnlyWritePaths = PropertiesUtil.toStringArray(config.get(PROP_IGNORE_READ_ONLY_WRITES), new String[0]);
partialReadOnly = PropertiesUtil.toBoolean(config.get(PROP_PARTIAL_READ_ONLY), true);
seedMount = PropertiesUtil.toString(config.get(PROP_SEED_MOUNT), null);
pathStats = PropertiesUtil.toBoolean(config.get(PATH_STATS), false);
enableChecks = PropertiesUtil.toBoolean(config.get(ENABLE_CHECKS), true);
registerCompositeNodeStore();
}

Expand Down Expand Up @@ -168,7 +177,9 @@ private void registerCompositeNodeStore() throws IOException, CommitFailedExcept
CompositeNodeStore.Builder builder = new CompositeNodeStore.Builder(mountInfoProvider, globalNs.getNodeStoreProvider().getNodeStore());
nodeStoresInUse.add(globalNs.getNodeStoreProvider());

builder.with(checks);
if (enableChecks) {
builder.with(checks);
}
builder.setPartialReadOnly(partialReadOnly);
for (String p : ignoreReadOnlyWritePaths) {
builder.addIgnoredReadOnlyWritePath(p);
Expand Down

0 comments on commit 5f389fc

Please sign in to comment.