ddanielr commented on code in PR #4776:
URL: https://github.com/apache/accumulo/pull/4776#discussion_r1695767067
##########
test/src/main/java/org/apache/accumulo/test/ScanServerMetadataEntriesIT.java:
##########
@@ -231,43 +231,42 @@ public void testGcRunScanServerReferences() throws
Exception {
Iterator<Entry<Key,Value>> iter = scanner.iterator();
assertTrue(iter.hasNext());
assertNotNull(iter.next());
-
- List<Entry<Key,Value>> metadataEntries = null;
- try (Scanner scanner2 =
- client.createScanner(AccumuloTable.SCAN_REF.tableName(),
Authorizations.EMPTY)) {
- metadataEntries =
scanner2.stream().distinct().collect(Collectors.toList());
- }
- assertEquals(fileCount, metadataEntries.size());
- metadataEntries.forEach(e -> log.info("{}", e.getKey()));
-
- Set<String> metadataScanFileRefs = new HashSet<>();
- metadataEntries.forEach(m -> {
- String file = m.getKey().getRow().toString();
- metadataScanFileRefs.add(file);
- });
- assertEquals(fileCount, metadataScanFileRefs.size());
-
- assertEquals(fileCount,
ctx.getAmple().scanServerRefs().list().count());
- List<Reference> refs;
- try (Stream<Reference> references = gc.getReferences()) {
- refs = references.collect(Collectors.toList());
- }
- assertTrue(refs.size() > fileCount * 2);
- List<Reference> tableRefs =
- refs.stream().filter(r -> r.getTableId().equals(tid) &&
!r.isDirectory())
- .peek(r ->
assertTrue(metadataScanFileRefs.contains(r.getMetadataPath())))
- .collect(Collectors.toList());
- log.info("Reference List:{}", tableRefs);
- // There should be 6 references here. 3 for the table file entries,
and 3 for the scan
- // server references
- assertEquals(fileCount * 2, tableRefs.size());
-
- Set<String> deduplicatedReferences =
-
tableRefs.stream().map(Reference::getMetadataPath).collect(Collectors.toSet());
-
- assertEquals(fileCount, deduplicatedReferences.size());
}
+ List<Entry<Key,Value>> metadataEntries = null;
+ try (Scanner scanner2 =
+ client.createScanner(AccumuloTable.SCAN_REF.tableName(),
Authorizations.EMPTY)) {
+ metadataEntries =
scanner2.stream().distinct().collect(Collectors.toList());
+ }
+ assertEquals(fileCount, metadataEntries.size());
+ metadataEntries.forEach(e -> log.info("{}", e.getKey()));
+
+ Set<String> metadataScanFileRefs = new HashSet<>();
+ metadataEntries.forEach(m -> {
+ String file = m.getKey().getColumnQualifier().toString();
Review Comment:
This line was the fix for the test. The rest of these changes are just
indent changes from closing the first scanner's try-with-resources section
sooner
--
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]