Replace non-public SortedMapIterator with DataWave utility#3322
Replace non-public SortedMapIterator with DataWave utility#3322SethSmucker wants to merge 8 commits intointegrationfrom
Conversation
Create datawave.test.util.SortedMapIterator as a replacement for the non-public org.apache.accumulo.core.iteratorsImpl.system.SortedMapIterator class for Accumulo 4 compatibility. New utility class created in both modules: - warehouse/query-core/src/test/java/datawave/test/util/SortedMapIterator.java - warehouse/ingest-core/src/test/java/datawave/test/util/SortedMapIterator.java Updated 32 test files to use the new utility. Fixes #3321 Part of #2443
foster33
left a comment
There was a problem hiding this comment.
There seems to be other uses of SortedMapIterator:
core/in-memory-accumulo/src/main/java/datawave/accumulo/inmemory/InMemoryScannercore/in-memory-accumulo/src/main/java/datawave/accumulo/inmemory/InMemoryBatchScannerwarehouse/query-core/src/main/java/datawave/query/iterator/logic/ArrayIterator
Is this PR / Issue only focusing on the tests that use SortedMapIterator? Or should these also be included in this PR?
Also, is it necessary to make two SortedMapIterator utility classes? I feel like it would be best to only have one for consistency.
Response to Review FeedbackTwo Utility ClassesThe two Having duplicate utility classes in the same package ( Production UsagesThe reviewer correctly identified additional usages in production code:
These are in the
Please advise on preferred approach. If expanding scope, I can add the production changes to this PR. |
|
Rather than having two SortedMapIterator in query-core and ingest-core, we could have a single SortedMapIterator class in one of the core modules such as core/common or core/common-util and thus available to both query-core and ingest-core via dependency imports. The SortedMapIterator class does not need to exist only a test-scoped class only. |
Summary
Create DataWave replacement for non-public Accumulo SortedMapIterator class.
New Utility Class
datawave.test.util.SortedMapIterator- implementsSortedKeyValueIterator<Key,Value>:SortedMap<Key,Value>for testing iterator logic without a full Accumulo instanceFiles Changed
Fixes #3321
Part of #2443