HADOOP-14271. Correct spelling of 'occurred' and variants. Contributed by Yeliang Cang

This commit is contained in:
Chris Douglas 2017-04-03 20:13:14 -07:00
parent 5faa949b78
commit 6eba79232f
16 changed files with 63 additions and 63 deletions

View File

@ -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.</p>
* has occurred and time-out the operation.</p>
*/
@InterfaceAudience.Public
@InterfaceStability.Stable

View File

@ -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; i<end; i++) {
@ -47,7 +47,7 @@ public static int findByte(byte [] utf, int start, int end, byte b) {
* @param start starting offset
* @param end ending position
* @param b the bytes to find
* @return position that first byte occures otherwise -1
* @return position that first byte occurs, otherwise -1
*/
public static int findBytes(byte [] utf, int start, int end, byte[] b) {
int matchEnd = end - b.length;

View File

@ -8298,7 +8298,7 @@ FilePath FilePath::RemoveExtension(const char* extension) const {
return *this;
}
// Returns a pointer to the last occurence of a valid path separator in
// Returns a pointer to the last occurrence of a valid path separator in
// the FilePath. On Windows, for example, both '/' and '\' are valid path
// separators. Returns NULL if no path separator was found.
const char* FilePath::FindLastPathSeparator() const {

View File

@ -4457,7 +4457,7 @@ class GTEST_API_ FilePath {
void Normalize();
// Returns a pointer to the last occurence of a valid path separator in
// Returns a pointer to the last occurrence of a valid path separator in
// the FilePath. On Windows, for example, both '/' and '\' are valid path
// separators. Returns NULL if no path separator was found.
const char* FindLastPathSeparator() const;

View File

@ -225,7 +225,7 @@ public final void doWork() throws Exception {
/**
* User method for any code to test repeating behavior of (as threads).
* @throws Exception throw an exception if a failure has occured.
* @throws Exception throw an exception if a failure has occurred.
*/
public abstract void doAnAction() throws Exception;
}

View File

@ -777,7 +777,7 @@ protected synchronized int readWithStrategy(ReaderStrategy strategy)
}
} finally {
// Check if need to report block replicas corruption either read
// was successful or ChecksumException occured.
// was successful or ChecksumException occurred.
reportCheckSumFailure(corruptedBlocks,
currentLocatedBlock.getLocations().length, false);
}

View File

@ -394,7 +394,7 @@ protected synchronized int readWithStrategy(ReaderStrategy strategy)
return result;
} finally {
// Check if need to report block replicas corruption either read
// was successful or ChecksumException occured.
// was successful or ChecksumException occurred.
reportCheckSumFailure(corruptedBlocks,
currentLocatedBlock.getLocations().length, true);
}

View File

@ -333,7 +333,7 @@ public FSAppend(InputStream is, String path) {
*
* @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 {
@ -377,7 +377,7 @@ public FSConcat(String path, String[] sources) {
*
* @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 {
@ -418,7 +418,7 @@ public FSTruncate(String path, long newLength) {
* wait for it to complete before proceeding with further file
* updates.
*
* @throws IOException thrown if an IO error occured.
* @throws IOException thrown if an IO error occurred.
*/
@Override
public JSONObject execute(FileSystem fs) throws IOException {
@ -452,7 +452,7 @@ public FSContentSummary(String path) {
*
* @return a Map object (JSON friendly) with the content-summary.
*
* @throws IOException thrown if an IO error occured.
* @throws IOException thrown if an IO error occurred.
*/
@Override
public Map execute(FileSystem fs) throws IOException {
@ -501,7 +501,7 @@ public FSCreate(InputStream is, String path, short perm, boolean override,
*
* @return The URI of the created file.
*
* @throws IOException thrown if an IO error occured.
* @throws IOException thrown if an IO error occurred.
*/
@Override
public Void execute(FileSystem fs) throws IOException {
@ -549,7 +549,7 @@ public FSDelete(String path, boolean recursive) {
* @return <code>true</code> if the delete operation was successful,
* <code>false</code> 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.FileSystemExecutor<JSO
*
* @return a JSON object with the user home directory.
*
* @throws IOException thrown if an IO error occured.
* @throws IOException thrown if an IO error occurred.
*/
@Override
@SuppressWarnings("unchecked")
@ -765,7 +765,7 @@ public FSMkdirs(String path, short permission) {
* @return <code>true</code> if the mkdirs operation was successful,
* <code>false</code> 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 <code>true</code> if the rename operation was successful,
* <code>false</code> 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 <code>true</code> if the replication value was set,
* <code>false</code> 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<String> 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 {

View File

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

View File

@ -1323,7 +1323,7 @@ private LinkedList<ScanInfo> 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;

View File

@ -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<ControlledJob> it = jobsInProgress.iterator();
while(it.hasNext()) {

View File

@ -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");

View File

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

View File

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

View File

@ -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<Event> {
@ -652,15 +652,15 @@ private static class ContainerExitHandler implements EventHandler<Event> {
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());

View File

@ -343,43 +343,43 @@ public void testSingleLevelQueuesPrecision() throws Exception {
csConf.setCapacity(Q_B, 70.5F);
Map<String, CSQueue> queues = new HashMap<String, CSQueue>();
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.");
}