jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1574627 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment: AbstractStore.java SegmentStore.java file/FileStore.java memory/MemoryStore.java
Date Wed, 05 Mar 2014 19:12:04 GMT
Author: jukka
Date: Wed Mar  5 19:12:03 2014
New Revision: 1574627

URL: http://svn.apache.org/r1574627
Log:
OAK-631: SegmentMK: Implement garbage collection

GC is best implemented below the SegmentStore interface, not above it,
so we can drop the deleteSegment() method

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/AbstractStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/memory/MemoryStore.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/AbstractStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/AbstractStore.java?rev=1574627&r1=1574626&r2=1574627&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/AbstractStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/AbstractStore.java
Wed Mar  5 19:12:03 2014
@@ -137,22 +137,6 @@ public abstract class AbstractStore impl
     }
 
     @Override
-    public void deleteSegment(UUID segmentId) {
-        if (segments != null) {
-            synchronized (segments) {
-                while (currentlyLoading.contains(segmentId)) {
-                    try {
-                        segments.wait(); // for concurrent load to finish
-                    } catch (InterruptedException e) {
-                        throw new RuntimeException("Interrupted", e);
-                    }
-                }
-                segments.invalidate(segmentId);
-            }
-        }
-    }
-
-    @Override
     public void close() {
         if (segments != null) {
             synchronized (segments) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentStore.java?rev=1574627&r1=1574626&r2=1574627&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentStore.java
Wed Mar  5 19:12:03 2014
@@ -54,8 +54,6 @@ public interface SegmentStore {
      */
     void writeSegment(UUID segmentId, byte[] bytes, int offset, int length);
 
-    void deleteSegment(UUID segmentId);
-
     void close();
 
     /**

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java?rev=1574627&r1=1574626&r2=1574627&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java
Wed Mar  5 19:12:03 2014
@@ -322,12 +322,6 @@ public class FileStore extends AbstractS
     }
 
     @Override
-    public void deleteSegment(UUID segmentId) {
-        // TODO: implement
-        super.deleteSegment(segmentId);
-    }
-
-    @Override
     public Blob readBlob(String reference) {
         return new FileBlob(reference); // FIXME: proper reference lookup
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/memory/MemoryStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/memory/MemoryStore.java?rev=1574627&r1=1574626&r2=1574627&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/memory/MemoryStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/memory/MemoryStore.java
Wed Mar  5 19:12:03 2014
@@ -88,11 +88,4 @@ public class MemoryStore extends Abstrac
         }
     }
 
-    @Override
-    public void deleteSegment(UUID segmentId) {
-        if (segments.remove(segmentId) == null) {
-            throw new IllegalStateException("Missing segment: " + segmentId);
-        }
-    }
-
 }



Mime
View raw message