Skip to content

Commit

Permalink
OAK-4493 Offline compaction persisted mode
Browse files Browse the repository at this point in the history
 - fix for segmentmk

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1749899 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
stillalex committed Jun 23, 2016
1 parent 71ffd30 commit 311cb45
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ public class Compactor {
/** Logger instance */
private static final Logger log = LoggerFactory.getLogger(Compactor.class);

private static boolean eagerFlush = Boolean
.getBoolean("oak.compaction.eagerFlush");

static {
if (eagerFlush) {
log.debug("Eager flush enabled.");
}
}

/**
* Locks down the RecordId persistence structure
*/
Expand Down Expand Up @@ -245,7 +254,12 @@ public boolean childNodeAdded(String name, NodeState after) {

progress.onNode();
try {
NodeBuilder child = EMPTY_NODE.builder();
NodeBuilder child;
if (eagerFlush) {
child = builder.setChildNode(name);
} else {
child = EMPTY_NODE.builder();
}
boolean success = new CompactDiff(child, path, name).diff(EMPTY_NODE, after);
if (success) {
SegmentNodeState state = writer.writeNode(child.getNodeState());
Expand Down

0 comments on commit 311cb45

Please sign in to comment.