milleruntime commented on code in PR #2811:
URL: https://github.com/apache/accumulo/pull/2811#discussion_r936965742
##########
core/src/main/java/org/apache/accumulo/core/iteratorsImpl/system/LocalityGroupIterator.java:
##########
@@ -163,26 +164,14 @@ static final Collection<LocalityGroup> _seek(HeapIterator
hiter, LocalityGroupCo
Range range, Collection<ByteSequence> columnFamilies, boolean inclusive)
throws IOException {
hiter.clear();
- Set<ByteSequence> cfSet;
- if (columnFamilies.isEmpty()) {
- cfSet = Collections.emptySet();
- } else {
- if (columnFamilies instanceof Set<?>) {
- cfSet = (Set<ByteSequence>) columnFamilies;
- } else {
- cfSet = new HashSet<>();
- cfSet.addAll(columnFamilies);
- }
- }
+ final Set<ByteSequence> cfSet = getCfSet(columnFamilies);
// determine the set of groups to use
- Collection<LocalityGroup> groups = Collections.emptyList();
+ final Collection<LocalityGroup> groups;
// if no column families specified, then include all groups unless
!inclusive
if (cfSet.isEmpty()) {
- if (!inclusive) {
- groups = lgContext.groups;
- }
+ groups = inclusive ? List.of() : lgContext.groups;
} else {
groups = new HashSet<>();
Review Comment:
Or create a method for all the logic for "determining the set of groups to
use".
--
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]