diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Progressable.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Progressable.java index 495ca82b76e..201ee5c41c9 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Progressable.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Progressable.java @@ -28,7 +28,7 @@ * to explicitly report progress to the Hadoop framework. This is especially * important for operations which take significant amount of time since, * in-lieu of the reported progress, the framework has to assume that an error - * has occured and time-out the operation.

+ * has occurred and time-out the operation.

*/ @InterfaceAudience.Public @InterfaceStability.Stable diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/UTF8ByteArrayUtils.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/UTF8ByteArrayUtils.java index 2a804c618e1..069494f0f38 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/UTF8ByteArrayUtils.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/UTF8ByteArrayUtils.java @@ -30,7 +30,7 @@ public class UTF8ByteArrayUtils { * @param start starting offset * @param end ending position * @param b the byte to find - * @return position that first byte occures otherwise -1 + * @return position that first byte occurs, otherwise -1 */ public static int findByte(byte [] utf, int start, int end, byte b) { for(int i=start; itrue if the delete operation was successful, * false otherwise. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public JSONObject execute(FileSystem fs) throws IOException { @@ -583,7 +583,7 @@ public FSFileChecksum(String path) { * * @return a Map object (JSON friendly) with the file checksum. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public Map execute(FileSystem fs) throws IOException { @@ -640,7 +640,7 @@ public static class FSHomeDir implements FileSystemAccess.FileSystemExecutortrue if the mkdirs operation was successful, * false otherwise. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public JSONObject execute(FileSystem fs) throws IOException { @@ -799,7 +799,7 @@ public FSOpen(String path) { * * @return The inputstream of the file. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public InputStream execute(FileSystem fs) throws IOException { @@ -837,7 +837,7 @@ public FSRename(String path, String toPath) { * @return true if the rename operation was successful, * false otherwise. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public JSONObject execute(FileSystem fs) throws IOException { @@ -876,7 +876,7 @@ public FSSetOwner(String path, String owner, String group) { * * @return void. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public Void execute(FileSystem fs) throws IOException { @@ -913,7 +913,7 @@ public FSSetPermission(String path, short permission) { * * @return void. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public Void execute(FileSystem fs) throws IOException { @@ -1186,7 +1186,7 @@ public FSSetReplication(String path, short replication) { * @return true if the replication value was set, * false otherwise. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override @SuppressWarnings("unchecked") @@ -1228,7 +1228,7 @@ public FSSetTimes(String path, long mTime, long aTime) { * * @return void. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public Void execute(FileSystem fs) throws IOException { @@ -1314,7 +1314,7 @@ public FSListXAttrs(String path) { * * @return Map a map object (JSON friendly) with the xattr names. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public Map execute(FileSystem fs) throws IOException { @@ -1353,7 +1353,7 @@ public FSGetXAttrs(String path, List names, XAttrCodec encoding) { * * @return Map a map object (JSON friendly) with the xattrs. * - * @throws IOException thrown if an IO error occured. + * @throws IOException thrown if an IO error occurred. */ @Override public Map execute(FileSystem fs) throws IOException { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java index c8df300ff6b..c17ef366271 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/BlockPoolSlice.java @@ -822,7 +822,7 @@ private boolean readReplicasFromCache(ReplicaMap volumeMap, } catch (Exception e) { // Any exception we need to revert back to read from disk // Log the error and return false - LOG.info("Exception occured while reading the replicas cache file: " + LOG.info("Exception occurred while reading the replicas cache file: " + replicaFile.getPath(), e ); return false; } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java index f6e6a59aa43..b948fb788a4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java @@ -1323,7 +1323,7 @@ private LinkedList compileReport(File bpFinalizedDir, fileNames = fileIoProvider.listDirectory( this, dir, BlockDirFilter.INSTANCE); } catch (IOException ioe) { - LOG.warn("Exception occured while compiling report: ", ioe); + LOG.warn("Exception occurred while compiling report: ", ioe); // Volume error check moved to FileIoProvider. // Ignore this directory and proceed. return report; diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java index b0b7a3c119f..e5399b5f744 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java @@ -276,7 +276,7 @@ public void run() { } synchronized private void failAllJobs(Throwable t) { - String message = "Unexpected System Error Occured: "+ + String message = "Unexpected System Error Occurred: "+ StringUtils.stringifyException(t); Iterator it = jobsInProgress.iterator(); while(it.hasNext()) { diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/BlockBlobAppendStream.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/BlockBlobAppendStream.java index a7e286c917a..afb9379c3ca 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/BlockBlobAppendStream.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/BlockBlobAppendStream.java @@ -346,7 +346,7 @@ public synchronized void close() throws IOException { try { if (!ioThreadPool.awaitTermination(10, TimeUnit.MINUTES)) { - LOG.error("Time out occured while waiting for IO request to finish in append" + LOG.error("Time out occurred while waiting for IO request to finish in append" + " for blob : {}", key); NativeAzureFileSystemHelper.logAllLiveStackTraces(); throw new IOException("Timed out waiting for IO requests to finish"); diff --git a/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamKeyValUtil.java b/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamKeyValUtil.java index 75e05dc0708..fba45b11f24 100644 --- a/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamKeyValUtil.java +++ b/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamKeyValUtil.java @@ -26,11 +26,11 @@ public class StreamKeyValUtil { /** - * Find the first occured tab in a UTF-8 encoded string + * Find the first occurred tab in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string * @param start starting offset * @param length no. of bytes - * @return position that first tab occures otherwise -1 + * @return position that first tab occurres otherwise -1 */ public static int findTab(byte [] utf, int start, int length) { for(int i=start; i<(start+length); i++) { @@ -41,9 +41,9 @@ public static int findTab(byte [] utf, int start, int length) { return -1; } /** - * Find the first occured tab in a UTF-8 encoded string + * Find the first occurred tab in a UTF-8 encoded string * @param utf a byte array containing a UTF-8 encoded string - * @return position that first tab occures otherwise -1 + * @return position that first tab occurres otherwise -1 */ public static int findTab(byte [] utf) { return org.apache.hadoop.util.UTF8ByteArrayUtils.findNthByte(utf, 0, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java index 300ea67497c..ef21c8786c5 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/test/java/org/apache/hadoop/yarn/applications/distributedshell/TestDistributedShell.java @@ -544,17 +544,17 @@ private void checkTimelineV2(boolean haveDomain, ApplicationId appId, Assert.assertEquals( "Container created event needs to be published atleast once", 1, - getNumOfStringOccurences(containerEntityFile, + getNumOfStringOccurrences(containerEntityFile, ContainerMetricsConstants.CREATED_EVENT_TYPE)); // to avoid race condition of testcase, atleast check 4 times with sleep // of 500ms - long numOfContainerFinishedOccurences = 0; + long numOfContainerFinishedOccurrences = 0; for (int i = 0; i < 4; i++) { - numOfContainerFinishedOccurences = - getNumOfStringOccurences(containerEntityFile, + numOfContainerFinishedOccurrences = + getNumOfStringOccurrences(containerEntityFile, ContainerMetricsConstants.FINISHED_EVENT_TYPE); - if (numOfContainerFinishedOccurences > 0) { + if (numOfContainerFinishedOccurrences > 0) { break; } else { Thread.sleep(500L); @@ -563,7 +563,7 @@ private void checkTimelineV2(boolean haveDomain, ApplicationId appId, Assert.assertEquals( "Container finished event needs to be published atleast once", 1, - numOfContainerFinishedOccurences); + numOfContainerFinishedOccurrences); // Verify RM posting Application life cycle Events are getting published String appMetricsTimestampFileName = @@ -576,17 +576,17 @@ private void checkTimelineV2(boolean haveDomain, ApplicationId appId, Assert.assertEquals( "Application created event should be published atleast once", 1, - getNumOfStringOccurences(appEntityFile, + getNumOfStringOccurrences(appEntityFile, ApplicationMetricsConstants.CREATED_EVENT_TYPE)); // to avoid race condition of testcase, atleast check 4 times with sleep // of 500ms - long numOfStringOccurences = 0; + long numOfStringOccurrences = 0; for (int i = 0; i < 4; i++) { - numOfStringOccurences = - getNumOfStringOccurences(appEntityFile, + numOfStringOccurrences = + getNumOfStringOccurrences(appEntityFile, ApplicationMetricsConstants.FINISHED_EVENT_TYPE); - if (numOfStringOccurences > 0) { + if (numOfStringOccurrences > 0) { break; } else { Thread.sleep(500L); @@ -595,7 +595,7 @@ private void checkTimelineV2(boolean haveDomain, ApplicationId appId, Assert.assertEquals( "Application finished event should be published atleast once", 1, - numOfStringOccurences); + numOfStringOccurrences); // Verify RM posting AppAttempt life cycle Events are getting published String appAttemptMetricsTimestampFileName = @@ -609,13 +609,13 @@ private void checkTimelineV2(boolean haveDomain, ApplicationId appId, Assert.assertEquals( "AppAttempt register event should be published atleast once", 1, - getNumOfStringOccurences(appAttemptEntityFile, + getNumOfStringOccurrences(appAttemptEntityFile, AppAttemptMetricsConstants.REGISTERED_EVENT_TYPE)); Assert.assertEquals( "AppAttempt finished event should be published atleast once", 1, - getNumOfStringOccurences(appAttemptEntityFile, + getNumOfStringOccurrences(appAttemptEntityFile, AppAttemptMetricsConstants.FINISHED_EVENT_TYPE)); } finally { FileUtils.deleteDirectory(tmpRootFolder.getParentFile()); @@ -636,7 +636,7 @@ private File verifyEntityTypeFileExists(String basePath, String entityType, return entityFile; } - private long getNumOfStringOccurences(File entityFile, String searchString) + private long getNumOfStringOccurrences(File entityFile, String searchString) throws IOException { BufferedReader reader = null; String strLine; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java index 23b99d9a7e5..8dcf4be41f8 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/launcher/TestContainerLaunch.java @@ -641,8 +641,8 @@ private void verifyTailErrorLogOnContainerExit(Configuration conf, ContainerLaunch launch = new ContainerLaunch(context, conf, dispatcher, exec, app, container, dirsHandler, containerManager); launch.call(); - Assert.assertTrue("ContainerExitEvent should have occured", - eventHandler.isContainerExitEventOccured()); + Assert.assertTrue("ContainerExitEvent should have occurred", + eventHandler.isContainerExitEventOccurred()); } private static class ContainerExitHandler implements EventHandler { @@ -652,15 +652,15 @@ private static class ContainerExitHandler implements EventHandler { this.testForMultiFile = testForMultiFile; } - boolean containerExitEventOccured = false; + boolean containerExitEventOccurred = false; - public boolean isContainerExitEventOccured() { - return containerExitEventOccured; + public boolean isContainerExitEventOccurred() { + return containerExitEventOccurred; } public void handle(Event event) { if (event instanceof ContainerExitEvent) { - containerExitEventOccured = true; + containerExitEventOccurred = true; ContainerExitEvent exitEvent = (ContainerExitEvent) event; Assert.assertEquals(ContainerEventType.CONTAINER_EXITED_WITH_FAILURE, exitEvent.getType()); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java index c4b7a0d4031..cdbbc519857 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestParentQueue.java @@ -343,43 +343,43 @@ public void testSingleLevelQueuesPrecision() throws Exception { csConf.setCapacity(Q_B, 70.5F); Map queues = new HashMap(); - boolean exceptionOccured = false; + boolean exceptionOccurred = false; try { CapacitySchedulerQueueManager.parseQueue(csContext, csConf, null, CapacitySchedulerConfiguration.ROOT, queues, queues, TestUtils.spyHook); } catch (IllegalArgumentException ie) { - exceptionOccured = true; + exceptionOccurred = true; } - if (!exceptionOccured) { + if (!exceptionOccurred) { Assert.fail("Capacity is more then 100% so should be failed."); } csConf.setCapacity(Q_A, 30); csConf.setCapacity(Q_B, 70); - exceptionOccured = false; + exceptionOccurred = false; queues.clear(); try { CapacitySchedulerQueueManager.parseQueue(csContext, csConf, null, CapacitySchedulerConfiguration.ROOT, queues, queues, TestUtils.spyHook); } catch (IllegalArgumentException ie) { - exceptionOccured = true; + exceptionOccurred = true; } - if (exceptionOccured) { + if (exceptionOccurred) { Assert.fail("Capacity is 100% so should not be failed."); } csConf.setCapacity(Q_A, 30); csConf.setCapacity(Q_B, 70.005F); - exceptionOccured = false; + exceptionOccurred = false; queues.clear(); try { CapacitySchedulerQueueManager.parseQueue(csContext, csConf, null, CapacitySchedulerConfiguration.ROOT, queues, queues, TestUtils.spyHook); } catch (IllegalArgumentException ie) { - exceptionOccured = true; + exceptionOccurred = true; } - if (exceptionOccured) { + if (exceptionOccurred) { Assert .fail("Capacity is under PRECISION which is .05% so should not be failed."); }