[
https://issues.apache.org/jira/browse/FLINK-14845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16978325#comment-16978325
]
Piotr Nowojski edited comment on FLINK-14845 at 11/20/19 11:37 AM:
-------------------------------------------------------------------
Re, [~lzljs3620320]: doesn't Blink work on batches of records? Couldn't the
(columnar?) compression be performed there? Either via some mapping operator or
on record serialisation/deserialisation layer?
[~kevin.cyj], thanks for pointing this out. I missed that
{{ResultSubpartitionView#getNextBuffer}} happens too late for
{{BoundedBlockingSubpartition}} - after the data have already been written to
disks. In that case I can see three options:
# Above mentioned idea of compressing during record serialisation/mapping
operator
# let the compression happen somewhere in
{{BoundedBlockingSubpartition#writeAndCloseBufferConsumer}}
# use some streaming/continuous compression algorithm, that would allow for
the compressed stream of bytes to be chopped off (and decompressed) at any
point of time
# let the compression happen inside {{BufferConsumer#build}}?
1. No changes to the {{flink-runtime}}, to re-use user would have to wrap his
record serializer into a compressing serializer? Could support columnar
compression for batches of records?
2. Would work just for {{BoundedBlockingSubpartition}}
3. Maybe a bit more complicated, but works for both pipelined and bounded
sub-partitions and also solves the problem of frequent flushing with few
records handled in between?
4. ?
was (Author: pnowojski):
Re, [~lzljs3620320]: doesn't Blink work on batches of records? Couldn't the
(columnar?) compression be performed there? Either via some mapping operator or
on record serialisation/deserialisation layer?
[~kevin.cyj], thanks for pointing this out. I missed that
{{ResultSubpartitionView#getNextBuffer}} happens too late for
{{BoundedBlockingSubpartition}} - after the data have already been written to
disks. In that case I can see three options:
# let the compression happen somewhere in
{{BoundedBlockingSubpartition#writeAndCloseBufferConsumer}}
# use some streaming/continuous compression algorithm, that would allow for the
compressed stream of bytes to be chopped off (and decompressed) at any point of
time
# let the compression happen inside {{BufferConsumer#build}}?
1. Would work just for {{BoundedBlockingSubpartition}}
2. Maybe a bit more complicated, but works for both pipelined and bounded
sub-partitions and also solves the problem of frequent flushing with few
records handled in between?
3. ?
> Introduce data compression to blocking shuffle.
> -----------------------------------------------
>
> Key: FLINK-14845
> URL: https://issues.apache.org/jira/browse/FLINK-14845
> Project: Flink
> Issue Type: Sub-task
> Components: Runtime / Network
> Reporter: Yingjie Cao
> Assignee: Yingjie Cao
> Priority: Major
>
> Currently, blocking shuffle writer writes raw output data to disk without
> compression. For IO bounded scenario, this can be optimized by compressing
> the output data. It is better to introduce a compression mechanism and offer
> users a config option to let the user decide whether to compress the shuffle
> data. Actually, we hava implemented compression in our inner Flink version
> and here are some key points:
> 1. Where to compress/decompress?
> Compressing at upstream and decompressing at downstream.
> 2. Which thread do compress/decompress?
> Task threads do compress/decompress.
> 3. Data compression granularity.
> Per buffer.
> 4. How to handle that when data size become even bigger after compression?
> Give up compression in this case and introduce an extra flag to identify if
> the data was compressed, that is, the output may be a mixture of compressed
> and uncompressed data.
>
> We'd like to introduce blocking shuffle data compression to Flink if there
> are interests.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)