Skip to content

Commit ebcbe5d

Browse files
dongjoon-hyunjasontedor
authored andcommitted
Fix typos in comments
Closes #16592
1 parent a5406e1 commit ebcbe5d

File tree

93 files changed

+119
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+119
-119
lines changed

core/src/main/java/org/elasticsearch/ElasticsearchException.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public static ElasticsearchException readException(StreamInput input, int id) th
257257
}
258258

259259
/**
260-
* Retruns <code>true</code> iff the given class is a registered for an exception to be read.
260+
* Returns <code>true</code> iff the given class is a registered for an exception to be read.
261261
*/
262262
public static boolean isRegistered(Class<? extends Throwable> exception) {
263263
return CLASS_TO_ELASTICSEARCH_EXCEPTION_HANDLE.containsKey(exception);
@@ -372,7 +372,7 @@ public static void toXContent(XContentBuilder builder, Params params, Throwable
372372
}
373373

374374
/**
375-
* Returns the root cause of this exception or mupltiple if different shards caused different exceptions
375+
* Returns the root cause of this exception or multiple if different shards caused different exceptions
376376
*/
377377
public ElasticsearchException[] guessRootCauses() {
378378
final Throwable cause = getCause();
@@ -383,7 +383,7 @@ public ElasticsearchException[] guessRootCauses() {
383383
}
384384

385385
/**
386-
* Returns the root cause of this exception or mupltiple if different shards caused different exceptions.
386+
* Returns the root cause of this exception or multiple if different shards caused different exceptions.
387387
* If the given exception is not an instance of {@link org.elasticsearch.ElasticsearchException} an empty array
388388
* is returned.
389389
*/

core/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public NodesInfoRequestBuilder clear() {
4040
}
4141

4242
/**
43-
* Sets to reutrn all the data.
43+
* Sets to return all the data.
4444
*/
4545
public NodesInfoRequestBuilder all() {
4646
request.all();

core/src/main/java/org/elasticsearch/action/fieldstats/IndexConstraint.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public Comparison getComparison() {
7373
}
7474

7575
/**
76-
* @return On what property of a field the contraint is going to be applied on (min or max value)
76+
* @return On what property of a field the constraint is going to be applied on (min or max value)
7777
*/
7878
public Property getProperty() {
7979
return property;

core/src/main/java/org/elasticsearch/action/index/IndexRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public String getPipeline() {
372372
}
373373

374374
/**
375-
* The source of the document to index, recopied to a new array if it is unsage.
375+
* The source of the document to index, recopied to a new array if it is unsafe.
376376
*/
377377
public BytesReference source() {
378378
return source;

core/src/main/java/org/elasticsearch/action/indexedscripts/put/PutIndexedScriptRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public PutIndexedScriptRequest id(String id) {
164164
}
165165

166166
/**
167-
* The source of the document to index, recopied to a new array if it is unsage.
167+
* The source of the document to index, recopied to a new array if it is unsafe.
168168
*/
169169
public BytesReference source() {
170170
return source;

core/src/main/java/org/elasticsearch/action/search/ClearScrollResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public boolean isSucceeded() {
5555
}
5656

5757
/**
58-
* @return The number of seach contexts that were freed. If this is <code>0</code> the assumption can be made,
58+
* @return The number of search contexts that were freed. If this is <code>0</code> the assumption can be made,
5959
* that the scroll id specified in the request did not exist. (never existed, was expired, or completely consumed)
6060
*/
6161
public int getNumFreed() {

core/src/main/java/org/elasticsearch/action/search/SearchRequestBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public SearchRequestBuilder setVersion(boolean version) {
223223
}
224224

225225
/**
226-
* Sets the boost a specific index will receive when the query is executeed against it.
226+
* Sets the boost a specific index will receive when the query is executed against it.
227227
*
228228
* @param index The index to apply the boost against
229229
* @param indexBoost The boost to apply to the index

core/src/main/java/org/elasticsearch/action/termvectors/TermVectorsFields.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -486,15 +486,15 @@ public long cost() {
486486

487487
// read a vInt. this is used if the integer might be negative. In this case,
488488
// the writer writes a 0 for -1 or value +1 and accordingly we have to
489-
// substract 1 again
489+
// subtract 1 again
490490
// adds one to mock not existing term freq
491491
int readPotentiallyNegativeVInt(StreamInput stream) throws IOException {
492492
return stream.readVInt() - 1;
493493
}
494494

495495
// read a vLong. this is used if the integer might be negative. In this
496496
// case, the writer writes a 0 for -1 or value +1 and accordingly we have to
497-
// substract 1 again
497+
// subtract 1 again
498498
// adds one to mock not existing term freq
499499
long readPotentiallyNegativeVLong(StreamInput stream) throws IOException {
500500
return stream.readVLong() - 1;

core/src/main/java/org/elasticsearch/bootstrap/JNANatives.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static String rlimitToString(long value) {
108108
if (value == JNACLibrary.RLIM_INFINITY) {
109109
return "unlimited";
110110
} else {
111-
// TODO, on java 8 use Long.toUnsignedString, since thats what it is.
111+
// TODO, on java 8 use Long.toUnsignedString, since that's what it is.
112112
return Long.toString(value);
113113
}
114114
}

core/src/main/java/org/elasticsearch/bootstrap/Seccomp.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static interface LinuxLibrary extends Library {
104104
int prctl(int option, NativeLong arg2, NativeLong arg3, NativeLong arg4, NativeLong arg5);
105105
/**
106106
* used to call seccomp(2), its too new...
107-
* this is the only way, DONT use it on some other architecture unless you know wtf you are doing
107+
* this is the only way, DON'T use it on some other architecture unless you know wtf you are doing
108108
*/
109109
NativeLong syscall(NativeLong number, Object... args);
110110
};

core/src/main/java/org/elasticsearch/cache/recycler/PageCacheRecycler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public PageCacheRecycler(Settings settings, ThreadPool threadPool) {
9393
// because they would make obtain/release too costly: we really need constant-time
9494
// operations.
9595
// Ultimately a better solution would be to only store one kind of data and have the
96-
// ability to intepret it either as a source of bytes, doubles, longs, etc. eg. thanks
96+
// ability to interpret it either as a source of bytes, doubles, longs, etc. eg. thanks
9797
// to direct ByteBuffers or sun.misc.Unsafe on a byte[] but this would have other issues
9898
// that would need to be addressed such as garbage collection of native memory or safety
9999
// of Unsafe writes.

core/src/main/java/org/elasticsearch/client/Requests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static DeleteRequest deleteRequest(String index) {
107107
}
108108

109109
/**
110-
* Creats a new bulk request.
110+
* Creates a new bulk request.
111111
*/
112112
public static BulkRequest bulkRequest() {
113113
return new BulkRequest();

core/src/main/java/org/elasticsearch/cluster/LocalNodeMasterListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public interface LocalNodeMasterListener {
3838
* The name of the executor that the implementation of the callbacks of this lister should be executed on. The thread
3939
* that is responsible for managing instances of this lister is the same thread handling the cluster state events. If
4040
* the work done is the callbacks above is inexpensive, this value may be {@link org.elasticsearch.threadpool.ThreadPool.Names#SAME SAME}
41-
* (indicating that the callbaks will run on the same thread as the cluster state events are fired with). On the other hand,
41+
* (indicating that the callbacks will run on the same thread as the cluster state events are fired with). On the other hand,
4242
* if the logic in the callbacks are heavier and take longer to process (or perhaps involve blocking due to IO operations),
43-
* prefer to execute them on a separte more appropriate executor (eg. {@link org.elasticsearch.threadpool.ThreadPool.Names#GENERIC GENERIC}
43+
* prefer to execute them on a separate more appropriate executor (eg. {@link org.elasticsearch.threadpool.ThreadPool.Names#GENERIC GENERIC}
4444
* or {@link org.elasticsearch.threadpool.ThreadPool.Names#MANAGEMENT MANAGEMENT}).
4545
*
4646
* @return The name of the executor that will run the callbacks of this listener.

core/src/main/java/org/elasticsearch/cluster/metadata/MetaData.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ public Builder generateClusterUuidIfNeeded() {
959959

960960
public MetaData build() {
961961
// TODO: We should move these datastructures to IndexNameExpressionResolver, this will give the following benefits:
962-
// 1) The datastructures will only be rebuilded when needed. Now during serailizing we rebuild these datastructures
962+
// 1) The datastructures will only be rebuilded when needed. Now during serializing we rebuild these datastructures
963963
// while these datastructures aren't even used.
964964
// 2) The aliasAndIndexLookup can be updated instead of rebuilding it all the time.
965965

core/src/main/java/org/elasticsearch/cluster/routing/allocation/AllocationService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ private RoutingNodes getMutableRoutingNodes(ClusterState clusterState) {
611611
return routingNodes;
612612
}
613613

614-
/** ovrride this to control time based decisions during allocation */
614+
/** override this to control time based decisions during allocation */
615615
protected long currentNanoTime() {
616616
return System.nanoTime();
617617
}

core/src/main/java/org/elasticsearch/cluster/routing/allocation/FailedRerouteAllocation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
/**
3232
* This {@link RoutingAllocation} keeps a shard which routing
33-
* allocation has faild
33+
* allocation has failed.
3434
*/
3535
public class FailedRerouteAllocation extends RoutingAllocation {
3636

core/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/BalancedShardsAllocator.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ private void buildModelFromAssigned(Iterable<ShardRouting> shards) {
571571
}
572572

573573
/**
574-
* Allocates all given shards on the minimal eligable node for the shards index
574+
* Allocates all given shards on the minimal eligible node for the shards index
575575
* with respect to the weight function. All given shards must be unassigned.
576576
*/
577577
private boolean allocateUnassigned(RoutingNodes.UnassignedShards unassigned) {
@@ -611,7 +611,7 @@ private boolean allocateUnassigned(RoutingNodes.UnassignedShards unassigned) {
611611
* The arrays are sorted by primaries first and then by index and shard ID so a 2 indices with 2 replica and 1 shard would look like:
612612
* [(0,P,IDX1), (0,P,IDX2), (0,R,IDX1), (0,R,IDX1), (0,R,IDX2), (0,R,IDX2)]
613613
* if we allocate for instance (0, R, IDX1) we move the second replica to the secondary array and proceed with
614-
* the next replica. If we could not find a node to allocate (0,R,IDX1) we move all it's replicas to ingoreUnassigned.
614+
* the next replica. If we could not find a node to allocate (0,R,IDX1) we move all it's replicas to ignoreUnassigned.
615615
*/
616616
ShardRouting[] primary = unassigned.drain();
617617
ShardRouting[] secondary = new ShardRouting[primary.length];
@@ -733,7 +733,7 @@ private boolean allocateUnassigned(RoutingNodes.UnassignedShards unassigned) {
733733
secondary = tmp;
734734
secondaryLength = 0;
735735
} while (primaryLength > 0);
736-
// clear everything we have either added it or moved to ingoreUnassigned
736+
// clear everything we have either added it or moved to ignoreUnassigned
737737
return changed;
738738
}
739739

core/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/AwarenessAllocationDecider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* <p>
5555
* Awareness can also be used to prevent over-allocation in the case of node or
5656
* even "zone" failure. For example in cloud-computing infrastructures like
57-
* Amazone AWS a cluster might span over multiple "zones". Awareness can be used
57+
* Amazon AWS a cluster might span over multiple "zones". Awareness can be used
5858
* to distribute replicas to individual zones by setting:
5959
* <pre>
6060
* cluster.routing.allocation.awareness.attributes: zone

core/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/ConcurrentRebalanceAllocationDecider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* Similar to the {@link ClusterRebalanceAllocationDecider} this
3131
* {@link AllocationDecider} controls the number of currently in-progress
3232
* re-balance (relocation) operations and restricts node allocations if the
33-
* configured threashold is reached. The default number of concurrent rebalance
33+
* configured threshold is reached. The default number of concurrent rebalance
3434
* operations is set to <tt>2</tt>
3535
* <p>
3636
* Re-balance operations can be controlled in real-time via the cluster update API using

core/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public TimeValue getRerouteInterval() {
282282

283283
/**
284284
* Returns the size of all shards that are currently being relocated to
285-
* the node, but may not be finished transfering yet.
285+
* the node, but may not be finished transferring yet.
286286
*
287287
* If subtractShardsMovingAway is set then the size of shards moving away is subtracted from the total size
288288
* of all shards

core/src/main/java/org/elasticsearch/discovery/DiscoverySettings.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class DiscoverySettings extends AbstractComponent {
4141
public final static ClusterBlock NO_MASTER_BLOCK_WRITES = new ClusterBlock(NO_MASTER_BLOCK_ID, "no master", true, false, RestStatus.SERVICE_UNAVAILABLE, EnumSet.of(ClusterBlockLevel.WRITE, ClusterBlockLevel.METADATA_WRITE));
4242
/**
4343
* sets the timeout for a complete publishing cycle, including both sending and committing. the master
44-
* will continute to process the next cluster state update after this time has elapsed
44+
* will continue to process the next cluster state update after this time has elapsed
4545
**/
4646
public static final Setting<TimeValue> PUBLISH_TIMEOUT_SETTING = Setting.positiveTimeSetting("discovery.zen.publish_timeout", TimeValue.timeValueSeconds(30), true, Setting.Scope.CLUSTER);
4747

core/src/main/java/org/elasticsearch/discovery/local/LocalDiscovery.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private void publish(LocalDiscovery[] members, ClusterChangedEvent clusterChange
328328
ClusterState newNodeSpecificClusterState = null;
329329
synchronized (this) {
330330
// we do the marshaling intentionally, to check it works well...
331-
// check if we publsihed cluster state at least once and node was in the cluster when we published cluster state the last time
331+
// check if we published cluster state at least once and node was in the cluster when we published cluster state the last time
332332
if (discovery.lastProcessedClusterState != null && clusterChangedEvent.previousState().nodes().nodeExists(discovery.localNode().id())) {
333333
// both conditions are true - which means we can try sending cluster state as diffs
334334
if (clusterStateDiffBytes == null) {

core/src/main/java/org/elasticsearch/discovery/zen/elect/ElectMasterService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public boolean hasEnoughMasterNodes(Iterable<DiscoveryNode> nodes) {
7979
}
8080

8181
/**
82-
* Returns the given nodes sorted by likelyhood of being elected as master, most likely first.
82+
* Returns the given nodes sorted by likelihood of being elected as master, most likely first.
8383
* Non-master nodes are not removed but are rather put in the end
8484
*/
8585
public List<DiscoveryNode> sortByMasterLikelihood(Iterable<DiscoveryNode> nodes) {

core/src/main/java/org/elasticsearch/discovery/zen/ping/unicast/UnicastZenPing.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void sendPings(final TimeValue timeout, @Nullable TimeValue waitTime, final Send
342342
// sort the nodes by likelihood of being an active master
343343
List<DiscoveryNode> sortedNodesToPing = electMasterService.sortByMasterLikelihood(nodesToPingSet);
344344

345-
// new add the the unicast targets first
345+
// new add the unicast targets first
346346
List<DiscoveryNode> nodesToPing = CollectionUtils.arrayAsArrayList(configuredTargetNodes);
347347
nodesToPing.addAll(sortedNodesToPing);
348348

core/src/main/java/org/elasticsearch/gateway/AsyncShardFetch.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public synchronized FetchResult<T> fetchData(DiscoveryNodes nodes, MetaData meta
166166
/**
167167
* Called by the response handler of the async action to fetch data. Verifies that its still working
168168
* on the same cache generation, otherwise the results are discarded. It then goes and fills the relevant data for
169-
* the shard (response + failures), issueing a reroute at the end of it to make sure there will be another round
169+
* the shard (response + failures), issuing a reroute at the end of it to make sure there will be another round
170170
* of allocations taking this new data into account.
171171
*/
172172
protected synchronized void processAsyncFetch(ShardId shardId, T[] responses, FailedNodeException[] failures) {

core/src/main/java/org/elasticsearch/gateway/MetaDataStateFormat.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public T loadLatestState(ESLogger logger, Path... dataLocations) throws IOExcep
255255
List<PathAndStateId> files = new ArrayList<>();
256256
long maxStateId = -1;
257257
boolean maxStateIdIsLegacy = true;
258-
if (dataLocations != null) { // select all eligable files first
258+
if (dataLocations != null) { // select all eligible files first
259259
for (Path dataLocation : dataLocations) {
260260
final Path stateDir = dataLocation.resolve(STATE_DIR_NAME);
261261
// now, iterate over the current versions, and find latest one

core/src/main/java/org/elasticsearch/http/netty/ESHttpContentDecompressor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected DecoderEmbedder<ChannelBuffer> newContentDecoder(String contentEncodin
3939
// compression is enabled so handle the request according to the headers (compressed and uncompressed)
4040
return super.newContentDecoder(contentEncoding);
4141
} else {
42-
// if compression is disabled only allow "indentity" (uncompressed) requests
42+
// if compression is disabled only allow "identity" (uncompressed) requests
4343
if (HttpHeaders.Values.IDENTITY.equals(contentEncoding)) {
4444
// nothing to handle here
4545
return null;
@@ -48,4 +48,4 @@ protected DecoderEmbedder<ChannelBuffer> newContentDecoder(String contentEncodin
4848
}
4949
}
5050
}
51-
}
51+
}

core/src/main/java/org/elasticsearch/http/netty/cors/CorsConfig.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public boolean isNullOriginAllowed() {
132132
* xhr.withCredentials = true;
133133
* </pre>
134134
* The default value for 'withCredentials' is false in which case no cookies are sent.
135-
* Settning this to true will included cookies in cross origin requests.
135+
* Setting this to true will included cookies in cross origin requests.
136136
*
137137
* @return {@code true} if cookies are supported.
138138
*/
@@ -205,7 +205,7 @@ public HttpHeaders preflightResponseHeaders() {
205205
* and this setting will check that the Origin is valid and if it is not valid no
206206
* further processing will take place, and a error will be returned to the calling client.
207207
*
208-
* @return {@code true} if a CORS request should short-curcuit upon receiving an invalid Origin header.
208+
* @return {@code true} if a CORS request should short-circuit upon receiving an invalid Origin header.
209209
*/
210210
public boolean isShortCircuit() {
211211
return shortCircuit;

core/src/main/java/org/elasticsearch/http/netty/cors/CorsConfigBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public static CorsConfigBuilder forOrigins(final String... origins) {
133133
/**
134134
* Web browsers may set the 'Origin' request header to 'null' if a resource is loaded
135135
* from the local file system. Calling this method will enable a successful CORS response
136-
* with a wildcard for the the CORS response header 'Access-Control-Allow-Origin'.
136+
* with a wildcard for the CORS response header 'Access-Control-Allow-Origin'.
137137
*
138138
* @return {@link CorsConfigBuilder} to support method chaining.
139139
*/

core/src/main/java/org/elasticsearch/index/IndexModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void addIndexEventListener(IndexEventListener listener) {
143143
}
144144

145145
/**
146-
* Adds an {@link IndexStore} type to this index module. Typically stores are registered with a refrence to
146+
* Adds an {@link IndexStore} type to this index module. Typically stores are registered with a reference to
147147
* it's constructor:
148148
* <pre>
149149
* indexModule.addIndexStore("my_store_type", MyStore::new);

core/src/main/java/org/elasticsearch/index/IndexService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ static abstract class BaseAsyncTask implements Runnable, Closeable {
691691
}
692692

693693
boolean mustReschedule() {
694-
// don't re-schedule if its closed or if we dont' have a single shard here..., we are done
694+
// don't re-schedule if its closed or if we don't have a single shard here..., we are done
695695
return indexService.closed.get() == false
696696
&& closed.get() == false && interval.millis() > 0;
697697
}

core/src/main/java/org/elasticsearch/index/IndexSettings.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public IndexMetaData getIndexMetaData() {
329329
public boolean isShadowReplicaIndex() { return isShadowReplicaIndex; }
330330

331331
/**
332-
* Returns the node settings. The settings retured from {@link #getSettings()} are a merged version of the
332+
* Returns the node settings. The settings returned from {@link #getSettings()} are a merged version of the
333333
* index settings and the node settings where node settings are overwritten by index settings.
334334
*/
335335
public Settings getNodeSettings() {

core/src/main/java/org/elasticsearch/index/engine/DeleteVersionValue.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.apache.lucene.util.RamUsageEstimator;
2323
import org.elasticsearch.index.translog.Translog;
2424

25-
/** Holds a deleted version, which just adds a timestmap to {@link VersionValue} so we know when we can expire the deletion. */
25+
/** Holds a deleted version, which just adds a timestamp to {@link VersionValue} so we know when we can expire the deletion. */
2626

2727
class DeleteVersionValue extends VersionValue {
2828
private final long time;

0 commit comments

Comments
 (0)