Skip to content

Commit 1ba30d6

Browse files
authored
YARN-11754. [JDK17] Fix SpotBugs Issues in YARN. (#7317) Contributed by Shilun Fan.
Reviewed-by: Chris Nauroth <[email protected]> Signed-off-by: Shilun Fan <[email protected]>
1 parent c7e1b66 commit 1ba30d6

File tree

2 files changed

+3
-3
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server
    • hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer
    • hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common

2 files changed

+3
-3
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ private void recoverTrackerResources(LocalResourcesTracker tracker,
343343
LocalResourceTrackerState state) throws URISyntaxException, IOException {
344344
try (RecoveryIterator<LocalizedResourceProto> it =
345345
state.getCompletedResourcesIterator()) {
346-
while (it != null && it.hasNext()) {
346+
while (it.hasNext()) {
347347
LocalizedResourceProto proto = it.next();
348348
LocalResource rsrc = new LocalResourcePBImpl(proto.getResource());
349349
LocalResourceRequest req = new LocalResourceRequest(rsrc);
@@ -356,7 +356,7 @@ private void recoverTrackerResources(LocalResourcesTracker tracker,
356356

357357
try (RecoveryIterator<Map.Entry<LocalResourceProto, Path>> it =
358358
state.getStartedResourcesIterator()) {
359-
while (it != null && it.hasNext()) {
359+
while (it.hasNext()) {
360360
Map.Entry<LocalResourceProto, Path> entry = it.next();
361361
LocalResource rsrc = new LocalResourcePBImpl(entry.getKey());
362362
LocalResourceRequest req = new LocalResourceRequest(rsrc);

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/hadoop-yarn-server-timelineservice-hbase-client/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/common/ColumnRWHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public static <K> Map<K, Object> readResults(Result result,
330330
for (Map.Entry<Long, byte[]> cell : cells.entrySet()) {
331331
V value =
332332
(V) valueConverter.decodeValue(cell.getValue());
333-
Long ts = supplementTs ? TimestampGenerator.
333+
long ts = supplementTs ? TimestampGenerator.
334334
getTruncatedTimestamp(cell.getKey()) : cell.getKey();
335335
cellResults.put(ts, value);
336336
}

0 commit comments

Comments
 (0)