You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2010/12/17 11:29:38 UTC

svn commit: r1050339 - in /lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta: FORIndexOutput.java PForDeltaIndexOutput.java

Author: mikemccand
Date: Fri Dec 17 10:29:37 2010
New Revision: 1050339

URL: http://svn.apache.org/viewvc?rev=1050339&view=rev
Log:
assert that FOR/PFOR always do int-aligned (0 mod 4) block writes

Modified:
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/FORIndexOutput.java
    lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/PForDeltaIndexOutput.java

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/FORIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/FORIndexOutput.java?rev=1050339&r1=1050338&r2=1050339&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/FORIndexOutput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/FORIndexOutput.java Fri Dec 17 10:29:37 2010
@@ -55,6 +55,8 @@ public class FORIndexOutput extends Fixe
 
   @Override
   protected void flushBlock() throws IOException {
+    // make sure output is always aligned to int
+    assert (out.getFilePointer() & 3) == 0;
     compressor.setUnCompressedData(buffer, 0, buffer.length);
     final int numFrameBits = compressor.frameBitsForCompression();
     compressor.compress();

Modified: lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/PForDeltaIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/PForDeltaIndexOutput.java?rev=1050339&r1=1050338&r2=1050339&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/PForDeltaIndexOutput.java (original)
+++ lucene/dev/branches/bulkpostings/lucene/src/java/org/apache/lucene/index/codecs/pfordelta/PForDeltaIndexOutput.java Fri Dec 17 10:29:37 2010
@@ -44,6 +44,8 @@ public class PForDeltaIndexOutput extend
 
   @Override
   protected void flushBlock() throws IOException {
+    // make sure output is always aligned to int
+    assert (out.getFilePointer() & 3) == 0;
     compressor.setUnCompressedData(buffer, 0, buffer.length);
     final int numFrameBits = compressor.frameBitsForCompression();
     compressor.compress();