ionutzpi commented on code in PR #1473:
URL: https://github.com/apache/jackrabbit-oak/pull/1473#discussion_r1618376527
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java:
##########
@@ -116,7 +155,20 @@ public int count() {
*/
@NotNull
String getValue() {
- return value;
+ return value != null ? value : decompress(this.compressedValue);
+ }
+
+ private String decompress(byte[] value) {
+ try {
+ return new String(compression.getInputStream(new
ByteArrayInputStream(value)).readAllBytes());
+ } catch (IOException e) {
+ LOG.error("Failed to decompress property {} value: ", getName(),
e);
+ return "\"{}\"";
+ }
+ }
+
+ public byte[] getCompressedValue() {
Review Comment:
Done point 2. For 1. I wouldn't add changes in compression interface, only
if indeed required.
##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyStateTest.java:
##########
@@ -16,14 +16,17 @@
*/
package org.apache.jackrabbit.oak.plugins.document;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
Review Comment:
Done
--
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]