@@ -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