jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1344750 - in /jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs: AbstractBlobStore.java DbBlobStore.java FileBlobStore.java
Date Thu, 31 May 2012 14:41:57 GMT
Author: thomasm
Date: Thu May 31 14:41:56 2012
New Revision: 1344750

URL: http://svn.apache.org/viewvc?rev=1344750&view=rev
Log:
OAK-123 Data store improvements

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/DbBlobStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/FileBlobStore.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=1344750&r1=1344749&r2=1344750&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 May 31 14:41:56 2012
@@ -392,6 +392,9 @@ public abstract class AbstractBlobStore 
             if (this == other) {
                 return true;
             }
+            if (other == null || !(other instanceof BlockId)) {
+                return false;
+            }
             BlockId o = (BlockId) other;
             return Arrays.equals(digest, o.digest) &&
                     pos == o.pos;

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/DbBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/DbBlobStore.java?rev=1344750&r1=1344749&r2=1344750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/DbBlobStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/DbBlobStore.java
Thu May 31 14:41:56 2012
@@ -43,6 +43,7 @@ public class DbBlobStore extends Abstrac
                 "(id varchar primary key, level int, lastMod bigint)");
         stat.execute("create table if not exists datastore_data" +
                 "(id varchar primary key, data binary)");
+        stat.close();
         conn.close();
     }
 
@@ -154,6 +155,7 @@ public class DbBlobStore extends Abstrac
             prep.setString(2, id);
             prep.setLong(3, minLastModified);
             prep.executeUpdate();
+            prep.close();
         } finally {
             conn.close();
         }
@@ -183,6 +185,8 @@ public class DbBlobStore extends Abstrac
                 prepData.execute();
                 count++;
             }
+            prepData.close();
+            prep.close();
         } finally {
             conn.close();
         }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/FileBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/FileBlobStore.java?rev=1344750&r1=1344749&r2=1344750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/FileBlobStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/blobs/FileBlobStore.java
Thu May 31 14:41:56 2012
@@ -40,6 +40,8 @@ public class FileBlobStore extends Abstr
     private final byte[] buffer = new byte[16 * 1024];
     private boolean mark;
 
+    // TODO file operations are not secure (return values not checked, no retry,...)
+
     public FileBlobStore(String dir) throws IOException {
         baseDir = new File(dir);
         baseDir.mkdirs();



Mime
View raw message