Package org.apache.jackrabbit.core.data

Examples of org.apache.jackrabbit.core.data.FileDataStore


        testCreateAndRead(getFileBlob());
    }

    @Test
    public void testDataStoreBlob() throws Exception {
        FileDataStore fds = new FileDataStore();
        fds.setMinRecordLength(4092);
        fds.init(getWorkDir().getAbsolutePath());
        DataStoreBlobStore dbs = new DataStoreBlobStore(fds);
        nodeStore = getNodeStore(dbs);

        //Test for Blob which get inlined
        byte[] data = new byte[fds.getMinRecordLength()-2];
        new Random().nextBytes(data);
        Blob b1 = testCreateAndRead(nodeStore.createBlob(new ByteArrayInputStream(data)));
        assertTrue(b1 instanceof SegmentBlob);
        assertNull(((SegmentBlob) b1).getBlobId());
View Full Code Here


        testCreateAndRead(getFileBlob());
    }

    @Test
    public void testDataStoreBlob() throws Exception {
        FileDataStore fds = new FileDataStore();
        fds.setMinRecordLength(4092);
        fds.init(getWorkDir().getAbsolutePath());
        DataStoreBlobStore dbs = new DataStoreBlobStore(fds);
        nodeStore = getNodeStore(dbs);

        //Test for Blob which get inlined
        byte[] data = new byte[fds.getMinRecordLength()-2];
        new Random().nextBytes(data);
        Blob b1 = testCreateAndRead(nodeStore.createBlob(new ByteArrayInputStream(data)));
        assertTrue(b1 instanceof SegmentBlob);
        assertNull(((SegmentBlob) b1).getBlobId());
View Full Code Here

        testCreateAndRead(getFileBlob());
    }

    @Test
    public void testDataStoreBlob() throws Exception {
        FileDataStore fds = new FileDataStore();
        fds.setMinRecordLength(4092);
        fds.init(getWorkDir().getAbsolutePath());
        DataStoreBlobStore dbs = new DataStoreBlobStore(fds);
        nodeStore = getNodeStore(dbs);

        //Test for Blob which get inlined
        byte[] data = new byte[fds.getMinRecordLength()-2];
        new Random().nextBytes(data);
        Blob b1 = testCreateAndRead(nodeStore.createBlob(new ByteArrayInputStream(data)));
        assertTrue(b1 instanceof SegmentBlob);
        assertNull(b1.getReference());
View Full Code Here

public class FileDataStoreService extends AbstractDataStoreService{
    public static final String NAME = "org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore";

    @Override
    protected DataStore createDataStore(ComponentContext context, Map<String, Object> config) {
        return new FileDataStore();
    }
View Full Code Here

    private static File getWorkDir() {
        return new File("target", "DataStoreBlobGCTest");
    }

    public HashSet<String> setUp() throws Exception {
        FileDataStore fds = new FileDataStore();
        fds.setMinRecordLength(4092);
        fds.init(getWorkDir().getAbsolutePath());
        blobStore = new DataStoreBlobStore(fds);
        nodeStore = getNodeStore(blobStore);

        HashSet<String> set = new HashSet<String>();
View Full Code Here

        testCreateAndRead(getFileBlob());
    }

    @Test
    public void testDataStoreBlob() throws Exception {
        FileDataStore fds = createFileDataStore();
        DataStoreBlobStore dbs = new DataStoreBlobStore(fds);
        nodeStore = getNodeStore(dbs);

        //Test for Blob which get inlined
        Blob b1 = testCreateAndRead(createBlob(fds.getMinRecordLength()-2));
        assertTrue(b1 instanceof SegmentBlob);
        assertNull(((SegmentBlob) b1).getBlobId());

        //Test for Blob which need to be pushed to BlobStore
        byte[] data2 = new byte[Segment.MEDIUM_LIMIT + 1];
View Full Code Here

        is.close();
    }

    @Test
    public void testNullBlobId() throws Exception{
        FileDataStore fds = createFileDataStore();
        DataStoreBlobStore dbs = new DataStoreBlobStore(fds);
        nodeStore = getNodeStore(dbs);

        NodeBuilder nb = nodeStore.getRoot().builder();
        NodeBuilder cb = nb.child("hello");
View Full Code Here

        new Random().nextBytes(data);
        return nodeStore.createBlob(new ByteArrayInputStream(data));
    }

    private FileDataStore createFileDataStore() {
        FileDataStore fds = new FileDataStore();
        fds.setMinRecordLength(4092);
        fds.init(getWorkDir().getAbsolutePath());
        return fds;
    }
View Full Code Here

        File testDir = new File("./target", "oak-fds-test");
        FileUtils.touch(new File(testDir, "a"));
        FileUtils.touch(new File(testDir, "b"));
        FileUtils.touch(new File(testDir, "adir/c"));

        FileDataStore fds = new OakFileDataStore();
        fds.setPath(testDir.getAbsolutePath());
        fds.init(null);

        Iterator<DataIdentifier> dis = fds.getAllIdentifiers();
        Set<String> fileNames = Sets.newHashSet(Iterators.transform(dis, new Function<DataIdentifier, String>() {
            @Override
            public String apply(@Nullable DataIdentifier input) {
                return input.toString();
            }
View Full Code Here

            private File storeDir;
            private FileDataStore fds;

            @Override
            public BlobStore setUp() {
                fds = new FileDataStore();
                fds.setMinRecordLength(4092);
                storeDir = new File(basedir, unique);
                fds.init(storeDir.getAbsolutePath());
                configure(fds);
                BlobStore bs = new DataStoreBlobStore(fds, true, fdsCacheInMB);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.data.FileDataStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.