DomGarguilo commented on code in PR #4486:
URL: https://github.com/apache/accumulo/pull/4486#discussion_r1580007005
##########
server/base/src/main/java/org/apache/accumulo/server/metadata/iterators/SetEqualityIterator.java:
##########
@@ -45,16 +47,22 @@
/**
* This iterator exists to enable checking for set equality in a conditional
mutation. It allows
- * comparing a set in a client process to a set encoded in column qualifiers
within a tablet.
+ * comparing a set in a client process to a set encoded in column qualifiers
within a tablet. If the
+ * "concat.value" options is supplied and is true, then the bytes from the
Value will be added with
+ * a null byte separator.
Review Comment:
Could do something like the following. This better allows for addition of
more opts in the future and separates them from the description.
```suggestion
* comparing a set in a client process to a set encoded in column qualifiers
within a tablet.
*
* <h3>Options</h3>
* <ul>
* <li><b>concat.value:</b> If this option is supplied and is true, then the
bytes from the Value
* will be concatenated with a null byte separator.</li>
* </ul>
```
##########
server/base/src/test/java/org/apache/accumulo/server/SetEqualityIteratorTest.java:
##########
@@ -150,8 +154,11 @@ public void testTabletWithOneFile() throws IOException {
// Asserting the result
assertEquals(new Key(tabletRow, family),
setEqualityIteratorOneFile.getTopKey());
// The iterator should produce a value that is equal to the expected value
on the condition
- var condition =
SetEqualityIterator.createCondition(Collections.singleton(file1),
- storedTabletFile -> storedTabletFile.getMetadata().getBytes(UTF_8),
family);
+ var condition =
+
SetEqualityIterator.createCondition(tmOneFile.getFilesMap().entrySet(), entry
-> {
+ return (entry.getKey().getMetadata() +
SetEqualityIterator.VALUE_SEPARATOR
+ + entry.getValue().encodeAsString()).getBytes(UTF_8);
+ }, family, true);
Review Comment:
I was curious so I tried messing around with the newly added `concatValue`
booleans and all three tests that use `createCondition` pass when
`concatValue` is true OR false. Not sure if that is expected or not. If so, is
there a test case that we could add that tests that this field is enforced
within `createCondition`?
--
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]