Commit 44a6a56
committed
GH-3493: Deprecate LittleEndianDataInputStream and migrate last test usage
After GH-3493 replaced the only production usage of LittleEndianDataInputStream
in PlainValuesReader with direct ByteBuffer reads, the class has no remaining
production callers. Mark it @deprecated and document the faster alternative.
Migrate the only remaining usage in TestColumnChunkPageWriteStore.intValue()
to ByteBuffer.getInt() with LITTLE_ENDIAN order, reading directly from
BytesInput.toByteBuffer() instead of round-tripping through a
ByteArrayOutputStream + ByteArrayInputStream + LittleEndianDataInputStream.
Per-call readInt() on the deprecated class performs 4 virtual in.read()
dispatches and manually reassembles the value with bit shifts. The
ByteBuffer.getInt() replacement is a HotSpot intrinsic that compiles to a
single unaligned load on x86/ARM.
The class is left in place (only @deprecated) for source/binary compatibility
of any downstream code that may still reference it. It can be removed in a
future major release.
All 308 parquet-common, 573 parquet-column, and TestColumnChunkPageWriteStore
column-order tests pass. (The two pre-existing JDK Hadoop getSubject failures
in TestColumnChunkPageWriteStore are unrelated to this change.)1 parent 36b508d commit 44a6a56
2 files changed
Lines changed: 17 additions & 10 deletions
File tree
- parquet-common/src/main/java/org/apache/parquet/bytes
- parquet-hadoop/src/test/java/org/apache/parquet/hadoop
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
27 | 40 | | |
| 41 | + | |
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
| |||
Lines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | 41 | | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
| |||
249 | 247 | | |
250 | 248 | | |
251 | 249 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 250 | + | |
258 | 251 | | |
259 | 252 | | |
260 | 253 | | |
| |||
0 commit comments