Skip to content

Commit

Permalink
[FLINK-10189] Fix inefficient use of keySet iterators
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroaki Yoshida authored and zentol committed Aug 29, 2018
1 parent 260f789 commit 8a5271e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ public HBaseTableSource projectFields(int[] fields) {
for (int field : fields) {
String family = famNames[field];
Map<String, TypeInformation<?>> familyInfo = hBaseSchema.getFamilyInfo(family);
for (String qualifier : familyInfo.keySet()) {
for (Map.Entry<String, TypeInformation<?>> entry : familyInfo.entrySet()) {
// create the newSchema
newTableSource.addColumn(family, qualifier, familyInfo.get(qualifier).getTypeClass());
String qualifier = entry.getKey();
newTableSource.addColumn(family, qualifier, entry.getValue().getTypeClass());
}
}
return newTableSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ public void putAll(Map<UK, UV> map) throws Exception {
return;
}
Map<UK, TtlValue<UV>> ttlMap = new HashMap<>(map.size());
for (UK key : map.keySet()) {
ttlMap.put(key, wrapWithTs(map.get(key)));
for (Map.Entry<UK, UV> entry : map.entrySet()) {
UK key = entry.getKey();
ttlMap.put(key, wrapWithTs(entry.getValue()));
}
original.putAll(ttlMap);
}
Expand Down

0 comments on commit 8a5271e

Please sign in to comment.