emkornfield commented on code in PR #13275:
URL: https://github.com/apache/arrow/pull/13275#discussion_r890888928
##########
cpp/src/parquet/thrift_internal.h:
##########
@@ -350,74 +351,84 @@ static inline format::EncryptionAlgorithm
ToThrift(EncryptionAlgorithm encryptio
using ThriftBuffer = apache::thrift::transport::TMemoryBuffer;
-// On Thrift 0.14.0+, we want to use TConfiguration to raise the max message
size
-// limit (ARROW-13655). If we wanted to protect against huge messages, we
could
-// do it ourselves since we know the message size up front.
+class ThriftDeserializer {
+ public:
+ explicit ThriftDeserializer(const ReaderProperties& properties)
+ : ThriftDeserializer(properties.thrift_string_size_limit(),
+ properties.thrift_container_size_limit()) {}
+
+ ThriftDeserializer(int32_t string_size_limit, int32_t container_size_limit)
+ : string_size_limit_(string_size_limit),
+ container_size_limit_(container_size_limit) {}
-inline std::shared_ptr<ThriftBuffer> CreateReadOnlyMemoryBuffer(uint8_t* buf,
- uint32_t len) {
+ // Deserialize a thrift message from buf/len. buf/len must at least contain
+ // all the bytes needed to store the thrift message. On return, len will be
+ // set to the actual length of the header.
+ template <class T>
+ void DeserializeMessage(const uint8_t* buf, uint32_t* len, T*
deserialized_msg,
+ const std::shared_ptr<Decryptor>& decryptor =
NULLPTR) {
Review Comment:
I see this is just moving around code.
--
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]