lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r408916 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/store/RAMInputStream.java src/java/org/apache/lucene/store/RAMOutputStream.java
Date Tue, 23 May 2006 15:01:11 GMT
Author: yonik
Date: Tue May 23 08:01:11 2006
New Revision: 408916

URL: http://svn.apache.org/viewvc?rev=408916&view=rev
Log:
remove 2GB file limitation from RAMIndexInput and RAMIndexOutput: LUCENE-546

Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java
    lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=408916&r1=408915&r2=408916&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue May 23 08:01:11 2006
@@ -70,9 +70,9 @@
     ConstantScoreQuery in order to allow their use with a MultiSearcher.
     (Yonik Seeley)
 
-15. LUCENE-546: Creating a RAMDirectory from a Directory truncated files over 2GB.
-    (Peter Royal via Yonik Seeley)
-    
+15. LUCENE-546: Removed 2GB file size limitations for RAMDirectory.
+    (Peter Royal, Michael Chan, Yonik Seeley)
+
 1.9.1
 
 Bug fixes

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java?rev=408916&r1=408915&r2=408916&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/RAMInputStream.java Tue May 23 08:01:11
2006
@@ -24,7 +24,7 @@
 
 class RAMInputStream extends BufferedIndexInput implements Cloneable {
   private RAMFile file;
-  private int pointer = 0;
+  private long pointer = 0;
   private long length;
 
   public RAMInputStream(RAMFile f) {
@@ -34,10 +34,10 @@
 
   public void readInternal(byte[] dest, int destOffset, int len) {
     int remainder = len;
-    int start = pointer;
+    long start = pointer;
     while (remainder != 0) {
-      int bufferNumber = start/BUFFER_SIZE;
-      int bufferOffset = start%BUFFER_SIZE;
+      int bufferNumber = (int)(start/BUFFER_SIZE);
+      int bufferOffset = (int)(start%BUFFER_SIZE);
       int bytesInBuffer = BUFFER_SIZE - bufferOffset;
       int bytesToCopy = bytesInBuffer >= remainder ? remainder : bytesInBuffer;
       byte[] buffer = (byte[])file.buffers.elementAt(bufferNumber);
@@ -53,7 +53,7 @@
   }
 
   public void seekInternal(long pos) {
-    pointer = (int)pos;
+    pointer = pos;
   }
 
   public long length() {

Modified: lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java?rev=408916&r1=408915&r2=408916&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/store/RAMOutputStream.java Tue May 23 08:01:11
2006
@@ -26,7 +26,7 @@
 
 public class RAMOutputStream extends BufferedIndexOutput {
   private RAMFile file;
-  private int pointer = 0;
+  private long pointer = 0;
 
   /** Construct an empty output buffer. */
   public RAMOutputStream() {
@@ -69,8 +69,8 @@
     byte[] buffer;
     int bufferPos = 0;
     while (bufferPos != len) {
-      int bufferNumber = pointer/BUFFER_SIZE;
-      int bufferOffset = pointer%BUFFER_SIZE;
+      int bufferNumber = (int)(pointer/BUFFER_SIZE);
+      int bufferOffset = (int)(pointer%BUFFER_SIZE);
       int bytesInBuffer = BUFFER_SIZE - bufferOffset;
       int remainInSrcBuffer = len - bufferPos;
       int bytesToCopy = bytesInBuffer >= remainInSrcBuffer ? remainInSrcBuffer : bytesInBuffer;
@@ -99,7 +99,7 @@
 
   public void seek(long pos) throws IOException {
     super.seek(pos);
-    pointer = (int)pos;
+    pointer = pos;
   }
   public long length() {
     return file.length;



Mime
View raw message