You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/10/02 19:14:08 UTC

[GitHub] [lucene] rmuir opened a new pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

rmuir opened a new pull request #348:
URL: https://github.com/apache/lucene/pull/348


   Make the following methods abstract:
   * DataInput.readShort
   * DataInput.readInt
   * DataInput.readLong
   * DataOutput.writeShort
   * DataOutput.writeInt
   * DataOutput.writeLong
   
   In javadocs of each, reference both the relevant BitUtil VH constant,
   and a protected slow fallback implementation (e.g. readShortSlowly).
   Slow implementations document that they read/write bytes one-at-a-time
   
   Not all subclasses were fixed to be fast: some have TODOs.
   
   I only fixed subclasses to be fast if it was completely 100% obvious to me. There are a lot of TODOs, feel free to push stuff to my branch (as long as tests pass!)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir closed pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir closed pull request #348:
URL: https://github.com/apache/lucene/pull/348


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r720800554



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.java
##########
@@ -319,6 +320,27 @@ public void readBytes(byte[] b, int offset, int len) {
       pos += len;
     }
 
+    @Override
+    public short readShort() throws IOException {
+      short value = (short) BitUtil.VH_LE_SHORT.get(pos);
+      pos += Short.BYTES;
+      return value;
+    }
+
+    @Override
+    public int readInt() throws IOException {
+      int value = (int) BitUtil.VH_LE_INT.get(pos);
+      pos += Integer.BYTES;
+      return value;
+    }
+
+    @Override
+    public long readLong() throws IOException {

Review comment:
       I agree in theory, however there is no such consistency in practice. mmapdirectory (and probably others) behaves the way you describe already, just as a side effect of how bytebuffers work. 
   
   the existing readBytes() method in this same file behaves this way too.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir commented on pull request #348:
URL: https://github.com/apache/lucene/pull/348#issuecomment-933349094


   if you want tweaks, please, just push commits to my branch. I don't really have time to tackle all the crazy shit ppl want done here, especially during the week. I tried to defer a lot of it as TODOs, that didn't seem to go over well either. But we really should be able to make progress on issues like this without changing thousands of lines of code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r721096375



##########
File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
##########
@@ -103,6 +103,24 @@ public byte readByte() throws EOFException {
     }
   }
 
+  @Override
+  public short readShort() throws IOException {
+    // TODO: use ByteBuffer.getShort

Review comment:
       I was referring to the TODO - the slow method has an explicit byte order; when you switch to ByteBuffer.getShort it'd be safer to ensure the byte order is what we expect it to be?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r720801428



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.java
##########
@@ -319,6 +320,27 @@ public void readBytes(byte[] b, int offset, int len) {
       pos += len;
     }
 
+    @Override
+    public short readShort() throws IOException {
+      short value = (short) BitUtil.VH_LE_SHORT.get(pos);
+      pos += Short.BYTES;
+      return value;
+    }
+
+    @Override
+    public int readInt() throws IOException {
+      int value = (int) BitUtil.VH_LE_INT.get(pos);
+      pos += Integer.BYTES;
+      return value;
+    }
+
+    @Override
+    public long readLong() throws IOException {

Review comment:
       I don't want to make this code complicated over this issue. I think it is crazy to even attempt at a "rule" here. Due to the way it is encoded, methods such as readVInt() can't even adhere to it anyway.
   
   If there are insufficient bytes, you have index corruption. we don't need to guarantee a damn thing. let's keep code simple.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r721231734



##########
File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
##########
@@ -103,6 +103,24 @@ public byte readByte() throws EOFException {
     }
   }
 
+  @Override
+  public short readShort() throws IOException {
+    // TODO: use ByteBuffer.getShort

Review comment:
       i don't understand why i should make a code change to add a TODO. I think it is perfectly reasonable to simply add a TODO and not touch the code.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] jpountz commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
jpountz commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r720719926



##########
File path: lucene/core/src/java/org/apache/lucene/store/InputStreamDataInput.java
##########
@@ -33,6 +33,21 @@ public byte readByte() throws IOException {
     return (byte) v;
   }
 
+  @Override
+  public short readShort() throws IOException {
+    return readShortSlowly();
+  }
+
+  @Override
+  public int readInt() throws IOException {
+    return readIntSlowly();
+  }
+
+  @Override
+  public long readLong() throws IOException {
+    return readLongSlowly();
+  }

Review comment:
       it looks like this class is often instantiated on a buffered input stream, could we read directly from the buffer?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #348:
URL: https://github.com/apache/lucene/pull/348#issuecomment-933658907


   Hi Robert, all fine. I fully agree if we change this, we should do it only in API.
   
   What I mentioned here were just suggestions (brainstorming).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #348:
URL: https://github.com/apache/lucene/pull/348#issuecomment-933285775


   Hi,
   I am a bit busy and was not yet able to review. I have some comments so please wait with merging...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
uschindler commented on pull request #348:
URL: https://github.com/apache/lucene/pull/348#issuecomment-934132019


   I opened #352 to fix the original issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r720791546



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.java
##########
@@ -319,6 +320,27 @@ public void readBytes(byte[] b, int offset, int len) {
       pos += len;
     }
 
+    @Override
+    public short readShort() throws IOException {
+      short value = (short) BitUtil.VH_LE_SHORT.get(pos);
+      pos += Short.BYTES;
+      return value;
+    }
+
+    @Override
+    public int readInt() throws IOException {
+      int value = (int) BitUtil.VH_LE_INT.get(pos);
+      pos += Integer.BYTES;
+      return value;
+    }
+
+    @Override
+    public long readLong() throws IOException {

Review comment:
       I would copy the code I used in ByteArrayDataInput. Then it's consistent.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r720782981



##########
File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
##########
@@ -103,6 +103,24 @@ public byte readByte() throws EOFException {
     }
   }
 
+  @Override
+  public short readShort() throws IOException {
+    // TODO: use ByteBuffer.getShort

Review comment:
       + add an assertion somewhere ensuring proper byte order on all blocks?

##########
File path: lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.java
##########
@@ -319,6 +320,27 @@ public void readBytes(byte[] b, int offset, int len) {
       pos += len;
     }
 
+    @Override
+    public short readShort() throws IOException {
+      short value = (short) BitUtil.VH_LE_SHORT.get(pos);
+      pos += Short.BYTES;
+      return value;
+    }
+
+    @Override
+    public int readInt() throws IOException {
+      int value = (int) BitUtil.VH_LE_INT.get(pos);
+      pos += Integer.BYTES;
+      return value;
+    }
+
+    @Override
+    public long readLong() throws IOException {

Review comment:
       All multibyte-reading implementations with position increment after the read suffer from the same subtle issue: imagine you're at file length-3 bytes offset and trying to read an int: readInt() would fail but a subsequent readByte() or readShort() would succeed. I'm not sure if we need to make it a contract that the bytes are always consumed by readXYZ but if we don't then it'd be good to document this somewhere (even as an "unspecified behavior on insufficient bytes").




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r721097179



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/MultiLevelSkipListReader.java
##########
@@ -319,6 +320,27 @@ public void readBytes(byte[] b, int offset, int len) {
       pos += len;
     }
 
+    @Override
+    public short readShort() throws IOException {
+      short value = (short) BitUtil.VH_LE_SHORT.get(pos);
+      pos += Short.BYTES;
+      return value;
+    }
+
+    @Override
+    public int readInt() throws IOException {
+      int value = (int) BitUtil.VH_LE_INT.get(pos);
+      pos += Integer.BYTES;
+      return value;
+    }
+
+    @Override
+    public long readLong() throws IOException {

Review comment:
       >  I think it is crazy to even attempt at a "rule" here.
   
   Fair enough. I think it'd be good to state it explicitly somehow in the javadoc. I'll do it as a follow-up.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r721174730



##########
File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
##########
@@ -103,6 +103,24 @@ public byte readByte() throws EOFException {
     }
   }
 
+  @Override
+  public short readShort() throws IOException {
+    // TODO: use ByteBuffer.getShort

Review comment:
       In general we should also clarify the DataInput/DataOutput APIs to explicitely document how each methods needs to behave. The read/writeInt/Long/Short should mention that byte order is little endian in 9.0. That's missing in the specs and leads to confusion for people who implement their own DataInput/DataOutput (custom directories). Now that it is required to implement the method (as it is abstract), it should specify how it should behave.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r721235121



##########
File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
##########
@@ -103,6 +103,24 @@ public byte readByte() throws EOFException {
     }
   }
 
+  @Override
+  public short readShort() throws IOException {
+    // TODO: use ByteBuffer.getShort

Review comment:
       does it make sense: when i add a TODO in this PR: means, "i don't have the time/resources to fuck with this class", maybe because i don't understand it, maybe because its complicated, etc. That also applies to sprinkling asserts in the code as well as changing logic that isn't asserts.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir commented on pull request #348:
URL: https://github.com/apache/lucene/pull/348#issuecomment-933351956


   I closed this PR as I feel the way folks want to approach it is too risky and will cause bugs. 
   
   This kind of thing needs to be done *incrementally* to reduce risk.
   
   I don't have the cycles to argue about it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r720871395



##########
File path: lucene/core/src/java/org/apache/lucene/store/InputStreamDataInput.java
##########
@@ -33,6 +33,21 @@ public byte readByte() throws IOException {
     return (byte) v;
   }
 
+  @Override
+  public short readShort() throws IOException {
+    return readShortSlowly();
+  }
+
+  @Override
+  public int readInt() throws IOException {
+    return readIntSlowly();
+  }
+
+  @Override
+  public long readLong() throws IOException {
+    return readLongSlowly();
+  }

Review comment:
       maybe. personally i don't plan on doing the work though. i don't see anything important using this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
rmuir commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r720802169



##########
File path: lucene/core/src/java/org/apache/lucene/store/ByteBuffersDataInput.java
##########
@@ -103,6 +103,24 @@ public byte readByte() throws EOFException {
     }
   }
 
+  @Override
+  public short readShort() throws IOException {
+    // TODO: use ByteBuffer.getShort

Review comment:
       I don't know what you mean here. i didnt change anything about the behavior of this file. it is invoking the same slow code it was before...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on a change in pull request #348: LUCENE-10143: Make DataInput/Output short/int/long reads and writes abstract

Posted by GitBox <gi...@apache.org>.
uschindler commented on a change in pull request #348:
URL: https://github.com/apache/lucene/pull/348#discussion_r721173204



##########
File path: lucene/core/src/java/org/apache/lucene/store/InputStreamDataInput.java
##########
@@ -33,6 +33,21 @@ public byte readByte() throws IOException {
     return (byte) v;
   }
 
+  @Override
+  public short readShort() throws IOException {
+    return readShortSlowly();
+  }
+
+  @Override
+  public int readInt() throws IOException {
+    return readIntSlowly();
+  }
+
+  @Override
+  public long readLong() throws IOException {
+    return readLongSlowly();
+  }

Review comment:
       That is more or less the same like OutputStreamIndexOutput, so theoretically we could use the same trick. But I am not sure if this is important here.
   Unless there's a slowdown I wont do something like this. This would also require to remove the BufferedOutputStream from the caller's code to prevent double buffering (if the bufferring is implicitly added).
   This is a separte issue (if required).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org