MAPREDUCE-7430 FileSystemCount enumeration changes will cause mapreduce application failure during upgrade

This commit is contained in:
Daniel-009497 2022-12-23 15:33:55 +08:00
parent ca3526da92
commit a58011dd86
1 changed files with 4 additions and 1 deletions

View File

@ -311,8 +311,11 @@ public abstract class FileSystemCounterGroup<C extends Counter>
String scheme = WritableUtils.readString(in); // scheme
int numCounters = WritableUtils.readVInt(in); // #counter
for (int j = 0; j < numCounters; ++j) {
findCounter(scheme, enums[WritableUtils.readVInt(in)]) // key
int countTypeIndex = WritableUtils.readVInt(in);
if (countTypeIndex < enums.length) {
findCounter(scheme, enums[countTypeIndex]) // key
.setValue(WritableUtils.readVLong(in)); // value
}
}
}
}