mapleFU commented on issue #37169:
URL: https://github.com/apache/arrow/issues/37169#issuecomment-1678458283
@kou
I've another question, does `Codec` gurantee it will not call `Compress`
parallel ? If not, maybe we can only use:
```c++
/// \brief One-shot decompression function
///
/// output_buffer_len must be correct and therefore be obtained in advance.
/// The actual decompressed length is returned.
///
/// \note One-shot decompression is not always compatible with streaming
/// compression. Depending on the codec (e.g. LZ4), different formats may
/// be used.
virtual Result<int64_t> Decompress(int64_t input_len, const uint8_t* input,
int64_t output_buffer_len,
uint8_t* output_buffer,
CompressionCtx*) = 0;
/// \brief One-shot compression function
///
/// output_buffer_len must first have been computed using
MaxCompressedLen().
/// The actual compressed length is returned.
///
/// \note One-shot compression is not always compatible with streaming
/// decompression. Depending on the codec (e.g. LZ4), different formats
may
/// be used.
virtual Result<int64_t> Compress(int64_t input_len, const uint8_t* input,
int64_t output_buffer_len, uint8_t*
output_buffer, DecompressionCtx*) = 0;
```
And if we can gurantee that `Compress` and `Decompress` will not in
parallel, We can put context in `Codec`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]