tolleybot commented on code in PR #34616:
URL: https://github.com/apache/arrow/pull/34616#discussion_r1141456434
##########
cpp/src/parquet/properties.h:
##########
@@ -57,624 +57,699 @@ constexpr int32_t kDefaultThriftStringSizeLimit = 100 *
1000 * 1000;
constexpr int32_t kDefaultThriftContainerSizeLimit = 1000 * 1000;
class PARQUET_EXPORT ReaderProperties {
- public:
- explicit ReaderProperties(MemoryPool* pool = ::arrow::default_memory_pool())
- : pool_(pool) {}
-
- MemoryPool* memory_pool() const { return pool_; }
-
- std::shared_ptr<ArrowInputStream> GetStream(std::shared_ptr<ArrowInputFile>
source,
- int64_t start, int64_t
num_bytes);
-
- /// Buffered stream reading allows the user to control the memory usage of
- /// parquet readers. This ensure that all `RandomAccessFile::ReadAt` calls
are
- /// wrapped in a buffered reader that uses a fix sized buffer (of size
- /// `buffer_size()`) instead of the full size of the ReadAt.
- ///
- /// The primary reason for this control knobs is for resource control and not
- /// performance.
- bool is_buffered_stream_enabled() const { return buffered_stream_enabled_; }
- /// Enable buffered stream reading.
- void enable_buffered_stream() { buffered_stream_enabled_ = true; }
- /// Disable buffered stream reading.
- void disable_buffered_stream() { buffered_stream_enabled_ = false; }
-
- /// Return the size of the buffered stream buffer.
- int64_t buffer_size() const { return buffer_size_; }
- /// Set the size of the buffered stream buffer in bytes.
- void set_buffer_size(int64_t size) { buffer_size_ = size; }
-
- /// \brief Return the size limit on thrift strings.
- ///
- /// This limit helps prevent space and time bombs in files, but may need to
- /// be increased in order to read files with especially large headers.
- int32_t thrift_string_size_limit() const { return thrift_string_size_limit_;
}
- /// Set the size limit on thrift strings.
- void set_thrift_string_size_limit(int32_t size) { thrift_string_size_limit_
= size; }
-
- /// \brief Return the size limit on thrift containers.
- ///
- /// This limit helps prevent space and time bombs in files, but may need to
- /// be increased in order to read files with especially large headers.
- int32_t thrift_container_size_limit() const { return
thrift_container_size_limit_; }
- /// Set the size limit on thrift containers.
- void set_thrift_container_size_limit(int32_t size) {
- thrift_container_size_limit_ = size;
- }
-
- /// Set the decryption properties.
- void file_decryption_properties(std::shared_ptr<FileDecryptionProperties>
decryption) {
- file_decryption_properties_ = std::move(decryption);
- }
- /// Return the decryption properties.
- const std::shared_ptr<FileDecryptionProperties>&
file_decryption_properties() const {
- return file_decryption_properties_;
- }
-
- bool page_checksum_verification() const { return
page_checksum_verification_; }
- void set_page_checksum_verification(bool check_crc) {
- page_checksum_verification_ = check_crc;
- }
-
- private:
- MemoryPool* pool_;
- int64_t buffer_size_ = kDefaultBufferSize;
- int32_t thrift_string_size_limit_ = kDefaultThriftStringSizeLimit;
- int32_t thrift_container_size_limit_ = kDefaultThriftContainerSizeLimit;
- bool buffered_stream_enabled_ = false;
- bool page_checksum_verification_ = false;
- std::shared_ptr<FileDecryptionProperties> file_decryption_properties_;
+ public:
Review Comment:
Sorry about that. I used the incorrect formatter through vscode.
--
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]