You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2014/12/01 17:04:02 UTC

[18/19] jena git commit: Armour ObjectFile contract and implementation.

Armour ObjectFile contract and implementation.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/1097c6f0
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/1097c6f0
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/1097c6f0

Branch: refs/heads/hadoop-rdf
Commit: 1097c6f0c3d4d701901a528ef9729b7f50948cfb
Parents: 9981875
Author: Andy Seaborne <an...@apache.org>
Authored: Sun Nov 30 21:02:37 2014 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Sun Nov 30 21:02:37 2014 +0000

----------------------------------------------------------------------
 .../java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java | 8 ++++++--
 .../hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java   | 5 ++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/1097c6f0/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java
index 4a48d8a..5d609ab 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFile.java
@@ -39,10 +39,14 @@ public interface ObjectFile extends Sync, Closeable
     /** A label to identify this ObjectFile */ 
     public String getLabel() ;
     
-    /** Allocate space for a write - pass this buffer to completeWrite */ 
+    /** Allocate space for a write - pass this buffer to completeWrite .
+     * The data to be written can be smaller than that requested but
+     * the data must be in position 0 -> limit.   
+     */
     public Block allocWrite(int bytesSpace) ;
     
-    /** Announce that a write is complete (buffer must come from allocWrite) */
+    /** Announce that a write is complete (buffer must come from allocWrite)
+     */  
     public void completeWrite(Block buffer) ;
 
     /** Decide not to perform the write */

http://git-wip-us.apache.org/repos/asf/jena/blob/1097c6f0/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java
index 73e60ee..13b77cf 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/objectfile/ObjectFileStorage.java
@@ -222,7 +222,10 @@ public class ObjectFileStorage implements ObjectFile
             rawWrite(buffer) ;
             return ;
         }
-        
+        // Write area is 0 -> limit
+        if ( 0 != buffer.position() )
+            log.warn("ObjectFleStorage: position != 0") ;
+        buffer.position(0) ;
         int actualLength = buffer.limit()-buffer.position() ;
         // Insert object length
         int idx = (int)(allocLocation-filesize) ;