use of org.apache.jackrabbit.oak.upgrade.RepositorySidegrade in project jackrabbit-oak by apache.
the class MigrationFactory method createSidegrade.
private RepositorySidegrade createSidegrade(NodeStore srcStore, NodeStore dstStore) {
RepositorySidegrade sidegrade = new RepositorySidegrade(srcStore, dstStore);
sidegrade.setCopyVersions(options.getCopyVersions());
sidegrade.setCopyOrphanedVersions(options.getCopyOrphanedVersions());
if (options.getIncludePaths() != null) {
sidegrade.setIncludes(options.getIncludePaths());
}
if (options.getExcludePaths() != null) {
sidegrade.setExcludes(options.getExcludePaths());
}
if (options.getExcludeFragments() != null) {
sidegrade.setExcludeFragments(options.getExcludeFragments());
}
if (options.getFragmentPaths() != null) {
sidegrade.setFragmentPaths(options.getFragmentPaths());
}
if (options.getMergePaths() != null) {
sidegrade.setMerges(options.getMergePaths());
}
sidegrade.setFilterLongNames(stores.getSrcType().isSupportLongNames() && !stores.getDstType().isSupportLongNames());
sidegrade.setIncludeIndex(options.isIncludeIndex());
sidegrade.setVerify(options.isVerify());
sidegrade.setOnlyVerify(options.isOnlyVerify());
sidegrade.setSkipCheckpoints(options.isSkipCheckpoints());
sidegrade.setForceCheckpoints(options.isForceCheckpoints());
sidegrade.setMigrateDocumentMetadata(options.isAddSecondaryMetadata());
sidegrade.setCustomCommitHooks(loacCommitHooks());
return sidegrade;
}
use of org.apache.jackrabbit.oak.upgrade.RepositorySidegrade in project jackrabbit-oak by apache.
the class AbstractOak2OakTest method initContent.
protected void initContent(NodeStore target) throws IOException, RepositoryException, CommitFailedException {
NodeStore initialContent = testContent.open();
try {
RepositorySidegrade sidegrade = new RepositorySidegrade(initialContent, target);
sidegrade.copy();
} finally {
testContent.close();
}
NodeBuilder builder = target.getRoot().builder();
builder.setProperty("binary-prop", getRandomBlob(target));
builder.setProperty("checkpoint-state", "before");
target.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
target.checkpoint(60000, singletonMap("key", "123"));
builder.setProperty("checkpoint-state", "after");
builder.setProperty("binary-prop", getRandomBlob(target));
builder.child(":async").setProperty("test", "123");
target.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
}
Aggregations