mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-09 06:25:07 +00:00
Fix typos in comments in elasticsearch/common.
This commit is contained in:
parent
374ecea435
commit
06e7c9c005
@ -93,7 +93,7 @@ import java.util.Locale;
|
|||||||
* <a href="http://www.faqs.org/rfcs/rfc3548.html">RFC3548</a>.</li>
|
* <a href="http://www.faqs.org/rfcs/rfc3548.html">RFC3548</a>.</li>
|
||||||
* <li><em>Throws exceptions instead of returning null values.</em> Because some operations
|
* <li><em>Throws exceptions instead of returning null values.</em> Because some operations
|
||||||
* (especially those that may permit the GZIP option) use IO streams, there
|
* (especially those that may permit the GZIP option) use IO streams, there
|
||||||
* is a possiblity of an java.io.IOException being thrown. After some discussion and
|
* is a possibility of an java.io.IOException being thrown. After some discussion and
|
||||||
* thought, I've changed the behavior of the methods to throw java.io.IOExceptions
|
* thought, I've changed the behavior of the methods to throw java.io.IOExceptions
|
||||||
* rather than return null if ever there's an error. I think this is more
|
* rather than return null if ever there's an error. I think this is more
|
||||||
* appropriate, though it will require some changes to your code. Sorry,
|
* appropriate, though it will require some changes to your code. Sorry,
|
||||||
@ -1511,7 +1511,7 @@ public class Base64 {
|
|||||||
if (suspendEncoding) {
|
if (suspendEncoding) {
|
||||||
this.out.write(theByte);
|
this.out.write(theByte);
|
||||||
return;
|
return;
|
||||||
} // end if: supsended
|
} // end if: suspended
|
||||||
|
|
||||||
// Encode?
|
// Encode?
|
||||||
if (encode) {
|
if (encode) {
|
||||||
@ -1565,7 +1565,7 @@ public class Base64 {
|
|||||||
if (suspendEncoding) {
|
if (suspendEncoding) {
|
||||||
this.out.write(theBytes, off, len);
|
this.out.write(theBytes, off, len);
|
||||||
return;
|
return;
|
||||||
} // end if: supsended
|
} // end if: suspended
|
||||||
|
|
||||||
for (int i = 0; i < len; i++) {
|
for (int i = 0; i < len; i++) {
|
||||||
write(theBytes[off + i]);
|
write(theBytes[off + i]);
|
||||||
|
@ -147,7 +147,7 @@ public class PagedBytesReference implements BytesReference {
|
|||||||
bytearray.get(offset, length, ref);
|
bytearray.get(offset, length, ref);
|
||||||
|
|
||||||
// undo the single-page optimization by ByteArray.get(), otherwise
|
// undo the single-page optimization by ByteArray.get(), otherwise
|
||||||
// a materialized stream will contain traling garbage/zeros
|
// a materialized stream will contain trailing garbage/zeros
|
||||||
byte[] result = ref.bytes;
|
byte[] result = ref.bytes;
|
||||||
if (result.length != length || ref.offset != 0) {
|
if (result.length != length || ref.offset != 0) {
|
||||||
result = Arrays.copyOfRange(result, ref.offset, ref.offset + length);
|
result = Arrays.copyOfRange(result, ref.offset, ref.offset + length);
|
||||||
@ -403,7 +403,7 @@ public class PagedBytesReference implements BytesReference {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int numBytesToCopy = Math.min(len, length - pos); // copy the full lenth or the remaining part
|
final int numBytesToCopy = Math.min(len, length - pos); // copy the full length or the remaining part
|
||||||
|
|
||||||
// current offset into the underlying ByteArray
|
// current offset into the underlying ByteArray
|
||||||
long byteArrayOffset = offset + pos;
|
long byteArrayOffset = offset + pos;
|
||||||
|
@ -33,7 +33,7 @@ package org.elasticsearch.common.component;
|
|||||||
* following logic can be applied:
|
* following logic can be applied:
|
||||||
* <pre>
|
* <pre>
|
||||||
* public void stop() {
|
* public void stop() {
|
||||||
* if (!lifeccycleState.moveToStopped()) {
|
* if (!lifecycleState.moveToStopped()) {
|
||||||
* return;
|
* return;
|
||||||
* }
|
* }
|
||||||
* // continue with stop logic
|
* // continue with stop logic
|
||||||
@ -50,7 +50,7 @@ package org.elasticsearch.common.component;
|
|||||||
* if (!lifecycleState.moveToClosed()) {
|
* if (!lifecycleState.moveToClosed()) {
|
||||||
* return;
|
* return;
|
||||||
* }
|
* }
|
||||||
* // perofrm close logic here
|
* // perform close logic here
|
||||||
* }
|
* }
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
|
@ -124,7 +124,7 @@ public abstract class CompressedIndexInput extends IndexInput {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readBytes(byte[] b, int offset, int len) throws IOException {
|
public void readBytes(byte[] b, int offset, int len) throws IOException {
|
||||||
int result = read(b, offset, len, true /* we want to have full reads, thats the contract... */);
|
int result = read(b, offset, len, true /* we want to have full reads, that's the contract... */);
|
||||||
if (result < len) {
|
if (result < len) {
|
||||||
throw new EOFException();
|
throw new EOFException();
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ public abstract class CompressedStreamInput extends StreamInput {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readBytes(byte[] b, int offset, int len) throws IOException {
|
public void readBytes(byte[] b, int offset, int len) throws IOException {
|
||||||
int result = read(b, offset, len, true /* we want to have full reads, thats the contract... */);
|
int result = read(b, offset, len, true /* we want to have full reads, that's the contract... */);
|
||||||
if (result < len) {
|
if (result < len) {
|
||||||
throw new EOFException();
|
throw new EOFException();
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class DeflateCompressor implements Compressor {
|
|||||||
private static final byte[] HEADER = new byte[] { 'D', 'F', 'L', '\0' };
|
private static final byte[] HEADER = new byte[] { 'D', 'F', 'L', '\0' };
|
||||||
// 3 is a good trade-off between speed and compression ratio
|
// 3 is a good trade-off between speed and compression ratio
|
||||||
private static final int LEVEL = 3;
|
private static final int LEVEL = 3;
|
||||||
// We use buffering on the input and ouput of in/def-laters in order to
|
// We use buffering on the input and output of in/def-laters in order to
|
||||||
// limit the number of JNI calls
|
// limit the number of JNI calls
|
||||||
private static final int BUFFER_SIZE = 4096;
|
private static final int BUFFER_SIZE = 4096;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ import java.lang.annotation.Target;
|
|||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acccompanies a {@literal @}{@link org.elasticsearch.common.inject.Provides Provides} method annotation in a
|
* Accompanies a {@literal @}{@link org.elasticsearch.common.inject.Provides Provides} method annotation in a
|
||||||
* private module to indicate that the provided binding is exposed.
|
* private module to indicate that the provided binding is exposed.
|
||||||
*
|
*
|
||||||
* @author jessewilson@google.com (Jesse Wilson)
|
* @author jessewilson@google.com (Jesse Wilson)
|
||||||
|
@ -489,7 +489,7 @@ class InjectorImpl implements Injector, Lookups {
|
|||||||
ParameterizedType parameterizedType = (ParameterizedType) typeLiteralType;
|
ParameterizedType parameterizedType = (ParameterizedType) typeLiteralType;
|
||||||
Type innerType = parameterizedType.getActualTypeArguments()[0];
|
Type innerType = parameterizedType.getActualTypeArguments()[0];
|
||||||
|
|
||||||
// this is unforunate. We don't support building TypeLiterals for type variable like 'T'. If
|
// this is unfortunate. We don't support building TypeLiterals for type variable like 'T'. If
|
||||||
// this proves problematic, we can probably fix TypeLiteral to support type variables
|
// this proves problematic, we can probably fix TypeLiteral to support type variables
|
||||||
if (!(innerType instanceof Class)
|
if (!(innerType instanceof Class)
|
||||||
&& !(innerType instanceof GenericArrayType)
|
&& !(innerType instanceof GenericArrayType)
|
||||||
|
@ -41,7 +41,7 @@ import java.util.Objects;
|
|||||||
* TypeLiteral}.
|
* TypeLiteral}.
|
||||||
* <p>
|
* <p>
|
||||||
* Keys do not differentiate between primitive types (int, char, etc.) and
|
* Keys do not differentiate between primitive types (int, char, etc.) and
|
||||||
* their correpsonding wrapper types (Integer, Character, etc.). Primitive
|
* their corresponding wrapper types (Integer, Character, etc.). Primitive
|
||||||
* types will be replaced with their wrapper types when keys are created.
|
* types will be replaced with their wrapper types when keys are created.
|
||||||
*
|
*
|
||||||
* @author crazybob@google.com (Bob Lee)
|
* @author crazybob@google.com (Bob Lee)
|
||||||
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal respresentation of a constructor annotated with
|
* Internal representation of a constructor annotated with
|
||||||
* {@link AssistedInject}
|
* {@link AssistedInject}
|
||||||
*
|
*
|
||||||
* @author jmourits@google.com (Jerome Mourits)
|
* @author jmourits@google.com (Jerome Mourits)
|
||||||
|
@ -24,7 +24,7 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of {@link TypeLiteral}s to match an injectable Constructor's assited
|
* A list of {@link TypeLiteral}s to match an injectable Constructor's assisted
|
||||||
* parameter types to the corresponding factory method.
|
* parameter types to the corresponding factory method.
|
||||||
*
|
*
|
||||||
* @author jmourits@google.com (Jerome Mourits)
|
* @author jmourits@google.com (Jerome Mourits)
|
||||||
|
@ -91,7 +91,7 @@ public final class Dependency<T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the index of this dependency in the injection point's parameter list, or {@code -1} if
|
* Returns the index of this dependency in the injection point's parameter list, or {@code -1} if
|
||||||
* this dependency does not belong to a parameter list. Only method and constuctor dependencies
|
* this dependency does not belong to a parameter list. Only method and constructor dependencies
|
||||||
* are elements in a parameter list.
|
* are elements in a parameter list.
|
||||||
*/
|
*/
|
||||||
public int getParameterIndex() {
|
public int getParameterIndex() {
|
||||||
|
@ -125,7 +125,7 @@ public final class InjectionPoint {
|
|||||||
return Collections.unmodifiableList(dependencies);
|
return Collections.unmodifiableList(dependencies);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This metohd is necessary to create a Dependency<T> with proper generic type information
|
// This method is necessary to create a Dependency<T> with proper generic type information
|
||||||
private <T> Dependency<T> newDependency(Key<T> key, boolean allowsNull, int parameterIndex) {
|
private <T> Dependency<T> newDependency(Key<T> key, boolean allowsNull, int parameterIndex) {
|
||||||
return new Dependency<>(this, key, allowsNull, parameterIndex);
|
return new Dependency<>(this, key, allowsNull, parameterIndex);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ import java.util.Objects;
|
|||||||
*/
|
*/
|
||||||
public final class ProviderLookup<T> implements Element {
|
public final class ProviderLookup<T> implements Element {
|
||||||
|
|
||||||
// NOTE: this class is not part of guice and was added so the provder lookup's key can be acessible for tests
|
// NOTE: this class is not part of guice and was added so the provider lookup's key can be accessible for tests
|
||||||
public static class ProviderImpl<T> implements Provider<T> {
|
public static class ProviderImpl<T> implements Provider<T> {
|
||||||
private ProviderLookup<T> lookup;
|
private ProviderLookup<T> lookup;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import java.io.IOException;
|
|||||||
/**
|
/**
|
||||||
* This exception can be used to wrap a given, not serializable exception
|
* This exception can be used to wrap a given, not serializable exception
|
||||||
* to serialize via {@link StreamOutput#writeThrowable(Throwable)}.
|
* to serialize via {@link StreamOutput#writeThrowable(Throwable)}.
|
||||||
* This class will perserve the stacktrace as well as the suppressed exceptions of
|
* This class will preserve the stacktrace as well as the suppressed exceptions of
|
||||||
* the throwable it was created with instead of it's own. The stacktrace has no indication
|
* the throwable it was created with instead of it's own. The stacktrace has no indication
|
||||||
* of where this exception was created.
|
* of where this exception was created.
|
||||||
*/
|
*/
|
||||||
|
@ -627,7 +627,7 @@ public class Lucene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the version string lenient and returns the the default value if the given string is null or emtpy
|
* Parses the version string lenient and returns the default value if the given string is null or emtpy
|
||||||
*/
|
*/
|
||||||
public static Version parseVersionLenient(String toParse, Version defaultValue) {
|
public static Version parseVersionLenient(String toParse, Version defaultValue) {
|
||||||
return LenientParser.parse(toParse, defaultValue);
|
return LenientParser.parse(toParse, defaultValue);
|
||||||
|
@ -21,7 +21,7 @@ package org.elasticsearch.common.recycler;
|
|||||||
|
|
||||||
abstract class FilterRecycler<T> implements Recycler<T> {
|
abstract class FilterRecycler<T> implements Recycler<T> {
|
||||||
|
|
||||||
/** Get the delegate instance to foward calls to. */
|
/** Get the delegate instance to forward calls to. */
|
||||||
protected abstract Recycler<T> getDelegate();
|
protected abstract Recycler<T> getDelegate();
|
||||||
|
|
||||||
/** Wrap a recycled reference. */
|
/** Wrap a recycled reference. */
|
||||||
|
@ -47,7 +47,7 @@ import java.util.stream.Collectors;
|
|||||||
* A setting. Encapsulates typical stuff like default value, parsing, and scope.
|
* A setting. Encapsulates typical stuff like default value, parsing, and scope.
|
||||||
* Some (dynamic=true) can by modified at run time using the API.
|
* Some (dynamic=true) can by modified at run time using the API.
|
||||||
* All settings inside elasticsearch or in any of the plugins should use this type-safe and generic settings infrastructure
|
* All settings inside elasticsearch or in any of the plugins should use this type-safe and generic settings infrastructure
|
||||||
* together with {@link AbstractScopedSettings}. This class contains several untility methods that makes it straight forward
|
* together with {@link AbstractScopedSettings}. This class contains several utility methods that makes it straight forward
|
||||||
* to add settings for the majority of the cases. For instance a simple boolean settings can be defined like this:
|
* to add settings for the majority of the cases. For instance a simple boolean settings can be defined like this:
|
||||||
* <pre>{@code
|
* <pre>{@code
|
||||||
* public static final Setting<Boolean>; MY_BOOLEAN = Setting.boolSetting("my.bool.setting", true, false, Scope.CLUSTER);}
|
* public static final Setting<Boolean>; MY_BOOLEAN = Setting.boolSetting("my.bool.setting", true, false, Scope.CLUSTER);}
|
||||||
|
@ -471,7 +471,7 @@ public final class Settings implements ToXContent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the setting value (as size) associated with the setting key. Provided values can either be
|
* Returns the setting value (as size) associated with the setting key. Provided values can either be
|
||||||
* absolute values (intepreted as a number of bytes), byte sizes (eg. 1mb) or percentage of the heap size
|
* absolute values (interpreted as a number of bytes), byte sizes (eg. 1mb) or percentage of the heap size
|
||||||
* (eg. 12%). If it does not exists, parses the default value provided.
|
* (eg. 12%). If it does not exists, parses the default value provided.
|
||||||
*/
|
*/
|
||||||
public ByteSizeValue getAsMemory(String setting, String defaultValue) throws SettingsException {
|
public ByteSizeValue getAsMemory(String setting, String defaultValue) throws SettingsException {
|
||||||
@ -480,7 +480,7 @@ public final class Settings implements ToXContent {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the setting value (as size) associated with the setting key. Provided values can either be
|
* Returns the setting value (as size) associated with the setting key. Provided values can either be
|
||||||
* absolute values (intepreted as a number of bytes), byte sizes (eg. 1mb) or percentage of the heap size
|
* absolute values (interpreted as a number of bytes), byte sizes (eg. 1mb) or percentage of the heap size
|
||||||
* (eg. 12%). If it does not exists, parses the default value provided.
|
* (eg. 12%). If it does not exists, parses the default value provided.
|
||||||
*/
|
*/
|
||||||
public ByteSizeValue getAsMemory(String[] settings, String defaultValue) throws SettingsException {
|
public ByteSizeValue getAsMemory(String[] settings, String defaultValue) throws SettingsException {
|
||||||
|
@ -112,7 +112,7 @@ abstract class AbstractPagedHashMap implements Releasable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// The only entries which have not been put in their final position in the previous loop are those that were stored in a slot that
|
// The only entries which have not been put in their final position in the previous loop are those that were stored in a slot that
|
||||||
// is < slot(key, mask). This only happens when slot(key, mask) returned a slot that was close to the end of the array and colision
|
// is < slot(key, mask). This only happens when slot(key, mask) returned a slot that was close to the end of the array and collision
|
||||||
// resolution has put it back in the first slots. This time, collision resolution will have put them at the beginning of the newly
|
// resolution has put it back in the first slots. This time, collision resolution will have put them at the beginning of the newly
|
||||||
// allocated slots. Let's re-add them to make sure they are in the right slot. This 2nd loop will typically exit very early.
|
// allocated slots. Let's re-add them to make sure they are in the right slot. This 2nd loop will typically exit very early.
|
||||||
for (long i = buckets; i < newBuckets; ++i) {
|
for (long i = buckets; i < newBuckets; ++i) {
|
||||||
|
@ -78,7 +78,7 @@ public abstract class ExtensionPoint {
|
|||||||
/**
|
/**
|
||||||
* Creates a new {@link ClassMap}
|
* Creates a new {@link ClassMap}
|
||||||
*
|
*
|
||||||
* @param name the human readable underscore case name of the extension poing. This is used in error messages etc.
|
* @param name the human readable underscore case name of the extension point. This is used in error messages etc.
|
||||||
* @param extensionClass the base class that should be extended
|
* @param extensionClass the base class that should be extended
|
||||||
* @param singletons a list of singletons to bind with this extension point - these are bound in {@link #bind(Binder)}
|
* @param singletons a list of singletons to bind with this extension point - these are bound in {@link #bind(Binder)}
|
||||||
* @param reservedKeys a set of reserved keys by internal implementations
|
* @param reservedKeys a set of reserved keys by internal implementations
|
||||||
@ -120,7 +120,7 @@ public abstract class ExtensionPoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Type extension point which basically allows to registerd keyed extensions like {@link ClassMap}
|
* A Type extension point which basically allows to registered keyed extensions like {@link ClassMap}
|
||||||
* but doesn't instantiate and bind all the registered key value pairs but instead replace a singleton based on a given setting via {@link #bindType(Binder, Settings, String, String)}
|
* but doesn't instantiate and bind all the registered key value pairs but instead replace a singleton based on a given setting via {@link #bindType(Binder, Settings, String, String)}
|
||||||
* Note: {@link #bind(Binder)} is not supported by this class
|
* Note: {@link #bind(Binder)} is not supported by this class
|
||||||
*/
|
*/
|
||||||
@ -169,7 +169,7 @@ public abstract class ExtensionPoint {
|
|||||||
/**
|
/**
|
||||||
* Creates a new {@link ClassSet}
|
* Creates a new {@link ClassSet}
|
||||||
*
|
*
|
||||||
* @param name the human readable underscore case name of the extension poing. This is used in error messages etc.
|
* @param name the human readable underscore case name of the extension point. This is used in error messages etc.
|
||||||
* @param extensionClass the base class that should be extended
|
* @param extensionClass the base class that should be extended
|
||||||
* @param singletons a list of singletons to bind with this extension point - these are bound in {@link #bind(Binder)}
|
* @param singletons a list of singletons to bind with this extension point - these are bound in {@link #bind(Binder)}
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user