Search in sources :

Example 1 with TarNodeStore

use of org.apache.jackrabbit.oak.upgrade.cli.node.TarNodeStore in project jackrabbit-oak by apache.

the class RepositorySidegrade method verify.

private void verify() {
    final NodeState sourceRoot;
    final NodeState targetRoot;
    if (source instanceof TarNodeStore && target instanceof TarNodeStore) {
        sourceRoot = ((TarNodeStore) source).getSuperRoot();
        targetRoot = ((TarNodeStore) target).getSuperRoot();
    } else {
        sourceRoot = source.getRoot();
        targetRoot = target.getRoot();
    }
    final NodeState reportingSource = ReportingNodeState.wrap(sourceRoot, new LoggingReporter(LOG, "Verifying", LOG_NODE_COPY, -1));
    LOG.info("Verifying whether repositories are identical");
    if (targetRoot.compareAgainstBaseState(reportingSource, new LoggingEqualsDiff(LOG, "/"))) {
        LOG.info("Verification result: both repositories are identical");
    } else {
        LOG.warn("Verification result: repositories are not identical");
    }
}
Also used : ReportingNodeState(org.apache.jackrabbit.oak.upgrade.nodestate.report.ReportingNodeState) EmptyNodeState(org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState) NameFilteringNodeState(org.apache.jackrabbit.oak.upgrade.nodestate.NameFilteringNodeState) MetadataExposingNodeState(org.apache.jackrabbit.oak.upgrade.nodestate.MetadataExposingNodeState) NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) FilteringNodeState(org.apache.jackrabbit.oak.upgrade.nodestate.FilteringNodeState) TarNodeStore(org.apache.jackrabbit.oak.upgrade.cli.node.TarNodeStore) LoggingReporter(org.apache.jackrabbit.oak.upgrade.nodestate.report.LoggingReporter)

Aggregations

EmptyNodeState (org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState)1 NodeState (org.apache.jackrabbit.oak.spi.state.NodeState)1 TarNodeStore (org.apache.jackrabbit.oak.upgrade.cli.node.TarNodeStore)1 FilteringNodeState (org.apache.jackrabbit.oak.upgrade.nodestate.FilteringNodeState)1 MetadataExposingNodeState (org.apache.jackrabbit.oak.upgrade.nodestate.MetadataExposingNodeState)1 NameFilteringNodeState (org.apache.jackrabbit.oak.upgrade.nodestate.NameFilteringNodeState)1 LoggingReporter (org.apache.jackrabbit.oak.upgrade.nodestate.report.LoggingReporter)1 ReportingNodeState (org.apache.jackrabbit.oak.upgrade.nodestate.report.ReportingNodeState)1