Package org.apache.jackrabbit.oak.plugins.blob

Examples of org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector


    @Test
    public void gc() throws Exception {
        HashSet<String> set = setUp();

        DocumentNodeStore s = mk.getNodeStore();
        MarkSweepGarbageCollector gc = new MarkSweepGarbageCollector();
        gc.init(s, "./target", 2048, true, 2);
        gc.collectGarbage();

        Set<String> existing = iterate();
        boolean empty = Sets.intersection(set, existing).isEmpty();
        assertTrue(empty);
    }
View Full Code Here


        gc(set);
    }

    private void gc(HashSet<String> set) throws Exception {
        DocumentNodeStore store = mk.getNodeStore();
        MarkSweepGarbageCollector gc = new MarkSweepGarbageCollector(
                new DocumentBlobReferenceRetriever(store),
                (GarbageCollectableBlobStore) store.getBlobStore(),
                MoreExecutors.sameThreadExecutor(),
                "./target", 2048, true, 0);
        gc.collectGarbage();

        Set<String> existing = iterate();
        boolean empty = Sets.intersection(set, existing).isEmpty();
        assertTrue(empty);
    }
View Full Code Here

     * @return garbage collector of the BlobStore supports GC otherwise null
     * @param blobGcMaxAgeInSecs
     */
    @CheckForNull
    public MarkSweepGarbageCollector createBlobGarbageCollector(long blobGcMaxAgeInSecs) {
        MarkSweepGarbageCollector blobGC = null;
        if(blobStore instanceof GarbageCollectableBlobStore){
            try {
                blobGC = new MarkSweepGarbageCollector(
                        new DocumentBlobReferenceRetriever(this),
                            (GarbageCollectableBlobStore) blobStore,
                        executor,
                        TimeUnit.SECONDS.toMillis(blobGcMaxAgeInSecs));
            } catch (IOException e) {
View Full Code Here

     * @return garbage collector of the BlobStore supports GC otherwise null
     * @param blobGcMaxAgeInSecs
     */
    @CheckForNull
    public MarkSweepGarbageCollector createBlobGarbageCollector(long blobGcMaxAgeInSecs) {
        MarkSweepGarbageCollector blobGC = null;
        if(blobStore instanceof GarbageCollectableBlobStore){
            try {
                blobGC = new MarkSweepGarbageCollector(
                        new DocumentBlobReferenceRetriever(this),
                            (GarbageCollectableBlobStore) blobStore,
                        executor,
                        TimeUnit.SECONDS.toMillis(blobGcMaxAgeInSecs));
            } catch (IOException e) {
View Full Code Here

        if (blobStore instanceof GarbageCollectableBlobStore) {
            BlobGarbageCollector gc = new BlobGarbageCollector() {
                @Override
                public void collectGarbage() throws Exception {
                    MarkSweepGarbageCollector gc = new MarkSweepGarbageCollector(
                            new SegmentBlobReferenceRetriever(store.getTracker()),
                            (GarbageCollectableBlobStore) blobStore,
                            executor);
                    gc.collectGarbage();
                }
            };

            blobGCRegistration = registerMBean(whiteboard, BlobGCMBean.class, new BlobGC(gc, executor),
                    BlobGCMBean.TYPE, "Segment node store blob garbage collection");
View Full Code Here

    @Test
    public void gc() throws Exception {
        HashSet<String> set = setUp();

        DocumentNodeStore s = mk.getNodeStore();
        MarkSweepGarbageCollector gc = new MarkSweepGarbageCollector();
        gc.init(s, "./target", 2048, true, 2, 0);
        gc.collectGarbage();

        Set<String> existing = iterate();
        boolean empty = Sets.intersection(set, existing).isEmpty();
        assertTrue(empty);
    }
View Full Code Here

     * @return garbage collector of the BlobStore supports GC otherwise null
     * @param blobGcMaxAgeInSecs
     */
    @CheckForNull
    public MarkSweepGarbageCollector createBlobGarbageCollector(long blobGcMaxAgeInSecs) {
        MarkSweepGarbageCollector blobGC = null;
        if(blobStore instanceof GarbageCollectableBlobStore){
            try {
                blobGC = new MarkSweepGarbageCollector(
                        new DocumentBlobReferenceRetriever(this),
                            (GarbageCollectableBlobStore) blobStore,
                        executor,
                        TimeUnit.SECONDS.toMillis(blobGcMaxAgeInSecs));
            } catch (IOException e) {
View Full Code Here

     * @return garbage collector of the BlobStore supports GC otherwise null
     * @param blobGcMaxAgeInSecs
     */
    @CheckForNull
    public MarkSweepGarbageCollector createBlobGarbageCollector(long blobGcMaxAgeInSecs) {
        MarkSweepGarbageCollector blobGC = null;
        if(blobStore instanceof GarbageCollectableBlobStore){
            try {
                blobGC = new MarkSweepGarbageCollector(
                        new DocumentBlobReferenceRetriever(this),
                            (GarbageCollectableBlobStore) blobStore,
                        executor,
                        TimeUnit.SECONDS.toMillis(blobGcMaxAgeInSecs));
            } catch (IOException e) {
View Full Code Here

    @Test
    public void gc() throws Exception {
        HashSet<String> set = setUp();

        MarkSweepGarbageCollector gc = new MarkSweepGarbageCollector(
                new SegmentBlobReferenceRetriever(store.getTracker()),
                    (GarbageCollectableBlobStore) store.getBlobStore(),
                    MoreExecutors.sameThreadExecutor(),
                    "./target", 2048, true,  0);
        gc.collectGarbage();

        Set<String> existing = iterate();
        boolean empty = Sets.intersection(set, existing).isEmpty();
        assertTrue(empty);
    }
View Full Code Here

        if (blobStore instanceof GarbageCollectableBlobStore) {
            BlobGarbageCollector gc = new BlobGarbageCollector() {
                @Override
                public void collectGarbage() throws Exception {
                    MarkSweepGarbageCollector gc = new MarkSweepGarbageCollector(
                            new SegmentBlobReferenceRetriever(store.getTracker()),
                            (GarbageCollectableBlobStore) blobStore,
                            executor);
                    gc.collectGarbage();
                }
            };

            blobGCRegistration = registerMBean(whiteboard, BlobGCMBean.class, new BlobGC(gc, executor),
                    BlobGCMBean.TYPE, "Segment node store blob garbage collection");
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.blob.MarkSweepGarbageCollector

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.