DomGarguilo commented on code in PR #2811:
URL: https://github.com/apache/accumulo/pull/2811#discussion_r983706649
##########
core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java:
##########
@@ -135,6 +118,17 @@ else if (cvCommonPrefixLen > 1)
fieldsSame |= DELETED;
}
+ private int getCommonPrefixLen(ByteSequence prevKeyScratch, ByteSequence
keyScratch, byte rowSame,
+ byte commonPrefix) {
+ int commonPrefixLen = getCommonPrefix(prevKeyScratch, keyScratch);
+ if (commonPrefixLen == -1) {
+ fieldsSame |= rowSame;
Review Comment:
Addressed in c86dac5
##########
core/src/main/java/org/apache/accumulo/core/iteratorsImpl/system/LocalityGroupIterator.java:
##########
@@ -207,35 +208,33 @@ static final Collection<LocalityGroup> _seek(HeapIterator
hiter, LocalityGroupCo
* other
*/
if (!inclusive) {
- for (Entry<ByteSequence,LocalityGroup> entry :
lgContext.groupByCf.entrySet()) {
- if (!cfSet.contains(entry.getKey())) {
- groups.add(entry.getValue());
- }
- }
+ lgContext.groupByCf.entrySet().stream().filter(entry ->
!cfSet.contains(entry.getKey()))
+ .map(Entry::getValue).forEach(groups::add);
} else if (lgContext.groupByCf.size() <= cfSet.size()) {
- for (Entry<ByteSequence,LocalityGroup> entry :
lgContext.groupByCf.entrySet()) {
- if (cfSet.contains(entry.getKey())) {
- groups.add(entry.getValue());
- }
- }
+ lgContext.groupByCf.entrySet().stream().filter(entry ->
cfSet.contains(entry.getKey()))
+ .map(Entry::getValue).forEach(groups::add);
} else {
- for (ByteSequence cf : cfSet) {
- LocalityGroup group = lgContext.groupByCf.get(cf);
- if (group != null) {
- groups.add(group);
- }
- }
+
cfSet.stream().map(lgContext.groupByCf::get).filter(Objects::nonNull).forEach(groups::add);
}
}
- for (LocalityGroup lgr : groups) {
- lgr.getIterator().seek(range, EMPTY_CF_SET, false);
- hiter.addSource(lgr.getIterator());
- }
-
return groups;
}
+ private static Set<ByteSequence> getCfSet(Collection<ByteSequence>
columnFamilies) {
+ final Set<ByteSequence> cfSet;
+ if (columnFamilies.isEmpty()) {
+ cfSet = Collections.emptySet();
+ } else {
+ if (columnFamilies instanceof Set<?>) {
+ cfSet = (Set<ByteSequence>) columnFamilies;
+ } else {
+ cfSet = new HashSet<>(columnFamilies);
Review Comment:
Addressed in c86dac5
--
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]