milleruntime commented on a change in pull request #2112:
URL: https://github.com/apache/accumulo/pull/2112#discussion_r634508012
##########
File path:
core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
##########
@@ -377,11 +377,11 @@ public static void seek(FileSKVIterator reader, Range
range, String lgName,
if (lgName == null) {
// this is the default locality group, create a set of all families not
in the default group
Set<ByteSequence> nonDefaultFamilies = new HashSet<>();
- for (Entry<String,ArrayList<ByteSequence>> entry :
localityGroupCF.entrySet()) {
- if (entry.getKey() != null) {
- nonDefaultFamilies.addAll(entry.getValue());
+ localityGroupCF.forEach((k, v) -> {
+ if (k != null) {
+ nonDefaultFamilies.addAll(v);
}
- }
+ });
Review comment:
Looking at the code that calls this, it looks like the key can be null.
https://github.com/apache/accumulo/blob/0781550076f04d12716650fd64881d8b9d041afa/core/src/main/java/org/apache/accumulo/core/file/rfile/PrintInfo.java#L260
It pulls `lgname` from the Map and then passes it in with the map. Based on
the check before the loop, `if (lgName == null)` there will be at least one key
that is definitely null.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]