HDFS-7780. Update use of Iterator to Iterable in DataXceiverServer and SnapshotDiffInfo. Contributed by Ray Chiang.
(cherry picked from commit 6dc8812a95
)
This commit is contained in:
parent
f92a4904bf
commit
6d6c684567
|
@ -351,6 +351,9 @@ Release 2.7.0 - UNRELEASED
|
|||
HDFS-7795. Show warning if not all favored nodes were chosen by namenode
|
||||
(kihwal)
|
||||
|
||||
HDFS-7780. Update use of Iterator to Iterable in DataXceiverServer and
|
||||
SnapshotDiffInfo. (Ray Chiang via aajisaka)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
HDFS-7454. Reduce memory footprint for AclEntries in NameNode.
|
||||
|
|
|
@ -252,9 +252,9 @@ class DataXceiverServer implements Runnable {
|
|||
// be set true before calling this method.
|
||||
synchronized void restartNotifyPeers() {
|
||||
assert (datanode.shouldRun == true && datanode.shutdownForUpgrade);
|
||||
for (Peer p : peers.keySet()) {
|
||||
for (Thread t : peers.values()) {
|
||||
// interrupt each and every DataXceiver thread.
|
||||
peers.get(p).interrupt();
|
||||
t.interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -187,12 +187,13 @@ class SnapshotDiffInfo {
|
|||
*/
|
||||
public SnapshotDiffReport generateReport() {
|
||||
List<DiffReportEntry> diffReportList = new ArrayList<DiffReportEntry>();
|
||||
for (INode node : diffMap.keySet()) {
|
||||
diffReportList.add(new DiffReportEntry(DiffType.MODIFY, diffMap
|
||||
.get(node), null));
|
||||
for (Map.Entry<INode,byte[][]> drEntry : diffMap.entrySet()) {
|
||||
INode node = drEntry.getKey();
|
||||
byte[][] path = drEntry.getValue();
|
||||
diffReportList.add(new DiffReportEntry(DiffType.MODIFY, path, null));
|
||||
if (node.isDirectory()) {
|
||||
List<DiffReportEntry> subList = generateReport(dirDiffMap.get(node),
|
||||
diffMap.get(node), isFromEarlier(), renameMap);
|
||||
path, isFromEarlier(), renameMap);
|
||||
diffReportList.addAll(subList);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue