Skip to content

Commit 7468aa8

Browse files
authored
HDDS-7523. Fix warnings in ContainerReportQueue (#9581)
1 parent 4fd8360 commit 7468aa8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/ContainerReportQueue.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ public class ContainerReportQueue
4848
* i.e. report execution from multiple datanode will be executed in same
4949
* order as added to queue.
5050
*/
51-
private LinkedBlockingQueue<String> orderingQueue
51+
private final LinkedBlockingQueue<String> orderingQueue
5252
= new LinkedBlockingQueue<>();
53-
private Map<String, List<ContainerReport>> dataMap = new HashMap<>();
53+
private final Map<String, List<ContainerReport>> dataMap = new HashMap<>();
5454

5555
private int capacity = 0;
5656

57-
private AtomicInteger droppedCount = new AtomicInteger();
57+
private final AtomicInteger droppedCount = new AtomicInteger();
5858

5959
public ContainerReportQueue() {
6060
this(100000);
@@ -232,7 +232,7 @@ public ContainerReport peek() {
232232
public void put(@Nonnull ContainerReport value) throws InterruptedException {
233233
Objects.requireNonNull(value);
234234
while (!addValue(value)) {
235-
Thread.currentThread().sleep(10);
235+
Thread.sleep(10);
236236
}
237237
}
238238

@@ -246,14 +246,14 @@ public boolean offer(ContainerReport value, long timeout,
246246
return true;
247247
}
248248
long startTime = Time.monotonicNow();
249-
Thread.currentThread().sleep(10);
249+
Thread.sleep(10);
250250
long timeDiff = Time.monotonicNow() - startTime;
251251
timeoutMillis -= timeDiff;
252252
}
253253
return false;
254254
}
255255

256-
@Nonnull
256+
@Nullable
257257
@Override
258258
public ContainerReport take() throws InterruptedException {
259259
String uuid = orderingQueue.take();

0 commit comments

Comments
 (0)