This is an automated email from the ASF dual-hosted git repository.
ngupta pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/trunk by this push:
new e220c69ec7 Revert "OAK-10733 | Filter out hidden properties while
creating FlatFileStore (#1398)"
e220c69ec7 is described below
commit e220c69ec73f1cf8012d6f702a8eb1d386a4418e
Author: Nitin Gupta <[email protected]>
AuthorDate: Wed Apr 3 21:32:19 2024 +0530
Revert "OAK-10733 | Filter out hidden properties while creating
FlatFileStore (#1398)"
This reverts commit 2b27df56b9901fe107bcad6aed03c402234f590a.
---
.../flatfile/pipelined/NodeDocumentCodec.java | 7 +----
.../document/flatfile/pipelined/PipelinedIT.java | 36 +---------------------
2 files changed, 2 insertions(+), 41 deletions(-)
diff --git
a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/NodeDocumentCodec.java
b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/NodeDocumentCodec.java
index a8fe2d1ff2..c5a879327a 100644
---
a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/NodeDocumentCodec.java
+++
b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/NodeDocumentCodec.java
@@ -81,12 +81,7 @@ public class NodeDocumentCodec implements
Codec<NodeDocument> {
while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) {
String fieldName = reader.readName();
Object value = readValue(reader, fieldName);
- // 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.isEmpty() && fieldName.charAt(0) != ':') {
- nodeDocument.put(fieldName, value);
- }
+ nodeDocument.put(fieldName, value);
}
reader.readEndDocument();
nodeDocument.put(SIZE_FIELD, estimatedSizeOfCurrentObject);
diff --git
a/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/PipelinedIT.java
b/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/PipelinedIT.java
index cd41b10991..0c1ec406db 100644
---
a/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/PipelinedIT.java
+++
b/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/PipelinedIT.java
@@ -191,26 +191,6 @@ public class PipelinedIT {
), true);
}
- @Test
- public void createFFS_mongoFiltering_hidden_nodes_and_properties() throws
Exception {
- System.setProperty(OAK_INDEXER_PIPELINED_RETRY_ON_CONNECTION_ERRORS,
"false");
- System.setProperty(OAK_INDEXER_PIPELINED_MONGO_REGEX_PATH_FILTERING,
"true");
-
- Predicate<String> pathPredicate = s -> true;
- List<PathFilter> pathFilters = List.of(new
PathFilter(List.of("/content/dam/2023", "/content/dam/2024"),
List.of("/content/dam/2023/02")));
-
- testSuccessfulDownload(pathPredicate, pathFilters, List.of(
- "/|{}",
- "/content|{}",
- "/content/dam|{}",
- "/content/dam/2023|{\"p2\":\"v2023\"}",
- "/content/dam/2023/01|{\"p1\":\"v202301\"}",
- "/content/dam/2023/02|{}",
- "/content/dam/2024|{}",
- "/content/dam/2024/02|{\"p2\":\"v20240202\"}"
- ), true, true);
- }
-
@Test
public void createFFS_mongoFiltering_include_excludes2() throws Exception {
System.setProperty(OAK_INDEXER_PIPELINED_RETRY_ON_CONNECTION_ERRORS,
"false");
@@ -479,14 +459,9 @@ public class PipelinedIT {
}
private void testSuccessfulDownload(Predicate<String> pathPredicate,
List<PathFilter> pathFilters, List<String> expected, boolean ignoreLongPaths)
- throws IOException, CommitFailedException {
- testSuccessfulDownload(pathPredicate, pathFilters, expected,
ignoreLongPaths, false);
- }
-
- private void testSuccessfulDownload(Predicate<String> pathPredicate,
List<PathFilter> pathFilters, List<String> expected, boolean ignoreLongPaths,
boolean testHiddenNodesAndProps)
throws CommitFailedException, IOException {
Backend rwStore = createNodeStore(false);
- createContent(rwStore.documentNodeStore, testHiddenNodesAndProps);
+ createContent(rwStore.documentNodeStore);
Backend roStore = createNodeStore(true);
@@ -757,10 +732,6 @@ public class PipelinedIT {
}
private void createContent(NodeStore rwNodeStore) throws
CommitFailedException {
- createContent(rwNodeStore, false);
- }
-
- private void createContent(NodeStore rwNodeStore, boolean
addHiddenNodesAndProps) throws CommitFailedException {
@NotNull NodeBuilder rootBuilder = rwNodeStore.getRoot().builder();
@NotNull NodeBuilder contentDamBuilder =
rootBuilder.child("content").child("dam");
contentDamBuilder.child("1000").child("12").setProperty("p1",
"v100012");
@@ -778,11 +749,6 @@ public class PipelinedIT {
contentDamBuilder.child("2023").child("01").setProperty("p1",
"v202301");
contentDamBuilder.child("2023").child("02").child("28").setProperty("p1",
"v20230228");
- if (addHiddenNodesAndProps) {
- contentDamBuilder.child("2024").child(":01").setProperty("p1",
"v20240101");
- contentDamBuilder.child("2024").child("02").setProperty(":p1",
"v20240201").setProperty("p2", "v20240202");
- }
-
// Node with very long name
@NotNull NodeBuilder node = contentDamBuilder;
for (int i = 0; i < LONG_PATH_TEST_LEVELS; i++) {