diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/TezConfiguration.java b/tez-api/src/main/java/org/apache/tez/dag/api/TezConfiguration.java index 0f7d6d3754..4ffbcbb3bb 100644 --- a/tez-api/src/main/java/org/apache/tez/dag/api/TezConfiguration.java +++ b/tez-api/src/main/java/org/apache/tez/dag/api/TezConfiguration.java @@ -1302,7 +1302,7 @@ public TezConfiguration(boolean loadDefaults) { TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS = TEZ_AM_PREFIX + "container.reuse.locality.delay-allocation-millis"; public static final long - TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS_DEFAULT = 250l; + TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS_DEFAULT = 250L; /** * Int value. The minimum amount of time to hold on to a container that is idle. Only active when @@ -1313,7 +1313,7 @@ public TezConfiguration(boolean loadDefaults) { public static final String TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS = TEZ_AM_PREFIX + "container.idle.release-timeout-min.millis"; public static final long - TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS_DEFAULT = 5000l; + TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS_DEFAULT = 5000L; /** * Int value. The maximum amount of time to hold on to a container if no task can be @@ -1330,7 +1330,7 @@ public TezConfiguration(boolean loadDefaults) { public static final String TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS = TEZ_AM_PREFIX + "container.idle.release-timeout-max.millis"; public static final long - TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS_DEFAULT = 10000l; + TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS_DEFAULT = 10000L; /** * Int value. The minimum number of containers that will be held in session mode. Not active in diff --git a/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java b/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java index 8f74bcdc12..6d0d6aee93 100644 --- a/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java +++ b/tez-api/src/test/java/org/apache/tez/common/TestTezCommonUtils.java @@ -424,7 +424,7 @@ public void testGetDAGSessionTimeout() { // set to 1 month - * 1000 guaranteed to cross positive integer boundary conf.setInt(TezConfiguration.TEZ_SESSION_AM_DAG_SUBMIT_TIMEOUT_SECS, 24 * 60 * 60 * 30); - assertEquals(86400l*1000*30, + assertEquals(86400L*1000*30, TezCommonUtils.getDAGSessionTimeout(conf)); // set to negative val diff --git a/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java b/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java index 11187c7f7c..1d47f07d0c 100644 --- a/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java +++ b/tez-api/src/test/java/org/apache/tez/dag/api/TestDAG.java @@ -376,8 +376,8 @@ public void testRecreateDAG() { TezConfiguration tezConf = new TezConfiguration(); DAGPlan firstPlan = dag.createDag(tezConf, null, null, null, false); for (int i = 0; i < 3; ++i) { - DAGPlan dagPlan = dag.createDag(tezConf, null, null, null, false); - assertEquals(dagPlan, firstPlan); + DAGPlan dagPlan = dag.createDag(tezConf, null, null, null, false); + assertEquals(dagPlan, firstPlan); } } diff --git a/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java b/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java index 26225644a4..a93e15f3a8 100644 --- a/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java +++ b/tez-api/src/test/java/org/apache/tez/dag/api/TestDAGPlan.java @@ -64,8 +64,9 @@ // based on TestDAGLocationHint public class TestDAGPlan { + @SuppressWarnings("checkstyle:VisibilityModifier") @TempDir - public Path tempFolder; + Path tempFolder; @Test @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) @@ -88,17 +89,16 @@ public void testBasicJobPlanSerde() throws IOException { .build()) .build()) .build(); - File file = tempFolder.resolve("jobPlan").toFile(); - FileOutputStream outStream = null; - try { - outStream = new FileOutputStream(file); - job.writeTo(outStream); - } - finally { - if(outStream != null){ - outStream.close(); - } - } + File file = tempFolder.resolve("jobPlan").toFile(); + FileOutputStream outStream = null; + try { + outStream = new FileOutputStream(file); + job.writeTo(outStream); + } finally { + if (outStream != null) { + outStream.close(); + } + } DAGPlan inJob; FileInputStream inputStream; @@ -110,7 +110,7 @@ public void testBasicJobPlanSerde() throws IOException { outStream.close(); } - assertEquals(job, inJob); + assertEquals(job, inJob); } @Test diff --git a/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java b/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java index 69c679947d..398fd2c573 100644 --- a/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java +++ b/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java @@ -359,7 +359,7 @@ public void testGetDagStatusWithTimeout() throws Exception { long diff; TezConfiguration tezConf = new TezConfiguration(); - tezConf.setLong(TezConfiguration.TEZ_DAG_STATUS_POLLINTERVAL_MS, 800l); + tezConf.setLong(TezConfiguration.TEZ_DAG_STATUS_POLLINTERVAL_MS, 800L); DAGClientImplForTest dagClient = new DAGClientImplForTest(mockAppId, dagIdStr, tezConf, null); DAGClientRPCImplForTest dagClientRpc = @@ -376,10 +376,10 @@ public void testGetDagStatusWithTimeout() throws Exception { dagClient.setRmDagStatus(rmDagStatus); startTime = System.currentTimeMillis(); - dagStatus = dagClient.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 2000l); + dagStatus = dagClient.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 2000L); endTime = System.currentTimeMillis(); diff = endTime - startTime; - assertTrue(diff > 1500l && diff < 2500l); + assertTrue(diff > 1500L && diff < 2500L); // One at start. Second and Third within the sleep. Fourth at final refresh. assertEquals(0, dagClientRpc.numGetStatusViaAmInvocations); // No AM available, so no invocations to AM assertEquals(4, dagClient.numGetStatusViaRmInvocations); @@ -394,10 +394,10 @@ public void testGetDagStatusWithTimeout() throws Exception { dagClientRpc.setAMProxy(createMockProxy(DAGStatusStateProto.DAG_RUNNING, -1)); startTime = System.currentTimeMillis(); - dagStatus = dagClient.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 2000l); + dagStatus = dagClient.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 2000L); endTime = System.currentTimeMillis(); diff = endTime - startTime; - assertTrue(diff > 1500l && diff < 2500l); + assertTrue(diff > 1500L && diff < 2500L); // Directly from AM assertEquals(0, dagClient.numGetStatusViaRmInvocations); // Directly from AM - one refresh. One with timeout. @@ -411,13 +411,13 @@ public void testGetDagStatusWithTimeout() throws Exception { rmDagStatus = new DAGStatus(constructDagStatusProto(DAGStatusStateProto.DAG_RUNNING), DagStatusSource.RM); dagClient.setRmDagStatus(rmDagStatus); - dagClientRpc.setAMProxy(createMockProxy(DAGStatusStateProto.DAG_SUCCEEDED, 1000l)); + dagClientRpc.setAMProxy(createMockProxy(DAGStatusStateProto.DAG_SUCCEEDED, 1000L)); startTime = System.currentTimeMillis(); - dagStatus = dagClient.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 2000l); + dagStatus = dagClient.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 2000L); endTime = System.currentTimeMillis(); diff = endTime - startTime; - assertTrue(diff > 500l && diff < 1500l); + assertTrue(diff > 500L && diff < 1500L); // Directly from AM assertEquals(0, dagClient.numGetStatusViaRmInvocations); // Directly from AM - previous request cached, so single invocation only. diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java index 2fc43a3147..8a1f9d7a11 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java @@ -958,7 +958,7 @@ public DAGStatusBuilder getDAGStatus(Set statusOptions) { public DAGStatusBuilder getDAGStatus(Set statusOptions, long timeoutMillis) throws TezException { - long timeoutNanos = timeoutMillis * 1000l * 1000l; + long timeoutNanos = timeoutMillis * 1000L * 1000L; if (timeoutMillis < 0) { // Return only on SUCCESS timeoutNanos = Long.MAX_VALUE; diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java b/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java index 1705675462..74255c2c38 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/app/launcher/LocalContainerLauncher.java @@ -196,7 +196,7 @@ public void shutdown() throws Exception { } if (eventHandlingThread != null) { eventHandlingThread.interrupt(); - eventHandlingThread.join(2000l); + eventHandlingThread.join(2000L); } if (taskExecutorService != null) { taskExecutorService.shutdownNow(); diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerManager.java b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerManager.java index b35cb3c003..f4b6dc4eb3 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerManager.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerManager.java @@ -744,7 +744,7 @@ public void serviceStop() throws InterruptedException { } LOG.info("Shutting down AppCallbackExecutor"); appCallbackExecutor.shutdownNow(); - appCallbackExecutor.awaitTermination(1000l, TimeUnit.MILLISECONDS); + appCallbackExecutor.awaitTermination(1000L, TimeUnit.MILLISECONDS); } // TaskSchedulerAppCallback methods with schedulerId, where relevant diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java index f78843a920..0fa4d2968a 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/YarnTaskSchedulerService.java @@ -392,7 +392,7 @@ public void shutdown() throws InterruptedException { try { delayedContainerManager.shutdown(); // Wait for contianers to be released. - delayedContainerManager.join(2000l); + delayedContainerManager.join(2000L); synchronized (this) { if (shouldUnregister.get()) { AppFinalStatus status = getContext().getFinalAppStatus(); diff --git a/tez-dag/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClientAMProtocolBlockingPBServerImpl.java b/tez-dag/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClientAMProtocolBlockingPBServerImpl.java index 360d5ac138..2e240caddf 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClientAMProtocolBlockingPBServerImpl.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClientAMProtocolBlockingPBServerImpl.java @@ -62,8 +62,9 @@ import org.mockito.MockitoAnnotations; public class TestDAGClientAMProtocolBlockingPBServerImpl { + @SuppressWarnings("checkstyle:VisibilityModifier") @TempDir - public java.nio.file.Path tmpFolder; + java.nio.file.Path tmpFolder; @Captor private ArgumentCaptor> localResourcesCaptor; diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/MockDAGAppMaster.java b/tez-dag/src/test/java/org/apache/tez/dag/app/MockDAGAppMaster.java index deec226bbc..dbfd37dcb0 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/MockDAGAppMaster.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/MockDAGAppMaster.java @@ -213,7 +213,7 @@ public void start() throws Exception { public void shutdown() throws Exception { if (eventHandlingThread != null) { eventHandlingThread.interrupt(); - eventHandlingThread.join(2000l); + eventHandlingThread.join(2000L); } if (executorService != null) { executorService.shutdownNow(); diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java index a36f4127a2..fe985384a3 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestDAGImpl.java @@ -1811,7 +1811,7 @@ public void testGetDAGStatusWithWait() throws TezException { assertEquals(5, dag.getSuccessfulVertices()); long dagStatusStartTime = System.currentTimeMillis(); - DAGStatusBuilder dagStatus = dag.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 2000l); + DAGStatusBuilder dagStatus = dag.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 2000L); long dagStatusEndTime = System.currentTimeMillis(); long diff = dagStatusEndTime - dagStatusStartTime; assertTrue(diff >= 0 && diff < 2500); @@ -1882,7 +1882,7 @@ public void runTestGetDAGStatusReturnOnDagFinished(DAGStatusBuilder.State testSt } // Sleep for 2 seconds. Then mark the last vertex is successful. - Thread.sleep(2000l); + Thread.sleep(2000L); if (testState == State.SUCCEEDED) { dispatcher.getEventHandler().handle(new DAGEventVertexCompleted( TezVertexID.getInstance(dagId, 5), VertexState.SUCCEEDED)); @@ -2370,7 +2370,7 @@ public void run() { } try { dagStatusStartTime = System.currentTimeMillis(); - dagStatus = dag.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 10000l); + dagStatus = dag.getDAGStatus(EnumSet.noneOf(StatusGetOpts.class), 10000L); dagStatusEndTime = System.currentTimeMillis(); } catch (TezException e) { diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java index 5c16313c4a..b8c6e6db24 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java @@ -1053,7 +1053,7 @@ public void testProgressTimeStampUpdate() throws Exception { TaskHeartbeatHandler mockHeartbeatHandler = mock(TaskHeartbeatHandler.class); Clock mockClock = mock(Clock.class); - when(mockClock.getTime()).thenReturn(50l); + when(mockClock.getTime()).thenReturn(50L); TaskAttemptImpl taImpl = new MockTaskAttemptImpl(taskID, 1, eventHandler, taListener, taskConf, mockClock, mockHeartbeatHandler, appCtx, false, @@ -1067,7 +1067,7 @@ public void testProgressTimeStampUpdate() throws Exception { assertEquals(taImpl.getState(), TaskAttemptState.RUNNING, "Task attempt is not in the RUNNING state"); verify(mockHeartbeatHandler).register(taskAttemptID); - when(mockClock.getTime()).thenReturn(100l); + when(mockClock.getTime()).thenReturn(100L); taImpl.handle(new TaskAttemptEventStatusUpdate( taskAttemptID, new TaskStatusUpdateEvent(null, 0.1f, null, false))); verify(eventHandler, atLeast(1)).handle(arg.capture()); @@ -1080,7 +1080,7 @@ public void testProgressTimeStampUpdate() throws Exception { } else { assertEquals(taImpl.getInternalState(), TaskAttemptStateInternal.RUNNING, "Task Attempt's internal state should be RUNNING!"); } - when(mockClock.getTime()).thenReturn(200l); + when(mockClock.getTime()).thenReturn(200L); taImpl.handle(new TaskAttemptEventStatusUpdate( taskAttemptID, new TaskStatusUpdateEvent(null, 0.1f, null, false))); verify(eventHandler, atLeast(1)).handle(arg.capture()); @@ -1265,26 +1265,26 @@ public void testNoProgressFail() throws Exception { assertEquals(TaskAttemptState.RUNNING, taImpl.getState(), "Task attempt is not in the RUNNING state"); verify(mockHeartbeatHandler).register(taskAttemptID); - when(mockClock.getTime()).thenReturn(100l); + when(mockClock.getTime()).thenReturn(100L); taImpl.handle(new TaskAttemptEventStatusUpdate( taskAttemptID, new TaskStatusUpdateEvent(null, 0.1f, null, true))); // invocations and time updated - assertEquals(100l, taImpl.lastNotifyProgressTimestamp); - when(mockClock.getTime()).thenReturn(150l); + assertEquals(100L, taImpl.lastNotifyProgressTimestamp); + when(mockClock.getTime()).thenReturn(150L); taImpl.handle(new TaskAttemptEventStatusUpdate( taskAttemptID, new TaskStatusUpdateEvent(null, 0.1f, null, true))); // invocations and time updated - assertEquals(150l, taImpl.lastNotifyProgressTimestamp); - when(mockClock.getTime()).thenReturn(200l); + assertEquals(150L, taImpl.lastNotifyProgressTimestamp); + when(mockClock.getTime()).thenReturn(200L); taImpl.handle(new TaskAttemptEventStatusUpdate( taskAttemptID, new TaskStatusUpdateEvent(null, 0.1f, null, false))); // invocations and time not updated - assertEquals(150l, taImpl.lastNotifyProgressTimestamp); - when(mockClock.getTime()).thenReturn(250l); + assertEquals(150L, taImpl.lastNotifyProgressTimestamp); + when(mockClock.getTime()).thenReturn(250L); taImpl.handle(new TaskAttemptEventStatusUpdate( taskAttemptID, new TaskStatusUpdateEvent(null, 0.1f, null, false))); // invocations and time not updated - assertEquals(150l, taImpl.lastNotifyProgressTimestamp); + assertEquals(150L, taImpl.lastNotifyProgressTimestamp); // failed event sent to self verify(eventHandler, atLeast(1)).handle(arg.capture()); TaskAttemptEventAttemptFailed fEvent = (TaskAttemptEventAttemptFailed) arg.getValue(); diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexStats.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexStats.java index 5b83510916..8ec3efb387 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexStats.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexStats.java @@ -50,7 +50,7 @@ public void testBasicStats() { TezVertexID tezVertexID = TezVertexID.getInstance( TezDAGID.getInstance( - ApplicationId.newInstance(100l, 1), 1), 1); + ApplicationId.newInstance(100L, 1), 1), 1); TezTaskID tezTaskID1 = TezTaskID.getInstance(tezVertexID, 1); TezTaskID tezTaskID2 = TezTaskID.getInstance(tezVertexID, 2); TezTaskID tezTaskID3 = TezTaskID.getInstance(tezVertexID, 3); diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java index 7f814c1c69..92fc0d23e6 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java @@ -127,7 +127,7 @@ public void testDelayedReuseContainerBecomesAvailable() conf.setBoolean( TezConfiguration.TEZ_AM_CONTAINER_REUSE_NON_LOCAL_FALLBACK_ENABLED, false); conf.setLong( - TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 3000l); + TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 3000L); conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 0); conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 0); @@ -237,7 +237,7 @@ public void testDelayedReuseContainerBecomesAvailable() long currentTs = System.currentTimeMillis(); Throwable exception = null; - while (System.currentTimeMillis() < currentTs + 5000l) { + while (System.currentTimeMillis() < currentTs + 5000L) { try { verify(taskSchedulerManager, times(1)).containerBeingReleased(eq(0), eq(containerHost2.getId())); @@ -261,7 +261,7 @@ public void testDelayedReuseContainerNotAvailable() conf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true); conf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_RACK_FALLBACK_ENABLED, false); conf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_NON_LOCAL_FALLBACK_ENABLED, false); - conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 1000l); + conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 1000L); conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 0); conf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 0); @@ -710,9 +710,9 @@ public void testReuseNonLocalRequest() tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true); tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_RACK_FALLBACK_ENABLED, true); tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_NON_LOCAL_FALLBACK_ENABLED, true); - tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 100l); - tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 1000l); - tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 1000l); + tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 100L); + tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 1000L); + tezConf.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 1000L); CapturingEventHandler eventHandler = new CapturingEventHandler(); DAG dag = mock(DAG.class); @@ -833,11 +833,11 @@ public void testReuseAcrossVertices() Configuration tezConf = new Configuration(); tezConf.setBoolean(TezConfiguration.TEZ_AM_CONTAINER_REUSE_ENABLED, true); tezConf.setLong( - TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 1l); + TezConfiguration.TEZ_AM_CONTAINER_REUSE_LOCALITY_DELAY_ALLOCATION_MILLIS, 1L); tezConf.setLong( - TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 20l); + TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, 20L); tezConf.setLong( - TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 30l); + TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, 30L); tezConf.setInt( TezConfiguration.TEZ_AM_SESSION_MIN_HELD_CONTAINERS, 1); @@ -941,7 +941,7 @@ public void testReuseAcrossVertices() LOG.info("Sleeping to ensure that the container has been idled longer " + "than TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS "); - Thread.sleep(50l); + Thread.sleep(50L); // container should not get released due to min held containers verify(rmClient, times(0)).releaseAssignedContainer(eq(container1.getId())); diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestLocalTaskSchedulerService.java b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestLocalTaskSchedulerService.java index fafeb5e436..3d21386c00 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestLocalTaskSchedulerService.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestLocalTaskSchedulerService.java @@ -58,7 +58,7 @@ public void testCreateResource() { //value in integer long value = 4*1024*1024; resource = ltss.createResource(value,core); - assertEquals((int)(value/(1024*1024)),resource.getMemory()); + assertEquals((int)(value/(1024*1024)),resource.getMemorySize()); } @Test @@ -96,10 +96,10 @@ public void testCreateResourceWithNegativeValue() { @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) public void testDeallocationBeforeAllocation() throws InterruptedException { ApplicationAttemptId appAttemptId = - ApplicationAttemptId.newInstance(ApplicationId.newInstance(10000l, 1), 1); + ApplicationAttemptId.newInstance(ApplicationId.newInstance(10000L, 1), 1); TaskSchedulerContext mockContext = TestTaskSchedulerHelpers - .setupMockTaskSchedulerContext("", 0, "", false, appAttemptId, 10000l, null, new Configuration()); + .setupMockTaskSchedulerContext("", 0, "", false, appAttemptId, 10000L, null, new Configuration()); MockLocalTaskSchedulerSerivce taskSchedulerService = new MockLocalTaskSchedulerSerivce(mockContext); taskSchedulerService.initialize(); @@ -129,10 +129,10 @@ public void testDeallocationBeforeAllocation() throws InterruptedException { @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) public void testDeallocationAfterAllocation() throws InterruptedException { ApplicationAttemptId appAttemptId = - ApplicationAttemptId.newInstance(ApplicationId.newInstance(10000l, 1), 1); + ApplicationAttemptId.newInstance(ApplicationId.newInstance(10000L, 1), 1); TaskSchedulerContext mockContext = TestTaskSchedulerHelpers - .setupMockTaskSchedulerContext("", 0, "", false, appAttemptId, 10000l, null, new Configuration()); + .setupMockTaskSchedulerContext("", 0, "", false, appAttemptId, 10000L, null, new Configuration()); MockLocalTaskSchedulerSerivce taskSchedulerService = new MockLocalTaskSchedulerSerivce(mockContext); @@ -168,7 +168,7 @@ public void preemptDescendantsOnly() { Long grandchildTask1 = new Long(4); TaskSchedulerContext mockContext = - TestTaskSchedulerHelpers.setupMockTaskSchedulerContext("", 0, "", true, appAttemptId, 1000l, null, tezConf); + TestTaskSchedulerHelpers.setupMockTaskSchedulerContext("", 0, "", true, appAttemptId, 1000L, null, tezConf); when(mockContext.getVertexIndexForTask(parentTask1)).thenReturn(0); when(mockContext.getVertexIndexForTask(parentTask2)).thenReturn(0); when(mockContext.getVertexIndexForTask(childTask1)).thenReturn(1); diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskScheduler.java b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskScheduler.java index 3eb57dd9f0..d620d101d5 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskScheduler.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskScheduler.java @@ -948,8 +948,8 @@ public void testTaskSchedulerRandomReuseExpireTime() throws Exception { TezAMRMClientAsync mockRMClient = spy( new AMRMClientAsyncForTest(new AMRMClientForTest(), 100)); - long minTime = 1000l; - long maxTime = 100000l; + long minTime = 1000L; + long maxTime = 100000L; Configuration conf1 = new Configuration(); conf1.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MIN_MILLIS, minTime); conf1.setLong(TezConfiguration.TEZ_AM_CONTAINER_IDLE_RELEASE_TIMEOUT_MAX_MILLIS, minTime); @@ -1566,11 +1566,11 @@ public void testLocalityMatching() throws Exception { Resource resource = Resource.newInstance(1024, 1); Priority priority = Priority.newInstance(1); - String hostsTask1[] = {"host1"}; - String hostsTask2[] = {"non-allocated-host"}; + String[] hostsTask1 = {"host1"}; + String[] hostsTask2 = {"non-allocated-host"}; - String defaultRack[] = {"/default-rack"}; - String otherRack[] = {"/other-rack"}; + String[] defaultRack = {"/default-rack"}; + String[] otherRack = {"/other-rack"}; Object mockTask1 = new MockTask("task1"); CookieContainerRequest mockCookie1 = mock(CookieContainerRequest.class, RETURNS_DEEP_STUBS); diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java index 5df54e1c59..fb1e088bc8 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestTaskSchedulerHelpers.java @@ -410,7 +410,7 @@ public void preemptContainer(ContainerId cId) { public void drain() throws InterruptedException, ExecutionException { while (completedEvents < invocations) { - Future f = countingExecutorService.completionService.poll(5000l, TimeUnit.MILLISECONDS); + Future f = countingExecutorService.completionService.poll(5000L, TimeUnit.MILLISECONDS); if (f != null) { completedEvents++; } else { diff --git a/tez-dag/src/test/java/org/apache/tez/dag/history/TestHistoryEventHandler.java b/tez-dag/src/test/java/org/apache/tez/dag/history/TestHistoryEventHandler.java index 572e7ff331..d178382d73 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/history/TestHistoryEventHandler.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/history/TestHistoryEventHandler.java @@ -60,7 +60,7 @@ public class TestHistoryEventHandler { - private static ApplicationId appId = ApplicationId.newInstance(1000l, 1); + private static ApplicationId appId = ApplicationId.newInstance(1000L, 1); private static ApplicationAttemptId attemptId = ApplicationAttemptId.newInstance(appId, 1); private static String user = "TEST_USER"; private Configuration baseConfig; diff --git a/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java b/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java index 60db6821ea..bc904211ce 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java @@ -176,7 +176,7 @@ private void testAMStartedEvent() throws Exception { private final String QUEUE_NAME = "TEST_QUEUE_NAME"; private void testDAGSubmittedEvent() throws Exception { DAGSubmittedEvent event = new DAGSubmittedEvent(TezDAGID.getInstance( - ApplicationId.newInstance(0, 1), 1), 1001l, + ApplicationId.newInstance(0, 1), 1), 1001L, DAGPlan.newBuilder().setName("foo").build(), ApplicationAttemptId.newInstance( ApplicationId.newInstance(0, 1), 1), null, "", null, null, QUEUE_NAME); @@ -193,7 +193,7 @@ private void testDAGSubmittedEvent() throws Exception { private void testDAGInitializedEvent() throws Exception { DAGInitializedEvent event = new DAGInitializedEvent( - TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 100334l, + TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 100334L, "user", "dagName", null); DAGInitializedEvent deserializedEvent = (DAGInitializedEvent) testProtoConversion(event); @@ -204,7 +204,7 @@ private void testDAGInitializedEvent() throws Exception { private void testDAGStartedEvent() throws Exception { DAGStartedEvent event = new DAGStartedEvent( - TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 100334l, + TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 100334L, "user", "dagName"); DAGStartedEvent deserializedEvent = (DAGStartedEvent) testProtoConversion(event); @@ -215,7 +215,7 @@ private void testDAGStartedEvent() throws Exception { private void testDAGKillRequestEvent() throws Exception { DAGKillRequestEvent event = - new DAGKillRequestEvent(TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 100334l,false); + new DAGKillRequestEvent(TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 100334L,false); DAGKillRequestEvent deserializedEvent = (DAGKillRequestEvent) testProtoConversion(event); assertEquals(event.getDagID(), deserializedEvent.getDagID()); @@ -227,7 +227,7 @@ private void testDAGKillRequestEvent() throws Exception { private void testDAGFinishedEvent() throws Exception { { DAGFinishedEvent event = new DAGFinishedEvent( - TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 1000l, 20000l, + TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 1000L, 20000L, DAGState.FAILED, null, null, "user", "dagName", null, null, DAGPlan.newBuilder().setName("dagName").build()); DAGFinishedEvent deserializedEvent = (DAGFinishedEvent) @@ -246,7 +246,7 @@ private void testDAGFinishedEvent() throws Exception { tezCounters.getGroup("foo").addCounter("c1", "c1", 100); tezCounters.getGroup("foo").findCounter("c1").increment(1); DAGFinishedEvent event = new DAGFinishedEvent( - TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 1000l, 20000l, + TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 1000L, 20000L, DAGState.FAILED, "bad diagnostics", tezCounters, "user", "dagName", null, null, DAGPlan.newBuilder().setName("dagName").build()); DAGFinishedEvent deserializedEvent = (DAGFinishedEvent) @@ -268,7 +268,7 @@ private void testVertexInitializedEvent() throws Exception { VertexInitializedEvent event = new VertexInitializedEvent( TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), - "vertex1", 1000l, 15000l, 100, "procName", null, initGeneratedEvents, null); + "vertex1", 1000L, 15000L, 100, "procName", null, initGeneratedEvents, null); VertexInitializedEvent deserializedEvent = (VertexInitializedEvent) testProtoConversion(event); assertEquals(event.getVertexID(), deserializedEvent.getVertexID()); @@ -287,7 +287,7 @@ private void testVertexStartedEvent() throws Exception { VertexStartedEvent event = new VertexStartedEvent( TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), - 145553l, 12334455l); + 145553L, 12334455L); VertexStartedEvent deserializedEvent = (VertexStartedEvent) testProtoConversion(event); assertEquals(event.getVertexID(), deserializedEvent.getVertexID()); @@ -366,7 +366,7 @@ private void testVertexFinishedEvent() throws Exception { VertexFinishedEvent event = new VertexFinishedEvent(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), - "vertex1", 1, 1000l, 15000l, 16000l, 20000l, 1344400l, VertexState.ERROR, + "vertex1", 1, 1000L, 15000L, 16000L, 20000L, 1344400L, VertexState.ERROR, null, null, null, null, null); VertexFinishedEvent deserializedEvent = (VertexFinishedEvent) testProtoConversion(event); @@ -381,7 +381,7 @@ private void testVertexFinishedEvent() throws Exception { VertexFinishedEvent event = new VertexFinishedEvent(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), - "vertex1", 1, 1000l, 15000l, 16000l, 20000l, 1344400l, VertexState.ERROR, + "vertex1", 1, 1000L, 15000L, 16000L, 20000L, 1344400L, VertexState.ERROR, "diagnose", new TezCounters(), new VertexStats(), null, null); VertexFinishedEvent deserializedEvent = (VertexFinishedEvent) testProtoConversion(event); @@ -397,7 +397,7 @@ private void testTaskStartedEvent() throws Exception { TaskStartedEvent event = new TaskStartedEvent( TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), - "vertex1", 1000l, 100000l); + "vertex1", 1000L, 100000L); TaskStartedEvent deserializedEvent = (TaskStartedEvent) testProtoConversion(event); assertEquals(event.getTaskID(), deserializedEvent.getTaskID()); @@ -411,7 +411,7 @@ private void testTaskFinishedEvent() throws Exception { TaskFinishedEvent event = new TaskFinishedEvent( TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), - "vertex1", 11000l, 1000000l, null, TaskState.FAILED, null, null, 0); + "vertex1", 11000L, 1000000L, null, TaskState.FAILED, null, null, 0); TaskFinishedEvent deserializedEvent = (TaskFinishedEvent) testProtoConversion(event); assertEquals(event.getTaskID(), deserializedEvent.getTaskID()); @@ -425,7 +425,7 @@ private void testTaskFinishedEvent() throws Exception { TaskFinishedEvent event = new TaskFinishedEvent( TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), - "vertex1", 11000l, 1000000l, + "vertex1", 11000L, 1000000L, TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), 1), TaskState.FAILED, "task_diagnostics", new TezCounters(), 0); @@ -445,7 +445,7 @@ private void testTaskAttemptStartedEvent() throws Exception { TaskAttemptStartedEvent event = new TaskAttemptStartedEvent( TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), 1), - "vertex1", 10009l, ContainerId.newInstance( + "vertex1", 10009L, ContainerId.newInstance( ApplicationAttemptId.newInstance( ApplicationId.newInstance(0, 1), 1), 1001), NodeId.newInstance( "host1", 19999), "inProgress", "Completed", "nodeHttpAddress" @@ -464,7 +464,7 @@ private void testTaskAttemptFinishedEvent() throws Exception { TaskAttemptFinishedEvent event = new TaskAttemptFinishedEvent( TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), 1), - "vertex1", 10001l, 1000434444l, TaskAttemptState.FAILED, TaskFailureType.FATAL, + "vertex1", 10001L, 1000434444L, TaskAttemptState.FAILED, TaskFailureType.FATAL, null, null, null, null, null, 2048, TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), 0), 1024, @@ -499,7 +499,7 @@ private void testTaskAttemptFinishedEvent() throws Exception { TaskAttemptFinishedEvent event = new TaskAttemptFinishedEvent( TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), 1), - "vertex1", 10001l, 1000434444l, TaskAttemptState.FAILED, TaskFailureType.NON_FATAL, + "vertex1", 10001L, 1000434444L, TaskAttemptState.FAILED, TaskFailureType.NON_FATAL, TaskAttemptTerminationCause.APPLICATION_ERROR, "diagnose", new TezCounters(), events, null, 0, null, 0, ContainerId.newInstance( @@ -534,7 +534,7 @@ private void testTaskAttemptFinishedEvent() throws Exception { TaskAttemptFinishedEvent event = new TaskAttemptFinishedEvent( TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), 1), - "vertex1", 10001l, 1000434444l, TaskAttemptState.KILLED, null, + "vertex1", 10001L, 1000434444L, TaskAttemptState.KILLED, null, TaskAttemptTerminationCause.APPLICATION_ERROR, "diagnose", new TezCounters(), events, null, 0, null, 0, ContainerId.newInstance( @@ -570,7 +570,7 @@ private void testTaskAttemptFinishedEvent() throws Exception { TaskAttemptFinishedEvent event = new TaskAttemptFinishedEvent( TezTaskAttemptID.getInstance(TezTaskID.getInstance(TezVertexID.getInstance( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111), 1), 1), - "vertex1", 10001l, 1000434444l, TaskAttemptState.SUCCEEDED, null, null, + "vertex1", 10001L, 1000434444L, TaskAttemptState.SUCCEEDED, null, null, null, new TezCounters(), events, null, 0, null, 0, null, null, null, null, null); String eventStr = event.toString(); String[] items = new String[] {"taskFailureType", "errorEnum", "diagnostics", "containerId", @@ -613,7 +613,7 @@ private void testContainerStoppedEvent() throws Exception { private void testDAGCommitStartedEvent() throws Exception { DAGCommitStartedEvent event = new DAGCommitStartedEvent( - TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 100l); + TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 100L); DAGCommitStartedEvent deserializedEvent = (DAGCommitStartedEvent) testProtoConversion(event); assertEquals(event.getDagID(), deserializedEvent.getDagID()); @@ -623,7 +623,7 @@ private void testDAGCommitStartedEvent() throws Exception { private void testVertexCommitStartedEvent() throws Exception { VertexCommitStartedEvent event = new VertexCommitStartedEvent( TezVertexID.getInstance( - TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 1), 100l); + TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 1), 100L); VertexCommitStartedEvent deserializedEvent = (VertexCommitStartedEvent) testProtoConversion(event); assertEquals(event.getVertexID(), deserializedEvent.getVertexID()); @@ -638,7 +638,7 @@ private void testVertexGroupCommitStartedEvent() throws Exception { Collection vertexIds = Lists.newArrayList(vertexId1, vertexId2); VertexGroupCommitStartedEvent event = new VertexGroupCommitStartedEvent( TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), - "fooGroup", vertexIds, 1000344l); + "fooGroup", vertexIds, 1000344L); { VertexGroupCommitStartedEvent deserializedEvent = (VertexGroupCommitStartedEvent) testProtoConversion(event); @@ -764,7 +764,7 @@ private void testDAGRecoveredEvent() throws TezException { DAGRecoveredEvent dagRecoveredEvent = new DAGRecoveredEvent( ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1), TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), - "mockDagname", "mockuser", 100334l, null); + "mockDagname", "mockuser", 100334L, null); try { testProtoConversion(dagRecoveredEvent); fail("Proto conversion should have failed"); diff --git a/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java b/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java index c05e944616..aef389ad48 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java @@ -100,7 +100,7 @@ public class TestHistoryEventJsonConversion { @SuppressWarnings("deprecation") @BeforeEach public void setup() { - applicationId = ApplicationId.newInstance(9999l, 1); + applicationId = ApplicationId.newInstance(9999L, 1); applicationAttemptId = ApplicationAttemptId.newInstance(applicationId, 1); tezDAGID = TezDAGID.getInstance(applicationId, random.nextInt()); tezVertexID = TezVertexID.getInstance(tezDAGID, random.nextInt()); @@ -195,7 +195,7 @@ public void testHandlerExists() throws JSONException { break; case DAG_RECOVERED: event = new DAGRecoveredEvent(applicationAttemptId, tezDAGID, dagPlan.getName(), user, - 1l, null); + 1L, null); break; case DAG_KILL_REQUEST: event = new DAGKillRequestEvent(); @@ -225,7 +225,7 @@ public void testHandlerExists() throws JSONException { public void testConvertVertexReconfigureDoneEvent() throws JSONException { TezVertexID vId = TezVertexID.getInstance( TezDAGID.getInstance( - ApplicationId.newInstance(1l, 1), 1), 1); + ApplicationId.newInstance(1L, 1), 1), 1); Map edgeMgrs = new HashMap(); diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRJobConfig.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRJobConfig.java index 7c5393b610..5b5895336d 100644 --- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRJobConfig.java +++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRJobConfig.java @@ -489,7 +489,7 @@ public interface MRJobConfig { * containers.*/ public static final String MR_AM_SCHEDULER_INTERVAL = MR_AM_PREFIX + "scheduler.interval-ms"; - public static final long DEFAULT_MR_AM_SCHEDULER_INTERVAL = 1000l; + public static final long DEFAULT_MR_AM_SCHEDULER_INTERVAL = 1000L; /** How often the AM should send heartbeats to the RM.*/ public static final String MR_AM_TO_RM_HEARTBEAT_INTERVAL_MS = @@ -526,7 +526,7 @@ public interface MRJobConfig { public static final String MR_AM_HISTORY_COMPLETE_EVENT_FLUSH_TIMEOUT_MS = MR_AM_PREFIX + "history.complete-event-flush-timeout"; public static final long DEFAULT_MR_AM_HISTORY_COMPLETE_EVENT_FLUSH_TIMEOUT_MS = - 30 * 1000l; + 30 * 1000L; public static final String MR_AM_HISTORY_USE_BATCHED_FLUSH_QUEUE_SIZE_THRESHOLD = MR_AM_PREFIX + "history.use-batched-flush.queue-size.threshold"; diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/base/MRInputBase.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/base/MRInputBase.java index cae26a69c4..9d8831f678 100644 --- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/base/MRInputBase.java +++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/input/base/MRInputBase.java @@ -65,7 +65,7 @@ public Reader getReader() throws Exception { protected boolean useNewApi; public List initialize() throws IOException { - getContext().requestInitialMemory(0l, null); // mandatory call + getContext().requestInitialMemory(0L, null); // mandatory call MRRuntimeProtos.MRInputUserPayloadProto mrUserPayload = MRInputHelpers.parseMRInputPayload(getContext().getUserPayload()); boolean isGrouped = mrUserPayload.getGroupingEnabled(); diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java index 829fa47a6b..dddc636c21 100644 --- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java +++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/output/MROutput.java @@ -397,7 +397,7 @@ public List initialize() throws IOException, InterruptedException { } protected List initializeBase() throws IOException, InterruptedException { - getContext().requestInitialMemory(0l, null); //mandatory call + getContext().requestInitialMemory(0L, null); //mandatory call taskNumberFormat.setMinimumIntegerDigits(5); taskNumberFormat.setGroupingUsed(false); nonTaskNumberFormat.setMinimumIntegerDigits(3); diff --git a/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java b/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java index 548253bc94..cd5fe073fb 100644 --- a/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java +++ b/tez-mapreduce/src/test/java/org/apache/hadoop/mapred/split/TestGroupedSplits.java @@ -299,7 +299,7 @@ public void testGzip() throws IOException { start = testResults(results, thirdList, start); break; default: - fail("unexpected first token - " + first); + fail("unexpected first token - " + first); } } } @@ -323,10 +323,10 @@ public void testGroupedSplitSize() throws IOException { format.setInputFormat(mockWrappedFormat); job = (JobConf) TezSplitGrouper.newConfigBuilder(job) - .setGroupingSplitSize(50*1000*1000l, 500*1000*1000l) + .setGroupingSplitSize(50 * 1000 * 1000L, 500 * 1000 * 1000L) .build(); InputSplit mockSplit1 = mock(InputSplit.class); - when(mockSplit1.getLength()).thenReturn(10*1000*1000l); + when(mockSplit1.getLength()).thenReturn(10 * 1000 * 1000L); when(mockSplit1.getLocations()).thenReturn(null); int numSplits = 100; InputSplit[] mockSplits = new InputSplit[numSplits]; @@ -564,7 +564,7 @@ public void testGroupedSplitWithDuplicates() throws IOException { InputSplit[] mockSplits = new InputSplit[numSplits]; for (int i=0; i manifestLogger; + @SuppressWarnings("checkstyle:VisibilityModifier") @TempDir - public java.nio.file.Path tempFolder; + java.nio.file.Path tempFolder; @BeforeEach public void setupTest() throws Exception { @@ -131,7 +132,7 @@ public void testError() throws Exception { private void createManifestEvents(long time, int numEvents) throws IOException { for (int i = 0; i < numEvents; ++i) { - ApplicationId appId = ApplicationId.newInstance(1000l, i); + ApplicationId appId = ApplicationId.newInstance(1000L, i); ManifestEntryProto proto = ManifestEntryProto.newBuilder() .setAppId(appId.toString()) .setDagFilePath("dummy_dag_path_" + i) diff --git a/tez-plugins/tez-protobuf-history-plugin/src/test/java/org/apache/tez/dag/history/logging/proto/TestHistoryEventProtoConverter.java b/tez-plugins/tez-protobuf-history-plugin/src/test/java/org/apache/tez/dag/history/logging/proto/TestHistoryEventProtoConverter.java index 3cda184bc4..220722fbb3 100644 --- a/tez-plugins/tez-protobuf-history-plugin/src/test/java/org/apache/tez/dag/history/logging/proto/TestHistoryEventProtoConverter.java +++ b/tez-plugins/tez-protobuf-history-plugin/src/test/java/org/apache/tez/dag/history/logging/proto/TestHistoryEventProtoConverter.java @@ -109,7 +109,7 @@ public class TestHistoryEventProtoConverter { @BeforeEach public void setup() { - applicationId = ApplicationId.newInstance(9999l, 1); + applicationId = ApplicationId.newInstance(9999L, 1); applicationAttemptId = ApplicationAttemptId.newInstance(applicationId, 1); tezDAGID = TezDAGID.getInstance(applicationId, random.nextInt()); tezVertexID = TezVertexID.getInstance(tezDAGID, random.nextInt()); @@ -272,18 +272,18 @@ private void assertCommon(HistoryEventProto proto, HistoryEventType type, long e if (entityType != null) { switch (entityType) { // Intentional fallthrough. case TEZ_TASK_ATTEMPT_ID: - assertEquals(tezTaskAttemptID.toString(), proto.getTaskAttemptId()); + assertEquals(tezTaskAttemptID.toString(), proto.getTaskAttemptId()); case TEZ_TASK_ID: - assertEquals(tezTaskID.toString(), proto.getTaskId()); + assertEquals(tezTaskID.toString(), proto.getTaskId()); case TEZ_VERTEX_ID: - assertEquals(tezVertexID.toString(), proto.getVertexId()); + assertEquals(tezVertexID.toString(), proto.getVertexId()); case TEZ_DAG_ID: - assertEquals(tezDAGID.toString(), proto.getDagId()); + assertEquals(tezDAGID.toString(), proto.getDagId()); case TEZ_APPLICATION: - assertEquals(applicationId.toString(), proto.getAppId()); + assertEquals(applicationId.toString(), proto.getAppId()); break; default: - fail("Invalid type: " + entityType.name()); + fail("Invalid type: " + entityType.name()); } } assertEquals(numData, proto.getEventDataCount()); diff --git a/tez-plugins/tez-protobuf-history-plugin/src/test/java/org/apache/tez/dag/history/logging/proto/TestProtoHistoryLoggingService.java b/tez-plugins/tez-protobuf-history-plugin/src/test/java/org/apache/tez/dag/history/logging/proto/TestProtoHistoryLoggingService.java index 596a62916c..093060b28d 100644 --- a/tez-plugins/tez-protobuf-history-plugin/src/test/java/org/apache/tez/dag/history/logging/proto/TestProtoHistoryLoggingService.java +++ b/tez-plugins/tez-protobuf-history-plugin/src/test/java/org/apache/tez/dag/history/logging/proto/TestProtoHistoryLoggingService.java @@ -76,13 +76,14 @@ import org.junit.jupiter.api.io.TempDir; public class TestProtoHistoryLoggingService { - private static ApplicationId appId = ApplicationId.newInstance(1000l, 1); + private static ApplicationId appId = ApplicationId.newInstance(1000L, 1); private static ApplicationAttemptId attemptId = ApplicationAttemptId.newInstance(appId, 1); private static String user = "TEST_USER"; private Clock clock; + @SuppressWarnings("checkstyle:VisibilityModifier") @TempDir - public java.nio.file.Path tempFolder; + java.nio.file.Path tempFolder; @Test public void testService() throws Exception { diff --git a/tez-plugins/tez-yarn-timeline-cache-plugin/src/test/java/org/apache/tez/dag/history/logging/ats/TestTimelineCachePluginImpl.java b/tez-plugins/tez-yarn-timeline-cache-plugin/src/test/java/org/apache/tez/dag/history/logging/ats/TestTimelineCachePluginImpl.java index 0c2a0e1ad9..c8509920a7 100644 --- a/tez-plugins/tez-yarn-timeline-cache-plugin/src/test/java/org/apache/tez/dag/history/logging/ats/TestTimelineCachePluginImpl.java +++ b/tez-plugins/tez-yarn-timeline-cache-plugin/src/test/java/org/apache/tez/dag/history/logging/ats/TestTimelineCachePluginImpl.java @@ -87,8 +87,8 @@ private static TimelineCachePluginImpl createPlugin(int numDagsPerGroup, String @BeforeAll public static void beforeClass() { - appId1 = ApplicationId.newInstance(1000l, 111); - appId2 = ApplicationId.newInstance(1001l, 121); + appId1 = ApplicationId.newInstance(1000L, 111); + appId2 = ApplicationId.newInstance(1001L, 121); appAttemptId1 = ApplicationAttemptId.newInstance(appId1, 11); dagID1 = TezDAGID.getInstance(appId1, 1); diff --git a/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java b/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java index f1ba1ef32d..e0e147610e 100644 --- a/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java +++ b/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java @@ -291,7 +291,7 @@ public void testSimpleAMACls() throws Exception { while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } assertEquals(DAGStatus.State.SUCCEEDED, dagStatus.getState()); @@ -348,7 +348,7 @@ public void testDAGACls() throws Exception { while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } assertEquals(DAGStatus.State.SUCCEEDED, dagStatus.getState()); @@ -412,7 +412,7 @@ public void testDisableSessionLogging() throws Exception { while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } assertEquals(DAGStatus.State.SUCCEEDED, dagStatus.getState()); @@ -432,7 +432,7 @@ public void testDisableSessionLogging() throws Exception { while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } tezSession.stop(); @@ -463,7 +463,7 @@ public void testDagLoggingDisabled() throws Exception { tezConf.set(TezConfiguration.TEZ_AM_STAGING_DIR, remoteStagingDir.toString()); historyLoggingService.init(tezConf); historyLoggingService.start(); - ApplicationId appId = ApplicationId.newInstance(100l, 1); + ApplicationId appId = ApplicationId.newInstance(100L, 1); TezDAGID tezDAGID = TezDAGID.getInstance( appId, 100); ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, 1); @@ -474,7 +474,7 @@ public void testDagLoggingDisabled() throws Exception { submittedEvent.setHistoryLoggingEnabled(false); DAGHistoryEvent event = new DAGHistoryEvent(tezDAGID, submittedEvent); historyLoggingService.handle(new DAGHistoryEvent(tezDAGID, submittedEvent)); - Thread.sleep(1000l); + Thread.sleep(1000L); String url = "http://" + timelineAddress + "/ws/v1/timeline/TEZ_DAG_ID/"+event.getDAGID(); Client client = ClientBuilder.newClient(); WebTarget target = client.target(url); @@ -509,7 +509,7 @@ public void testDagLoggingEnabled() throws Exception { tezConf.set(TezConfiguration.TEZ_AM_STAGING_DIR, remoteStagingDir.toString()); historyLoggingService.init(tezConf); historyLoggingService.start(); - ApplicationId appId = ApplicationId.newInstance(100l, 1); + ApplicationId appId = ApplicationId.newInstance(100L, 1); TezDAGID tezDAGID = TezDAGID.getInstance( appId, 11); ApplicationAttemptId appAttemptId = ApplicationAttemptId.newInstance(appId, 1); @@ -520,7 +520,7 @@ public void testDagLoggingEnabled() throws Exception { submittedEvent.setHistoryLoggingEnabled(true); DAGHistoryEvent event = new DAGHistoryEvent(tezDAGID, submittedEvent); historyLoggingService.handle(new DAGHistoryEvent(tezDAGID, submittedEvent)); - Thread.sleep(1000l); + Thread.sleep(1000L); String url = "http://" + timelineAddress + "/ws/v1/timeline/TEZ_DAG_ID/"+event.getDAGID(); Client client = ClientBuilder.newClient(); WebTarget target = client.target(url); diff --git a/tez-plugins/tez-yarn-timeline-history-with-fs/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryV15.java b/tez-plugins/tez-yarn-timeline-history-with-fs/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryV15.java index 53983ac284..924ae366b0 100644 --- a/tez-plugins/tez-yarn-timeline-history-with-fs/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryV15.java +++ b/tez-plugins/tez-yarn-timeline-history-with-fs/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryV15.java @@ -185,7 +185,7 @@ public void testSimpleDAG() throws Exception { while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } assertEquals(State.SUCCEEDED, dagStatus.getState()); @@ -239,7 +239,7 @@ public void testATSLogLevelNone() throws Exception { while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } assertEquals(State.SUCCEEDED, dagStatus.getState()); @@ -274,7 +274,7 @@ private int verifyATSDataOnHDFS(Path p, ApplicationId applicationId) throws IOEx @Test public void testGetGroupId() throws Exception { - ApplicationId appId = ApplicationId.newInstance(1000l, 1); + ApplicationId appId = ApplicationId.newInstance(1000L, 1); TezDAGID dagid = TezDAGID.getInstance(appId, 1); for (final HistoryEventType eventType : HistoryEventType.values()) { HistoryEvent historyEvent = new HistoryEvent() { diff --git a/tez-plugins/tez-yarn-timeline-history-with-fs/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSV15HistoryLoggingService.java b/tez-plugins/tez-yarn-timeline-history-with-fs/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSV15HistoryLoggingService.java index 8fbc023ae6..021b432bdb 100644 --- a/tez-plugins/tez-yarn-timeline-history-with-fs/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSV15HistoryLoggingService.java +++ b/tez-plugins/tez-yarn-timeline-history-with-fs/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSV15HistoryLoggingService.java @@ -72,7 +72,7 @@ import org.mockito.stubbing.Answer; public class TestATSV15HistoryLoggingService { - private static ApplicationId appId = ApplicationId.newInstance(1000l, 1); + private static ApplicationId appId = ApplicationId.newInstance(1000L, 1); private static ApplicationAttemptId attemptId = ApplicationAttemptId.newInstance(appId, 1); private static String user = "TEST_USER"; diff --git a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryLoggingService.java b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryLoggingService.java index 7a863ac6e2..dbc9e18842 100644 --- a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryLoggingService.java +++ b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryLoggingService.java @@ -78,7 +78,7 @@ public class TestATSHistoryLoggingService { private int atsEntitiesCounter; private HistoryACLPolicyManager historyACLPolicyManager; private SystemClock clock = new SystemClock(); - private static ApplicationId appId = ApplicationId.newInstance(1000l, 1); + private static ApplicationId appId = ApplicationId.newInstance(1000L, 1); private static ApplicationAttemptId attemptId = ApplicationAttemptId.newInstance(appId, 1); @BeforeEach @@ -89,7 +89,7 @@ public void setup() throws Exception { atsHistoryLoggingService.setAppContext(appContext); conf = new Configuration(false); conf.setLong(TezConfiguration.YARN_ATS_EVENT_FLUSH_TIMEOUT_MILLIS, - 1000l); + 1000L); conf.setInt(TezConfiguration.YARN_ATS_MAX_EVENTS_PER_BATCH, 2); conf.setBoolean(TezConfiguration.TEZ_AM_ALLOW_DISABLED_TIMELINE_DOMAINS, true); conf.set(TezConfiguration.YARN_ATS_ACL_SESSION_DOMAIN_ID, "test-domain"); @@ -110,7 +110,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable { ++atsInvokeCounter; atsEntitiesCounter += invocation.getArguments().length; try { - Thread.sleep(500l); + Thread.sleep(500L); } catch (InterruptedException e) { // do nothing } @@ -131,16 +131,16 @@ public void teardown() { public void testATSHistoryLoggingServiceShutdown() { atsHistoryLoggingService.start(); TezDAGID tezDAGID = TezDAGID.getInstance( - ApplicationId.newInstance(100l, 1), 1); + ApplicationId.newInstance(100L, 1), 1); DAGHistoryEvent historyEvent = new DAGHistoryEvent(tezDAGID, - new DAGStartedEvent(tezDAGID, 1001l, "user1", "dagName1")); + new DAGStartedEvent(tezDAGID, 1001L, "user1", "dagName1")); for (int i = 0; i < 100; ++i) { atsHistoryLoggingService.handle(historyEvent); } try { - Thread.sleep(2500l); + Thread.sleep(2500L); } catch (InterruptedException e) { // Do nothing } @@ -159,16 +159,16 @@ public void testATSHistoryLoggingServiceShutdown() { public void testATSEventBatching() { atsHistoryLoggingService.start(); TezDAGID tezDAGID = TezDAGID.getInstance( - ApplicationId.newInstance(100l, 1), 1); + ApplicationId.newInstance(100L, 1), 1); DAGHistoryEvent historyEvent = new DAGHistoryEvent(tezDAGID, - new DAGStartedEvent(tezDAGID, 1001l, "user1", "dagName1")); + new DAGStartedEvent(tezDAGID, 1001L, "user1", "dagName1")); for (int i = 0; i < 100; ++i) { atsHistoryLoggingService.handle(historyEvent); } try { - Thread.sleep(1000l); + Thread.sleep(1000L); } catch (InterruptedException e) { // Do nothing } @@ -195,7 +195,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable { ++atsInvokeCounter; atsEntitiesCounter += invocation.getArguments().length; try { - Thread.sleep(10l); + Thread.sleep(10L); } catch (InterruptedException e) { // do nothing } @@ -208,15 +208,15 @@ public Object answer(InvocationOnMock invocation) throws Throwable { atsHistoryLoggingService1.init(conf); atsHistoryLoggingService1.start(); TezDAGID tezDAGID = TezDAGID.getInstance( - ApplicationId.newInstance(100l, 1), 1); + ApplicationId.newInstance(100L, 1), 1); DAGHistoryEvent historyEvent = new DAGHistoryEvent(tezDAGID, - new DAGStartedEvent(tezDAGID, 1001l, "user1", "dagName1")); + new DAGStartedEvent(tezDAGID, 1001L, "user1", "dagName1")); for (int i = 0; i < 100; ++i) { atsHistoryLoggingService1.handle(historyEvent); } try { - Thread.sleep(20l); + Thread.sleep(20L); } catch (InterruptedException e) { // Do nothing } diff --git a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryWithMiniCluster.java b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryWithMiniCluster.java index 19edeb264a..c47c30fa33 100644 --- a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryWithMiniCluster.java +++ b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestATSHistoryWithMiniCluster.java @@ -166,7 +166,7 @@ public void testDisabledACls() throws Exception { while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } assertEquals(DAGStatus.State.SUCCEEDED, dagStatus.getState()); diff --git a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java index 7e5da0e2d9..f757ddb17a 100644 --- a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java +++ b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java @@ -118,7 +118,7 @@ public class TestHistoryEventTimelineConversion { @SuppressWarnings("deprecation") @BeforeEach public void setup() { - applicationId = ApplicationId.newInstance(9999l, 1); + applicationId = ApplicationId.newInstance(9999L, 1); applicationAttemptId = ApplicationAttemptId.newInstance(applicationId, 1); tezDAGID = TezDAGID.getInstance(applicationId, random.nextInt()); tezVertexID = TezVertexID.getInstance(tezDAGID, random.nextInt()); diff --git a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/tests/MiniTezClusterWithTimeline.java b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/tests/MiniTezClusterWithTimeline.java index 2348b20943..e30b5787d9 100644 --- a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/tests/MiniTezClusterWithTimeline.java +++ b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/tests/MiniTezClusterWithTimeline.java @@ -114,7 +114,7 @@ public void serviceInit(Configuration conf) throws Exception { if (conf.get(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC) == null) { // nothing defined. set quick delete value - conf.setLong(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0l); + conf.setLong(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0L); } maxTimeToWaitForAppsOnShutdown = conf.getLong( diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/common/resources/MemoryDistributor.java b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/common/resources/MemoryDistributor.java index 0a37ba40d9..a759241cd1 100644 --- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/common/resources/MemoryDistributor.java +++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/common/resources/MemoryDistributor.java @@ -210,7 +210,7 @@ private long registerRequest(long requestSize, MemoryUpdateCallback callback, private void validateAllocations(Iterable allocations, int numRequestors) { Objects.requireNonNull(allocations); - long totalAllocated = 0l; + long totalAllocated = 0L; int numAllocations = 0; for (Long l : allocations) { totalAllocated += l; diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/common/resources/ScalingAllocator.java b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/common/resources/ScalingAllocator.java index a430d48c48..ee2212f547 100644 --- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/common/resources/ScalingAllocator.java +++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/common/resources/ScalingAllocator.java @@ -80,7 +80,7 @@ public Long apply(InitialMemoryRequestContext requestContext) { for (InitialMemoryRequestContext request : requests) { long requestedSize = request.getRequestedSize(); if (requestedSize == 0) { - allocations.add(0l); + allocations.add(0L); LOG.debug("Scaling requested: 0 to allocated: 0"); } else { long allocated = (long) ((requestedSize / (double) totalRequested) * availableForAllocation); diff --git a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/ContainerReporter.java b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/ContainerReporter.java index 950d7264d7..130987d941 100644 --- a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/ContainerReporter.java +++ b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/ContainerReporter.java @@ -40,7 +40,7 @@ public class ContainerReporter extends CallableWithNdc { private final TezTaskUmbilicalProtocol umbilical; private final ContainerContext containerContext; private final int getTaskMaxSleepTime; - private final long LOG_INTERVAL = 30000l; + private final long LOG_INTERVAL = 30000L; private long nextGetTaskPrintTime; diff --git a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/TestInputReadyTracker.java b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/TestInputReadyTracker.java index 6294b12166..d1b21cfd04 100644 --- a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/TestInputReadyTracker.java +++ b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/TestInputReadyTracker.java @@ -47,7 +47,7 @@ public class TestInputReadyTracker { - private static final long SLEEP_TIME = 200l; + private static final long SLEEP_TIME = 200L; @Test @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) @@ -59,8 +59,8 @@ public void testWithoutGrouping1() throws InterruptedException { // Test for simple inputs List requestList; - long startTime = 0l; - long readyTime = 0l; + long startTime = 0L; + long readyTime = 0L; requestList = new ArrayList(); requestList.add(input1); requestList.add(input2); @@ -92,8 +92,8 @@ public void testWithoutGrouping2() throws InterruptedException { // Test for simple inputs List requestList; - long startTime = 0l; - long readyTime = 0l; + long startTime = 0L; + long readyTime = 0L; requestList = new ArrayList(); requestList.add(input1); @@ -182,8 +182,8 @@ public void testGrouped() throws InterruptedException { // Test for simple inputs List requestList; - long startTime = 0l; - long readyTime = 0l; + long startTime = 0L; + long readyTime = 0L; requestList = new ArrayList(); requestList.add(group1); Input readyInput = inputReadyTracker.waitForAnyInputReady(requestList); diff --git a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/api/impl/TestProcessorContext.java b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/api/impl/TestProcessorContext.java index 2a0bbf4b31..5fb328a965 100644 --- a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/api/impl/TestProcessorContext.java +++ b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/api/impl/TestProcessorContext.java @@ -83,7 +83,7 @@ public void testDagNumber() throws IOException { InputReadyTracker inputReadyTracker = mock(InputReadyTracker.class); ObjectRegistry objectRegistry = new ObjectRegistryImpl(); ExecutionContext execContext = new ExecutionContextImpl("localhost"); - long memAvailable = 10000l; + long memAvailable = 10000L; TezProcessorContextImpl procContext = new TezProcessorContextImpl( diff --git a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java index b08781dcc9..8778814862 100644 --- a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java +++ b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/common/resources/TestMemoryDistributor.java @@ -56,7 +56,7 @@ public void setup() { public void testScalingNoProcessor() throws TezException { MemoryDistributor dist = new MemoryDistributor(2, 1, conf); - dist.setJvmMemory(10000l); + dist.setJvmMemory(10000L); // First request MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); @@ -92,24 +92,24 @@ public void testScalingNoProcessor2() throws TezException { // Real world values MemoryDistributor dist = new MemoryDistributor(2, 0, conf); - dist.setJvmMemory(209715200l); + dist.setJvmMemory(209715200L); // First request MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); InputContext e1InputContext1 = createTestInputContext(); InputDescriptor e1InDesc1 = createTestInputDescriptor(); - dist.requestMemory(104857600l, e1Callback, e1InputContext1, e1InDesc1); + dist.requestMemory(104857600L, e1Callback, e1InputContext1, e1InDesc1); // Second request MemoryUpdateCallbackForTest e2Callback = new MemoryUpdateCallbackForTest(); InputContext e2InputContext2 = createTestInputContext(); InputDescriptor e2InDesc2 = createTestInputDescriptor(); - dist.requestMemory(157286400l, e2Callback, e2InputContext2, e2InDesc2); + dist.requestMemory(157286400L, e2Callback, e2InputContext2, e2InDesc2); dist.makeInitialAllocations(); - assertEquals(58720256l, e1Callback.assigned); - assertEquals(88080384l, e2Callback.assigned); + assertEquals(58720256L, e1Callback.assigned); + assertEquals(88080384L, e2Callback.assigned); } @Test @@ -117,7 +117,7 @@ public void testScalingNoProcessor2() throws TezException { public void testScalingProcessor() throws TezException { MemoryDistributor dist = new MemoryDistributor(2, 1, conf); - dist.setJvmMemory(10000l); + dist.setJvmMemory(10000L); // First request MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); @@ -163,24 +163,24 @@ public void testScalingDisabled() throws TezException { conf.setBoolean(TezConfiguration.TEZ_TASK_SCALE_MEMORY_ENABLED, false); MemoryDistributor dist = new MemoryDistributor(2, 0, conf); - dist.setJvmMemory(207093760l); + dist.setJvmMemory(207093760L); // First request MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); InputContext e1InputContext1 = createTestInputContext(); InputDescriptor e1InDesc1 = createTestInputDescriptor(); - dist.requestMemory(104857600l, e1Callback, e1InputContext1, e1InDesc1); + dist.requestMemory(104857600L, e1Callback, e1InputContext1, e1InDesc1); // Second request MemoryUpdateCallbackForTest e2Callback = new MemoryUpdateCallbackForTest(); InputContext e2InputContext2 = createTestInputContext(); InputDescriptor e2InDesc2 = createTestInputDescriptor(); - dist.requestMemory(144965632l, e2Callback, e2InputContext2, e2InDesc2); + dist.requestMemory(144965632L, e2Callback, e2InputContext2, e2InDesc2); dist.makeInitialAllocations(); - assertEquals(104857600l, e1Callback.assigned); - assertEquals(144965632l, e2Callback.assigned); + assertEquals(104857600L, e1Callback.assigned); + assertEquals(144965632L, e2Callback.assigned); } @Test @@ -190,7 +190,7 @@ public void testReserveFractionConfigured() throws TezException { conf.setDouble(TezConfiguration.TEZ_TASK_SCALE_MEMORY_RESERVE_FRACTION, 0.5d); MemoryDistributor dist = new MemoryDistributor(2, 1, conf); - dist.setJvmMemory(10000l); + dist.setJvmMemory(10000L); // First request MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); diff --git a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskReporter.java b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskReporter.java index 7bef84c841..d2437cb079 100644 --- a/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskReporter.java +++ b/tez-runtime-internals/src/test/java/org/apache/tez/runtime/task/TestTaskReporter.java @@ -131,7 +131,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable { } } verify(mockUmbilical, times(3)).heartbeat(any()); - Thread.sleep(200l); + Thread.sleep(200L); // Sleep for less than the callable sleep time. No more invocations. verify(mockUmbilical, times(3)).heartbeat(any()); } finally { diff --git a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManagerBase.java b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManagerBase.java index 6f5eaa513e..33eb649407 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManagerBase.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/ShuffleVertexManagerBase.java @@ -76,7 +76,7 @@ @Private @Evolving abstract class ShuffleVertexManagerBase extends VertexManagerPlugin { - static long MB = 1024l * 1024l; + static long MB = 1024L * 1024L; private static final Logger LOG = LoggerFactory.getLogger(ShuffleVertexManagerBase.class); diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/ShuffleUtils.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/ShuffleUtils.java index b2135b0566..afe2d0063c 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/ShuffleUtils.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/ShuffleUtils.java @@ -77,7 +77,7 @@ public final class ShuffleUtils { private static final Logger LOG = LoggerFactory.getLogger(ShuffleUtils.class); - private static final long MB = 1024l * 1024l; + private static final long MB = 1024L * 1024L; static final ThreadLocal MBPS_FORMAT = new ThreadLocal() { diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/MergeManager.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/MergeManager.java index fa5d5df9ed..96ee20b367 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/MergeManager.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/MergeManager.java @@ -751,7 +751,7 @@ public void merge(List inputs) throws IOException, InterruptedExcepti MapOutput mergedMapOutputs = null; - long mergeOutputSize = 0l; + long mergeOutputSize = 0L; //Lock manager so that fetcher threads can not change the mem size synchronized (manager) { diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/input/OrderedGroupedKVInput.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/input/OrderedGroupedKVInput.java index f95e47cd3a..f709c487d8 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/input/OrderedGroupedKVInput.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/input/OrderedGroupedKVInput.java @@ -102,7 +102,7 @@ public synchronized List initialize() throws IOException { this.conf = TezUtils.createConfFromBaseConfAndPayload(getContext()); if (this.getNumPhysicalInputs() == 0) { - getContext().requestInitialMemory(0l, null); + getContext().requestInitialMemory(0L, null); isStarted.set(true); getContext().inputIsReady(); LOG.info("input fetch not required since there are 0 physical inputs for input vertex: " diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/input/UnorderedKVInput.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/input/UnorderedKVInput.java index 7096cde1fb..b5ee15d867 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/input/UnorderedKVInput.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/input/UnorderedKVInput.java @@ -89,7 +89,7 @@ public synchronized List initialize() throws Exception { this.conf = TezUtils.createConfFromBaseConfAndPayload(getContext()); if (getNumPhysicalInputs() == 0) { - getContext().requestInitialMemory(0l, null); + getContext().requestInitialMemory(0L, null); isStarted.set(true); getContext().inputIsReady(); LOG.info("input fetch not required since there are 0 physical inputs for input vertex: " diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/resources/WeightedScalingMemoryDistributor.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/resources/WeightedScalingMemoryDistributor.java index 08a5b34478..e97afba4dc 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/resources/WeightedScalingMemoryDistributor.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/resources/WeightedScalingMemoryDistributor.java @@ -141,7 +141,7 @@ public Iterable assignMemory(long availableForAllocation, int numTotalInpu for (Request request : requests) { long allocated = 0; if (request.requestSize == 0) { - allocations.add(0l); + allocations.add(0L); if (LOG.isDebugEnabled()) { LOG.debug("Scaling requested " + request.componentClassname + " of type " + request.requestType + " 0 to allocated: 0"); diff --git a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/utils/DATA_RANGE_IN_MB.java b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/utils/DATA_RANGE_IN_MB.java index 43cc00272f..933e8aab73 100644 --- a/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/utils/DATA_RANGE_IN_MB.java +++ b/tez-runtime-library/src/main/java/org/apache/tez/runtime/library/utils/DATA_RANGE_IN_MB.java @@ -37,7 +37,7 @@ static long ceil(long a, long b) { } public static final DATA_RANGE_IN_MB getRange(long sizeInBytes) { - long sizeInMB = ceil(sizeInBytes, (1024l * 1024l)); + long sizeInMB = ceil(sizeInBytes, (1024L * 1024L)); for (DATA_RANGE_IN_MB range : values()) { if (sizeInMB >= range.sizeInMB) { return range; diff --git a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestFairShuffleVertexManager.java b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestFairShuffleVertexManager.java index 77ef557024..2eca76551e 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestFairShuffleVertexManager.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestFairShuffleVertexManager.java @@ -77,7 +77,7 @@ public void testAutoParallelismConfig() throws Exception { manager = createManager(null, mockContext, null, 0.5f); verify(mockContext, times(1)).vertexReconfigurationPlanned(); // Tez notified of reconfig assertTrue(manager.config.isAutoParallelismEnabled()); - assertEquals(manager.config.getDesiredTaskInputDataSize(), 1000l * MB); + assertEquals(manager.config.getDesiredTaskInputDataSize(), 1000L * MB); assertEquals(0.25f, manager.config.getMinFraction()); assertEquals(0.5f, manager.config.getMaxFraction()); @@ -382,7 +382,7 @@ private void testSchedulingWithPartitionStats( private static FairShuffleVertexManager createManager(Configuration conf, VertexManagerPluginContext context, Float min, Float max) { - return createManager(conf, context, true, 1000l * MB, min, max); + return createManager(conf, context, true, 1000L * MB, min, max); } private static FairShuffleVertexManager createManager(Configuration conf, diff --git a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java index 3f6a9ddfb1..805fcb9f87 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManager.java @@ -153,8 +153,8 @@ public void testLargeDataSize() throws IOException { assertEquals(2, newEdgeManagers.size()); assertEquals(0, manager.pendingTasks.size()); // all tasks scheduled assertEquals(2, scheduledTasks.size()); - assertTrue(scheduledTasks.contains(new Integer(0))); - assertTrue(scheduledTasks.contains(new Integer(1))); + assertTrue(scheduledTasks.contains(0)); + assertTrue(scheduledTasks.contains(1)); assertEquals(4, manager.numBipartiteSourceTasksCompleted); assertEquals(4, manager.numVertexManagerEventsReceived); assertEquals(Long.MAX_VALUE >> 1 << 1, manager.completedSourceTasksOutputSize); @@ -183,7 +183,7 @@ public void testAutoParallelismConfig() throws Exception { ShuffleVertexManager.ShuffleVertexManagerConfigBuilder configurer = ShuffleVertexManager .createConfigBuilder(null); VertexManagerPluginDescriptor pluginDesc = configurer.setAutoReduceParallelism(true) - .setDesiredTaskInputSize(1000l) + .setDesiredTaskInputSize(1000L) .setMinTaskParallelism(10).setSlowStartMaxSrcCompletionFraction(0.5f).build(); when(mockContext.getUserPayload()).thenReturn(pluginDesc.getUserPayload()); @@ -194,7 +194,7 @@ public void testAutoParallelismConfig() throws Exception { verify(mockContext, times(1)).vertexReconfigurationPlanned(); // Tez notified of reconfig assertTrue(manager.config.isAutoParallelismEnabled()); - assertEquals(1000l, manager.config.getDesiredTaskInputDataSize()); + assertEquals(1000L, manager.config.getDesiredTaskInputDataSize()); assertEquals(10, manager.mgrConfig.getMinTaskParallelism()); assertEquals(0.25f, manager.config.getMinFraction()); assertEquals(0.5f, manager.config.getMaxFraction()); @@ -283,12 +283,12 @@ public void testSchedulingWithPartitionStats() throws IOException { assertEquals(3, manager.totalNumBipartiteSourceTasks); //Tasks should be scheduled in task 2, 0, 1 order - long[] sizes = new long[]{(100 * 1000l * 1000l), (0l), (5000 * 1000l * 1000l)}; + long[] sizes = new long[]{(100 * 1000L * 1000L), (0L), (5000 * 1000L * 1000L)}; VertexManagerEvent vmEvent = getVertexManagerEvent(sizes, 1060000000, r1); manager.onVertexManagerEventReceived(vmEvent); //send VM event //stats from another vertex (more of empty stats) - sizes = new long[]{(0l), (0l), (0l)}; + sizes = new long[]{(0L), (0L), (0L)}; vmEvent = getVertexManagerEvent(sizes, 1060000000, r1); manager.onVertexManagerEventReceived(vmEvent); //send VM event @@ -312,7 +312,7 @@ public void testSchedulingWithPartitionStats() throws IOException { private static ShuffleVertexManager createManager(Configuration conf, VertexManagerPluginContext context, Float min, Float max) { - return createManager(conf, context, true, 1000l, min, max); + return createManager(conf, context, true, 1000L, min, max); } private static ShuffleVertexManager createManager(Configuration conf, diff --git a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManagerBase.java b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManagerBase.java index beb715b20e..3590c54a33 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManagerBase.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManagerBase.java @@ -65,7 +65,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -@SuppressWarnings({ "unchecked", "rawtypes" }) +@SuppressWarnings({ "unchecked", "rawtypes", "checkstyle:MethodLength" }) public class TestShuffleVertexManagerBase extends TestShuffleVertexManagerUtils { List emptyCompletions = null; @@ -211,8 +211,8 @@ public void testPartitionStats(Class shuffle mockSrcVertexId1, 2, mockSrcVertexId2, 2, mockSrcVertexId3, 2, mockManagedVertexId, 4, scheduledTasks, null); //{5,9,12,18} in bitmap - final long MB = 1024l * 1024l; - long[] sizes = new long[]{(0l), (1 * MB), (964 * MB), (48 * MB)}; + final long MB = 1024L * 1024L; + long[] sizes = new long[]{(0L), (1 * MB), (964 * MB), (48 * MB)}; VertexManagerEvent vmEvent = getVertexManagerEvent(sizes, 0, "Vertex", false); manager = createManager(shuffleVertexManagerClass, conf, mockContext, 0.01f, 0.75f); @@ -432,8 +432,8 @@ public void testAutoParallelism(Class shuffl // TODO improve tests for parallelism assertEquals(0, manager.pendingTasks.size()); // all tasks scheduled assertEquals(2, scheduledTasks.size()); - assertTrue(scheduledTasks.contains(new Integer(0))); - assertTrue(scheduledTasks.contains(new Integer(1))); + assertTrue(scheduledTasks.contains(0)); + assertTrue(scheduledTasks.contains(1)); assertEquals(2, manager.numBipartiteSourceTasksCompleted); assertEquals(2, manager.numVertexManagerEventsReceived); assertEquals(100 * MB, manager.completedSourceTasksOutputSize); @@ -808,7 +808,7 @@ public void testShuffleVertexManagerSlowStart(Class shuffleVertexManagerClass) throws IOException { Configuration conf = new Configuration(); ShuffleVertexManagerBase manager = null; @@ -930,7 +930,7 @@ public void test_Tez1649_with_scatter_gather_edges( @ParameterizedTest(name = "test[{0}]") @MethodSource("data") @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS) - public void test_Tez1649_with_mixed_edges(Class shuffleVertexManagerClass) { + public void testTez1649WithMixedEdges(Class shuffleVertexManagerClass) { Configuration conf = new Configuration(); ShuffleVertexManagerBase manager = null; @@ -1126,7 +1126,8 @@ public void testZeroTasksSendsConfigured(Class shuffleVertexManagerClass) { + public void testTezDrainCompletionsOnVertexStart( + Class shuffleVertexManagerClass) { Configuration conf = new Configuration(); ShuffleVertexManagerBase manager; diff --git a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManagerUtils.java b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManagerUtils.java index b6e049da0b..3d599eb43f 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManagerUtils.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/dag/library/vertexmanager/TestShuffleVertexManagerUtils.java @@ -67,7 +67,7 @@ @SuppressWarnings({ "unchecked", "rawtypes" }) public class TestShuffleVertexManagerUtils { - static long MB = 1024l * 1024l; + static long MB = 1024L * 1024L; TezVertexID vertexId = TezVertexID.fromString("vertex_1436907267600_195589_1_00"); int taskId = 0; diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java index 9a2558a7bb..9fc1bf3667 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/common/resources/TestWeightedScalingMemoryDistributor.java @@ -70,7 +70,7 @@ public void testSimpleWeightedScaling() throws TezException { MemoryDistributor dist = new MemoryDistributor(2, 2, conf); - dist.setJvmMemory(10000l); + dist.setJvmMemory(10000L); // First request - ScatterGatherShuffleInput MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); @@ -118,7 +118,7 @@ public void testAdditionalReserveFractionWeightedScaling() throws TezException { MemoryDistributor dist = new MemoryDistributor(2, 2, conf); - dist.setJvmMemory(10000l); + dist.setJvmMemory(10000L); // First request - ScatterGatherShuffleInput [weight 6] MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); @@ -169,7 +169,7 @@ public void testWeightedScalingNonConcurrent() throws TezException { MemoryDistributor dist = new MemoryDistributor(2, 2, conf); - dist.setJvmMemory(10000l); + dist.setJvmMemory(10000L); // First request - ScatterGatherShuffleInput MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); @@ -226,7 +226,7 @@ public void testAdditionalReserveFractionWeightedScalingNonConcurrent() throws T MemoryDistributor dist = new MemoryDistributor(2, 2, conf); - dist.setJvmMemory(10000l); + dist.setJvmMemory(10000L); // First request - ScatterGatherShuffleInput [weight 6] MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); @@ -277,7 +277,7 @@ public void testWeightedScalingNonConcurrentInputsDisabled() throws TezException MemoryDistributor dist = new MemoryDistributor(2, 2, conf); - dist.setJvmMemory(10000l); + dist.setJvmMemory(10000L); // First request - ScatterGatherShuffleInput MemoryUpdateCallbackForTest e1Callback = new MemoryUpdateCallbackForTest(); diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/TestValuesIterator.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/TestValuesIterator.java index ca39cdccea..6eab2a0c8b 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/TestValuesIterator.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/TestValuesIterator.java @@ -89,6 +89,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@SuppressWarnings({"checkstyle:HiddenField", "checkstyle:VisibilityModifier"}) public class TestValuesIterator { private static final Logger LOG = LoggerFactory.getLogger(TestValuesIterator.class); @@ -166,7 +167,8 @@ public void cleanup() throws Exception { @ParameterizedTest(name = "test[{0}, {1}, {2}, {3}, {4}, {5}]") @MethodSource("getParameters") @Timeout(value = 20000, unit = TimeUnit.MILLISECONDS) - public void testIteratorWithInMemoryReader(String serializationClassName, Class key, Class val, TestWithComparator comparator, TestWithComparator correctComparator, boolean testResult) throws Exception { + public void testIteratorWithInMemoryReader(String serializationClassName, Class key, Class val, + TestWithComparator comparator, TestWithComparator correctComparator, boolean testResult) throws Exception { setupInit(serializationClassName, key, val, comparator, correctComparator, testResult); ValuesIterator iterator = createIterator(true); verifyIteratorData(iterator); @@ -557,7 +559,7 @@ public List createInMemStreams() throws IOException { private InputContext createTezInputContext() { TezCounters counters = new TezCounters(); InputContext inputContext = mock(InputContext.class); - doReturn(1024 * 1024 * 100l).when(inputContext).getTotalMemoryAvailableToTask(); + doReturn(1024 * 1024 * 100L).when(inputContext).getTotalMemoryAvailableToTask(); doReturn(counters).when(inputContext).getCounters(); doReturn(1).when(inputContext).getInputIndex(); doReturn("srcVertex").when(inputContext).getSourceVertexName(); diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/TestFetcher.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/TestFetcher.java index fb0e34f50c..79dd9665d0 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/TestFetcher.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/TestFetcher.java @@ -193,7 +193,7 @@ public void testSetupLocalDiskFetch() throws Exception { for(int i=0;i Integer.MAX_VALUE); - initialMemoryAvailable = 200 * 1024 * 1024l; //initial mem < memlimit + initialMemoryAvailable = 200 * 1024 * 1024L; //initial mem < memlimit mergeManager = new MergeManager(conf, localFs, localDirAllocator, t0inputContext, null, null, null, null, t0exceptionReporter, initialMemoryAvailable, null, false, -1); @@ -823,7 +824,7 @@ public void testOnDiskMergerFilenames() throws IOException, InterruptedException MergeManager mergeManagerReal = new MergeManager(conf, localFs, localDirAllocator, inputContext, null, null, null, null, - exceptionReporter, 1 * 1024l * 1024l, null, false, -1); + exceptionReporter, 1 * 1024L * 1024L, null, false, -1); MergeManager mergeManager = spy(mergeManagerReal); // Partition 0 Keys 0-2, Partition 1 Keys 3-5 @@ -1079,7 +1080,7 @@ public synchronized void closeOnDiskFile(FileChunk file) { } private InputContext createMockInputContext(String uniqueId) { - return createMockInputContext(uniqueId, 200 * 1024 * 1024l); + return createMockInputContext(uniqueId, 200 * 1024 * 1024L); } private InputContext createMockInputContext(String uniqueId, long mem) { diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffle.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffle.java index 190b1a6a87..c589cfcbd0 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffle.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffle.java @@ -79,8 +79,8 @@ public void testSchedulerTerminatesOnException() throws IOException, Interrupted InputContext inputContext = createTezInputContext(); TezConfiguration conf = new TezConfiguration(); - conf.setLong(Constants.TEZ_RUNTIME_TASK_MEMORY, 300000l); - Shuffle shuffle = new Shuffle(inputContext, conf, 1, 3000000l); + conf.setLong(Constants.TEZ_RUNTIME_TASK_MEMORY, 300000L); + Shuffle shuffle = new Shuffle(inputContext, conf, 1, 3000000L); try { shuffle.run(); ShuffleScheduler scheduler = shuffle.scheduler; @@ -92,12 +92,12 @@ public void testSchedulerTerminatesOnException() throws IOException, Interrupted shuffle.reportException(new IOException(exceptionMessage)); while (!scheduler.isShutdown()) { - Thread.sleep(100l); + Thread.sleep(100L); } assertTrue(scheduler.isShutdown()); while (!mergeManager.isShutdown()) { - Thread.sleep(100l); + Thread.sleep(100L); } assertTrue(mergeManager.isShutdown()); @@ -121,8 +121,8 @@ public void testSchedulerTerminatesOnException() throws IOException, Interrupted public void testKillSelf() throws IOException, InterruptedException { InputContext inputContext = createTezInputContext(); TezConfiguration conf = new TezConfiguration(); - conf.setLong(Constants.TEZ_RUNTIME_TASK_MEMORY, 300000l); - Shuffle shuffle = new Shuffle(inputContext, conf, 1, 3000000l); + conf.setLong(Constants.TEZ_RUNTIME_TASK_MEMORY, 300000L); + Shuffle shuffle = new Shuffle(inputContext, conf, 1, 3000000L); try { shuffle.run(); ShuffleScheduler scheduler = shuffle.scheduler; diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffleInputEventHandlerOrderedGrouped.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffleInputEventHandlerOrderedGrouped.java index fa6abcce24..0978bc09f2 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffleInputEventHandlerOrderedGrouped.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffleInputEventHandlerOrderedGrouped.java @@ -351,7 +351,8 @@ public void basicTest() throws IOException { int partitionId = srcIdx; verify(scheduler).addKnownMapOutput(eq(HOST), eq(PORT), eq(partitionId), eq(expectedIdentifier)); - assertTrue(scheduler.pipelinedShuffleInfoEventsMap.isEmpty(), "Shuffle info events should be empty for regular shuffle codepath"); + assertTrue(scheduler.pipelinedShuffleInfoEventsMap.isEmpty(), + "Shuffle info events should be empty for regular shuffle codepath"); } @Test diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffleScheduler.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffleScheduler.java index 915ced6009..f3f09d9406 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffleScheduler.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/shuffle/orderedgrouped/TestShuffleScheduler.java @@ -814,13 +814,15 @@ public void testPenalty() throws IOException, InterruptedException { //Should not get host, as it is added to penalty loop MapHost host = scheduler.getHost(); - assertFalse((host.getHost() + ":" + host.getPort() + ":" + host.getPartitionId()).equalsIgnoreCase("host0:10000"), "Host identifier mismatch"); + assertFalse((host.getHost() + ":" + host.getPort() + ":" + host.getPartitionId()).equalsIgnoreCase("host0:10000"), + "Host identifier mismatch"); //Refree thread would release it after INITIAL_PENALTY timeout Thread.sleep(ShuffleScheduler.INITIAL_PENALTY + 1000); host = scheduler.getHost(); - assertFalse((host.getHost() + ":" + host.getPort() + ":" + host.getPartitionId()).equalsIgnoreCase("host0:10000"), "Host identifier mismatch"); + assertFalse((host.getHost() + ":" + host.getPort() + ":" + host.getPartitionId()).equalsIgnoreCase("host0:10000"), + "Host identifier mismatch"); } @Test @@ -1086,7 +1088,7 @@ FetcherOrderedGrouped constructFetcherForHost(MapHost mapHost) { @Override public Void answer(InvocationOnMock invocation) throws Throwable { if (fetcherShouldWait) { - Thread.sleep(100000l); + Thread.sleep(100000L); } return null; } diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/TestPipelinedSorter.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/TestPipelinedSorter.java index f5d8737f48..c2c864fe2d 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/TestPipelinedSorter.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/TestPipelinedSorter.java @@ -153,7 +153,7 @@ public void basicTest() throws IOException { //# partition, # of keys, size per key, InitialMem, blockSize conf.setInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB, 5); - basicTest(1, 100000, 100, (10 * 1024l * 1024l), 3 << 20); + basicTest(1, 100000, 100, (10 * 1024L * 1024L), 3 << 20); verifyOutputPermissions(outputContext.getUniqueIdentifier()); } @@ -161,7 +161,7 @@ public void basicTest() throws IOException { public void testWithoutPartitionStats() throws IOException { conf.setBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_REPORT_PARTITION_STATS, false); //# partition, # of keys, size per key, InitialMem, blockSize - basicTest(1, 0, 0, (10 * 1024l * 1024l), 3 << 20); + basicTest(1, 0, 0, (10 * 1024L * 1024L), 3 << 20); conf.setBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_REPORT_PARTITION_STATS, true); } @@ -169,7 +169,7 @@ public void testWithoutPartitionStats() throws IOException { public void testWithEmptyData() throws IOException { conf.setInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB, 5); //# partition, # of keys, size per key, InitialMem, blockSize - basicTest(1, 0, 0, (10 * 1024l * 1024l), 3 << 20); + basicTest(1, 0, 0, (10 * 1024L * 1024L), 3 << 20); } @Test @@ -249,26 +249,26 @@ public void testEmptyPartitionsHelper(int numKeys, boolean sendEmptyPartitionDet @Test public void basicTestWithSmallBlockSize() throws IOException { //3 MB key & 3 MB value, whereas block size is just 3 MB - basicTest(1, 5, (3 << 20), (10 * 1024l * 1024l), 3 << 20); + basicTest(1, 5, (3 << 20), (10 * 1024L * 1024L), 3 << 20); } @Test public void testWithLargeKeyValue() throws IOException { //15 MB key & 15 MB value, 48 MB sort buffer. block size is 48MB (or 1 block) //meta would be 16 MB - basicTest(1, 5, (15 << 20), (48 * 1024l * 1024l), 48 << 20); + basicTest(1, 5, (15 << 20), (48 * 1024L * 1024L), 48 << 20); } @Test public void testKVExceedsBuffer() throws IOException { // a single block of 1mb, 2KV pair, key 1mb, value 1mb - basicTest(1, 2, (1 << 20), (1 * 1024l * 1024l), 1<<20); + basicTest(1, 2, (1 << 20), (1 * 1024L * 1024L), 1 << 20); } @Test public void testKVExceedsBuffer2() throws IOException { // a list of 4 blocks each 256kb, 2KV pair, key 1mb, value 1mb - basicTest(1, 2, (1 << 20), (1 * 1024l * 1024l), 256<<20); + basicTest(1, 2, (1 << 20), (1 * 1024L * 1024L), 256 << 20); } @Test @@ -384,7 +384,7 @@ public void testWithVariableKVLength2() throws IOException { // 20 KVpairs of 2X10kb, 10 KV of 2X200kb, 20KV of 2X10kb int numkeys[] = {20, 10, 20}; int keylens[] = {10<<10, 200<<10, 10<<10}; - basicTest2(1, numkeys, keylens, (10 * 1024l * 1024l), 2); + basicTest2(1, numkeys, keylens, (10 * 1024L * 1024L), 2); } @Test @@ -392,7 +392,7 @@ public void testWithCustomComparator() throws IOException { //Test with custom comparator conf.set(TezRuntimeConfiguration.TEZ_RUNTIME_KEY_COMPARATOR_CLASS, CustomComparator.class.getName()); - basicTest(1, 100000, 100, (10 * 1024l * 1024l), 3 << 20); + basicTest(1, 100000, 100, (10 * 1024L * 1024L), 3 << 20); } @Test @@ -632,8 +632,8 @@ private void verifyCounters(PipelinedSorter sorter, OutputContext context) { public void memTest() throws IOException { //Verify if > 2 GB can be set via config conf.setInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB, 3076); - long size = ExternalSorter.getInitialMemoryRequirement(conf, 4096 * 1024 * 1024l); - assertEquals((3076l << 20), size); + long size = ExternalSorter.getInitialMemoryRequirement(conf, 4096 * 1024 * 1024L); + assertEquals((3076L << 20), size); //Verify number of block buffers allocated this.initialAvailableMem = 10 * 1024 * 1024; @@ -724,7 +724,7 @@ public void test_without_lazyMemAllocation() throws IOException { conf.setBoolean(TezRuntimeConfiguration .TEZ_RUNTIME_PIPELINED_SORTER_LAZY_ALLOCATE_MEMORY, false); PipelinedSorter sorter = new PipelinedSorter(this.outputContext, conf, - numOutputs, (128l << 20)); + numOutputs, (128L << 20)); assertEquals(1, sorter.buffers.size(), "Expected 1 sort buffers. current len=" + sorter.buffers.size()); //128 MB. Pre-allocate. Get 2 buffer @@ -734,7 +734,7 @@ public void test_without_lazyMemAllocation() throws IOException { conf.setBoolean(TezRuntimeConfiguration .TEZ_RUNTIME_PIPELINED_SORTER_LAZY_ALLOCATE_MEMORY, false); sorter = new PipelinedSorter(this.outputContext, conf, - numOutputs, (128l << 20)); + numOutputs, (128L << 20)); assertEquals(2, sorter.buffers.size(), "Expected 2 sort buffers. current len=" + sorter.buffers.size()); //48 MB. Pre-allocate. But request for lesser block size (62). Get 2 buffer @@ -744,7 +744,7 @@ public void test_without_lazyMemAllocation() throws IOException { conf.setBoolean(TezRuntimeConfiguration .TEZ_RUNTIME_PIPELINED_SORTER_LAZY_ALLOCATE_MEMORY, false); sorter = new PipelinedSorter(this.outputContext, conf, - numOutputs, (48l << 20)); + numOutputs, (48L << 20)); assertEquals(1, sorter.buffers.size(), "Expected 1 sort buffers. current len=" + sorter.buffers.size()); } @@ -758,7 +758,7 @@ public void test_with_lazyMemAllocation() throws IOException { // the 32 MB buffer. conf.setInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB, 128); conf.setBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_PIPELINED_SORTER_LAZY_ALLOCATE_MEMORY, true); - PipelinedSorter sorter = new PipelinedSorter(this.outputContext, conf, numOutputs, (128l << 20)); + PipelinedSorter sorter = new PipelinedSorter(this.outputContext, conf, numOutputs, (128L << 20)); assertEquals(1, sorter.buffers.size(), "Expected 1 sort buffers. current len=" + sorter.buffers.size()); assertEquals(32 * 1024 * 1024 - 64, sorter.buffers.get(0).capacity()); writeData(sorter, 100, 1024 * 1024, false); // 100 1 MB KV. Will spill @@ -775,7 +775,7 @@ public void test_with_lazyMemAllocation() throws IOException { // Get 1 buffer with 62 MB. But grow to 2 buffers as data is written conf.setInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB, 300); conf.setBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_PIPELINED_SORTER_LAZY_ALLOCATE_MEMORY, true); - sorter = new PipelinedSorter(this.outputContext, conf, numOutputs, (300l << 20)); + sorter = new PipelinedSorter(this.outputContext, conf, numOutputs, (300L << 20)); assertEquals(1, sorter.buffers.size()); assertEquals(32 * 1024 * 1024 - 64, sorter.buffers.get(0).capacity()); @@ -788,7 +788,7 @@ public void test_with_lazyMemAllocation() throws IOException { // Get 32 MB buffer first invariably and proceed with the rest. conf.setInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB, 48); conf.setBoolean(TezRuntimeConfiguration.TEZ_RUNTIME_PIPELINED_SORTER_LAZY_ALLOCATE_MEMORY, true); - sorter = new PipelinedSorter(this.outputContext, conf, numOutputs, (48l << 20)); + sorter = new PipelinedSorter(this.outputContext, conf, numOutputs, (48L << 20)); assertEquals(1, sorter.buffers.size(), "Expected 1 sort buffers. current len=" + sorter.buffers.size()); assertEquals(32 * 1024 * 1024 - 64, sorter.buffers.get(0).capacity()); writeData(sorter, 20, 1024 * 1024, false); // 100 1 MB KV. Will spill @@ -811,7 +811,7 @@ public void testLazyAllocateMem() throws IOException { .TEZ_RUNTIME_PIPELINED_SORTER_MIN_BLOCK_SIZE_IN_MB, 4500); try { PipelinedSorter sorter = new PipelinedSorter(this.outputContext, conf, - numOutputs, (4500l << 20)); + numOutputs, (4500L << 20)); } catch (IllegalArgumentException iae) { assertTrue(iae.getMessage().contains(TezRuntimeConfiguration .TEZ_RUNTIME_PIPELINED_SORTER_MIN_BLOCK_SIZE_IN_MB)); @@ -822,7 +822,7 @@ public void testLazyAllocateMem() throws IOException { .TEZ_RUNTIME_PIPELINED_SORTER_MIN_BLOCK_SIZE_IN_MB, -1); try { PipelinedSorter sorter = new PipelinedSorter(this.outputContext, conf, - numOutputs, (4500l << 20)); + numOutputs, (4500L << 20)); } catch (IllegalArgumentException iae) { assertTrue(iae.getMessage().contains(TezRuntimeConfiguration .TEZ_RUNTIME_PIPELINED_SORTER_MIN_BLOCK_SIZE_IN_MB)); @@ -835,7 +835,7 @@ public void testLazyAllocateMem() throws IOException { .TEZ_RUNTIME_PIPELINED_SORTER_MIN_BLOCK_SIZE_IN_MB, -1); try { PipelinedSorter sorter = new PipelinedSorter(this.outputContext, conf, - numOutputs, (4500l << 20)); + numOutputs, (4500L << 20)); } catch (IllegalArgumentException iae) { assertTrue(iae.getMessage().contains(TezRuntimeConfiguration .TEZ_RUNTIME_PIPELINED_SORTER_MIN_BLOCK_SIZE_IN_MB)); @@ -848,7 +848,7 @@ public void testLazyAllocateMem() throws IOException { //Intentionally not having timeout public void testWithLargeKeyValueWithMinBlockSize() throws IOException { //2 MB key & 2 MB value, 48 MB sort buffer. block size is 16MB - basicTest(1, 5, (2 << 20), (48 * 1024l * 1024l), 16 << 20); + basicTest(1, 5, (2 << 20), (48 * 1024L * 1024L), 16 << 20); } @Test diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/TestTezMerger.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/TestTezMerger.java index 763c851e64..a18f16f4b6 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/TestTezMerger.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/TestTezMerger.java @@ -699,7 +699,7 @@ public void testMergeSegments() throws Exception { private void mergeSegments(List segmentList, int mergeFactor, boolean hasDiskSegments) throws Exception { //Merge datasets - MergeQueue mergeQueue = new MergeQueue(DEFAULT_CONF, localFs, segmentList, + MergeQueue mergeQueue = new MergeQueue<>(DEFAULT_CONF, localFs, segmentList, comparator, new Reporter(), false, false); TezRawKeyValueIterator records = mergeQueue.merge( diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/dflt/TestDefaultSorter.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/dflt/TestDefaultSorter.java index 3441fd079b..42928119b6 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/dflt/TestDefaultSorter.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/sort/impl/dflt/TestDefaultSorter.java @@ -141,7 +141,7 @@ public void testSortSpillPercent() throws Exception { conf.setFloat(TezRuntimeConfiguration.TEZ_RUNTIME_SORT_SPILL_PERCENT, 0.0f); try { - new DefaultSorter(context, conf, 10, (10 * 1024 * 1024l)); + new DefaultSorter(context, conf, 10, (10 * 1024 * 1024L)); fail(); } catch(IllegalArgumentException e) { assertTrue(e.getMessage().contains(TezRuntimeConfiguration.TEZ_RUNTIME_SORT_SPILL_PERCENT)); @@ -149,7 +149,7 @@ public void testSortSpillPercent() throws Exception { conf.setFloat(TezRuntimeConfiguration.TEZ_RUNTIME_SORT_SPILL_PERCENT, 1.1f); try { - new DefaultSorter(context, conf, 10, (10 * 1024 * 1024l)); + new DefaultSorter(context, conf, 10, (10 * 1024 * 1024L)); fail(); } catch(IllegalArgumentException e) { assertTrue(e.getMessage().contains(TezRuntimeConfiguration.TEZ_RUNTIME_SORT_SPILL_PERCENT)); @@ -168,7 +168,7 @@ public void testSortLimitsWithSmallRecord() throws IOException { conf.set(TezRuntimeConfiguration.TEZ_RUNTIME_VALUE_CLASS, NullWritable.class.getName()); OutputContext context = createTezOutputContext(); - doReturn(2800 * 1024 * 1024l).when(context).getTotalMemoryAvailableToTask(); + doReturn(2800 * 1024 * 1024L).when(context).getTotalMemoryAvailableToTask(); //Setting IO_SORT_MB to 2047 MB conf.setInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB, 2047); @@ -207,7 +207,7 @@ public void testSortLimitsWithSmallRecord() throws IOException { public void testSortLimitsWithLargeRecords() throws IOException { OutputContext context = createTezOutputContext(); - doReturn(2800 * 1024 * 1024l).when(context).getTotalMemoryAvailableToTask(); + doReturn(2800 * 1024 * 1024L).when(context).getTotalMemoryAvailableToTask(); //Setting IO_SORT_MB to 2047 MB conf.setInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB, 2047); @@ -596,8 +596,10 @@ private void verifyOutputPermissions(String spillId) throws IOException { + "/" + Constants.TEZ_RUNTIME_TASK_OUTPUT_FILENAME_STRING; Path outputPath = dirAllocator.getLocalPathToRead(subpath, conf); Path indexPath = dirAllocator.getLocalPathToRead(subpath + Constants.TEZ_RUNTIME_TASK_OUTPUT_INDEX_SUFFIX_STRING, conf); - assertEquals((short)0640, localFs.getFileStatus(outputPath).getPermission().toShort(), "Incorrect output permissions"); - assertEquals((short)0640, localFs.getFileStatus(indexPath).getPermission().toShort(), "Incorrect index permissions"); + assertEquals((short)0640, localFs.getFileStatus(outputPath).getPermission().toShort(), + "Incorrect output permissions"); + assertEquals((short)0640, localFs.getFileStatus(indexPath).getPermission().toShort(), + "Incorrect index permissions"); } private void verifyCounters(DefaultSorter sorter, OutputContext context) { @@ -699,7 +701,7 @@ private OutputContext createTezOutputContext() throws IOException { doReturn(counters).when(context).getCounters(); doReturn(workingDirs).when(context).getWorkDirs(); doReturn(payLoad).when(context).getUserPayload(); - doReturn(5 * 1024 * 1024l).when(context).getTotalMemoryAvailableToTask(); + doReturn(5 * 1024 * 1024L).when(context).getTotalMemoryAvailableToTask(); doReturn(UniqueID).when(context).getUniqueIdentifier(); doReturn("v1").when(context).getDestinationVertexName(); doReturn(ByteBuffer.wrap(serviceProviderMetaData.getData())).when(context) diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/writers/TestUnorderedPartitionedKVWriter.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/writers/TestUnorderedPartitionedKVWriter.java index 82fef1a886..d4489c03ce 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/writers/TestUnorderedPartitionedKVWriter.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/common/writers/TestUnorderedPartitionedKVWriter.java @@ -115,6 +115,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@SuppressWarnings("checkstyle:HiddenField") public class TestUnorderedPartitionedKVWriter { private static final Logger LOG = LoggerFactory.getLogger(TestUnorderedPartitionedKVWriter.class); @@ -306,7 +307,7 @@ public void testNoRecords(boolean shouldCompress, ReportPartitionStats reportPar @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testNoRecords_SinglePartition(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testNoRecordsSinglePartition(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); // skipBuffers @@ -327,7 +328,7 @@ public void testSkippedPartitions(boolean shouldCompress, ReportPartitionStats r @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testNoSpill_SinglePartition(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testNoSpillSinglePartition(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTest(10, 1, null, shouldCompress, -1, 0); @@ -336,7 +337,7 @@ public void testNoSpill_SinglePartition(boolean shouldCompress, ReportPartitionS @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testSpill_SinglePartition(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testSpillSinglePartition(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTest(1000, 1, null, shouldCompress, -1, 0, 2048, true); @@ -695,7 +696,7 @@ private void verifyPartitionStats(VertexManagerEvent vme, @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testNoSpill_WithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testNoSpillWithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTestWithPipelinedTransfer(10, 10, null, shouldCompress); @@ -704,7 +705,7 @@ public void testNoSpill_WithPipelinedShuffle(boolean shouldCompress, ReportParti @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testSingleSpill_WithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testSingleSpillWithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTestWithPipelinedTransfer(50, 10, null, shouldCompress); @@ -713,7 +714,7 @@ public void testSingleSpill_WithPipelinedShuffle(boolean shouldCompress, ReportP @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testMultipleSpills_WithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testMultipleSpillsWithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTestWithPipelinedTransfer(200, 10, null, shouldCompress); @@ -722,7 +723,7 @@ public void testMultipleSpills_WithPipelinedShuffle(boolean shouldCompress, Repo @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testNoRecords_WithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testNoRecordsWithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTestWithPipelinedTransfer(0, 10, null, shouldCompress); @@ -731,7 +732,7 @@ public void testNoRecords_WithPipelinedShuffle(boolean shouldCompress, ReportPar @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testNoRecords_SinglePartition_WithPipelinedShuffle(boolean shouldCompress, + public void testNoRecordsSinglePartition_WithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); @@ -742,7 +743,7 @@ public void testNoRecords_SinglePartition_WithPipelinedShuffle(boolean shouldCom @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testSkippedPartitions_WithPipelinedShuffle(boolean shouldCompress, + public void testSkippedPartitionsWithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); @@ -752,7 +753,7 @@ public void testSkippedPartitions_WithPipelinedShuffle(boolean shouldCompress, @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testLargeKvPairs_WithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testLargeKvPairsWithPipelinedShuffle(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); textTest(0, 10, 2048, 10, 20, 50, true, false); @@ -974,7 +975,7 @@ private void verifyEmptyPartitions(DataMovementEventPayloadProto eventProto, @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testNoSpill_WithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testNoSpillWithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTestWithFinalMergeDisabled(10, 10, null, shouldCompress); @@ -983,7 +984,7 @@ public void testNoSpill_WithFinalMergeDisabled(boolean shouldCompress, ReportPar @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testSingleSpill_WithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testSingleSpillWithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTestWithFinalMergeDisabled(50, 10, null, shouldCompress); @@ -992,7 +993,7 @@ public void testSingleSpill_WithFinalMergeDisabled(boolean shouldCompress, Repor @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testSinglePartition_WithFinalMergeDisabled(boolean shouldCompress, + public void testSinglePartitionWithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); @@ -1002,7 +1003,7 @@ public void testSinglePartition_WithFinalMergeDisabled(boolean shouldCompress, @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testMultipleSpills_WithFinalMergeDisabled(boolean shouldCompress, + public void testMultipleSpillsWithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); @@ -1012,7 +1013,7 @@ public void testMultipleSpills_WithFinalMergeDisabled(boolean shouldCompress, @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testNoRecords_WithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) + public void testNoRecordsWithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); baseTestWithFinalMergeDisabled(0, 10, null, shouldCompress); @@ -1021,7 +1022,7 @@ public void testNoRecords_WithFinalMergeDisabled(boolean shouldCompress, ReportP @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testNoRecords_SinglePartition_WithFinalMergeDisabled(boolean shouldCompress, + public void testNoRecordsSinglePartition_WithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); @@ -1031,7 +1032,7 @@ public void testNoRecords_SinglePartition_WithFinalMergeDisabled(boolean shouldC @ParameterizedTest(name = "test[{0}, {1}]") @MethodSource("data") @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS) - public void testSkippedPartitions_WithFinalMergeDisabled(boolean shouldCompress, + public void testSkippedPartitionsWithFinalMergeDisabled(boolean shouldCompress, ReportPartitionStats reportPartitionStats) throws IOException, InterruptedException { setupInit(shouldCompress, reportPartitionStats); diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/input/TestOrderedGroupedKVInput.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/input/TestOrderedGroupedKVInput.java index 3257e2c2ee..1eba06f722 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/input/TestOrderedGroupedKVInput.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/input/TestOrderedGroupedKVInput.java @@ -106,7 +106,7 @@ private InputContext createMockInputContext() throws IOException { doReturn(payLoad).when(inputContext).getUserPayload(); doReturn(workingDirs).when(inputContext).getWorkDirs(); - doReturn(200 * 1024 * 1024l).when(inputContext).getTotalMemoryAvailableToTask(); + doReturn(200 * 1024 * 1024L).when(inputContext).getTotalMemoryAvailableToTask(); doReturn(counters).when(inputContext).getCounters(); doReturn(new Configuration(false)).when(inputContext).getContainerConfiguration(); diff --git a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/output/TestOnFileSortedOutput.java b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/output/TestOnFileSortedOutput.java index 88a8b4aecd..c6e18e6008 100644 --- a/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/output/TestOnFileSortedOutput.java +++ b/tez-runtime-library/src/test/java/org/apache/tez/runtime/library/output/TestOnFileSortedOutput.java @@ -73,7 +73,7 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -@SuppressWarnings({ "rawtypes", "unchecked" }) +@SuppressWarnings({ "rawtypes", "unchecked", "checkstyle:HiddenField" }) public class TestOnFileSortedOutput { private static final Random rnd = new Random(); private static final String UniqueID = "UUID"; @@ -259,7 +259,7 @@ public void testSortBufferSize(boolean sendEmptyPartitionViaEvent, SorterImpl so try { //Memory limit checks are done in sorter impls. For e.g, defaultsorter does not support > 2GB sortedOutput.initialize(); - DefaultSorter sorter = new DefaultSorter(context, conf, 100, 3500*1024*1024l); + DefaultSorter sorter = new DefaultSorter(context, conf, 100, 3500 * 1024 * 1024L); fail(); } catch(IllegalArgumentException e) { assertTrue(e.getMessage().contains(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB)); @@ -407,7 +407,7 @@ private OutputContext createTezOutputContext() throws IOException { doReturn(counters).when(context).getCounters(); doReturn(workingDirs).when(context).getWorkDirs(); doReturn(payLoad).when(context).getUserPayload(); - doReturn(5 * 1024 * 1024l).when(context).getTotalMemoryAvailableToTask(); + doReturn(5 * 1024 * 1024L).when(context).getTotalMemoryAvailableToTask(); doReturn(UniqueID).when(context).getUniqueIdentifier(); doReturn("v0").when(context).getTaskVertexName(); doReturn("v1").when(context).getDestinationVertexName(); diff --git a/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobs.java b/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobs.java index 3e9976d5ef..fc43b7917c 100644 --- a/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobs.java +++ b/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobs.java @@ -93,7 +93,7 @@ public static void setup() throws IOException { Configuration conf = new Configuration(); conf.set("fs.defaultFS", remoteFs.getUri().toString()); // use HDFS conf.set(MRJobConfig.MR_AM_STAGING_DIR, "/apps_staging_dir"); - conf.setLong(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0l); + conf.setLong(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0L); conf.setLong(TezConfiguration.TEZ_AM_SLEEP_TIME_BEFORE_EXIT_MILLIS, 500); mrrTezCluster.init(conf); mrrTezCluster.start(); diff --git a/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java b/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java index 92392ea6a3..ecb2426298 100644 --- a/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java +++ b/tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java @@ -215,7 +215,7 @@ public void testSleepJob() throws TezException, IOException, InterruptedExceptio while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); assertEquals(0, dagStatus.getMemoryUsedByAM(), "Memory used by AM is supposed to be 0 if not requested"); assertEquals(0, dagStatus.getMemoryUsedByTasks(), "Memory used by tasks is supposed to be 0 if not requested"); @@ -261,7 +261,7 @@ public void testNonDefaultFSStagingDir() throws Exception { while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } dagStatus = dagClient.getDAGStatus(Sets.newHashSet(StatusGetOpts.GET_COUNTERS)); @@ -310,7 +310,7 @@ public void testHistoryLogging() throws IOException, while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); dagStatus = dagClient.getDAGStatus(null); } assertEquals(DAGStatus.State.SUCCEEDED, dagStatus.getState()); @@ -721,7 +721,7 @@ public State testMRRSleepJobDagSubmitCore( yarnClient.start(); boolean sentKillSession = false; while(true) { - Thread.sleep(500l); + Thread.sleep(500L); ApplicationReport appReport = yarnClient.getApplicationReport(tezSession.getAppMasterApplicationId()); if (appReport == null) { @@ -763,7 +763,7 @@ public State testMRRSleepJobDagSubmitCore( while (!dagStatus.isCompleted()) { LOG.info("Waiting for job to complete. Sleeping for 500ms." + " Current state: " + dagStatus.getState()); - Thread.sleep(500l); + Thread.sleep(500L); if(killDagWhileRunning && dagStatus.getState() == DAGStatus.State.RUNNING) { LOG.info("Killing running dag/session"); diff --git a/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java b/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java index 5b6f736e96..5270f397a9 100644 --- a/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java +++ b/tez-tests/src/test/java/org/apache/tez/test/MiniTezCluster.java @@ -110,7 +110,7 @@ public void serviceInit(Configuration conf) throws Exception { if (conf.get(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC) == null) { // nothing defined. set quick delete value - conf.setLong(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0l); + conf.setLong(YarnConfiguration.DEBUG_NM_DELETE_DELAY_SEC, 0L); } maxTimeToWaitForAppsOnShutdown = conf.getLong( diff --git a/tez-tests/src/test/java/org/apache/tez/test/TestExceptionPropagation.java b/tez-tests/src/test/java/org/apache/tez/test/TestExceptionPropagation.java index 1a6ba7b718..cca298dc88 100644 --- a/tez-tests/src/test/java/org/apache/tez/test/TestExceptionPropagation.java +++ b/tez-tests/src/test/java/org/apache/tez/test/TestExceptionPropagation.java @@ -520,7 +520,7 @@ public List close() throws Exception { @Override public List initialize() throws Exception { - getContext().requestInitialMemory(0l, null); // mandatory call + getContext().requestInitialMemory(0L, null); // mandatory call if (this.exLocation == ExceptionLocation.INPUT_INITIALIZE) { throw new Exception(this.exLocation.name()); } else if ( getContext().getSourceVertexName().equals("v1")) { @@ -598,7 +598,7 @@ public List close() throws Exception { @Override public List initialize() throws Exception { - getContext().requestInitialMemory(0l, null); // mandatory call + getContext().requestInitialMemory(0L, null); // mandatory call if (this.exLocation == ExceptionLocation.OUTPUT_INITIALIZE) { throw new RuntimeException(this.exLocation.name()); } diff --git a/tez-tests/src/test/java/org/apache/tez/test/TestInput.java b/tez-tests/src/test/java/org/apache/tez/test/TestInput.java index 9a4532eaae..3a86dfae00 100644 --- a/tez-tests/src/test/java/org/apache/tez/test/TestInput.java +++ b/tez-tests/src/test/java/org/apache/tez/test/TestInput.java @@ -297,7 +297,7 @@ public static String getVertexConfName(String confName, String vertexName) { @Override public List initialize() throws Exception { - getContext().requestInitialMemory(0l, null); //Mandatory call. + getContext().requestInitialMemory(0L, null); //Mandatory call. getContext().inputIsReady(); if (getContext().getUserPayload() != null && getContext().getUserPayload().hasPayload()) { String vName = getContext().getTaskVertexName(); diff --git a/tez-tests/src/test/java/org/apache/tez/test/TestOutput.java b/tez-tests/src/test/java/org/apache/tez/test/TestOutput.java index 9a0fa219b9..31a729c494 100644 --- a/tez-tests/src/test/java/org/apache/tez/test/TestOutput.java +++ b/tez-tests/src/test/java/org/apache/tez/test/TestOutput.java @@ -57,7 +57,7 @@ public static OutputDescriptor getOutputDesc(UserPayload payload) { @Override public List initialize() throws Exception { - getContext().requestInitialMemory(0l, null); //Mandatory call + getContext().requestInitialMemory(0L, null); //Mandatory call return Collections.emptyList(); } diff --git a/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java b/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java index ad4249a077..8404755964 100644 --- a/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java +++ b/tez-tests/src/test/java/org/apache/tez/test/TestTezJobs.java @@ -1051,36 +1051,36 @@ public void testVertexOrder() throws Exception { tezClient.start(); try { - DAG dag = SimpleTestDAG.createDAGForVertexOrder("dag1", conf); - DAGClient dagClient = tezClient.submitDAG(dag); - DAGStatus dagStatus = dagClient.getDAGStatus(null); - while (!dagStatus.isCompleted()) { - LOG.info("Waiting for dag to complete. Sleeping for 500ms." - + " DAG name: " + dag.getName() - + " DAG context: " + dagClient.getExecutionContext() - + " Current state: " + dagStatus.getState()); - Thread.sleep(100); - dagStatus = dagClient.getDAGStatus(null); - } + DAG dag = SimpleTestDAG.createDAGForVertexOrder("dag1", conf); + DAGClient dagClient = tezClient.submitDAG(dag); + DAGStatus dagStatus = dagClient.getDAGStatus(null); + while (!dagStatus.isCompleted()) { + LOG.info("Waiting for dag to complete. Sleeping for 500ms." + + " DAG name: " + dag.getName() + + " DAG context: " + dagClient.getExecutionContext() + + " Current state: " + dagStatus.getState()); + Thread.sleep(100); + dagStatus = dagClient.getDAGStatus(null); + } - assertEquals(DAGStatus.State.SUCCEEDED, dagStatus.getState()); - - // verify vertex order - Set resultVertices = dagStatus.getVertexProgress().keySet(); - assertEquals(6, resultVertices.size()); - int i = 0; - for (String vertexName : resultVertices){ - if (i <= 1){ - assertTrue(vertexName.equals("v1") || vertexName.equals("v2")); - } else if (i == 2) { - assertEquals("v3", vertexName); - } else if (i <= 4) { - assertTrue(vertexName.equals("v4") || vertexName.equals("v5")); - } else { - assertEquals("v6", vertexName); + assertEquals(DAGStatus.State.SUCCEEDED, dagStatus.getState()); + + // verify vertex order + Set resultVertices = dagStatus.getVertexProgress().keySet(); + assertEquals(6, resultVertices.size()); + int i = 0; + for (String vertexName : resultVertices){ + if (i <= 1){ + assertTrue(vertexName.equals("v1") || vertexName.equals("v2")); + } else if (i == 2) { + assertEquals("v3", vertexName); + } else if (i <= 4) { + assertTrue(vertexName.equals("v4") || vertexName.equals("v5")); + } else { + assertEquals("v6", vertexName); + } + i++; } - i++; - } } finally { if (tezClient != null) { tezClient.stop(); diff --git a/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/SkewAnalyzer.java b/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/SkewAnalyzer.java index dec1a21ee9..e7eb38cba3 100644 --- a/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/SkewAnalyzer.java +++ b/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/SkewAnalyzer.java @@ -65,7 +65,7 @@ public class SkewAnalyzer extends TezAnalyzerBase implements Analyzer { */ private static final String SHUFFLE_BYTES_PER_ATTEMPT_PER_SOURCE = "tez.skew-analyzer.shuffle" + ".bytes.per.source"; - private static final long SHUFFLE_BYTES_PER_ATTEMPT_PER_SOURCE_DEFAULT = 900 * 1024 * 1024l; + private static final long SHUFFLE_BYTES_PER_ATTEMPT_PER_SOURCE_DEFAULT = 900 * 1024 * 1024L; //Min reducer input group : reducer keys ratio for computation private static final String ATTEMPT_SHUFFLE_KEY_GROUP_MIN_RATIO = "tez.skew-analyzer.shuffle.key" diff --git a/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/SpillAnalyzerImpl.java b/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/SpillAnalyzerImpl.java index b30544e7af..71229d747f 100644 --- a/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/SpillAnalyzerImpl.java +++ b/tez-tools/analyzers/job-analyzer/src/main/java/org/apache/tez/analyzer/plugins/SpillAnalyzerImpl.java @@ -56,7 +56,7 @@ public class SpillAnalyzerImpl extends TezAnalyzerBase implements Analyzer { */ private static final String OUTPUT_BYTES_THRESHOLD = "tez.spill-analyzer.min.output.bytes" + ".threshold"; - private static long OUTPUT_BYTES_THRESHOLD_DEFAULT = 1 * 1024 * 1024 * 1024l; + private static long OUTPUT_BYTES_THRESHOLD_DEFAULT = 1 * 1024 * 1024 * 1024L; private final long minOutputBytesPerTask;