jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1368542 - in /jackrabbit/oak/trunk/oak-mk/src: main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java main/java/org/apache/jackrabbit/mk/blobs/BlobStore.java test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java
Date Thu, 02 Aug 2012 15:32:28 GMT
Author: thomasm
Date: Thu Aug  2 15:32:28 2012
New Revision: 1368542

URL: http://svn.apache.org/viewvc?rev=1368542&view=rev
Log:
OAK-209 BlobStore: remove BlobStore.close() and writeBlob(String tempFilePath) as they don't
seem to be needed currently

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/BlobStore.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java?rev=1368542&r1=1368541&r2=1368542&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStore.java
Thu Aug  2 15:32:28 2012
@@ -22,7 +22,6 @@ import org.apache.jackrabbit.mk.util.Str
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -63,7 +62,7 @@ import java.util.WeakHashMap;
  * long), size of data store id (variable size long), hash code length (variable
  * size int), hash code.
  */
-public abstract class AbstractBlobStore implements Closeable, BlobStore, Cache.Backend<AbstractBlobStore.BlockId,
AbstractBlobStore.Data> {
+public abstract class AbstractBlobStore implements BlobStore, Cache.Backend<AbstractBlobStore.BlockId,
AbstractBlobStore.Data> {
 
     protected static final String HASH_ALGORITHM = "SHA-256";
 
@@ -116,6 +115,14 @@ public abstract class AbstractBlobStore 
         return blockSize;
     }
 
+    /**
+     * Write a blob from a temporary file. The temporary file is removed
+     * afterwards. A file based blob stores might simply rename the file, so
+     * that no additional writes are necessary.
+     *
+     * @param tempFilePath the temporary file
+     * @return the blob id
+     */
     public String writeBlob(String tempFilePath) throws Exception {
         File file = new File(tempFilePath);
         InputStream in = null;
@@ -380,10 +387,6 @@ public abstract class AbstractBlobStore 
         }
     }
 
-    public void close() {
-        // ignore
-    }
-
     /**
      * A block id. Blocks are small enough to fit in memory, so they can be
      * cached.

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/BlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/BlobStore.java?rev=1368542&r1=1368541&r2=1368542&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/BlobStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/BlobStore.java
Thu Aug  2 15:32:28 2012
@@ -24,16 +24,6 @@ import java.io.InputStream;
 public interface BlobStore {
 
     /**
-     * Write a blob from a temporary file. The temporary file is removed
-     * afterwards. A file based blob stores might simply rename the file, so
-     * that no additional writes are necessary.
-     *
-     * @param tempFilePath the temporary file
-     * @return the blob id
-     */
-    String writeBlob(String tempFilePath) throws Exception;
-
-    /**
      * Write a blob from an input stream.
      * This method closes the input stream.
      *
@@ -62,11 +52,4 @@ public interface BlobStore {
      */
     long getBlobLength(String blobId) throws Exception;
 
-    /**
-     * Close all internally used resources, such as file handles. This method
-     * should be called at the end of the components lifecycle. After calling
-     * this method, the blob store should no longer be used.
-     */
-    void close();
-
 }

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java?rev=1368542&r1=1368541&r2=1368542&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/blobs/AbstractBlobStoreTest.java
Thu Aug  2 15:32:28 2012
@@ -47,10 +47,10 @@ public abstract class AbstractBlobStoreT
     public abstract void setUp() throws Exception;
 
     public void tearDown() throws Exception {
-        store.close();
+        store = null;
     }
 
-    public void testAddFile() throws Exception {
+    public void testWriteFile() throws Exception {
         store.setBlockSize(1024 * 1024);
         byte[] data = new byte[4 * 1024 * 1024];
         Random r = new Random(0);
@@ -274,7 +274,6 @@ public abstract class AbstractBlobStoreT
         String id = addFiles(store, "~/temp/ds");
         extractFiles(store, id, "target/test");
 
-        store.close();
     }
 
     public static void extractFiles(AbstractBlobStore store, String listingId, String target)
throws IOException {



Mime
View raw message