Skip to content

Conversation

@BryanCutler
Copy link
Member

This changes the 8-byte EOS for non-legacy stream format to use {0xFFFFFFFF, 0x00000000} instead of all zeros. When using all zeros, the reader will not know to read the last 4-bytes, but with the 4-byte continuation token, all bytes written to a channel can be read.

out.writeIntLittleEndian(0);
} else {
out.writeLongLittleEndian(0);
public static void writeEndOfStream(WriteChannel out, IpcOption option) throws IOException {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BryanCutler
Copy link
Member Author

cc @emkornfield @tianchen92

@BryanCutler BryanCutler changed the title ARROW-6519: [Java] Use IPC continuation token to write 8-byte EOS ARROW-6519: [Java] Use IPC continuation prefix plus zero for 8-byte EOS Sep 10, 2019
@BryanCutler BryanCutler changed the title ARROW-6519: [Java] Use IPC continuation prefix plus zero for 8-byte EOS ARROW-6519: [Java] Use IPC continuation prefix as part of 8-byte EOS Sep 10, 2019
out.writeLongLittleEndian(0);
public static void writeEndOfStream(WriteChannel out, IpcOption option) throws IOException {
if (!option.write_legacy_ipc_format) {
out.writeIntLittleEndian(MessageSerializer.IPC_CONTINUATION_TOKEN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also apply this change to ArrowFileWriter#endInternal and probably remove MessageSerializer#writeLongLitterEndian since it’s no use anymore?

Copy link
Member Author

@BryanCutler BryanCutler Sep 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, I forgot that also writes EOS. done.

Copy link
Contributor

@tianchen92 tianchen92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @BryanCutler

@wesm
Copy link
Member

wesm commented Sep 11, 2019

Merging this. https://github.com/apache/arrow/tree/ARROW-6313-flatbuffer-alignment has a rebase conflict on apache/master, I'm going to try to fix

@wesm wesm force-pushed the ARROW-6313-flatbuffer-alignment branch from 4f9b887 to 0352456 Compare September 11, 2019 22:07
Write IPC continuation token to file format EOS
@wesm wesm force-pushed the java-ipc-cont-for-EOS-ARROW-6519 branch from edce1cd to 8fb38a0 Compare September 11, 2019 22:08
wesm pushed a commit that referenced this pull request Sep 11, 2019
This changes the 8-byte EOS for non-legacy stream format to use {0xFFFFFFFF, 0x00000000} instead of all zeros. When using all zeros, the reader will not know to read the last 4-bytes, but with the 4-byte continuation token, all bytes written to a channel can be read.

Closes #5345 from BryanCutler/java-ipc-cont-for-EOS-ARROW-6519 and squashes the following commits:

8fb38a0 <Bryan Cutler> Use IPC continuation token to write 8-byte EOS

Authored-by: Bryan Cutler <cutlerb@gmail.com>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
@wesm wesm closed this Sep 11, 2019
@BryanCutler BryanCutler deleted the java-ipc-cont-for-EOS-ARROW-6519 branch September 12, 2019 05:45
@BryanCutler
Copy link
Member Author

BryanCutler commented Sep 12, 2019

Thanks @wesm and @tianchen92 !

wesm pushed a commit that referenced this pull request Sep 13, 2019
This changes the 8-byte EOS for non-legacy stream format to use {0xFFFFFFFF, 0x00000000} instead of all zeros. When using all zeros, the reader will not know to read the last 4-bytes, but with the 4-byte continuation token, all bytes written to a channel can be read.

Closes #5345 from BryanCutler/java-ipc-cont-for-EOS-ARROW-6519 and squashes the following commits:

8fb38a0 <Bryan Cutler> Use IPC continuation token to write 8-byte EOS

Authored-by: Bryan Cutler <cutlerb@gmail.com>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
pprudhvi pushed a commit to pprudhvi/arrow that referenced this pull request Sep 16, 2019
This changes the 8-byte EOS for non-legacy stream format to use {0xFFFFFFFF, 0x00000000} instead of all zeros. When using all zeros, the reader will not know to read the last 4-bytes, but with the 4-byte continuation token, all bytes written to a channel can be read.

Closes apache#5345 from BryanCutler/java-ipc-cont-for-EOS-ARROW-6519 and squashes the following commits:

8fb38a0 <Bryan Cutler> Use IPC continuation token to write 8-byte EOS

Authored-by: Bryan Cutler <cutlerb@gmail.com>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
This changes the 8-byte EOS for non-legacy stream format to use {0xFFFFFFFF, 0x00000000} instead of all zeros. When using all zeros, the reader will not know to read the last 4-bytes, but with the 4-byte continuation token, all bytes written to a channel can be read.

Closes apache#5345 from BryanCutler/java-ipc-cont-for-EOS-ARROW-6519 and squashes the following commits:

8fb38a0 <Bryan Cutler> Use IPC continuation token to write 8-byte EOS

Authored-by: Bryan Cutler <cutlerb@gmail.com>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants