Re: [PR] OAK-10733 | Filter out hidden properties while creating FlatFileStore [jackrabbit-oak]

2024-04-03 Thread via GitHub


nit0906 merged PR #1398:
URL: https://github.com/apache/jackrabbit-oak/pull/1398


-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] OAK-10733 | Filter out hidden properties while creating FlatFileStore [jackrabbit-oak]

2024-04-03 Thread via GitHub


nit0906 commented on code in PR #1398:
URL: https://github.com/apache/jackrabbit-oak/pull/1398#discussion_r1549144950


##
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/NodeDocumentCodec.java:
##
@@ -81,7 +81,12 @@ public NodeDocument decode(BsonReader reader, DecoderContext 
decoderContext) {
 while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
 String fieldName = reader.readName();
 Object value = readValue(reader, fieldName);
-nodeDocument.put(fieldName, value);
+// Ignore hidden properties (property name starting with :)
+// Hidden properties are not indexed and also ignored during async 
index updates.
+// So it's safe to ignore them while building the FlatFileStore as 
well.
+if (fieldName.charAt(0) != ':') {

Review Comment:
   makes sense.



-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] OAK-10733 | Filter out hidden properties while creating FlatFileStore [jackrabbit-oak]

2024-04-03 Thread via GitHub


nfsantos commented on code in PR #1398:
URL: https://github.com/apache/jackrabbit-oak/pull/1398#discussion_r1548987562


##
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/NodeDocumentCodec.java:
##
@@ -81,7 +81,12 @@ public NodeDocument decode(BsonReader reader, DecoderContext 
decoderContext) {
 while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
 String fieldName = reader.readName();
 Object value = readValue(reader, fieldName);
-nodeDocument.put(fieldName, value);
+// Ignore hidden properties (property name starting with :)
+// Hidden properties are not indexed and also ignored during async 
index updates.
+// So it's safe to ignore them while building the FlatFileStore as 
well.
+if (fieldName.charAt(0) != ':') {

Review Comment:
   I wonder if `fieldName` can ever be empty? The docs of `readName()` do not 
exclude this possibility. If it is empty, this would fail with an exception and 
the whole download would fail. I suggest to add a check for empty, just to be 
sure we are not surprised by empty names. 



-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] OAK-10733 | Filter out hidden properties while creating FlatFileStore [jackrabbit-oak]

2024-04-03 Thread via GitHub


nfsantos commented on code in PR #1398:
URL: https://github.com/apache/jackrabbit-oak/pull/1398#discussion_r1548987562


##
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/NodeDocumentCodec.java:
##
@@ -81,7 +81,12 @@ public NodeDocument decode(BsonReader reader, DecoderContext 
decoderContext) {
 while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
 String fieldName = reader.readName();
 Object value = readValue(reader, fieldName);
-nodeDocument.put(fieldName, value);
+// Ignore hidden properties (property name starting with :)
+// Hidden properties are not indexed and also ignored during async 
index updates.
+// So it's safe to ignore them while building the FlatFileStore as 
well.
+if (fieldName.charAt(0) != ':') {

Review Comment:
   I wonder if `fieldName` can ever be empty? The docs of `readName()` do not 
exclude this possibility. If it is empty, this would fail with an exception and 
the whole download would fail. I suggest to had a check for empty, just to be 
sure we are not surprised by empty names. 



-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] OAK-10733 | Filter out hidden properties while creating FlatFileStore [jackrabbit-oak]

2024-04-02 Thread via GitHub


nit0906 opened a new pull request, #1398:
URL: https://github.com/apache/jackrabbit-oak/pull/1398

   (no comment)


-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org