Search in sources :

Example 1 with SegmentNodeStoreContainer

use of org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer in project jackrabbit-oak by apache.

the class SegmentToSegmentWithMissingDestinationDirectoryTest method getSegmentNodeStoreContainerWithMissingDirectory.

private SegmentNodeStoreContainer getSegmentNodeStoreContainerWithMissingDirectory() throws IOException {
    SegmentNodeStoreContainer segmentNodeStoreContainer = new SegmentNodeStoreContainer();
    segmentNodeStoreContainer.getDirectory().delete();
    return segmentNodeStoreContainer;
}
Also used : SegmentNodeStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer)

Example 2 with SegmentNodeStoreContainer

use of org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer in project jackrabbit-oak by apache.

the class CopyBinariesTest method data.

@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> data() throws IOException {
    List<Object[]> params = new ArrayList<Object[]>();
    BlobStoreContainer blob = new FileDataStoreContainer();
    BlobStoreContainer blob2 = new FileDataStoreContainer();
    params.add(new Object[] { "Copy references, no blobstores defined, segment -> segment", new SegmentNodeStoreContainer(blob), new SegmentNodeStoreContainer(blob), asList(), DatastoreArguments.BlobMigrationCase.COPY_REFERENCES });
    params.add(new Object[] { "Copy references, no blobstores defined, segment-tar -> segment-tar", new SegmentTarNodeStoreContainer(blob), new SegmentTarNodeStoreContainer(blob), asList(), DatastoreArguments.BlobMigrationCase.COPY_REFERENCES });
    params.add(new Object[] { "Copy references, no blobstores defined, segment -> segment-tar", new SegmentNodeStoreContainer(blob), new SegmentTarNodeStoreContainer(blob), asList(), DatastoreArguments.BlobMigrationCase.COPY_REFERENCES });
    params.add(new Object[] { "Copy references, no blobstores defined, document -> segment-tar", new JdbcNodeStoreContainer(blob), new SegmentNodeStoreContainer(blob), asList("--src-user=sa", "--src-password=sa"), DatastoreArguments.BlobMigrationCase.COPY_REFERENCES });
    params.add(new Object[] { "Copy references, no blobstores defined, segment-tar -> document", new SegmentTarNodeStoreContainer(blob), new JdbcNodeStoreContainer(blob), asList("--user=sa", "--password=sa"), DatastoreArguments.BlobMigrationCase.UNSUPPORTED });
    params.add(new Object[] { "Missing source, external destination", new SegmentTarNodeStoreContainer(blob), new SegmentTarNodeStoreContainer(blob), asList("--datastore=" + blob.getDescription()), DatastoreArguments.BlobMigrationCase.UNSUPPORTED });
    params.add(new Object[] { "Copy embedded to embedded, no blobstores defined", new SegmentTarNodeStoreContainer(), new SegmentTarNodeStoreContainer(), asList(), DatastoreArguments.BlobMigrationCase.EMBEDDED_TO_EMBEDDED });
    params.add(new Object[] { "Copy embedded to external, no blobstores defined", new SegmentTarNodeStoreContainer(), new SegmentTarNodeStoreContainer(blob), asList("--datastore=" + blob.getDescription()), DatastoreArguments.BlobMigrationCase.EMBEDDED_TO_EXTERNAL });
    params.add(new Object[] { "Copy references, src blobstore defined", new SegmentTarNodeStoreContainer(blob), new SegmentTarNodeStoreContainer(blob), asList("--src-datastore=" + blob.getDescription()), DatastoreArguments.BlobMigrationCase.COPY_REFERENCES });
    params.add(new Object[] { "Copy external to embedded, src blobstore defined", new SegmentTarNodeStoreContainer(blob), new SegmentTarNodeStoreContainer(), asList("--copy-binaries", "--src-datastore=" + blob.getDescription()), DatastoreArguments.BlobMigrationCase.EXTERNAL_TO_EMBEDDED });
    params.add(new Object[] { "Copy external to external, src blobstore defined", new SegmentTarNodeStoreContainer(blob), new SegmentTarNodeStoreContainer(blob2), asList("--copy-binaries", "--src-datastore=" + blob.getDescription(), "--datastore=" + blob2.getDescription()), DatastoreArguments.BlobMigrationCase.EXTERNAL_TO_EXTERNAL });
    return params;
}
Also used : JdbcNodeStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.JdbcNodeStoreContainer) SegmentTarNodeStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.SegmentTarNodeStoreContainer) ArrayList(java.util.ArrayList) BlobStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.BlobStoreContainer) FileDataStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.FileDataStoreContainer) SegmentNodeStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer)

Example 3 with SegmentNodeStoreContainer

use of org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer in project jackrabbit-oak by apache.

the class CopyCheckpointsTest method data.

@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> data() throws IOException {
    List<Object[]> params = new ArrayList<Object[]>();
    BlobStoreContainer blob = new FileDataStoreContainer();
    params.add(new Object[] { "Fails on missing blobstore", new SegmentNodeStoreContainer(blob), new SegmentNodeStoreContainer(blob), asList(), Result.EXCEPTION });
    params.add(new Object[] { "Suppress the warning", new SegmentNodeStoreContainer(blob), new SegmentNodeStoreContainer(blob), asList("--skip-checkpoints"), Result.CHECKPOINTS_MISSING });
    params.add(new Object[] { "Source data store defined, checkpoints migrated", new SegmentTarNodeStoreContainer(blob), new SegmentTarNodeStoreContainer(blob), asList("--src-datastore=" + blob.getDescription()), Result.CHECKPOINTS_COPIED });
    return params;
}
Also used : SegmentTarNodeStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.SegmentTarNodeStoreContainer) ArrayList(java.util.ArrayList) BlobStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.BlobStoreContainer) FileDataStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.FileDataStoreContainer) SegmentNodeStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer)

Example 4 with SegmentNodeStoreContainer

use of org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer in project jackrabbit-oak by apache.

the class AbstractOak2OakTest method unpackSegmentRepo.

@BeforeClass
public static void unpackSegmentRepo() throws IOException {
    File tempDir = new File("target", "test-segment-store");
    if (!tempDir.isDirectory()) {
        Util.unzip(AbstractOak2OakTest.class.getResourceAsStream("/segmentstore.zip"), tempDir);
    }
    testContent = new SegmentNodeStoreContainer(tempDir);
}
Also used : File(java.io.File) SegmentNodeStoreContainer(org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer) BeforeClass(org.junit.BeforeClass)

Aggregations

SegmentNodeStoreContainer (org.apache.jackrabbit.oak.upgrade.cli.container.SegmentNodeStoreContainer)4 ArrayList (java.util.ArrayList)2 BlobStoreContainer (org.apache.jackrabbit.oak.upgrade.cli.container.BlobStoreContainer)2 FileDataStoreContainer (org.apache.jackrabbit.oak.upgrade.cli.container.FileDataStoreContainer)2 SegmentTarNodeStoreContainer (org.apache.jackrabbit.oak.upgrade.cli.container.SegmentTarNodeStoreContainer)2 File (java.io.File)1 JdbcNodeStoreContainer (org.apache.jackrabbit.oak.upgrade.cli.container.JdbcNodeStoreContainer)1 BeforeClass (org.junit.BeforeClass)1