Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing @Override annotations. #9832

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions src/main/java/org/apache/lucene/queries/BlendedTermQuery.java
Expand Up @@ -239,6 +239,7 @@ public static BlendedTermQuery booleanBlendedQuery(Term[] terms, final boolean d

public static BlendedTermQuery booleanBlendedQuery(Term[] terms, final float[] boosts, final boolean disableCoord) {
return new BlendedTermQuery(terms) {
@Override
protected Query topLevelQuery(Term[] terms, TermContext[] ctx, int[] docFreqs, int maxDoc) {
BooleanQuery query = new BooleanQuery(disableCoord);
for (int i = 0; i < terms.length; i++) {
Expand All @@ -255,6 +256,7 @@ protected Query topLevelQuery(Term[] terms, TermContext[] ctx, int[] docFreqs, i

public static BlendedTermQuery commonTermsBlendedQuery(Term[] terms, final float[] boosts, final boolean disableCoord, final float maxTermFrequency) {
return new BlendedTermQuery(terms) {
@Override
protected Query topLevelQuery(Term[] terms, TermContext[] ctx, int[] docFreqs, int maxDoc) {
BooleanQuery query = new BooleanQuery(true);
BooleanQuery high = new BooleanQuery(disableCoord);
Expand Down Expand Up @@ -294,6 +296,7 @@ public static BlendedTermQuery dismaxBlendedQuery(Term[] terms, final float tieB

public static BlendedTermQuery dismaxBlendedQuery(Term[] terms, final float[] boosts, final float tieBreakerMultiplier) {
return new BlendedTermQuery(terms) {
@Override
protected Query topLevelQuery(Term[] terms, TermContext[] ctx, int[] docFreqs, int maxDoc) {
DisjunctionMaxQuery query = new DisjunctionMaxQuery(tieBreakerMultiplier);
for (int i = 0; i < terms.length; i++) {
Expand Down
Expand Up @@ -851,6 +851,7 @@ private Collection<String> extractMultiFields(String field) {
return fields;
}

@Override
public Query parse(String query) throws ParseException {
if (query.trim().isEmpty()) {
// if the query string is empty we return no docs / empty result
Expand Down
Expand Up @@ -254,7 +254,8 @@ public XAnalyzingSuggester(Analyzer indexAnalyzer, Automaton queryPrefix, Analyz
}

/** Returns byte size of the underlying FST. */
public long ramBytesUsed() {
@Override
public long ramBytesUsed() {
return fst == null ? 0 : fst.ramBytesUsed();
}

Expand Down
Expand Up @@ -190,6 +190,7 @@ public WithRestHeaders(String msg, Throwable cause, @Nullable ImmutableMap<Strin
this.headers = headers != null ? headers : ImmutableMap.<String, List<String>>of();
}

@Override
public ImmutableMap<String, List<String>> getHeaders() {
return headers;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/elasticsearch/action/ActionRunnable.java
Expand Up @@ -37,6 +37,7 @@ public ActionRunnable(ActionListener<Response> listener) {
* Calls the action listeners {@link ActionListener#onFailure(Throwable)} method with the given exception.
* This method is invoked for all exception thrown by {@link #doRun()}
*/
@Override
public void onFailure(Throwable t) {
listener.onFailure(t);
}
Expand Down
Expand Up @@ -198,13 +198,15 @@ public Failure(String index, int shardId, @Nullable String nodeId, String reason
/**
* @return On what index the failure occurred.
*/
@Override
public String index() {
return index;
}

/**
* @return On what shard id the failure occurred.
*/
@Override
public int shardId() {
return shardId;
}
Expand All @@ -220,13 +222,15 @@ public String nodeId() {
/**
* @return A text description of the failure
*/
@Override
public String reason() {
return reason;
}

/**
* @return The status to report if this failure was a primary failure.
*/
@Override
public RestStatus status() {
return status;
}
Expand Down
Expand Up @@ -110,6 +110,7 @@ public ClearIndicesCacheRequest idCache(boolean idCache) {
return this;
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
filterCache = in.readBoolean();
Expand All @@ -121,6 +122,7 @@ public void readFrom(StreamInput in) throws IOException {
queryCache = in.readBoolean();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(filterCache);
Expand Down
Expand Up @@ -76,6 +76,7 @@ public TypesExistsRequest indicesOptions(IndicesOptions indicesOptions) {
return this;
}

@Override
public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (indices == null) { // Specifying '*' via rest api results in an empty array
Expand Down
Expand Up @@ -64,6 +64,7 @@ public TypesExistsRequestBuilder setIndicesOptions(IndicesOptions indicesOptions
return this;
}

@Override
protected void doExecute(ActionListener<TypesExistsResponse> listener) {
client.typesExists(request, listener);
}
Expand Down
Expand Up @@ -42,11 +42,13 @@ public boolean isExists() {
return this.exists;
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
exists = in.readBoolean();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(exists);
Expand Down
Expand Up @@ -161,6 +161,7 @@ public boolean paramAsBoolean(String key, boolean defaultValue) {
return defaultValue;
}

@Override
public Boolean paramAsBoolean(String key, Boolean defaultValue) {
if (INCLUDE_DEFAULTS.equals(key)) {
return true;
Expand Down
Expand Up @@ -129,6 +129,7 @@ public OptimizeRequest upgrade(boolean upgrade) {
return this;
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
maxNumSegments = in.readInt();
Expand All @@ -137,6 +138,7 @@ public void readFrom(StreamInput in) throws IOException {
upgrade = in.readBoolean();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeInt(maxNumSegments);
Expand Down
Expand Up @@ -348,10 +348,12 @@ private void manage() {
}
}

@Override
public void onResponse(Response response) {
manage();
}

@Override
public void onFailure(Throwable e) {
try {
if (errorMessages.size() < 5) {
Expand Down
Expand Up @@ -405,6 +405,7 @@ protected CountDownAsyncHandler(int size) {
countDown = new CountDown(size);
}

@Override
public abstract T newInstance();

protected abstract void sendResponse();
Expand All @@ -426,6 +427,7 @@ public void handleException(TransportException t) {
}
}

@Override
public String executor() {
return ThreadPool.Names.SAME;
}
Expand Down Expand Up @@ -669,6 +671,7 @@ public AbortBenchmarkTask(String[] patterns, BenchmarkStateListener listener) {
this.patterns = patterns;
}

@Override
protected boolean match(BenchmarkMetaData.Entry entry) {
return entry.state() == BenchmarkMetaData.State.STARTED && Regex.simpleMatch(this.patterns, benchmarkId);
}
Expand Down
Expand Up @@ -573,6 +573,7 @@ private UpdateResult shardUpdateOperation(ClusterState clusterState, BulkShardRe
}


@Override
protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.shardId.getIndex()).shardSafe(shardRequest.shardId.id());
final BulkShardRequest request = shardRequest.request;
Expand Down
Expand Up @@ -125,6 +125,7 @@ public ActionRequestValidationException validate() {
/**
* The type of the document to delete.
*/
@Override
public String type() {
return type;
}
Expand All @@ -140,6 +141,7 @@ public DeleteRequest type(String type) {
/**
* The id of the document to delete.
*/
@Override
public String id() {
return id;
}
Expand Down Expand Up @@ -167,6 +169,7 @@ public DeleteRequest parent(String parent) {
* Controls the shard routing of the request. Using this value to hash the shard
* and not the id.
*/
@Override
public DeleteRequest routing(String routing) {
if (routing != null && routing.length() == 0) {
this.routing = null;
Expand All @@ -180,6 +183,7 @@ public DeleteRequest routing(String routing) {
* Controls the shard routing of the delete request. Using this value to hash the shard
* and not the id.
*/
@Override
public String routing() {
return this.routing;
}
Expand Down
Expand Up @@ -104,6 +104,7 @@ public DeleteRequestBuilder setVersionType(VersionType versionType) {
/**
* Set the replication type for this operation.
*/
@Override
public DeleteRequestBuilder setReplicationType(ReplicationType replicationType) {
request.replicationType(replicationType);
return this;
Expand All @@ -112,6 +113,7 @@ public DeleteRequestBuilder setReplicationType(ReplicationType replicationType)
/**
* Sets the consistency level. Defaults to {@link org.elasticsearch.action.WriteConsistencyLevel#DEFAULT}.
*/
@Override
public DeleteRequestBuilder setConsistencyLevel(WriteConsistencyLevel consistencyLevel) {
request.consistencyLevel(consistencyLevel);
return this;
Expand Down
Expand Up @@ -199,6 +199,7 @@ public DeleteByQueryRequest types(String... types) {
return this;
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
sourceUnsafe = false;
Expand All @@ -207,6 +208,7 @@ public void readFrom(StreamInput in) throws IOException {
types = in.readStringArray();
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBytesReference(source);
Expand Down
Expand Up @@ -137,6 +137,7 @@ public DeleteByQueryRequestBuilder setSource(byte[] source, int offset, int leng
/**
* The replication type to use with this operation.
*/
@Override
public DeleteByQueryRequestBuilder setReplicationType(ReplicationType replicationType) {
request.replicationType(replicationType);
return this;
Expand All @@ -145,11 +146,13 @@ public DeleteByQueryRequestBuilder setReplicationType(ReplicationType replicatio
/**
* The replication type to use with this operation.
*/
@Override
public DeleteByQueryRequestBuilder setReplicationType(String replicationType) {
request.replicationType(replicationType);
return this;
}

@Override
public DeleteByQueryRequestBuilder setConsistencyLevel(WriteConsistencyLevel consistencyLevel) {
request.consistencyLevel(consistencyLevel);
return this;
Expand Down
Expand Up @@ -34,10 +34,12 @@ private ExplainAction() {
super(NAME);
}

@Override
public ExplainRequestBuilder newRequestBuilder(Client client) {
return new ExplainRequestBuilder(client);
}

@Override
public ExplainResponse newResponse() {
return new ExplainResponse();
}
Expand Down
Expand Up @@ -163,6 +163,7 @@ public ExplainRequestBuilder setSource(BytesReference source, boolean unsafe) {
return this;
}

@Override
protected void doExecute(ActionListener<ExplainResponse> listener) {
if (sourceBuilder != null) {
request.source(sourceBuilder);
Expand Down
Expand Up @@ -95,6 +95,7 @@ public GetResult getGetResult() {
return getResult;
}

@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
index = in.readString();
Expand All @@ -109,6 +110,7 @@ public void readFrom(StreamInput in) throws IOException {
}
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeString(index);
Expand Down
Expand Up @@ -84,6 +84,7 @@ protected void doExecute(ExplainRequest request, ActionListener<ExplainResponse>
super.doExecute(request, listener);
}

@Override
protected String executor() {
return ThreadPool.Names.GET; // Or use Names.SEARCH?
}
Expand Down Expand Up @@ -146,10 +147,12 @@ protected ExplainResponse shardOperation(ExplainRequest request, ShardId shardId
}
}

@Override
protected ExplainRequest newRequest() {
return new ExplainRequest();
}

@Override
protected ExplainResponse newResponse() {
return new ExplainResponse();
}
Expand Down
Expand Up @@ -247,6 +247,7 @@ public IndexRequest contentType(XContentType contentType) {
/**
* The type of the indexed document.
*/
@Override
public String type() {
return type;
}
Expand All @@ -262,6 +263,7 @@ public IndexRequest type(String type) {
/**
* The id of the indexed document. If not set, will be automatically generated.
*/
@Override
public String id() {
return id;
}
Expand All @@ -278,6 +280,7 @@ public IndexRequest id(String id) {
* Controls the shard routing of the request. Using this value to hash the shard
* and not the id.
*/
@Override
public IndexRequest routing(String routing) {
if (routing != null && routing.length() == 0) {
this.routing = null;
Expand All @@ -291,6 +294,7 @@ public IndexRequest routing(String routing) {
* Controls the shard routing of the request. Using this value to hash the shard
* and not the id.
*/
@Override
public String routing() {
return this.routing;
}
Expand Down