You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2013/01/24 22:55:55 UTC

svn commit: r1438216 - in /lucene/dev/branches/lucene4547/lucene/core/src: java/org/apache/lucene/util/ByteBlockPool.java test/org/apache/lucene/util/TestByteBlockPool.java

Author: rmuir
Date: Thu Jan 24 21:55:54 2013
New Revision: 1438216

URL: http://svn.apache.org/viewvc?rev=1438216&view=rev
Log:
nuke i/o from byteblockpool

Modified:
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java
    lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java

Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java?rev=1438216&r1=1438215&r2=1438216&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java (original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/ByteBlockPool.java Thu Jan 24 21:55:54 2013
@@ -16,12 +16,10 @@ package org.apache.lucene.util;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import java.io.IOException;
+
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.lucene.store.DataOutput;
-
 import static org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_OBJECT_REF;
 
 /** 
@@ -297,18 +295,6 @@ public final class ByteBlockPool {
     assert term.length >= 0;
     return term;
   }
-  /**
-   * Dereferences the byte block according to {@link BytesRef} offset. The offset 
-   * is interpreted as the absolute offset into the {@link ByteBlockPool}.
-   */
-  public final BytesRef deref(BytesRef bytes) {
-    final int offset = bytes.offset;
-    byte[] buffer = buffers[offset >> BYTE_BLOCK_SHIFT];
-    int pos = offset & BYTE_BLOCK_MASK;
-    bytes.bytes = buffer;
-    bytes.offset = pos;
-    return bytes;
-  }
   
   /**
    * Copies the given {@link BytesRef} at the current positions (
@@ -365,18 +351,5 @@ public final class ByteBlockPool {
     } while (true);
     return bytes;
   }
-  
-  /**
-   * Writes the pools content to the given {@link DataOutput}
-   */
-  public final void writePool(final DataOutput out) throws IOException {
-    int bytesOffset = byteOffset;
-    int block = 0;
-    while (bytesOffset > 0) {
-      out.writeBytes(buffers[block++], BYTE_BLOCK_SIZE);
-      bytesOffset -= BYTE_BLOCK_SIZE;
-    }
-    out.writeBytes(buffers[block], byteUpto);
-  }
 }
 

Modified: lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java?rev=1438216&r1=1438215&r2=1438216&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java (original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestByteBlockPool.java Thu Jan 24 21:55:54 2013
@@ -27,6 +27,7 @@ import org.apache.lucene.store.RAMDirect
  */
 public class TestByteBlockPool extends LuceneTestCase {
 
+  /* nocommit: test this in some other way than dumping out
   public void testCopyRefAndWrite() throws IOException {
     Counter bytesUsed = Counter.newCounter();
     ByteBlockPool pool = new ByteBlockPool(new ByteBlockPool.DirectTrackingAllocator(bytesUsed));
@@ -76,5 +77,5 @@ public class TestByteBlockPool extends L
       }
       dir.close();
     }
-  }
+  } */
 }