org.apache.maven.plugins
diff --git a/src/main/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.java b/src/main/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.java
index e6a3e350c7e..4d946606201 100644
--- a/src/main/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.java
+++ b/src/main/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilter.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -39,7 +39,8 @@ public class TruncateTokenFilter extends TokenFilter {
this.size = size;
}
- @Override public final boolean incrementToken() throws IOException {
+ @Override
+ public final boolean incrementToken() throws IOException {
if (input.incrementToken()) {
final int length = termAttribute.length();
if (length > size) {
diff --git a/src/main/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilter.java b/src/main/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilter.java
index bdbbe8c27f5..020c26b0d2f 100644
--- a/src/main/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilter.java
+++ b/src/main/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilter.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,7 +50,8 @@ public class UniqueTokenFilter extends TokenFilter {
this.onlyOnSamePosition = onlyOnSamePosition;
}
- @Override public final boolean incrementToken() throws IOException {
+ @Override
+ public final boolean incrementToken() throws IOException {
while (input.incrementToken()) {
final char term[] = termAttribute.buffer();
final int length = termAttribute.length();
@@ -79,7 +80,8 @@ public class UniqueTokenFilter extends TokenFilter {
return false;
}
- @Override public final void reset() throws IOException {
+ @Override
+ public final void reset() throws IOException {
super.reset();
previous.clear();
}
diff --git a/src/main/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java b/src/main/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java
index ef0e143479a..e5d05e99482 100644
--- a/src/main/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java
+++ b/src/main/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterFilter.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -45,7 +45,7 @@ import java.io.IOException;
* - trailing "'s" are removed for each subword
* - "O'Neil's" -> "O", "Neil"
* - Note: this step isn't performed in a separate filter because of possible subword combinations.
- *
+ *
* The combinations parameter affects how subwords are combined:
* - combinations="0" causes no subword combinations.
* - "PowerShot" -> 0:"Power", 1:"Shot" (0 and 1 are the token positions)
@@ -53,7 +53,7 @@ import java.io.IOException;
* - "PowerShot" -> 0:"Power", 1:"Shot" 1:"PowerShot"
* - "A's+B's&C's" -> 0:"A", 1:"B", 2:"C", 2:"ABC"
* - "Super-Duper-XL500-42-AutoCoder!" -> 0:"Super", 1:"Duper", 2:"XL", 2:"SuperDuperXL", 3:"500" 4:"42", 5:"Auto", 6:"Coder", 6:"AutoCoder"
- *
+ *
* One use for WordDelimiterFilter is to help match words with different subword delimiters.
* For example, if the source text contained "wi-fi" one may want "wifi" "WiFi" "wi-fi" "wi+fi" queries to all match.
* One way of doing so is to specify combinations="1" in the analyzer used for indexing, and combinations="0" (the default)
diff --git a/src/main/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterIterator.java b/src/main/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterIterator.java
index 943ccfb6097..867422c920e 100644
--- a/src/main/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterIterator.java
+++ b/src/main/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterIterator.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/apache/lucene/analysis/pattern/PatternReplaceFilter.java b/src/main/java/org/apache/lucene/analysis/pattern/PatternReplaceFilter.java
index 9ddc816e6b7..ef7565215b1 100644
--- a/src/main/java/org/apache/lucene/analysis/pattern/PatternReplaceFilter.java
+++ b/src/main/java/org/apache/lucene/analysis/pattern/PatternReplaceFilter.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -23,63 +23,63 @@ import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* A TokenFilter which applies a Pattern to each token in the stream,
* replacing match occurances with the specified replacement string.
- *
+ *
*
* Note: Depending on the input and the pattern used and the input
* TokenStream, this TokenFilter may produce Tokens whose text is the empty
* string.
*
- *
+ *
* @see Pattern
*/
public final class PatternReplaceFilter extends TokenFilter {
- private final Pattern p;
- private final String replacement;
- private final boolean all;
- private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
- private final Matcher m;
+ private final Pattern p;
+ private final String replacement;
+ private final boolean all;
+ private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
+ private final Matcher m;
- /**
- * Constructs an instance to replace either the first, or all occurances
- *
- * @param in the TokenStream to process
- * @param p the patterm to apply to each Token
- * @param replacement the "replacement string" to substitute, if null a
- * blank string will be used. Note that this is not the literal
- * string that will be used, '$' and '\' have special meaning.
- * @param all if true, all matches will be replaced otherwise just the first match.
- * @see Matcher#quoteReplacement
- */
- public PatternReplaceFilter(TokenStream in,
- Pattern p,
- String replacement,
- boolean all) {
- super(in);
- this.p=p;
- this.replacement = (null == replacement) ? "" : replacement;
- this.all=all;
- this.m = p.matcher(termAtt);
- }
-
- @Override
- public boolean incrementToken() throws IOException {
- if (!input.incrementToken()) return false;
-
- m.reset();
- if (m.find()) {
- // replaceAll/replaceFirst will reset() this previous find.
- String transformed = all ? m.replaceAll(replacement) : m.replaceFirst(replacement);
- termAtt.setEmpty().append(transformed);
+ /**
+ * Constructs an instance to replace either the first, or all occurances
+ *
+ * @param in the TokenStream to process
+ * @param p the patterm to apply to each Token
+ * @param replacement the "replacement string" to substitute, if null a
+ * blank string will be used. Note that this is not the literal
+ * string that will be used, '$' and '\' have special meaning.
+ * @param all if true, all matches will be replaced otherwise just the first match.
+ * @see Matcher#quoteReplacement
+ */
+ public PatternReplaceFilter(TokenStream in,
+ Pattern p,
+ String replacement,
+ boolean all) {
+ super(in);
+ this.p = p;
+ this.replacement = (null == replacement) ? "" : replacement;
+ this.all = all;
+ this.m = p.matcher(termAtt);
}
- return true;
- }
+ @Override
+ public boolean incrementToken() throws IOException {
+ if (!input.incrementToken()) return false;
+
+ m.reset();
+ if (m.find()) {
+ // replaceAll/replaceFirst will reset() this previous find.
+ String transformed = all ? m.replaceAll(replacement) : m.replaceFirst(replacement);
+ termAtt.setEmpty().append(transformed);
+ }
+
+ return true;
+ }
}
diff --git a/src/main/java/org/apache/lucene/analysis/pattern/PatternTokenizer.java b/src/main/java/org/apache/lucene/analysis/pattern/PatternTokenizer.java
index 7a6397a5170..09d32506976 100644
--- a/src/main/java/org/apache/lucene/analysis/pattern/PatternTokenizer.java
+++ b/src/main/java/org/apache/lucene/analysis/pattern/PatternTokenizer.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/apache/lucene/index/ExtendedIndexSearcher.java b/src/main/java/org/apache/lucene/index/ExtendedIndexSearcher.java
index 00f4c1a3737..adb84ebd02d 100644
--- a/src/main/java/org/apache/lucene/index/ExtendedIndexSearcher.java
+++ b/src/main/java/org/apache/lucene/index/ExtendedIndexSearcher.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.apache.lucene.index;
import org.apache.lucene.search.IndexSearcher;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ExtendedIndexSearcher extends IndexSearcher {
diff --git a/src/main/java/org/apache/lucene/index/TrackingConcurrentMergeScheduler.java b/src/main/java/org/apache/lucene/index/TrackingConcurrentMergeScheduler.java
index 51f3ae43149..cd0799a9798 100644
--- a/src/main/java/org/apache/lucene/index/TrackingConcurrentMergeScheduler.java
+++ b/src/main/java/org/apache/lucene/index/TrackingConcurrentMergeScheduler.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -74,7 +74,8 @@ public class TrackingConcurrentMergeScheduler extends ConcurrentMergeScheduler {
return currentMergesSizeInBytes.count();
}
- @Override protected void doMerge(MergePolicy.OneMerge merge) throws IOException {
+ @Override
+ protected void doMerge(MergePolicy.OneMerge merge) throws IOException {
int totalNumDocs = merge.totalNumDocs();
long totalSizeInBytes = merge.totalBytesSize();
long time = System.currentTimeMillis();
diff --git a/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java b/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java
index 84a8b0a6b96..b1a34c954f3 100644
--- a/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java
+++ b/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/apache/lucene/index/memory/CustomMemoryIndex.java b/src/main/java/org/apache/lucene/index/memory/CustomMemoryIndex.java
index 9a68836010b..3954d5d0758 100644
--- a/src/main/java/org/apache/lucene/index/memory/CustomMemoryIndex.java
+++ b/src/main/java/org/apache/lucene/index/memory/CustomMemoryIndex.java
@@ -54,9 +54,9 @@ import java.util.*;
/**
* High-performance single-document main memory Apache Lucene fulltext search index.
- *
+ *
* Overview
- *
+ *
* This class is a replacement/substitute for a large subset of
* {@link RAMDirectory} functionality. It is designed to
* enable maximum efficiency for on-the-fly matchmaking combining structured and
@@ -71,7 +71,7 @@ import java.util.*;
*
* float score = search(String text, Query query)
*
- *
+ *
* Each instance can hold at most one Lucene "document", with a document containing
* zero or more "fields", each field having a name and a fulltext value. The
* fulltext value is tokenized (split and transformed) into zero or more index terms
@@ -82,7 +82,7 @@ import java.util.*;
* being reduced to "fish" (stemming), resolve synonyms/inflexions/thesauri
* (upon indexing and/or querying), etc. For details, see
* Lucene Analyzer Intro.
- *
+ *
* Arbitrary Lucene queries can be run against this class - see Lucene Query Syntax
* as well as
+ *
* For some interesting background information on search technology, see Bob Wyman's
* Prospective Search,
@@ -99,10 +99,10 @@ import java.util.*;
* A Call to Arms - Custom subscriptions, and Tim Bray's
* On Search, the Series.
- *
- *
+ *
+ *
* Example Usage
- *
+ *
*
* Analyzer analyzer = PatternAnalyzer.DEFAULT_ANALYZER;
* //Analyzer analyzer = new SimpleAnalyzer();
@@ -118,10 +118,10 @@ import java.util.*;
* }
* System.out.println("indexData=" + index.toString());
*
- *
- *
+ *
+ *
* Example XQuery Usage
- *
+ *
*
* (: An XQuery that finds all books authored by James that have something to do with "salmon fishing manuals", sorted by relevance :)
* declare namespace lucene = "java:nux.xom.pool.FullTextUtil";
@@ -132,10 +132,10 @@ import java.util.*;
* order by $score descending
* return $book
*
- *
- *
+ *
+ *
* No thread safety guarantees
- *
+ *
* An instance can be queried multiple times with the same or different queries,
* but an instance is not thread-safe. If desired use idioms such as:
*
@@ -144,14 +144,14 @@ import java.util.*;
* // read and/or write index (i.e. add fields and/or query)
* }
*
- *
- *
+ *
+ *
* Performance Notes
- *
+ *
* Internally there's a new data structure geared towards efficient indexing
* and searching, plus the necessary support code to seamlessly plug into the Lucene
* framework.
- *
+ *
* This class performs very well for very small texts (e.g. 10 chars)
* as well as for large texts (e.g. 10 MB) and everything in between.
* Typically, it is about 10-100 times faster than RAMDirectory
.
@@ -159,11 +159,11 @@ import java.util.*;
* large efficiency overheads for small to medium sized texts, both in time and space.
* Indexing a field with N tokens takes O(N) in the best case, and O(N logN) in the worst
* case. Memory consumption is probably larger than for RAMDirectory
.
- *
+ *
* Example throughput of many simple term queries over a single MemoryIndex:
* ~500000 queries/sec on a MacBook Pro, jdk 1.5.0_06, server VM.
* As always, your mileage may vary.
- *
+ *
* If you're curious about
* the whereabouts of bottlenecks, run java 1.5 with the non-perturbing '-server
* -agentlib:hprof=cpu=samples,depth=10' flags, then study the trace log and
@@ -1019,7 +1019,7 @@ public class CustomMemoryIndex implements Serializable {
}
info.sortTerms();
mapper.setExpectations(field, info.sortedTerms.length, stride != 1, true);
- for (int i = info.sortedTerms.length; --i >= 0;) {
+ for (int i = info.sortedTerms.length; --i >= 0; ) {
ArrayIntList positions = info.sortedTerms[i].getValue();
int size = positions.size();
@@ -1058,7 +1058,7 @@ public class CustomMemoryIndex implements Serializable {
public String[] getTerms() {
String[] terms = new String[sortedTerms.length];
- for (int i = sortedTerms.length; --i >= 0;) {
+ for (int i = sortedTerms.length; --i >= 0; ) {
terms[i] = sortedTerms[i].getKey();
}
return terms;
@@ -1066,7 +1066,7 @@ public class CustomMemoryIndex implements Serializable {
public int[] getTermFrequencies() {
int[] freqs = new int[sortedTerms.length];
- for (int i = sortedTerms.length; --i >= 0;) {
+ for (int i = sortedTerms.length; --i >= 0; ) {
freqs[i] = numPositions(sortedTerms[i].getValue());
}
return freqs;
diff --git a/src/main/java/org/apache/lucene/queryParser/ExistsFieldQueryExtension.java b/src/main/java/org/apache/lucene/queryParser/ExistsFieldQueryExtension.java
index d05b3bc5ee4..25b1b4d5195 100644
--- a/src/main/java/org/apache/lucene/queryParser/ExistsFieldQueryExtension.java
+++ b/src/main/java/org/apache/lucene/queryParser/ExistsFieldQueryExtension.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,16 +26,17 @@ import org.apache.lucene.search.TermRangeFilter;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.query.QueryParseContext;
-import static org.elasticsearch.index.query.support.QueryParsers.*;
+import static org.elasticsearch.index.query.support.QueryParsers.wrapSmartNameFilter;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ExistsFieldQueryExtension implements FieldQueryExtension {
public static final String NAME = "_exists_";
- @Override public Query query(QueryParseContext parseContext, String queryText) {
+ @Override
+ public Query query(QueryParseContext parseContext, String queryText) {
String fieldName = queryText;
Filter filter = null;
MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName);
diff --git a/src/main/java/org/apache/lucene/queryParser/FieldQueryExtension.java b/src/main/java/org/apache/lucene/queryParser/FieldQueryExtension.java
index 719709d21a9..b34e55b1d21 100644
--- a/src/main/java/org/apache/lucene/queryParser/FieldQueryExtension.java
+++ b/src/main/java/org/apache/lucene/queryParser/FieldQueryExtension.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -23,7 +23,7 @@ import org.apache.lucene.search.Query;
import org.elasticsearch.index.query.QueryParseContext;
/**
- * @author kimchy (shay.banon)
+ *
*/
public interface FieldQueryExtension {
diff --git a/src/main/java/org/apache/lucene/queryParser/MapperQueryParser.java b/src/main/java/org/apache/lucene/queryParser/MapperQueryParser.java
index 61424dfddf4..3bed69cf610 100644
--- a/src/main/java/org/apache/lucene/queryParser/MapperQueryParser.java
+++ b/src/main/java/org/apache/lucene/queryParser/MapperQueryParser.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,6 +19,7 @@
package org.apache.lucene.queryParser;
+import com.google.common.collect.ImmutableMap;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
@@ -26,7 +27,6 @@ import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.FuzzyQuery;
import org.apache.lucene.search.Query;
-import org.elasticsearch.common.collect.ImmutableMap;
import org.elasticsearch.common.io.FastStringReader;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.lucene.search.Queries;
@@ -40,17 +40,18 @@ import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
-import static org.elasticsearch.common.lucene.search.Queries.*;
-import static org.elasticsearch.index.query.support.QueryParsers.*;
+import static org.elasticsearch.common.lucene.search.Queries.fixNegativeQueryIfNeeded;
+import static org.elasticsearch.common.lucene.search.Queries.optimizeQuery;
+import static org.elasticsearch.index.query.support.QueryParsers.wrapSmartNameQuery;
/**
* A query parser that uses the {@link MapperService} in order to build smarter
* queries based on the mapping information.
- *
+ *
* Also breaks fields with [type].[name] into a boolean query that must include the type
* as well as the query on the name.
*
- * @author kimchy (shay.banon)
+ *
*/
public class MapperQueryParser extends QueryParser {
@@ -95,7 +96,8 @@ public class MapperQueryParser extends QueryParser {
this.analyzeWildcard = settings.analyzeWildcard();
}
- @Override protected Query newTermQuery(Term term) {
+ @Override
+ protected Query newTermQuery(Term term) {
if (currentMapper != null) {
Query termQuery = currentMapper.queryStringTermQuery(term);
if (termQuery != null) {
@@ -105,11 +107,13 @@ public class MapperQueryParser extends QueryParser {
return super.newTermQuery(term);
}
- @Override protected Query newMatchAllDocsQuery() {
+ @Override
+ protected Query newMatchAllDocsQuery() {
return Queries.MATCH_ALL_QUERY;
}
- @Override public Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException {
+ @Override
+ public Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException {
FieldQueryExtension fieldQueryExtension = fieldQueryExtensions.get(field);
if (fieldQueryExtension != null) {
return fieldQueryExtension.query(parseContext, queryText);
@@ -138,7 +142,8 @@ public class MapperQueryParser extends QueryParser {
}
}
- @Override protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
+ @Override
+ protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
if ("*".equals(part1)) {
part1 = null;
}
@@ -157,7 +162,8 @@ public class MapperQueryParser extends QueryParser {
return newRangeQuery(field, part1, part2, inclusive);
}
- @Override protected Query getFuzzyQuery(String field, String termStr, float minSimilarity) throws ParseException {
+ @Override
+ protected Query getFuzzyQuery(String field, String termStr, float minSimilarity) throws ParseException {
currentMapper = null;
MapperService.SmartNameFieldMappers fieldMappers = parseContext.smartFieldMappers(field);
if (fieldMappers != null) {
@@ -170,7 +176,8 @@ public class MapperQueryParser extends QueryParser {
return super.getFuzzyQuery(field, termStr, minSimilarity);
}
- @Override protected Query getPrefixQuery(String field, String termStr) throws ParseException {
+ @Override
+ protected Query getPrefixQuery(String field, String termStr) throws ParseException {
String indexedNameField = field;
currentMapper = null;
Analyzer oldAnalyzer = analyzer;
@@ -232,7 +239,8 @@ public class MapperQueryParser extends QueryParser {
}
- @Override protected Query getWildcardQuery(String field, String termStr) throws ParseException {
+ @Override
+ protected Query getWildcardQuery(String field, String termStr) throws ParseException {
if (AllFieldMapper.NAME.equals(field) && termStr.equals("*")) {
return newMatchAllDocsQuery();
}
@@ -319,7 +327,8 @@ public class MapperQueryParser extends QueryParser {
return super.getWildcardQuery(field, aggStr.toString());
}
- @Override protected Query getBooleanQuery(List clauses, boolean disableCoord) throws ParseException {
+ @Override
+ protected Query getBooleanQuery(List clauses, boolean disableCoord) throws ParseException {
Query q = super.getBooleanQuery(clauses, disableCoord);
if (q == null) {
return null;
diff --git a/src/main/java/org/apache/lucene/queryParser/MissingFieldQueryExtension.java b/src/main/java/org/apache/lucene/queryParser/MissingFieldQueryExtension.java
index d1650e98b1a..2ebf8065842 100644
--- a/src/main/java/org/apache/lucene/queryParser/MissingFieldQueryExtension.java
+++ b/src/main/java/org/apache/lucene/queryParser/MissingFieldQueryExtension.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,16 +27,17 @@ import org.elasticsearch.common.lucene.search.NotFilter;
import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.query.QueryParseContext;
-import static org.elasticsearch.index.query.support.QueryParsers.*;
+import static org.elasticsearch.index.query.support.QueryParsers.wrapSmartNameFilter;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class MissingFieldQueryExtension implements FieldQueryExtension {
public static final String NAME = "_missing_";
- @Override public Query query(QueryParseContext parseContext, String queryText) {
+ @Override
+ public Query query(QueryParseContext parseContext, String queryText) {
String fieldName = queryText;
Filter filter = null;
diff --git a/src/main/java/org/apache/lucene/queryParser/MultiFieldMapperQueryParser.java b/src/main/java/org/apache/lucene/queryParser/MultiFieldMapperQueryParser.java
index c4db1d17560..691a88ff6f7 100644
--- a/src/main/java/org/apache/lucene/queryParser/MultiFieldMapperQueryParser.java
+++ b/src/main/java/org/apache/lucene/queryParser/MultiFieldMapperQueryParser.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,18 +19,14 @@
package org.apache.lucene.queryParser;
-import org.apache.lucene.search.BooleanClause;
-import org.apache.lucene.search.DisjunctionMaxQuery;
-import org.apache.lucene.search.MultiPhraseQuery;
-import org.apache.lucene.search.PhraseQuery;
-import org.apache.lucene.search.Query;
+import org.apache.lucene.search.*;
import org.elasticsearch.index.query.QueryParseContext;
import java.util.ArrayList;
import java.util.List;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class MultiFieldMapperQueryParser extends MapperQueryParser {
@@ -50,7 +46,8 @@ public class MultiFieldMapperQueryParser extends MapperQueryParser {
this.settings = settings;
}
- @Override public Query getFieldQuery(String xField, String queryText, boolean quoted) throws ParseException {
+ @Override
+ public Query getFieldQuery(String xField, String queryText, boolean quoted) throws ParseException {
if (xField != null) {
return super.getFieldQuery(xField, queryText, quoted);
}
@@ -84,7 +81,8 @@ public class MultiFieldMapperQueryParser extends MapperQueryParser {
}
}
- @Override public Query getFieldQuery(String xField, String queryText, int slop) throws ParseException {
+ @Override
+ public Query getFieldQuery(String xField, String queryText, int slop) throws ParseException {
if (xField != null) {
Query q = super.getFieldQuery(xField, queryText, true);
applySlop(q, slop);
@@ -122,7 +120,8 @@ public class MultiFieldMapperQueryParser extends MapperQueryParser {
}
}
- @Override protected Query getRangeQuery(String xField, String part1, String part2, boolean inclusive) throws ParseException {
+ @Override
+ protected Query getRangeQuery(String xField, String part1, String part2, boolean inclusive) throws ParseException {
if (xField != null) {
return super.getRangeQuery(xField, part1, part2, inclusive);
}
@@ -156,7 +155,8 @@ public class MultiFieldMapperQueryParser extends MapperQueryParser {
}
}
- @Override protected Query getPrefixQuery(String xField, String termStr) throws ParseException {
+ @Override
+ protected Query getPrefixQuery(String xField, String termStr) throws ParseException {
if (xField != null) {
return super.getPrefixQuery(xField, termStr);
}
@@ -190,7 +190,8 @@ public class MultiFieldMapperQueryParser extends MapperQueryParser {
}
}
- @Override protected Query getWildcardQuery(String xField, String termStr) throws ParseException {
+ @Override
+ protected Query getWildcardQuery(String xField, String termStr) throws ParseException {
if (xField != null) {
return super.getWildcardQuery(xField, termStr);
}
@@ -224,7 +225,8 @@ public class MultiFieldMapperQueryParser extends MapperQueryParser {
}
}
- @Override protected Query getFuzzyQuery(String xField, String termStr, float minSimilarity) throws ParseException {
+ @Override
+ protected Query getFuzzyQuery(String xField, String termStr, float minSimilarity) throws ParseException {
if (xField != null) {
return super.getFuzzyQuery(xField, termStr, minSimilarity);
}
diff --git a/src/main/java/org/apache/lucene/queryParser/MultiFieldQueryParserSettings.java b/src/main/java/org/apache/lucene/queryParser/MultiFieldQueryParserSettings.java
index 24d93d3a600..58517b2f74f 100644
--- a/src/main/java/org/apache/lucene/queryParser/MultiFieldQueryParserSettings.java
+++ b/src/main/java/org/apache/lucene/queryParser/MultiFieldQueryParserSettings.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,12 +19,12 @@
package org.apache.lucene.queryParser;
-import org.elasticsearch.common.trove.map.hash.TObjectFloatHashMap;
+import gnu.trove.map.hash.TObjectFloatHashMap;
import java.util.List;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class MultiFieldQueryParserSettings extends QueryParserSettings {
@@ -65,7 +65,8 @@ public class MultiFieldQueryParserSettings extends QueryParserSettings {
this.useDisMax = useDisMax;
}
- @Override public boolean equals(Object o) {
+ @Override
+ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@@ -85,7 +86,8 @@ public class MultiFieldQueryParserSettings extends QueryParserSettings {
return true;
}
- @Override public int hashCode() {
+ @Override
+ public int hashCode() {
int result = super.hashCode();
result = 31 * result + (fields != null ? fields.hashCode() : 0);
result = 31 * result + (boosts != null ? boosts.hashCode() : 0);
diff --git a/src/main/java/org/apache/lucene/queryParser/QueryParserSettings.java b/src/main/java/org/apache/lucene/queryParser/QueryParserSettings.java
index 89628255341..825cc0fc4bb 100644
--- a/src/main/java/org/apache/lucene/queryParser/QueryParserSettings.java
+++ b/src/main/java/org/apache/lucene/queryParser/QueryParserSettings.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.apache.lucene.search.FuzzyQuery;
import org.apache.lucene.search.MultiTermQuery;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class QueryParserSettings {
@@ -173,7 +173,8 @@ public class QueryParserSettings {
this.minimumShouldMatch = minimumShouldMatch;
}
- @Override public boolean equals(Object o) {
+ @Override
+ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@@ -201,7 +202,8 @@ public class QueryParserSettings {
return true;
}
- @Override public int hashCode() {
+ @Override
+ public int hashCode() {
int result = queryString != null ? queryString.hashCode() : 0;
result = 31 * result + (defaultField != null ? defaultField.hashCode() : 0);
result = 31 * result + (boost != +0.0f ? Float.floatToIntBits(boost) : 0);
diff --git a/src/main/java/org/apache/lucene/search/DeletionAwareConstantScoreQuery.java b/src/main/java/org/apache/lucene/search/DeletionAwareConstantScoreQuery.java
index b8c1f130619..3142f047345 100644
--- a/src/main/java/org/apache/lucene/search/DeletionAwareConstantScoreQuery.java
+++ b/src/main/java/org/apache/lucene/search/DeletionAwareConstantScoreQuery.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.apache.lucene.index.IndexReader;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
// LUCENE MONITOR: Against ConstantScoreQuery, basically added logic in the doc iterator to take deletions into account
// So it can basically be cached safely even with a reader that changes deletions but remain with teh same cache key
@@ -49,7 +49,8 @@ public class DeletionAwareConstantScoreQuery extends ConstantScoreQuery {
similarity = getSimilarity(searcher);
}
- @Override public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
+ @Override
+ public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
final DocIdSet dis = filter.getDocIdSet(reader);
if (dis == null)
return null;
diff --git a/src/main/java/org/apache/lucene/search/PublicTermsFilter.java b/src/main/java/org/apache/lucene/search/PublicTermsFilter.java
index fcc7b6138cc..4cf98881b94 100644
--- a/src/main/java/org/apache/lucene/search/PublicTermsFilter.java
+++ b/src/main/java/org/apache/lucene/search/PublicTermsFilter.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -30,7 +30,7 @@ import java.util.Set;
import java.util.TreeSet;
/**
- * @author kimchy (shay.banon)
+ *
*/
// LUCENE MONITOR: Against TermsFilter
public class PublicTermsFilter extends Filter {
diff --git a/src/main/java/org/apache/lucene/search/ShardFieldDocSortedHitQueue.java b/src/main/java/org/apache/lucene/search/ShardFieldDocSortedHitQueue.java
index 1eaac6a6a9b..1aa325f20bb 100644
--- a/src/main/java/org/apache/lucene/search/ShardFieldDocSortedHitQueue.java
+++ b/src/main/java/org/apache/lucene/search/ShardFieldDocSortedHitQueue.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -28,7 +28,7 @@ import java.text.Collator;
import java.util.Locale;
/**
- * @author kimchy (Shay Banon)
+ *
*/
// LUCENE TRACK, Had to copy over in order ot improve same order tie break to take shards into account
public class ShardFieldDocSortedHitQueue extends PriorityQueue {
@@ -110,7 +110,8 @@ public class ShardFieldDocSortedHitQueue extends PriorityQueue {
* @param b ScoreDoc
* @return true
if document a
should be sorted after document b
.
*/
- @SuppressWarnings("unchecked") @Override
+ @SuppressWarnings("unchecked")
+ @Override
protected final boolean lessThan(final ShardFieldDoc docA, final ShardFieldDoc docB) {
final int n = fields.length;
int c = 0;
diff --git a/src/main/java/org/apache/lucene/search/vectorhighlight/CustomFieldQuery.java b/src/main/java/org/apache/lucene/search/vectorhighlight/CustomFieldQuery.java
index 35be0aace07..79c44f73fbf 100644
--- a/src/main/java/org/apache/lucene/search/vectorhighlight/CustomFieldQuery.java
+++ b/src/main/java/org/apache/lucene/search/vectorhighlight/CustomFieldQuery.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -21,14 +21,7 @@ package org.apache.lucene.search.vectorhighlight;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
-import org.apache.lucene.search.ConstantScoreQuery;
-import org.apache.lucene.search.DisjunctionMaxQuery;
-import org.apache.lucene.search.Filter;
-import org.apache.lucene.search.FilteredQuery;
-import org.apache.lucene.search.MultiTermQueryWrapperFilter;
-import org.apache.lucene.search.PublicTermsFilter;
-import org.apache.lucene.search.Query;
-import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.search.*;
import org.apache.lucene.search.spans.SpanTermQuery;
import org.elasticsearch.common.lucene.search.MultiPhrasePrefixQuery;
import org.elasticsearch.common.lucene.search.TermFilter;
@@ -41,7 +34,7 @@ import java.lang.reflect.Field;
import java.util.Collection;
/**
- * @author kimchy (shay.banon)
+ *
*/
// LUCENE MONITOR
public class CustomFieldQuery extends FieldQuery {
@@ -68,7 +61,8 @@ public class CustomFieldQuery extends FieldQuery {
highlightFilters.remove();
}
- @Override void flatten(Query sourceQuery, IndexReader reader, Collection flatQueries) throws IOException {
+ @Override
+ void flatten(Query sourceQuery, IndexReader reader, Collection flatQueries) throws IOException {
if (sourceQuery instanceof DisjunctionMaxQuery) {
DisjunctionMaxQuery dmq = (DisjunctionMaxQuery) sourceQuery;
for (Query query : dmq) {
diff --git a/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferAllocator.java b/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferAllocator.java
index fe4c053c306..6c78edaf65d 100644
--- a/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferAllocator.java
+++ b/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferAllocator.java
@@ -27,7 +27,7 @@ import java.nio.ByteBuffer;
* A byte buffer allocator simple allocates byte buffers, and handles releasing
* them. Implementation can include special direct buffer cleaning when releasing
* a buffer, as well as caching of byte buffers.
- *
+ *
* There are two types of buffers that can be allocated, small and big. This
* comes in handy when knowing in advance (more or less) the size of the buffers
* needed (large files or small), as well as in caching implementations.
diff --git a/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferDirectory.java b/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferDirectory.java
index 836033841f1..362e8e8fd59 100644
--- a/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferDirectory.java
+++ b/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferDirectory.java
@@ -33,16 +33,16 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* A memory based directory that uses {@link java.nio.ByteBuffer} in order to store the directory content.
- *
+ *
* The benefit of using {@link java.nio.ByteBuffer} is the fact that it can be stored in "native" memory
* outside of the JVM heap, thus not incurring the GC overhead of large in memory index.
- *
+ *
* Each "file" is segmented into one or more byte buffers.
- *
+ *
* If constructed with {@link ByteBufferAllocator}, it allows to control the allocation and release of
* byte buffer. For example, custom implementations can include caching of byte buffers.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ByteBufferDirectory extends Directory {
diff --git a/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferFile.java b/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferFile.java
index f85e1fbb082..215a403617b 100644
--- a/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferFile.java
+++ b/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferFile.java
@@ -23,7 +23,7 @@ import java.nio.ByteBuffer;
import java.util.concurrent.CopyOnWriteArrayList;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ByteBufferFile {
diff --git a/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferIndexInput.java b/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferIndexInput.java
index fe7f0252f41..520650d54e0 100644
--- a/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferIndexInput.java
+++ b/src/main/java/org/apache/lucene/store/bytebuffer/ByteBufferIndexInput.java
@@ -23,7 +23,7 @@ import java.io.IOException;
import java.nio.ByteBuffer;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ByteBufferIndexInput extends IndexInput {
diff --git a/src/main/java/org/elasticsearch/ElasticSearchException.java b/src/main/java/org/elasticsearch/ElasticSearchException.java
index 189b789d67a..608801815af 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.elasticsearch.rest.RestStatus;
/**
* A base class for all elasticsearch exceptions.
*
- * @author kimchy (Shay Banon)
+ *
*/
public class ElasticSearchException extends RuntimeException {
diff --git a/src/main/java/org/elasticsearch/ElasticSearchGenerationException.java b/src/main/java/org/elasticsearch/ElasticSearchGenerationException.java
index 24feddb5064..561c288a429 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchGenerationException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchGenerationException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch;
/**
* A generic exception indicating failure to generate.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ElasticSearchGenerationException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/ElasticSearchIllegalArgumentException.java b/src/main/java/org/elasticsearch/ElasticSearchIllegalArgumentException.java
index 48ab291de8d..678b50f5b6e 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchIllegalArgumentException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchIllegalArgumentException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch;
import org.elasticsearch.rest.RestStatus;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class ElasticSearchIllegalArgumentException extends ElasticSearchException {
@@ -38,7 +38,8 @@ public class ElasticSearchIllegalArgumentException extends ElasticSearchExceptio
super(msg, cause);
}
- @Override public RestStatus status() {
+ @Override
+ public RestStatus status() {
return RestStatus.BAD_REQUEST;
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/ElasticSearchIllegalStateException.java b/src/main/java/org/elasticsearch/ElasticSearchIllegalStateException.java
index 356c02fc7ae..27ec38afdc0 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchIllegalStateException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchIllegalStateException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -20,7 +20,7 @@
package org.elasticsearch;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class ElasticSearchIllegalStateException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/ElasticSearchInterruptedException.java b/src/main/java/org/elasticsearch/ElasticSearchInterruptedException.java
index 87657c48eb8..4dea314467d 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchInterruptedException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchInterruptedException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch;
/**
* The same as {@link InterruptedException} simply a runtime one.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ElasticSearchInterruptedException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/ElasticSearchNullPointerException.java b/src/main/java/org/elasticsearch/ElasticSearchNullPointerException.java
index 55859d71269..567b5fffad6 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchNullPointerException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchNullPointerException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -20,7 +20,7 @@
package org.elasticsearch;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class ElasticSearchNullPointerException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/ElasticSearchParseException.java b/src/main/java/org/elasticsearch/ElasticSearchParseException.java
index 9129252f8fe..92ecf0162ea 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchParseException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchParseException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -20,7 +20,7 @@
package org.elasticsearch;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class ElasticSearchParseException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/ElasticSearchTimeoutException.java b/src/main/java/org/elasticsearch/ElasticSearchTimeoutException.java
index 6caccaaa292..9e5e33b38e8 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchTimeoutException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchTimeoutException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch;
/**
* The same as {@link java.util.concurrent.TimeoutException} simply a runtime one.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ElasticSearchTimeoutException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/ElasticSearchWrapperException.java b/src/main/java/org/elasticsearch/ElasticSearchWrapperException.java
index 28694071f1a..483983dd916 100644
--- a/src/main/java/org/elasticsearch/ElasticSearchWrapperException.java
+++ b/src/main/java/org/elasticsearch/ElasticSearchWrapperException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -20,7 +20,7 @@
package org.elasticsearch;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public interface ElasticSearchWrapperException {
diff --git a/src/main/java/org/elasticsearch/ExceptionsHelper.java b/src/main/java/org/elasticsearch/ExceptionsHelper.java
index 88204fb3f90..fa2cdc13be2 100644
--- a/src/main/java/org/elasticsearch/ExceptionsHelper.java
+++ b/src/main/java/org/elasticsearch/ExceptionsHelper.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -23,7 +23,7 @@ import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
/**
- * @author kimchy (shay.banon)
+ *
*/
public final class ExceptionsHelper {
diff --git a/src/main/java/org/elasticsearch/Version.java b/src/main/java/org/elasticsearch/Version.java
index 05a4a3ef61c..4df0bded3f6 100644
--- a/src/main/java/org/elasticsearch/Version.java
+++ b/src/main/java/org/elasticsearch/Version.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -131,7 +131,8 @@ public class Version {
System.out.println("ElasticSearch Version: " + Version.CURRENT + ", JVM: " + JvmInfo.jvmInfo().vmVersion());
}
- @Override public String toString() {
+ @Override
+ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(number());
if (snapshot()) {
diff --git a/src/main/java/org/elasticsearch/action/Action.java b/src/main/java/org/elasticsearch/action/Action.java
index ac72b813c78..bc3ca22cfbb 100644
--- a/src/main/java/org/elasticsearch/action/Action.java
+++ b/src/main/java/org/elasticsearch/action/Action.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
import org.elasticsearch.ElasticSearchException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public interface Action {
diff --git a/src/main/java/org/elasticsearch/action/ActionFuture.java b/src/main/java/org/elasticsearch/action/ActionFuture.java
index fc38fec353d..819714ef883 100644
--- a/src/main/java/org/elasticsearch/action/ActionFuture.java
+++ b/src/main/java/org/elasticsearch/action/ActionFuture.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit;
/**
* An extension to {@link Future} allowing for simplified "get" operations.
*
- * @author kimchy (shay.banon)
+ *
*/
public interface ActionFuture extends Future {
@@ -37,7 +37,7 @@ public interface ActionFuture extends Future {
* Similar to {@link #get()}, just wrapping the {@link InterruptedException} with
* {@link org.elasticsearch.ElasticSearchInterruptedException}, and throwing the actual
* cause of the {@link java.util.concurrent.ExecutionException}.
- *
+ *
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
* still accessible using {@link #getRootFailure()}.
@@ -48,7 +48,7 @@ public interface ActionFuture extends Future {
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just wrapping the {@link InterruptedException} with
* {@link org.elasticsearch.ElasticSearchInterruptedException}, and throwing the actual
* cause of the {@link java.util.concurrent.ExecutionException}.
- *
+ *
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
* still accessible using {@link #getRootFailure()}.
@@ -59,7 +59,7 @@ public interface ActionFuture extends Future {
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just wrapping the {@link InterruptedException} with
* {@link org.elasticsearch.ElasticSearchInterruptedException}, and throwing the actual
* cause of the {@link java.util.concurrent.ExecutionException}.
- *
+ *
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
* still accessible using {@link #getRootFailure()}.
@@ -72,7 +72,7 @@ public interface ActionFuture extends Future {
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just wrapping the {@link InterruptedException} with
* {@link org.elasticsearch.ElasticSearchInterruptedException}, and throwing the actual
* cause of the {@link java.util.concurrent.ExecutionException}.
- *
+ *
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
* still accessible using {@link #getRootFailure()}.
@@ -83,7 +83,7 @@ public interface ActionFuture extends Future {
* Similar to {@link #get(long, java.util.concurrent.TimeUnit)}, just wrapping the {@link InterruptedException} with
* {@link org.elasticsearch.ElasticSearchInterruptedException}, and throwing the actual
* cause of the {@link java.util.concurrent.ExecutionException}.
- *
+ *
* Note, the actual cause is unwrapped to the actual failure (for example, unwrapped
* from {@link org.elasticsearch.transport.RemoteTransportException}. The root failure is
* still accessible using {@link #getRootFailure()}.
@@ -93,5 +93,6 @@ public interface ActionFuture extends Future {
/**
* The root (possibly) wrapped failure.
*/
- @Nullable Throwable getRootFailure();
+ @Nullable
+ Throwable getRootFailure();
}
diff --git a/src/main/java/org/elasticsearch/action/ActionListener.java b/src/main/java/org/elasticsearch/action/ActionListener.java
index b594480c590..44c4967c19b 100644
--- a/src/main/java/org/elasticsearch/action/ActionListener.java
+++ b/src/main/java/org/elasticsearch/action/ActionListener.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
/**
* A listener for action responses or failures.
*
- * @author kimchy (shay.banon)
+ *
*/
public interface ActionListener {
diff --git a/src/main/java/org/elasticsearch/action/ActionRequest.java b/src/main/java/org/elasticsearch/action/ActionRequest.java
index 3011d62f576..40d6584a275 100644
--- a/src/main/java/org/elasticsearch/action/ActionRequest.java
+++ b/src/main/java/org/elasticsearch/action/ActionRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
import org.elasticsearch.common.io.stream.Streamable;
/**
- * @author kimchy (shay.banon)
+ *
*/
public interface ActionRequest extends Streamable {
@@ -30,7 +30,7 @@ public interface ActionRequest extends Streamable {
/**
* Should the response listener be executed on a thread or not.
- *
+ *
* When not executing on a thread, it will either be executed on the calling thread, or
* on an expensive, IO based, thread.
*/
diff --git a/src/main/java/org/elasticsearch/action/ActionRequestValidationException.java b/src/main/java/org/elasticsearch/action/ActionRequestValidationException.java
index 79d4c45ee6b..900db4824b5 100644
--- a/src/main/java/org/elasticsearch/action/ActionRequestValidationException.java
+++ b/src/main/java/org/elasticsearch/action/ActionRequestValidationException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -25,7 +25,7 @@ import java.util.ArrayList;
import java.util.List;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ActionRequestValidationException extends ElasticSearchException {
@@ -49,7 +49,8 @@ public class ActionRequestValidationException extends ElasticSearchException {
return validationErrors;
}
- @Override public String getMessage() {
+ @Override
+ public String getMessage() {
StringBuilder sb = new StringBuilder();
sb.append("Validation Failed: ");
int index = 0;
diff --git a/src/main/java/org/elasticsearch/action/ActionResponse.java b/src/main/java/org/elasticsearch/action/ActionResponse.java
index 3ecda5471f2..88cf95d66b2 100644
--- a/src/main/java/org/elasticsearch/action/ActionResponse.java
+++ b/src/main/java/org/elasticsearch/action/ActionResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
import org.elasticsearch.common.io.stream.Streamable;
/**
- * @author kimchy (shay.banon)
+ *
*/
public interface ActionResponse extends Streamable {
}
diff --git a/src/main/java/org/elasticsearch/action/Actions.java b/src/main/java/org/elasticsearch/action/Actions.java
index 226e8dfa382..4aaa912eb80 100644
--- a/src/main/java/org/elasticsearch/action/Actions.java
+++ b/src/main/java/org/elasticsearch/action/Actions.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -20,7 +20,7 @@
package org.elasticsearch.action;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class Actions {
diff --git a/src/main/java/org/elasticsearch/action/FailedNodeException.java b/src/main/java/org/elasticsearch/action/FailedNodeException.java
index 622182b2d19..fc7f86a5e83 100644
--- a/src/main/java/org/elasticsearch/action/FailedNodeException.java
+++ b/src/main/java/org/elasticsearch/action/FailedNodeException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
import org.elasticsearch.ElasticSearchException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class FailedNodeException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/action/ListenableActionFuture.java b/src/main/java/org/elasticsearch/action/ListenableActionFuture.java
index 9aef24ca6ad..86614716808 100644
--- a/src/main/java/org/elasticsearch/action/ListenableActionFuture.java
+++ b/src/main/java/org/elasticsearch/action/ListenableActionFuture.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
/**
* An {@link ActionFuture} that listeners can be added to.
*
- * @author kimchy (shay.banon)
+ *
*/
public interface ListenableActionFuture extends ActionFuture {
diff --git a/src/main/java/org/elasticsearch/action/NoShardAvailableActionException.java b/src/main/java/org/elasticsearch/action/NoShardAvailableActionException.java
index 19976e4de6a..833e35ee9bd 100644
--- a/src/main/java/org/elasticsearch/action/NoShardAvailableActionException.java
+++ b/src/main/java/org/elasticsearch/action/NoShardAvailableActionException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -23,7 +23,7 @@ import org.elasticsearch.index.shard.IndexShardException;
import org.elasticsearch.index.shard.ShardId;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class NoShardAvailableActionException extends IndexShardException {
diff --git a/src/main/java/org/elasticsearch/action/NoSuchNodeException.java b/src/main/java/org/elasticsearch/action/NoSuchNodeException.java
index 414da698b98..8851ca77c9d 100644
--- a/src/main/java/org/elasticsearch/action/NoSuchNodeException.java
+++ b/src/main/java/org/elasticsearch/action/NoSuchNodeException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -20,7 +20,7 @@
package org.elasticsearch.action;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class NoSuchNodeException extends FailedNodeException {
diff --git a/src/main/java/org/elasticsearch/action/PrimaryMissingActionException.java b/src/main/java/org/elasticsearch/action/PrimaryMissingActionException.java
index 1dd03db884c..3ed6eb35123 100644
--- a/src/main/java/org/elasticsearch/action/PrimaryMissingActionException.java
+++ b/src/main/java/org/elasticsearch/action/PrimaryMissingActionException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
import org.elasticsearch.ElasticSearchException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class PrimaryMissingActionException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/action/RoutingMissingException.java b/src/main/java/org/elasticsearch/action/RoutingMissingException.java
index 1e6678dfe2b..117a226da8f 100644
--- a/src/main/java/org/elasticsearch/action/RoutingMissingException.java
+++ b/src/main/java/org/elasticsearch/action/RoutingMissingException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
import org.elasticsearch.ElasticSearchException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class RoutingMissingException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/action/ShardOperationFailedException.java b/src/main/java/org/elasticsearch/action/ShardOperationFailedException.java
index 645103f9488..651ea6e638a 100644
--- a/src/main/java/org/elasticsearch/action/ShardOperationFailedException.java
+++ b/src/main/java/org/elasticsearch/action/ShardOperationFailedException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import java.io.Serializable;
/**
* An exception indicating that a failure occurred performing an operation on the shard.
*
- * @author kimchy (Shay Banon)
+ *
*/
public interface ShardOperationFailedException extends Streamable, Serializable {
diff --git a/src/main/java/org/elasticsearch/action/ThreadingModel.java b/src/main/java/org/elasticsearch/action/ThreadingModel.java
index a04f2e76239..8a21955340b 100644
--- a/src/main/java/org/elasticsearch/action/ThreadingModel.java
+++ b/src/main/java/org/elasticsearch/action/ThreadingModel.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,7 @@ package org.elasticsearch.action;
import org.elasticsearch.ElasticSearchIllegalArgumentException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public enum ThreadingModel {
NONE((byte) 0),
diff --git a/src/main/java/org/elasticsearch/action/TimestampParsingException.java b/src/main/java/org/elasticsearch/action/TimestampParsingException.java
index e11c606231c..2332fc5c7df 100644
--- a/src/main/java/org/elasticsearch/action/TimestampParsingException.java
+++ b/src/main/java/org/elasticsearch/action/TimestampParsingException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -22,7 +22,6 @@ package org.elasticsearch.action;
import org.elasticsearch.ElasticSearchException;
/**
- * @author paikan (benjamin.deveze)
*/
public class TimestampParsingException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/action/TransportActionModule.java b/src/main/java/org/elasticsearch/action/TransportActionModule.java
index f06bf1a13bf..8b19f9d6fe3 100644
--- a/src/main/java/org/elasticsearch/action/TransportActionModule.java
+++ b/src/main/java/org/elasticsearch/action/TransportActionModule.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -69,23 +69,16 @@ import org.elasticsearch.action.mlt.TransportMoreLikeThisAction;
import org.elasticsearch.action.percolate.TransportPercolateAction;
import org.elasticsearch.action.search.TransportSearchAction;
import org.elasticsearch.action.search.TransportSearchScrollAction;
-import org.elasticsearch.action.search.type.TransportSearchCache;
-import org.elasticsearch.action.search.type.TransportSearchDfsQueryAndFetchAction;
-import org.elasticsearch.action.search.type.TransportSearchDfsQueryThenFetchAction;
-import org.elasticsearch.action.search.type.TransportSearchQueryAndFetchAction;
-import org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction;
-import org.elasticsearch.action.search.type.TransportSearchScanAction;
-import org.elasticsearch.action.search.type.TransportSearchScrollQueryAndFetchAction;
-import org.elasticsearch.action.search.type.TransportSearchScrollQueryThenFetchAction;
-import org.elasticsearch.action.search.type.TransportSearchScrollScanAction;
+import org.elasticsearch.action.search.type.*;
import org.elasticsearch.common.inject.AbstractModule;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportActionModule extends AbstractModule {
- @Override protected void configure() {
+ @Override
+ protected void configure() {
bind(TransportNodesInfoAction.class).asEagerSingleton();
bind(TransportNodesStatsAction.class).asEagerSingleton();
diff --git a/src/main/java/org/elasticsearch/action/TransportActions.java b/src/main/java/org/elasticsearch/action/TransportActions.java
index 6b77ea74e46..a10a445d76b 100644
--- a/src/main/java/org/elasticsearch/action/TransportActions.java
+++ b/src/main/java/org/elasticsearch/action/TransportActions.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -20,7 +20,7 @@
package org.elasticsearch.action;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportActions {
diff --git a/src/main/java/org/elasticsearch/action/UnavailableShardsException.java b/src/main/java/org/elasticsearch/action/UnavailableShardsException.java
index b611ffb56ee..0ff6d95c3d3 100644
--- a/src/main/java/org/elasticsearch/action/UnavailableShardsException.java
+++ b/src/main/java/org/elasticsearch/action/UnavailableShardsException.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -23,7 +23,7 @@ import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.index.shard.ShardId;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class UnavailableShardsException extends ElasticSearchException {
diff --git a/src/main/java/org/elasticsearch/action/WriteConsistencyLevel.java b/src/main/java/org/elasticsearch/action/WriteConsistencyLevel.java
index 63a301ef1eb..644df74e6cf 100644
--- a/src/main/java/org/elasticsearch/action/WriteConsistencyLevel.java
+++ b/src/main/java/org/elasticsearch/action/WriteConsistencyLevel.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -25,7 +25,7 @@ import org.elasticsearch.ElasticSearchIllegalArgumentException;
* Write Consistency Level control how many replicas should be active for a write operation to occur (a write operation
* can be index, or delete).
*
- * @author kimchy (shay.banon)
+ *
*/
public enum WriteConsistencyLevel {
DEFAULT((byte) 0),
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java
index 8dd124ece5b..768ae1f9563 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,10 +29,10 @@ import org.elasticsearch.common.unit.TimeValue;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
-import static org.elasticsearch.common.unit.TimeValue.*;
+import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ClusterHealthRequest extends MasterNodeOperationRequest {
@@ -124,11 +124,13 @@ public class ClusterHealthRequest extends MasterNodeOperationRequest {
return this;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
return null;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
int size = in.readVInt();
if (size == 0) {
@@ -148,7 +150,8 @@ public class ClusterHealthRequest extends MasterNodeOperationRequest {
waitForNodes = in.readUTF();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (indices == null) {
out.writeVInt(0);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java
index 636de3bac20..42426179795 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterHealthResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.health;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Maps;
import org.elasticsearch.action.ActionResponse;
-import org.elasticsearch.common.collect.ImmutableList;
-import org.elasticsearch.common.collect.Maps;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -30,11 +30,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import static org.elasticsearch.action.admin.cluster.health.ClusterIndexHealth.*;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
+import static org.elasticsearch.action.admin.cluster.health.ClusterIndexHealth.readClusterIndexHealth;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ClusterHealthResponse implements ActionResponse, Iterable {
@@ -194,11 +194,13 @@ public class ClusterHealthResponse implements ActionResponse, Iterable iterator() {
+ @Override
+ public Iterator iterator() {
return indices.values().iterator();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
clusterName = in.readUTF();
activePrimaryShards = in.readVInt();
activeShards = in.readVInt();
@@ -224,7 +226,8 @@ public class ClusterHealthResponse implements ActionResponse, Iterable, Streamable {
@@ -157,7 +157,8 @@ public class ClusterIndexHealth implements Iterable, Streama
return shards();
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return shards.values().iterator();
}
@@ -167,7 +168,8 @@ public class ClusterIndexHealth implements Iterable, Streama
return indexHealth;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
index = in.readUTF();
numberOfShards = in.readVInt();
numberOfReplicas = in.readVInt();
@@ -193,7 +195,8 @@ public class ClusterIndexHealth implements Iterable, Streama
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeUTF(index);
out.writeVInt(numberOfShards);
out.writeVInt(numberOfReplicas);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterShardHealth.java b/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterShardHealth.java
index 371326e0f70..6d65c498985 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterShardHealth.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/health/ClusterShardHealth.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.Streamable;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ClusterShardHealth implements Streamable {
@@ -114,7 +114,8 @@ public class ClusterShardHealth implements Streamable {
return ret;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
shardId = in.readVInt();
status = ClusterHealthStatus.fromValue(in.readByte());
activeShards = in.readVInt();
@@ -124,7 +125,8 @@ public class ClusterShardHealth implements Streamable {
primaryActive = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(shardId);
out.writeByte(status.value());
out.writeVInt(activeShards);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthAction.java
index 0748190a169..16abebf050d 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/health/TransportClusterHealthAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -38,35 +38,41 @@ import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportClusterHealthAction extends TransportMasterNodeOperationAction {
private final ClusterName clusterName;
- @Inject public TransportClusterHealthAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
- ClusterName clusterName) {
+ @Inject
+ public TransportClusterHealthAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
+ ClusterName clusterName) {
super(settings, transportService, clusterService, threadPool);
this.clusterName = clusterName;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.CACHED;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.HEALTH;
}
- @Override protected ClusterHealthRequest newRequest() {
+ @Override
+ protected ClusterHealthRequest newRequest() {
return new ClusterHealthRequest();
}
- @Override protected ClusterHealthResponse newResponse() {
+ @Override
+ protected ClusterHealthResponse newResponse() {
return new ClusterHealthResponse();
}
- @Override protected ClusterHealthResponse masterOperation(ClusterHealthRequest request, ClusterState unusedState) throws ElasticSearchException {
+ @Override
+ protected ClusterHealthResponse masterOperation(ClusterHealthRequest request, ClusterState unusedState) throws ElasticSearchException {
int waitFor = 5;
if (request.waitForStatus() == null) {
waitFor--;
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java
index 8fc88e120f2..526675f8cfb 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodeInfo.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,10 +19,10 @@
package org.elasticsearch.action.admin.cluster.node.info;
+import com.google.common.collect.ImmutableMap;
import org.elasticsearch.action.support.nodes.NodeOperationResponse;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.Nullable;
-import org.elasticsearch.common.collect.ImmutableMap;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.ImmutableSettings;
@@ -40,7 +40,7 @@ import java.util.Map;
/**
* Node information (static, does not change over time).
*
- * @author kimchy (shay.banon)
+ *
*/
public class NodeInfo extends NodeOperationResponse {
@@ -183,7 +183,8 @@ public class NodeInfo extends NodeOperationResponse {
return nodeInfo;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
ImmutableMap.Builder builder = ImmutableMap.builder();
int size = in.readVInt();
@@ -212,7 +213,8 @@ public class NodeInfo extends NodeOperationResponse {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(attributes.size());
for (Map.Entry entry : attributes.entrySet()) {
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequest.java
index d41388c6fa8..b49b427069e 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.elasticsearch.action.support.nodes.NodesOperationRequest;
/**
* A request to get node (cluster) level information.
*
- * @author kimchy (shay.banon)
+ *
*/
public class NodesInfoRequest extends NodesOperationRequest {
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java
index d58e94217d0..b942104837a 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class NodesInfoResponse extends NodesOperationResponse {
@@ -38,7 +38,8 @@ public class NodesInfoResponse extends NodesOperationResponse {
super(clusterName, nodes);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
nodes = new NodeInfo[in.readVInt()];
for (int i = 0; i < nodes.length; i++) {
@@ -46,7 +47,8 @@ public class NodesInfoResponse extends NodesOperationResponse {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(nodes.length);
for (NodeInfo node : nodes) {
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/TransportNodesInfoAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/TransportNodesInfoAction.java
index 29ea65e6a3d..83a0753cc24 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/TransportNodesInfoAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/TransportNodesInfoAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -36,32 +36,37 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportNodesInfoAction extends TransportNodesOperationAction {
private final NodeService nodeService;
- @Inject public TransportNodesInfoAction(Settings settings, ClusterName clusterName, ThreadPool threadPool,
- ClusterService clusterService, TransportService transportService,
- NodeService nodeService) {
+ @Inject
+ public TransportNodesInfoAction(Settings settings, ClusterName clusterName, ThreadPool threadPool,
+ ClusterService clusterService, TransportService transportService,
+ NodeService nodeService) {
super(settings, clusterName, threadPool, clusterService, transportService);
this.nodeService = nodeService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.Node.INFO;
}
- @Override protected String transportNodeAction() {
+ @Override
+ protected String transportNodeAction() {
return "/cluster/nodes/info/node";
}
- @Override protected NodesInfoResponse newResponse(NodesInfoRequest nodesInfoRequest, AtomicReferenceArray responses) {
+ @Override
+ protected NodesInfoResponse newResponse(NodesInfoRequest nodesInfoRequest, AtomicReferenceArray responses) {
final List nodesInfos = new ArrayList();
for (int i = 0; i < responses.length(); i++) {
Object resp = responses.get(i);
@@ -72,27 +77,33 @@ public class TransportNodesInfoAction extends TransportNodesOperationAction {
@@ -40,7 +40,8 @@ public class NodesRestartResponse extends NodesOperationResponse {
@@ -55,31 +55,37 @@ public class TransportNodesRestartAction extends TransportNodesOperationAction listener) {
+ @Override
+ protected void doExecute(NodesRestartRequest nodesRestartRequest, ActionListener listener) {
listener.onFailure(new ElasticSearchIllegalStateException("restart is disabled (for now) ...."));
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.CACHED;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.Node.RESTART;
}
- @Override protected String transportNodeAction() {
+ @Override
+ protected String transportNodeAction() {
return "/cluster/nodes/restart/node";
}
- @Override protected NodesRestartResponse newResponse(NodesRestartRequest nodesShutdownRequest, AtomicReferenceArray responses) {
+ @Override
+ protected NodesRestartResponse newResponse(NodesRestartRequest nodesShutdownRequest, AtomicReferenceArray responses) {
final List nodeRestartResponses = newArrayList();
for (int i = 0; i < responses.length(); i++) {
Object resp = responses.get(i);
@@ -90,23 +96,28 @@ public class TransportNodesRestartAction extends TransportNodesOperationAction {
@@ -60,8 +56,9 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
private final TimeValue delay;
- @Inject public TransportNodesShutdownAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
- Node node, ClusterName clusterName) {
+ @Inject
+ public TransportNodesShutdownAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
+ Node node, ClusterName clusterName) {
super(settings, transportService, clusterService, threadPool);
this.node = node;
this.clusterName = clusterName;
@@ -71,23 +68,28 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
this.transportService.registerHandler(NodeShutdownRequestHandler.ACTION, new NodeShutdownRequestHandler());
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.CACHED;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.Node.SHUTDOWN;
}
- @Override protected NodesShutdownRequest newRequest() {
+ @Override
+ protected NodesShutdownRequest newRequest() {
return new NodesShutdownRequest();
}
- @Override protected NodesShutdownResponse newResponse() {
+ @Override
+ protected NodesShutdownResponse newResponse() {
return new NodesShutdownResponse();
}
- @Override protected void processBeforeDelegationToMaster(NodesShutdownRequest request, ClusterState state) {
+ @Override
+ protected void processBeforeDelegationToMaster(NodesShutdownRequest request, ClusterState state) {
String[] nodesIds = request.nodesIds;
if (nodesIds != null) {
for (int i = 0; i < nodesIds.length; i++) {
@@ -99,7 +101,8 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
}
}
- @Override protected NodesShutdownResponse masterOperation(final NodesShutdownRequest request, final ClusterState state) throws ElasticSearchException {
+ @Override
+ protected NodesShutdownResponse masterOperation(final NodesShutdownRequest request, final ClusterState state) throws ElasticSearchException {
if (disabled) {
throw new ElasticSearchIllegalStateException("Shutdown is disabled");
}
@@ -109,7 +112,8 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
nodes.addAll(state.nodes().dataNodes().values());
nodes.addAll(state.nodes().masterNodes().values());
Thread t = new Thread(new Runnable() {
- @Override public void run() {
+ @Override
+ public void run() {
try {
Thread.sleep(request.delay.millis());
} catch (InterruptedException e) {
@@ -127,12 +131,14 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
} else {
logger.trace("[cluster_shutdown]: sending shutdown request to [{}]", node);
transportService.sendRequest(node, NodeShutdownRequestHandler.ACTION, new NodeShutdownRequest(request.exit), new VoidTransportResponseHandler(ThreadPool.Names.SAME) {
- @Override public void handleResponse(VoidStreamable response) {
+ @Override
+ public void handleResponse(VoidStreamable response) {
logger.trace("[cluster_shutdown]: received shutdown response from [{}]", node);
latch.countDown();
}
- @Override public void handleException(TransportException exp) {
+ @Override
+ public void handleException(TransportException exp) {
logger.warn("[cluster_shutdown]: received failed shutdown response from [{}]", exp, node);
latch.countDown();
}
@@ -149,11 +155,13 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
// now, kill the master
logger.trace("[cluster_shutdown]: shutting down the master [{}]", state.nodes().masterNode());
transportService.sendRequest(state.nodes().masterNode(), NodeShutdownRequestHandler.ACTION, new NodeShutdownRequest(request.exit), new VoidTransportResponseHandler(ThreadPool.Names.SAME) {
- @Override public void handleResponse(VoidStreamable response) {
+ @Override
+ public void handleResponse(VoidStreamable response) {
logger.trace("[cluster_shutdown]: received shutdown response from master");
}
- @Override public void handleException(TransportException exp) {
+ @Override
+ public void handleException(TransportException exp) {
logger.warn("[cluster_shutdown]: received failed shutdown response master", exp);
}
});
@@ -172,7 +180,8 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
}
Thread t = new Thread(new Runnable() {
- @Override public void run() {
+ @Override
+ public void run() {
try {
Thread.sleep(request.delay.millis());
} catch (InterruptedException e) {
@@ -190,12 +199,14 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
logger.trace("[partial_cluster_shutdown]: sending shutdown request to [{}]", node);
transportService.sendRequest(node, NodeShutdownRequestHandler.ACTION, new NodeShutdownRequest(request.exit), new VoidTransportResponseHandler(ThreadPool.Names.SAME) {
- @Override public void handleResponse(VoidStreamable response) {
+ @Override
+ public void handleResponse(VoidStreamable response) {
logger.trace("[partial_cluster_shutdown]: received shutdown response from [{}]", node);
latch.countDown();
}
- @Override public void handleException(TransportException exp) {
+ @Override
+ public void handleException(TransportException exp) {
logger.warn("[partial_cluster_shutdown]: received failed shutdown response from [{}]", exp, node);
latch.countDown();
}
@@ -220,21 +231,25 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
static final String ACTION = "/cluster/nodes/shutdown/node";
- @Override public NodeShutdownRequest newInstance() {
+ @Override
+ public NodeShutdownRequest newInstance() {
return new NodeShutdownRequest();
}
- @Override public String executor() {
+ @Override
+ public String executor() {
return ThreadPool.Names.SAME;
}
- @Override public void messageReceived(final NodeShutdownRequest request, TransportChannel channel) throws Exception {
+ @Override
+ public void messageReceived(final NodeShutdownRequest request, TransportChannel channel) throws Exception {
if (disabled) {
throw new ElasticSearchIllegalStateException("Shutdown is disabled");
}
logger.info("shutting down in [{}]", delay);
Thread t = new Thread(new Runnable() {
- @Override public void run() {
+ @Override
+ public void run() {
try {
Thread.sleep(delay.millis());
} catch (InterruptedException e) {
@@ -290,11 +305,13 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
this.exit = exit;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
exit = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(exit);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java
index 1f296aa3b7b..f7158fc668c 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -37,7 +37,7 @@ import java.io.IOException;
/**
* Node statistics (static, does not change over time).
*
- * @author kimchy (shay.banon)
+ *
*/
public class NodeStats extends NodeOperationResponse {
@@ -163,7 +163,8 @@ public class NodeStats extends NodeOperationResponse {
return nodeInfo;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
if (in.readBoolean()) {
indices = NodeIndicesStats.readIndicesStats(in);
@@ -188,7 +189,8 @@ public class NodeStats extends NodeOperationResponse {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (indices == null) {
out.writeBoolean(false);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequest.java
index 6f86f930279..42fbf59fc8c 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.elasticsearch.action.support.nodes.NodesOperationRequest;
/**
* A request to get node (cluster) level stats.
*
- * @author kimchy (shay.banon)
+ *
*/
public class NodesStatsRequest extends NodesOperationRequest {
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsResponse.java
index 430a140c768..39d451b21b3 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodesStatsResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class NodesStatsResponse extends NodesOperationResponse {
@@ -38,7 +38,8 @@ public class NodesStatsResponse extends NodesOperationResponse {
super(clusterName, nodes);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
nodes = new NodeStats[in.readVInt()];
for (int i = 0; i < nodes.length; i++) {
@@ -46,7 +47,8 @@ public class NodesStatsResponse extends NodesOperationResponse {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(nodes.length);
for (NodeStats node : nodes) {
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java
index cd985dddcc5..c60827f9f10 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,13 +19,13 @@
package org.elasticsearch.action.admin.cluster.node.stats;
+import com.google.common.collect.Lists;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.nodes.NodeOperationRequest;
import org.elasticsearch.action.support.nodes.TransportNodesOperationAction;
import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterService;
-import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.node.service.NodeService;
@@ -36,32 +36,37 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportNodesStatsAction extends TransportNodesOperationAction {
private final NodeService nodeService;
- @Inject public TransportNodesStatsAction(Settings settings, ClusterName clusterName, ThreadPool threadPool,
- ClusterService clusterService, TransportService transportService,
- NodeService nodeService) {
+ @Inject
+ public TransportNodesStatsAction(Settings settings, ClusterName clusterName, ThreadPool threadPool,
+ ClusterService clusterService, TransportService transportService,
+ NodeService nodeService) {
super(settings, clusterName, threadPool, clusterService, transportService);
this.nodeService = nodeService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.Node.STATS;
}
- @Override protected String transportNodeAction() {
+ @Override
+ protected String transportNodeAction() {
return "/cluster/nodes/stats/node";
}
- @Override protected NodesStatsResponse newResponse(NodesStatsRequest nodesInfoRequest, AtomicReferenceArray responses) {
+ @Override
+ protected NodesStatsResponse newResponse(NodesStatsRequest nodesInfoRequest, AtomicReferenceArray responses) {
final List nodeStats = Lists.newArrayList();
for (int i = 0; i < responses.length(); i++) {
Object resp = responses.get(i);
@@ -72,27 +77,33 @@ public class TransportNodesStatsAction extends TransportNodesOperationAction {
- @Inject public TransportBroadcastPingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
+ @Inject
+ public TransportBroadcastPingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
super(settings, threadPool, clusterService, transportService);
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.CACHED;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.Ping.BROADCAST;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "/cluster/ping/broadcast/shard";
}
- @Override protected BroadcastPingRequest newRequest() {
+ @Override
+ protected BroadcastPingRequest newRequest() {
return new BroadcastPingRequest();
}
- @Override protected GroupShardsIterator shards(BroadcastPingRequest request, String[] concreteIndices, ClusterState clusterState) {
+ @Override
+ protected GroupShardsIterator shards(BroadcastPingRequest request, String[] concreteIndices, ClusterState clusterState) {
return clusterService.operationRouting().searchShards(clusterState, request.indices(), concreteIndices, request.queryHint(), null, null);
}
- @Override protected BroadcastPingResponse newResponse(BroadcastPingRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
+ @Override
+ protected BroadcastPingResponse newResponse(BroadcastPingRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
int successfulShards = 0;
int failedShards = 0;
List shardFailures = null;
@@ -89,19 +96,23 @@ public class TransportBroadcastPingAction extends TransportBroadcastOperationAct
return new BroadcastPingResponse(shardsResponses.length(), successfulShards, failedShards, shardFailures);
}
- @Override protected BroadcastShardPingRequest newShardRequest() {
+ @Override
+ protected BroadcastShardPingRequest newShardRequest() {
return new BroadcastShardPingRequest();
}
- @Override protected BroadcastShardPingRequest newShardRequest(ShardRouting shard, BroadcastPingRequest request) {
+ @Override
+ protected BroadcastShardPingRequest newShardRequest(ShardRouting shard, BroadcastPingRequest request) {
return new BroadcastShardPingRequest(shard.index(), shard.id());
}
- @Override protected BroadcastShardPingResponse newShardResponse() {
+ @Override
+ protected BroadcastShardPingResponse newShardResponse() {
return new BroadcastShardPingResponse();
}
- @Override protected BroadcastShardPingResponse shardOperation(BroadcastShardPingRequest broadcastShardPingRequest) throws ElasticSearchException {
+ @Override
+ protected BroadcastShardPingResponse shardOperation(BroadcastShardPingRequest broadcastShardPingRequest) throws ElasticSearchException {
return new BroadcastShardPingResponse();
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/IndexReplicationPingRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/IndexReplicationPingRequest.java
index 2c8ee02a1a0..d912f837fa2 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/IndexReplicationPingRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/IndexReplicationPingRequest.java
@@ -28,7 +28,7 @@ import org.elasticsearch.common.unit.TimeValue;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class IndexReplicationPingRequest extends IndexReplicationOperationRequest {
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/IndexReplicationPingResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/IndexReplicationPingResponse.java
index 05af8124c7d..4f4ce5b3554 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/IndexReplicationPingResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/IndexReplicationPingResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.Streamable;
import java.io.IOException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class IndexReplicationPingResponse implements ActionResponse, Streamable {
@@ -63,13 +63,15 @@ public class IndexReplicationPingResponse implements ActionResponse, Streamable
return successfulShards + failedShards;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
index = in.readUTF();
successfulShards = in.readVInt();
failedShards = in.readVInt();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeUTF(index);
out.writeVInt(successfulShards);
out.writeVInt(failedShards);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ReplicationPingRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ReplicationPingRequest.java
index e572a951de0..0de2c47179d 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ReplicationPingRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ReplicationPingRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.elasticsearch.action.support.replication.ReplicationType;
import org.elasticsearch.common.unit.TimeValue;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class ReplicationPingRequest extends IndicesReplicationOperationRequest {
@@ -36,7 +36,8 @@ public class ReplicationPingRequest extends IndicesReplicationOperationRequest {
}
- @Override public ReplicationPingRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public ReplicationPingRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ReplicationPingResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ReplicationPingResponse.java
index 60812d85bc5..9535c9248fb 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ReplicationPingResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ReplicationPingResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.util.HashMap;
import java.util.Map;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class ReplicationPingResponse implements ActionResponse, Streamable {
@@ -47,7 +47,8 @@ public class ReplicationPingResponse implements ActionResponse, Streamable {
return responses.get(index);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
int size = in.readVInt();
for (int i = 0; i < size; i++) {
IndexReplicationPingResponse response = new IndexReplicationPingResponse();
@@ -56,7 +57,8 @@ public class ReplicationPingResponse implements ActionResponse, Streamable {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(responses.size());
for (IndexReplicationPingResponse response : responses.values()) {
response.writeTo(out);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ShardReplicationPingRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ShardReplicationPingRequest.java
index aa9454d935d..498b0f43d41 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ShardReplicationPingRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ShardReplicationPingRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ShardReplicationPingRequest extends ShardReplicationOperationRequest {
@@ -51,32 +51,38 @@ public class ShardReplicationPingRequest extends ShardReplicationOperationReques
return this.shardId;
}
- @Override public ShardReplicationPingRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public ShardReplicationPingRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
- @Override public ShardReplicationPingRequest operationThreaded(boolean threadedOperation) {
+ @Override
+ public ShardReplicationPingRequest operationThreaded(boolean threadedOperation) {
super.operationThreaded(threadedOperation);
return this;
}
- @Override public ShardReplicationPingRequest replicationType(ReplicationType replicationType) {
+ @Override
+ public ShardReplicationPingRequest replicationType(ReplicationType replicationType) {
super.replicationType(replicationType);
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shardId = in.readVInt();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(shardId);
}
- @Override public String toString() {
+ @Override
+ public String toString() {
return "replication_ping {[" + index + "][" + shardId + "]}";
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ShardReplicationPingResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ShardReplicationPingResponse.java
index 3829f06f990..048f42e50fc 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ShardReplicationPingResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/ShardReplicationPingResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.Streamable;
import java.io.IOException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class ShardReplicationPingResponse implements ActionResponse, Streamable {
@@ -35,9 +35,11 @@ public class ShardReplicationPingResponse implements ActionResponse, Streamable
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportIndexReplicationPingAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportIndexReplicationPingAction.java
index 1d04b5d10c2..65d0c903f53 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportIndexReplicationPingAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportIndexReplicationPingAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -36,17 +36,20 @@ import java.util.concurrent.atomic.AtomicReferenceArray;
*/
public class TransportIndexReplicationPingAction extends TransportIndexReplicationOperationAction {
- @Inject public TransportIndexReplicationPingAction(Settings settings, ClusterService clusterService,
- TransportService transportService, ThreadPool threadPool,
- TransportShardReplicationPingAction shardReplicationPingAction) {
+ @Inject
+ public TransportIndexReplicationPingAction(Settings settings, ClusterService clusterService,
+ TransportService transportService, ThreadPool threadPool,
+ TransportShardReplicationPingAction shardReplicationPingAction) {
super(settings, transportService, clusterService, threadPool, shardReplicationPingAction);
}
- @Override protected IndexReplicationPingRequest newRequestInstance() {
+ @Override
+ protected IndexReplicationPingRequest newRequestInstance() {
return new IndexReplicationPingRequest();
}
- @Override protected IndexReplicationPingResponse newResponseInstance(IndexReplicationPingRequest request, AtomicReferenceArray shardsResponses) {
+ @Override
+ protected IndexReplicationPingResponse newResponseInstance(IndexReplicationPingRequest request, AtomicReferenceArray shardsResponses) {
int successfulShards = 0;
int failedShards = 0;
for (int i = 0; i < shardsResponses.length(); i++) {
@@ -59,15 +62,18 @@ public class TransportIndexReplicationPingAction extends TransportIndexReplicati
return new IndexReplicationPingResponse(request.index(), successfulShards, failedShards);
}
- @Override protected boolean accumulateExceptions() {
+ @Override
+ protected boolean accumulateExceptions() {
return false;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return "ping/replication/index";
}
- @Override protected GroupShardsIterator shards(IndexReplicationPingRequest indexRequest) {
+ @Override
+ protected GroupShardsIterator shards(IndexReplicationPingRequest indexRequest) {
IndexRoutingTable indexRouting = clusterService.state().routingTable().index(indexRequest.index());
if (indexRouting == null) {
throw new IndexMissingException(new Index(indexRequest.index()));
@@ -75,7 +81,8 @@ public class TransportIndexReplicationPingAction extends TransportIndexReplicati
return indexRouting.groupByShardsIt();
}
- @Override protected ShardReplicationPingRequest newShardRequestInstance(IndexReplicationPingRequest indexRequest, int shardId) {
+ @Override
+ protected ShardReplicationPingRequest newShardRequestInstance(IndexReplicationPingRequest indexRequest, int shardId) {
return new ShardReplicationPingRequest(indexRequest, shardId);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportReplicationPingAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportReplicationPingAction.java
index 3c65046ca67..a29eb9c7621 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportReplicationPingAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportReplicationPingAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -34,15 +34,18 @@ import java.util.concurrent.atomic.AtomicReferenceArray;
*/
public class TransportReplicationPingAction extends TransportIndicesReplicationOperationAction {
- @Inject public TransportReplicationPingAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, TransportIndexReplicationPingAction indexAction) {
+ @Inject
+ public TransportReplicationPingAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool, TransportIndexReplicationPingAction indexAction) {
super(settings, transportService, clusterService, threadPool, indexAction);
}
- @Override protected ReplicationPingRequest newRequestInstance() {
+ @Override
+ protected ReplicationPingRequest newRequestInstance() {
return new ReplicationPingRequest();
}
- @Override protected ReplicationPingResponse newResponseInstance(ReplicationPingRequest request, AtomicReferenceArray indexResponses) {
+ @Override
+ protected ReplicationPingResponse newResponseInstance(ReplicationPingRequest request, AtomicReferenceArray indexResponses) {
ReplicationPingResponse response = new ReplicationPingResponse();
for (int i = 0; i < indexResponses.length(); i++) {
IndexReplicationPingResponse indexResponse = (IndexReplicationPingResponse) indexResponses.get(i);
@@ -53,15 +56,18 @@ public class TransportReplicationPingAction extends TransportIndicesReplicationO
return response;
}
- @Override protected boolean accumulateExceptions() {
+ @Override
+ protected boolean accumulateExceptions() {
return false;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.Ping.REPLICATION;
}
- @Override protected IndexReplicationPingRequest newIndexRequestInstance(ReplicationPingRequest request, String index, Set routing) {
+ @Override
+ protected IndexReplicationPingRequest newIndexRequestInstance(ReplicationPingRequest request, String index, Set routing) {
return new IndexReplicationPingRequest(request, index);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportShardReplicationPingAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportShardReplicationPingAction.java
index 4ed03482d41..b992491c60c 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportShardReplicationPingAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/replication/TransportShardReplicationPingAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -31,48 +31,58 @@ import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportShardReplicationPingAction extends TransportShardReplicationOperationAction {
- @Inject public TransportShardReplicationPingAction(Settings settings, TransportService transportService,
- ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool,
- ShardStateAction shardStateAction) {
+ @Inject
+ public TransportShardReplicationPingAction(Settings settings, TransportService transportService,
+ ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool,
+ ShardStateAction shardStateAction) {
super(settings, transportService, clusterService, indicesService, threadPool, shardStateAction);
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.CACHED;
}
- @Override protected boolean checkWriteConsistency() {
+ @Override
+ protected boolean checkWriteConsistency() {
return true;
}
- @Override protected ShardReplicationPingRequest newRequestInstance() {
+ @Override
+ protected ShardReplicationPingRequest newRequestInstance() {
return new ShardReplicationPingRequest();
}
- @Override protected ShardReplicationPingRequest newReplicaRequestInstance() {
+ @Override
+ protected ShardReplicationPingRequest newReplicaRequestInstance() {
return new ShardReplicationPingRequest();
}
- @Override protected ShardReplicationPingResponse newResponseInstance() {
+ @Override
+ protected ShardReplicationPingResponse newResponseInstance() {
return new ShardReplicationPingResponse();
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return "ping/replication/shard";
}
- @Override protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
+ @Override
+ protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
return new PrimaryResponse(shardRequest.request, new ShardReplicationPingResponse(), null);
}
- @Override protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
+ @Override
+ protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
}
- @Override protected ShardIterator shards(ClusterState clusterState, ShardReplicationPingRequest request) {
+ @Override
+ protected ShardIterator shards(ClusterState clusterState, ShardReplicationPingRequest request) {
return clusterService.state().routingTable().index(request.index()).shard(request.shardId()).shardsIt();
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/SinglePingRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/SinglePingRequest.java
index 5cda2aae92c..fbf5675ad05 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/SinglePingRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/SinglePingRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class SinglePingRequest extends SingleShardOperationRequest {
@@ -61,23 +61,27 @@ public class SinglePingRequest extends SingleShardOperationRequest {
return this;
}
- @Override public SinglePingRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public SinglePingRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
- @Override public SinglePingRequest operationThreaded(boolean threadedOperation) {
+ @Override
+ public SinglePingRequest operationThreaded(boolean threadedOperation) {
super.operationThreaded(threadedOperation);
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
type = in.readUTF();
id = in.readUTF();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(type);
out.writeUTF(id);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/SinglePingResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/SinglePingResponse.java
index 798b5051c3f..ecc6d6c4a26 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/SinglePingResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/SinglePingResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,13 +26,15 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class SinglePingResponse implements ActionResponse {
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/TransportSinglePingAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/TransportSinglePingAction.java
index 00d5f5085e9..2503f9b14b4 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/TransportSinglePingAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/ping/single/TransportSinglePingAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -31,40 +31,48 @@ import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportSinglePingAction extends TransportShardSingleOperationAction {
- @Inject public TransportSinglePingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
+ @Inject
+ public TransportSinglePingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
super(settings, threadPool, clusterService, transportService);
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.CACHED;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.Ping.SINGLE;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "/cluster/ping/single/shard";
}
- @Override protected ShardIterator shards(ClusterState clusterState, SinglePingRequest request) throws ElasticSearchException {
+ @Override
+ protected ShardIterator shards(ClusterState clusterState, SinglePingRequest request) throws ElasticSearchException {
return clusterService.operationRouting()
.getShards(clusterService.state(), request.index(), request.type, request.id, null, null);
}
- @Override protected SinglePingResponse shardOperation(SinglePingRequest request, int shardId) throws ElasticSearchException {
+ @Override
+ protected SinglePingResponse shardOperation(SinglePingRequest request, int shardId) throws ElasticSearchException {
return new SinglePingResponse();
}
- @Override protected SinglePingRequest newRequest() {
+ @Override
+ protected SinglePingRequest newRequest() {
return new SinglePingRequest();
}
- @Override protected SinglePingResponse newResponse() {
+ @Override
+ protected SinglePingResponse newResponse() {
return new SinglePingResponse();
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequest.java
index 3afd9b50f97..d204a25194e 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -33,15 +33,18 @@ public class ClusterRerouteRequest extends MasterNodeOperationRequest {
public ClusterRerouteRequest() {
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
return null;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponse.java
index 87016b7083a..133fd82ca92 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/reroute/ClusterRerouteResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -32,9 +32,11 @@ public class ClusterRerouteResponse implements ActionResponse {
ClusterRerouteResponse() {
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java
index c872294bd70..61ecfd38129 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -35,7 +35,7 @@ import org.elasticsearch.transport.TransportService;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
-import static org.elasticsearch.cluster.ClusterState.*;
+import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder;
/**
*/
@@ -43,34 +43,41 @@ public class TransportClusterRerouteAction extends TransportMasterNodeOperationA
private final AllocationService allocationService;
- @Inject public TransportClusterRerouteAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
- AllocationService allocationService) {
+ @Inject
+ public TransportClusterRerouteAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
+ AllocationService allocationService) {
super(settings, transportService, clusterService, threadPool);
this.allocationService = allocationService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.CACHED;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.REROUTE;
}
- @Override protected ClusterRerouteRequest newRequest() {
+ @Override
+ protected ClusterRerouteRequest newRequest() {
return new ClusterRerouteRequest();
}
- @Override protected ClusterRerouteResponse newResponse() {
+ @Override
+ protected ClusterRerouteResponse newResponse() {
return new ClusterRerouteResponse();
}
- @Override protected ClusterRerouteResponse masterOperation(ClusterRerouteRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected ClusterRerouteResponse masterOperation(ClusterRerouteRequest request, ClusterState state) throws ElasticSearchException {
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
clusterService.submitStateUpdateTask("cluster_reroute (api)", new ProcessedClusterStateUpdateTask() {
- @Override public ClusterState execute(ClusterState currentState) {
+ @Override
+ public ClusterState execute(ClusterState currentState) {
try {
RoutingAllocation.Result routingResult = allocationService.reroute(currentState);
return newClusterStateBuilder().state(currentState).routingResult(routingResult).build();
@@ -83,7 +90,8 @@ public class TransportClusterRerouteAction extends TransportMasterNodeOperationA
}
}
- @Override public void clusterStateProcessed(ClusterState clusterState) {
+ @Override
+ public void clusterStateProcessed(ClusterState clusterState) {
latch.countDown();
}
});
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java
index 0ce4b2253f5..79e6dc33575 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -33,9 +33,10 @@ import org.elasticsearch.common.xcontent.XContentType;
import java.io.IOException;
import java.util.Map;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.settings.ImmutableSettings.Builder.*;
-import static org.elasticsearch.common.settings.ImmutableSettings.*;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS;
+import static org.elasticsearch.common.settings.ImmutableSettings.readSettingsFromStream;
+import static org.elasticsearch.common.settings.ImmutableSettings.writeSettingsToStream;
/**
*/
@@ -47,7 +48,8 @@ public class ClusterUpdateSettingsRequest extends MasterNodeOperationRequest {
public ClusterUpdateSettingsRequest() {
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (transientSettings.getAsMap().isEmpty() && persistentSettings.getAsMap().isEmpty()) {
validationException = addValidationError("no settings to update", validationException);
@@ -116,13 +118,15 @@ public class ClusterUpdateSettingsRequest extends MasterNodeOperationRequest {
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
transientSettings = readSettingsFromStream(in);
persistentSettings = readSettingsFromStream(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
writeSettingsToStream(transientSettings, out);
writeSettingsToStream(persistentSettings, out);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java
index 44b527e8a25..709693a9249 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -34,9 +34,11 @@ public class ClusterUpdateSettingsResponse implements ActionResponse, Streamable
ClusterUpdateSettingsResponse() {
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java
index 7a4800cdaa0..7531a1b22a5 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -39,43 +39,50 @@ import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
-import static org.elasticsearch.cluster.ClusterState.*;
+import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportClusterUpdateSettingsAction extends TransportMasterNodeOperationAction {
private final AllocationService allocationService;
- @Inject public TransportClusterUpdateSettingsAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
- AllocationService allocationService) {
+ @Inject
+ public TransportClusterUpdateSettingsAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
+ AllocationService allocationService) {
super(settings, transportService, clusterService, threadPool);
this.allocationService = allocationService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.UPDATE_SETTINGS;
}
- @Override protected ClusterUpdateSettingsRequest newRequest() {
+ @Override
+ protected ClusterUpdateSettingsRequest newRequest() {
return new ClusterUpdateSettingsRequest();
}
- @Override protected ClusterUpdateSettingsResponse newResponse() {
+ @Override
+ protected ClusterUpdateSettingsResponse newResponse() {
return new ClusterUpdateSettingsResponse();
}
- @Override protected ClusterUpdateSettingsResponse masterOperation(final ClusterUpdateSettingsRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected ClusterUpdateSettingsResponse masterOperation(final ClusterUpdateSettingsRequest request, ClusterState state) throws ElasticSearchException {
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
clusterService.submitStateUpdateTask("cluster_update_settings", new ProcessedClusterStateUpdateTask() {
- @Override public ClusterState execute(ClusterState currentState) {
+ @Override
+ public ClusterState execute(ClusterState currentState) {
try {
boolean changed = false;
ImmutableSettings.Builder transientSettings = ImmutableSettings.settingsBuilder();
@@ -119,10 +126,12 @@ public class TransportClusterUpdateSettingsAction extends TransportMasterNodeOpe
}
}
- @Override public void clusterStateProcessed(ClusterState clusterState) {
+ @Override
+ public void clusterStateProcessed(ClusterState clusterState) {
// now, reroute
clusterService.submitStateUpdateTask("reroute_after_cluster_update_settings", new ClusterStateUpdateTask() {
- @Override public ClusterState execute(ClusterState currentState) {
+ @Override
+ public ClusterState execute(ClusterState currentState) {
try {
// now, reroute in case things change that require it (like number of replicas)
RoutingAllocation.Result routingResult = allocationService.reroute(currentState);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java b/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java
index 081367d8888..a9a94302413 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -28,7 +28,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ClusterStateRequest extends MasterNodeOperationRequest {
@@ -49,7 +49,8 @@ public class ClusterStateRequest extends MasterNodeOperationRequest {
public ClusterStateRequest() {
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
return null;
}
@@ -116,7 +117,8 @@ public class ClusterStateRequest extends MasterNodeOperationRequest {
return this.local;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
filterRoutingTable = in.readBoolean();
filterNodes = in.readBoolean();
@@ -139,7 +141,8 @@ public class ClusterStateRequest extends MasterNodeOperationRequest {
local = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(filterRoutingTable);
out.writeBoolean(filterNodes);
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateResponse.java
index 524e4fd3ee8..7bb0a1551ae 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/state/ClusterStateResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -28,7 +28,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class ClusterStateResponse implements ActionResponse {
@@ -60,12 +60,14 @@ public class ClusterStateResponse implements ActionResponse {
return clusterName();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
clusterName = ClusterName.readClusterName(in);
clusterState = ClusterState.Builder.readFrom(in, null);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
clusterName.writeTo(out);
ClusterState.Builder.writeTo(clusterState, out);
}
diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/state/TransportClusterStateAction.java b/src/main/java/org/elasticsearch/action/admin/cluster/state/TransportClusterStateAction.java
index 3ae027125b7..dcdfdc519db 100644
--- a/src/main/java/org/elasticsearch/action/admin/cluster/state/TransportClusterStateAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/cluster/state/TransportClusterStateAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -33,43 +33,50 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
-import static org.elasticsearch.cluster.ClusterState.*;
-import static org.elasticsearch.cluster.metadata.MetaData.*;
+import static org.elasticsearch.cluster.ClusterState.newClusterStateBuilder;
+import static org.elasticsearch.cluster.metadata.MetaData.newMetaDataBuilder;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportClusterStateAction extends TransportMasterNodeOperationAction {
private final ClusterName clusterName;
- @Inject public TransportClusterStateAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
- ClusterName clusterName) {
+ @Inject
+ public TransportClusterStateAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
+ ClusterName clusterName) {
super(settings, transportService, clusterService, threadPool);
this.clusterName = clusterName;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.CACHED;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Cluster.STATE;
}
- @Override protected ClusterStateRequest newRequest() {
+ @Override
+ protected ClusterStateRequest newRequest() {
return new ClusterStateRequest();
}
- @Override protected ClusterStateResponse newResponse() {
+ @Override
+ protected ClusterStateResponse newResponse() {
return new ClusterStateResponse();
}
- @Override protected boolean localExecute(ClusterStateRequest request) {
+ @Override
+ protected boolean localExecute(ClusterStateRequest request) {
return request.local();
}
- @Override protected ClusterStateResponse masterOperation(ClusterStateRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected ClusterStateResponse masterOperation(ClusterStateRequest request, ClusterState state) throws ElasticSearchException {
ClusterState currentState = clusterService.state();
ClusterState.Builder builder = newClusterStateBuilder();
if (!request.filterNodes()) {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java
index bbb568e67e0..ff2da4df521 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,11 +19,11 @@
package org.elasticsearch.action.admin.indices.alias;
+import com.google.common.collect.Lists;
import org.elasticsearch.ElasticSearchGenerationException;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.MasterNodeOperationRequest;
import org.elasticsearch.cluster.metadata.AliasAction;
-import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.unit.TimeValue;
@@ -37,14 +37,14 @@ import java.io.IOException;
import java.util.List;
import java.util.Map;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.cluster.metadata.AliasAction.*;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.cluster.metadata.AliasAction.readAliasAction;
import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
/**
* A request to add/remove aliases for one or more indices.
*
- * @author kimchy (shay.banon)
+ *
*/
public class IndicesAliasesRequest extends MasterNodeOperationRequest {
@@ -168,7 +168,8 @@ public class IndicesAliasesRequest extends MasterNodeOperationRequest {
return timeout(TimeValue.parseTimeValue(timeout, TimeValue.timeValueSeconds(10)));
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (aliasActions.isEmpty()) {
validationException = addValidationError("Must specify at least one alias action", validationException);
@@ -176,7 +177,8 @@ public class IndicesAliasesRequest extends MasterNodeOperationRequest {
return validationException;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
int size = in.readVInt();
for (int i = 0; i < size; i++) {
@@ -185,7 +187,8 @@ public class IndicesAliasesRequest extends MasterNodeOperationRequest {
timeout = readTimeValue(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(aliasActions.size());
for (AliasAction aliasAction : aliasActions) {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesResponse.java
index 52c0dce66d0..f564386dd30 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/IndicesAliasesResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* A response for a add/remove alias action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class IndicesAliasesResponse implements ActionResponse, Streamable {
@@ -52,11 +52,13 @@ public class IndicesAliasesResponse implements ActionResponse, Streamable {
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
acknowledged = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(acknowledged);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java b/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java
index 8c426d5d4ac..25cee1ae4d5 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/alias/TransportIndicesAliasesAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,6 +19,7 @@
package org.elasticsearch.action.admin.indices.alias;
+import com.google.common.collect.Sets;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.TransportActions;
import org.elasticsearch.action.support.master.TransportMasterNodeOperationAction;
@@ -28,7 +29,6 @@ import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.block.ClusterBlockLevel;
import org.elasticsearch.cluster.metadata.AliasAction;
import org.elasticsearch.cluster.metadata.MetaDataIndexAliasesService;
-import org.elasticsearch.common.collect.Sets;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
@@ -39,35 +39,41 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportIndicesAliasesAction extends TransportMasterNodeOperationAction {
private final MetaDataIndexAliasesService indexAliasesService;
- @Inject public TransportIndicesAliasesAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataIndexAliasesService indexAliasesService) {
+ @Inject
+ public TransportIndicesAliasesAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataIndexAliasesService indexAliasesService) {
super(settings, transportService, clusterService, threadPool);
this.indexAliasesService = indexAliasesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.ALIASES;
}
- @Override protected IndicesAliasesRequest newRequest() {
+ @Override
+ protected IndicesAliasesRequest newRequest() {
return new IndicesAliasesRequest();
}
- @Override protected IndicesAliasesResponse newResponse() {
+ @Override
+ protected IndicesAliasesResponse newResponse() {
return new IndicesAliasesResponse();
}
- @Override protected ClusterBlockException checkBlock(IndicesAliasesRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(IndicesAliasesRequest request, ClusterState state) {
Set indices = Sets.newHashSet();
for (AliasAction aliasAction : request.aliasActions()) {
indices.add(aliasAction.index());
@@ -75,17 +81,20 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeOperationA
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, indices.toArray(new String[indices.size()]));
}
- @Override protected IndicesAliasesResponse masterOperation(IndicesAliasesRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected IndicesAliasesResponse masterOperation(IndicesAliasesRequest request, ClusterState state) throws ElasticSearchException {
final AtomicReference responseRef = new AtomicReference();
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
indexAliasesService.indicesAliases(new MetaDataIndexAliasesService.Request(request.aliasActions().toArray(new AliasAction[request.aliasActions().size()]), request.timeout()), new MetaDataIndexAliasesService.Listener() {
- @Override public void onResponse(MetaDataIndexAliasesService.Response response) {
+ @Override
+ public void onResponse(MetaDataIndexAliasesService.Response response) {
responseRef.set(new IndicesAliasesResponse(response.acknowledged()));
latch.countDown();
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeRequest.java
index a5189c12aec..7b9ae0d1edf 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeRequest.java
@@ -26,13 +26,11 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
-import static org.elasticsearch.action.Actions.*;
+import static org.elasticsearch.action.Actions.addValidationError;
/**
* A request to analyze a text associated with a specific index. Allow to provide
* the actual analyzer name to perform the analysis with.
- *
- * @author kimchy
*/
public class AnalyzeRequest extends SingleCustomOperationRequest {
@@ -94,12 +92,14 @@ public class AnalyzeRequest extends SingleCustomOperationRequest {
* if this operation hits a node with a local relevant shard, should it be preferred
* to be executed on, or just do plain round robin. Defaults to true
*/
- @Override public AnalyzeRequest preferLocal(boolean preferLocal) {
+ @Override
+ public AnalyzeRequest preferLocal(boolean preferLocal) {
super.preferLocal(preferLocal);
return this;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = super.validate();
if (index == null) {
validationException = addValidationError("index is missing", validationException);
@@ -110,7 +110,8 @@ public class AnalyzeRequest extends SingleCustomOperationRequest {
return validationException;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
index = in.readUTF();
text = in.readUTF();
@@ -122,7 +123,8 @@ public class AnalyzeRequest extends SingleCustomOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(index);
out.writeUTF(text);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponse.java
index a41a5dddc27..aa2ed9c4648 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/analyze/AnalyzeResponse.java
@@ -32,7 +32,7 @@ import java.util.Iterator;
import java.util.List;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class AnalyzeResponse implements ActionResponse, Iterable, ToXContent {
@@ -100,7 +100,8 @@ public class AnalyzeResponse implements ActionResponse, Iterable iterator() {
+ @Override
+ public Iterator iterator() {
return tokens.iterator();
}
- @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
+ @Override
+ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
String format = params.param("format", "detailed");
if ("detailed".equals(format)) {
builder.startArray("tokens");
@@ -180,7 +184,8 @@ public class AnalyzeResponse implements ActionResponse, Iterable(size);
for (int i = 0; i < size; i++) {
@@ -188,7 +193,8 @@ public class AnalyzeResponse implements ActionResponse, Iterable {
private final IndicesService indicesService;
- @Inject public TransportAnalyzeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
- IndicesService indicesService) {
+ @Inject
+ public TransportAnalyzeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
+ IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.INDEX;
}
- @Override protected AnalyzeRequest newRequest() {
+ @Override
+ protected AnalyzeRequest newRequest() {
return new AnalyzeRequest();
}
- @Override protected AnalyzeResponse newResponse() {
+ @Override
+ protected AnalyzeResponse newResponse() {
return new AnalyzeResponse();
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.ANALYZE;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/analyze/shard";
}
- @Override protected ShardsIterator shards(ClusterState clusterState, AnalyzeRequest request) {
+ @Override
+ protected ShardsIterator shards(ClusterState clusterState, AnalyzeRequest request) {
request.index(clusterState.metaData().concreteIndex(request.index()));
return clusterState.routingTable().index(request.index()).randomAllActiveShardsIt();
}
- @Override protected AnalyzeResponse shardOperation(AnalyzeRequest request, int shardId) throws ElasticSearchException {
+ @Override
+ protected AnalyzeResponse shardOperation(AnalyzeRequest request, int shardId) throws ElasticSearchException {
IndexService indexService = indicesService.indexServiceSafe(request.index());
Analyzer analyzer = null;
String field = null;
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java
index 7704af11de9..c956107836a 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class ClearIndicesCacheRequest extends BroadcastOperationRequest {
@@ -49,7 +49,8 @@ public class ClearIndicesCacheRequest extends BroadcastOperationRequest {
/**
* Should the listener be called on a separate thread if needed.
*/
- @Override public ClearIndicesCacheRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public ClearIndicesCacheRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
@@ -57,7 +58,8 @@ public class ClearIndicesCacheRequest extends BroadcastOperationRequest {
/**
* Controls the operation threading model.
*/
- @Override public ClearIndicesCacheRequest operationThreading(BroadcastOperationThreading operationThreading) {
+ @Override
+ public ClearIndicesCacheRequest operationThreading(BroadcastOperationThreading operationThreading) {
super.operationThreading(operationThreading);
return this;
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java
index a5613a38ed7..e5d4d290598 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -30,7 +30,7 @@ import java.util.List;
/**
* The response of a refresh action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ClearIndicesCacheResponse extends BroadcastOperationResponse {
@@ -42,11 +42,13 @@ public class ClearIndicesCacheResponse extends BroadcastOperationResponse {
super(totalShards, successfulShards, failedShards, shardFailures);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ShardClearIndicesCacheRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ShardClearIndicesCacheRequest.java
index 3ec0976ac61..d988d8910d9 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ShardClearIndicesCacheRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ShardClearIndicesCacheRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
class ShardClearIndicesCacheRequest extends BroadcastShardOperationRequest {
@@ -73,7 +73,8 @@ class ShardClearIndicesCacheRequest extends BroadcastShardOperationRequest {
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
filterCache = in.readBoolean();
fieldDataCache = in.readBoolean();
@@ -88,7 +89,8 @@ class ShardClearIndicesCacheRequest extends BroadcastShardOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(filterCache);
out.writeBoolean(fieldDataCache);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ShardClearIndicesCacheResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ShardClearIndicesCacheResponse.java
index c1a28c97424..d6f372833e5 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ShardClearIndicesCacheResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/ShardClearIndicesCacheResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
class ShardClearIndicesCacheResponse extends BroadcastShardOperationResponse {
@@ -37,11 +37,13 @@ class ShardClearIndicesCacheResponse extends BroadcastShardOperationResponse {
super(index, shardId);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java
index 9ee04075109..db563c26621 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -39,45 +39,52 @@ import org.elasticsearch.transport.TransportService;
import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
/**
* Indices clear cache action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportClearIndicesCacheAction extends TransportBroadcastOperationAction {
private final IndicesService indicesService;
- @Inject public TransportClearIndicesCacheAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
- TransportService transportService, IndicesService indicesService) {
+ @Inject
+ public TransportClearIndicesCacheAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
+ TransportService transportService, IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.Cache.CLEAR;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/cache/clear/shard";
}
- @Override protected ClearIndicesCacheRequest newRequest() {
+ @Override
+ protected ClearIndicesCacheRequest newRequest() {
return new ClearIndicesCacheRequest();
}
- @Override protected boolean ignoreNonActiveExceptions() {
+ @Override
+ protected boolean ignoreNonActiveExceptions() {
return true;
}
- @Override protected ClearIndicesCacheResponse newResponse(ClearIndicesCacheRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
+ @Override
+ protected ClearIndicesCacheResponse newResponse(ClearIndicesCacheRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
int successfulShards = 0;
int failedShards = 0;
List shardFailures = null;
@@ -98,19 +105,23 @@ public class TransportClearIndicesCacheAction extends TransportBroadcastOperatio
return new ClearIndicesCacheResponse(shardsResponses.length(), successfulShards, failedShards, shardFailures);
}
- @Override protected ShardClearIndicesCacheRequest newShardRequest() {
+ @Override
+ protected ShardClearIndicesCacheRequest newShardRequest() {
return new ShardClearIndicesCacheRequest();
}
- @Override protected ShardClearIndicesCacheRequest newShardRequest(ShardRouting shard, ClearIndicesCacheRequest request) {
+ @Override
+ protected ShardClearIndicesCacheRequest newShardRequest(ShardRouting shard, ClearIndicesCacheRequest request) {
return new ShardClearIndicesCacheRequest(shard.index(), shard.id(), request);
}
- @Override protected ShardClearIndicesCacheResponse newShardResponse() {
+ @Override
+ protected ShardClearIndicesCacheResponse newShardResponse() {
return new ShardClearIndicesCacheResponse();
}
- @Override protected ShardClearIndicesCacheResponse shardOperation(ShardClearIndicesCacheRequest request) throws ElasticSearchException {
+ @Override
+ protected ShardClearIndicesCacheResponse shardOperation(ShardClearIndicesCacheRequest request) throws ElasticSearchException {
IndexService service = indicesService.indexService(request.index());
if (service != null) {
// we always clear the query cache
@@ -156,7 +167,8 @@ public class TransportClearIndicesCacheAction extends TransportBroadcastOperatio
/**
* The refresh request works against *all* shards.
*/
- @Override protected GroupShardsIterator shards(ClearIndicesCacheRequest request, String[] concreteIndices, ClusterState clusterState) {
+ @Override
+ protected GroupShardsIterator shards(ClearIndicesCacheRequest request, String[] concreteIndices, ClusterState clusterState) {
return clusterState.routingTable().allActiveShardsGrouped(concreteIndices, true);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequest.java
index 068074735fd..66c172995e8 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,13 +27,14 @@ import org.elasticsearch.common.unit.TimeValue;
import java.io.IOException;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.unit.TimeValue.*;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
+import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
/**
* A request to close an index.
*
- * @author kimchy (shay.banon)
+ *
*/
public class CloseIndexRequest extends MasterNodeOperationRequest {
@@ -51,7 +52,8 @@ public class CloseIndexRequest extends MasterNodeOperationRequest {
this.index = index;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (index == null) {
validationException = addValidationError("index is missing", validationException);
@@ -91,13 +93,15 @@ public class CloseIndexRequest extends MasterNodeOperationRequest {
return timeout(TimeValue.parseTimeValue(timeout, null));
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
index = in.readUTF();
timeout = readTimeValue(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(index);
timeout.writeTo(out);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponse.java
index ce1524b194c..37c522f200a 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/close/CloseIndexResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* A response for a close index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class CloseIndexResponse implements ActionResponse, Streamable {
@@ -50,11 +50,13 @@ public class CloseIndexResponse implements ActionResponse, Streamable {
return acknowledged();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
acknowledged = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(acknowledged);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java b/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java
index 9e9003a6373..73c46bbae87 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/close/TransportCloseIndexAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -38,49 +38,58 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Delete index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportCloseIndexAction extends TransportMasterNodeOperationAction {
private final MetaDataStateIndexService stateIndexService;
- @Inject public TransportCloseIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataStateIndexService stateIndexService) {
+ @Inject
+ public TransportCloseIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataStateIndexService stateIndexService) {
super(settings, transportService, clusterService, threadPool);
this.stateIndexService = stateIndexService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.CLOSE;
}
- @Override protected CloseIndexRequest newRequest() {
+ @Override
+ protected CloseIndexRequest newRequest() {
return new CloseIndexRequest();
}
- @Override protected CloseIndexResponse newResponse() {
+ @Override
+ protected CloseIndexResponse newResponse() {
return new CloseIndexResponse();
}
- @Override protected ClusterBlockException checkBlock(CloseIndexRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(CloseIndexRequest request, ClusterState state) {
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, request.index());
}
- @Override protected CloseIndexResponse masterOperation(CloseIndexRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected CloseIndexResponse masterOperation(CloseIndexRequest request, ClusterState state) throws ElasticSearchException {
final AtomicReference responseRef = new AtomicReference();
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
stateIndexService.closeIndex(new MetaDataStateIndexService.Request(request.index()).timeout(request.timeout()), new MetaDataStateIndexService.Listener() {
- @Override public void onResponse(MetaDataStateIndexService.Response response) {
+ @Override
+ public void onResponse(MetaDataStateIndexService.Response response) {
responseRef.set(new CloseIndexResponse(response.acknowledged()));
latch.countDown();
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java
index 2c61376dd9a..4172c79a418 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -37,18 +37,19 @@ import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.collect.Maps.*;
-import static org.elasticsearch.common.settings.ImmutableSettings.Builder.*;
-import static org.elasticsearch.common.settings.ImmutableSettings.*;
-import static org.elasticsearch.common.unit.TimeValue.*;
+import static com.google.common.collect.Maps.newHashMap;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS;
+import static org.elasticsearch.common.settings.ImmutableSettings.readSettingsFromStream;
+import static org.elasticsearch.common.settings.ImmutableSettings.writeSettingsToStream;
+import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
/**
* A request to create an index. Best created with {@link org.elasticsearch.client.Requests#createIndexRequest(String)}.
- *
+ *
* The index created can optionally be created with {@link #settings(org.elasticsearch.common.settings.Settings)}.
*
- * @author kimchy (shay.banon)
+ *
* @see org.elasticsearch.client.IndicesAdminClient#create(CreateIndexRequest)
* @see org.elasticsearch.client.Requests#createIndexRequest(String)
* @see CreateIndexResponse
@@ -83,7 +84,8 @@ public class CreateIndexRequest extends MasterNodeOperationRequest {
this.settings = settings;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (index == null) {
validationException = addValidationError("index is missing", validationException);
@@ -245,7 +247,8 @@ public class CreateIndexRequest extends MasterNodeOperationRequest {
return timeout(TimeValue.parseTimeValue(timeout, null));
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
cause = in.readUTF();
index = in.readUTF();
@@ -257,7 +260,8 @@ public class CreateIndexRequest extends MasterNodeOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(cause);
out.writeUTF(index);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponse.java
index b8b23c2c9cd..ea9de0deef6 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* A response for a create index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class CreateIndexResponse implements ActionResponse, Streamable {
@@ -58,11 +58,13 @@ public class CreateIndexResponse implements ActionResponse, Streamable {
return acknowledged();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
acknowledged = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(acknowledged);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexAction.java b/src/main/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexAction.java
index b6e6550430c..b2367985261 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/create/TransportCreateIndexAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -38,39 +38,46 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Create index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportCreateIndexAction extends TransportMasterNodeOperationAction {
private final MetaDataCreateIndexService createIndexService;
- @Inject public TransportCreateIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataCreateIndexService createIndexService) {
+ @Inject
+ public TransportCreateIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataCreateIndexService createIndexService) {
super(settings, transportService, clusterService, threadPool);
this.createIndexService = createIndexService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.CREATE;
}
- @Override protected CreateIndexRequest newRequest() {
+ @Override
+ protected CreateIndexRequest newRequest() {
return new CreateIndexRequest();
}
- @Override protected CreateIndexResponse newResponse() {
+ @Override
+ protected CreateIndexResponse newResponse() {
return new CreateIndexResponse();
}
- @Override protected ClusterBlockException checkBlock(CreateIndexRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(CreateIndexRequest request, ClusterState state) {
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, request.index());
}
- @Override protected CreateIndexResponse masterOperation(CreateIndexRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected CreateIndexResponse masterOperation(CreateIndexRequest request, ClusterState state) throws ElasticSearchException {
String cause = request.cause();
if (cause.length() == 0) {
cause = "api";
@@ -80,12 +87,14 @@ public class TransportCreateIndexAction extends TransportMasterNodeOperationActi
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
createIndexService.createIndex(new MetaDataCreateIndexService.Request(cause, request.index()).settings(request.settings()).mappings(request.mappings()).timeout(request.timeout()), new MetaDataCreateIndexService.Listener() {
- @Override public void onResponse(MetaDataCreateIndexService.Response response) {
+ @Override
+ public void onResponse(MetaDataCreateIndexService.Response response) {
responseRef.set(new CreateIndexResponse(response.acknowledged()));
latch.countDown();
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/create/package-info.java b/src/main/java/org/elasticsearch/action/admin/indices/create/package-info.java
index 179ddaa99b7..790e172d170 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/create/package-info.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/create/package-info.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexRequest.java
index 9e82634da12..276ac28ca9d 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,13 +27,14 @@ import org.elasticsearch.common.unit.TimeValue;
import java.io.IOException;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.unit.TimeValue.*;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
+import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
/**
* A request to delete an index. Best created with {@link org.elasticsearch.client.Requests#deleteIndexRequest(String)}.
*
- * @author kimchy (shay.banon)
+ *
*/
public class DeleteIndexRequest extends MasterNodeOperationRequest {
@@ -55,7 +56,8 @@ public class DeleteIndexRequest extends MasterNodeOperationRequest {
this.indices = indices;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (indices == null) {
validationException = addValidationError("index / indices is missing", validationException);
@@ -100,7 +102,8 @@ public class DeleteIndexRequest extends MasterNodeOperationRequest {
return timeout(TimeValue.parseTimeValue(timeout, null));
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = new String[in.readVInt()];
for (int i = 0; i < indices.length; i++) {
@@ -109,7 +112,8 @@ public class DeleteIndexRequest extends MasterNodeOperationRequest {
timeout = readTimeValue(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (indices == null) {
out.writeVInt(0);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexResponse.java
index 4679ddf8195..127e217a31a 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/delete/DeleteIndexResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* A response for a delete index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class DeleteIndexResponse implements ActionResponse, Streamable {
@@ -58,11 +58,13 @@ public class DeleteIndexResponse implements ActionResponse, Streamable {
return acknowledged();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
acknowledged = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(acknowledged);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/delete/TransportDeleteIndexAction.java b/src/main/java/org/elasticsearch/action/admin/indices/delete/TransportDeleteIndexAction.java
index ec85d2ee073..7a41f517d23 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/delete/TransportDeleteIndexAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/delete/TransportDeleteIndexAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -45,7 +45,7 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Delete index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportDeleteIndexAction extends TransportMasterNodeOperationAction {
@@ -55,8 +55,9 @@ public class TransportDeleteIndexAction extends TransportMasterNodeOperationActi
private final boolean disableDeleteAllIndices;
- @Inject public TransportDeleteIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataDeleteIndexService deleteIndexService, TransportDeleteMappingAction deleteMappingAction) {
+ @Inject
+ public TransportDeleteIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataDeleteIndexService deleteIndexService, TransportDeleteMappingAction deleteMappingAction) {
super(settings, transportService, clusterService, threadPool);
this.deleteIndexService = deleteIndexService;
this.deleteMappingAction = deleteMappingAction;
@@ -64,23 +65,28 @@ public class TransportDeleteIndexAction extends TransportMasterNodeOperationActi
this.disableDeleteAllIndices = settings.getAsBoolean("action.disable_delete_all_indices", false);
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.DELETE;
}
- @Override protected DeleteIndexRequest newRequest() {
+ @Override
+ protected DeleteIndexRequest newRequest() {
return new DeleteIndexRequest();
}
- @Override protected DeleteIndexResponse newResponse() {
+ @Override
+ protected DeleteIndexResponse newResponse() {
return new DeleteIndexResponse();
}
- @Override protected void doExecute(DeleteIndexRequest request, ActionListener listener) {
+ @Override
+ protected void doExecute(DeleteIndexRequest request, ActionListener listener) {
if (disableDeleteAllIndices && (request.indices() == null || request.indices().length == 0)) {
throw new ElasticSearchIllegalArgumentException("deleting all indices is disabled");
}
@@ -88,11 +94,13 @@ public class TransportDeleteIndexAction extends TransportMasterNodeOperationActi
super.doExecute(request, listener);
}
- @Override protected ClusterBlockException checkBlock(DeleteIndexRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(DeleteIndexRequest request, ClusterState state) {
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, request.indices());
}
- @Override protected DeleteIndexResponse masterOperation(DeleteIndexRequest request, final ClusterState state) throws ElasticSearchException {
+ @Override
+ protected DeleteIndexResponse masterOperation(DeleteIndexRequest request, final ClusterState state) throws ElasticSearchException {
if (request.indices().length == 0) {
return new DeleteIndexResponse(true);
}
@@ -101,17 +109,20 @@ public class TransportDeleteIndexAction extends TransportMasterNodeOperationActi
final CountDownLatch latch = new CountDownLatch(request.indices().length);
for (final String index : request.indices()) {
deleteIndexService.deleteIndex(new MetaDataDeleteIndexService.Request(index).timeout(request.timeout()), new MetaDataDeleteIndexService.Listener() {
- @Override public void onResponse(MetaDataDeleteIndexService.Response response) {
+ @Override
+ public void onResponse(MetaDataDeleteIndexService.Response response) {
responseRef.set(new DeleteIndexResponse(response.acknowledged()));
// YACK, but here we go: If this index is also percolated, make sure to delete all percolated queries from the _percolator index
IndexMetaData percolatorMetaData = state.metaData().index(PercolatorService.INDEX_NAME);
if (percolatorMetaData != null && percolatorMetaData.mappings().containsKey(index)) {
deleteMappingAction.execute(new DeleteMappingRequest(PercolatorService.INDEX_NAME).type(index), new ActionListener() {
- @Override public void onResponse(DeleteMappingResponse deleteMappingResponse) {
+ @Override
+ public void onResponse(DeleteMappingResponse deleteMappingResponse) {
latch.countDown();
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
latch.countDown();
}
});
@@ -120,7 +131,8 @@ public class TransportDeleteIndexAction extends TransportMasterNodeOperationActi
}
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/delete/package-info.java b/src/main/java/org/elasticsearch/action/admin/indices/delete/package-info.java
index c8c7618ea2a..1adc714118a 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/delete/package-info.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/delete/package-info.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/exists/IndicesExistsRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/exists/IndicesExistsRequest.java
index 7bf87d96dce..ddd1e641b17 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/exists/IndicesExistsRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/exists/IndicesExistsRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
-import static org.elasticsearch.action.Actions.*;
+import static org.elasticsearch.action.Actions.addValidationError;
public class IndicesExistsRequest extends MasterNodeOperationRequest {
@@ -44,7 +44,8 @@ public class IndicesExistsRequest extends MasterNodeOperationRequest {
this.indices = indices;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (indices == null || indices.length == 0) {
validationException = addValidationError("index/indices is missing", validationException);
@@ -52,7 +53,8 @@ public class IndicesExistsRequest extends MasterNodeOperationRequest {
return validationException;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = new String[in.readVInt()];
for (int i = 0; i < indices.length; i++) {
@@ -60,7 +62,8 @@ public class IndicesExistsRequest extends MasterNodeOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(indices.length);
for (String index : indices) {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/exists/IndicesExistsResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/exists/IndicesExistsResponse.java
index c979ea715a7..cf1c3d82263 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/exists/IndicesExistsResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/exists/IndicesExistsResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -45,11 +45,13 @@ public class IndicesExistsResponse implements ActionResponse, Streamable {
return exists();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
exists = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(exists);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/exists/TransportIndicesExistsAction.java b/src/main/java/org/elasticsearch/action/admin/indices/exists/TransportIndicesExistsAction.java
index 1bdf3d74c66..30b68140eb6 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/exists/TransportIndicesExistsAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/exists/TransportIndicesExistsAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -35,42 +35,50 @@ import org.elasticsearch.transport.TransportService;
/**
* Indices exists action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportIndicesExistsAction extends TransportMasterNodeOperationAction {
- @Inject public TransportIndicesExistsAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool) {
+ @Inject
+ public TransportIndicesExistsAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool) {
super(settings, transportService, clusterService, threadPool);
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.EXISTS;
}
- @Override protected IndicesExistsRequest newRequest() {
+ @Override
+ protected IndicesExistsRequest newRequest() {
return new IndicesExistsRequest();
}
- @Override protected IndicesExistsResponse newResponse() {
+ @Override
+ protected IndicesExistsResponse newResponse() {
return new IndicesExistsResponse();
}
- @Override protected void doExecute(IndicesExistsRequest request, ActionListener listener) {
+ @Override
+ protected void doExecute(IndicesExistsRequest request, ActionListener listener) {
// don't call this since it will throw IndexMissingException
//request.indices(clusterService.state().metaData().concreteIndices(request.indices()));
super.doExecute(request, listener);
}
- @Override protected ClusterBlockException checkBlock(IndicesExistsRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(IndicesExistsRequest request, ClusterState state) {
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, request.indices());
}
- @Override protected IndicesExistsResponse masterOperation(IndicesExistsRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected IndicesExistsResponse masterOperation(IndicesExistsRequest request, ClusterState state) throws ElasticSearchException {
boolean exists = true;
for (String index : request.indices()) {
if (!state.metaData().hasConcreteIndex(index)) {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java
index 7f4da8bfa84..41b3e53961f 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -30,10 +30,10 @@ import java.io.IOException;
* A flush request to flush one or more indices. The flush process of an index basically frees memory from the index
* by flushing data to the index storage and clearing the internal transaction log. By default, ElasticSearch uses
* memory heuristics in order to automatically trigger flush operations as required in order to clear memory.
- *
+ *
* Best created with {@link org.elasticsearch.client.Requests#flushRequest(String...)}.
*
- * @author kimchy (shay.banon)
+ *
* @see org.elasticsearch.client.Requests#flushRequest(String...)
* @see org.elasticsearch.client.IndicesAdminClient#flush(FlushRequest)
* @see FlushResponse
@@ -108,7 +108,8 @@ public class FlushRequest extends BroadcastOperationRequest {
/**
* Should the listener be called on a separate thread if needed.
*/
- @Override public FlushRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public FlushRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
@@ -116,19 +117,22 @@ public class FlushRequest extends BroadcastOperationRequest {
/**
* Controls the operation threading model.
*/
- @Override public FlushRequest operationThreading(BroadcastOperationThreading operationThreading) {
+ @Override
+ public FlushRequest operationThreading(BroadcastOperationThreading operationThreading) {
super.operationThreading(operationThreading);
return this;
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(refresh);
out.writeBoolean(full);
out.writeBoolean(force);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
refresh = in.readBoolean();
full = in.readBoolean();
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java
index f3a6fce085a..fdfb5b55ca5 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/flush/FlushResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -30,7 +30,7 @@ import java.util.List;
/**
* A response to flush action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class FlushResponse extends BroadcastOperationResponse {
@@ -42,11 +42,13 @@ public class FlushResponse extends BroadcastOperationResponse {
super(totalShards, successfulShards, failedShards, shardFailures);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushRequest.java
index 3104d72ad0b..1803b0cff77 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
class ShardFlushRequest extends BroadcastShardOperationRequest {
@@ -56,14 +56,16 @@ class ShardFlushRequest extends BroadcastShardOperationRequest {
return this.force;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
refresh = in.readBoolean();
full = in.readBoolean();
force = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(refresh);
out.writeBoolean(full);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushResponse.java
index c175e7b4669..e16729c9aae 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/flush/ShardFlushResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
class ShardFlushResponse extends BroadcastShardOperationResponse {
@@ -38,11 +38,13 @@ class ShardFlushResponse extends BroadcastShardOperationResponse {
super(index, shardId);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java b/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java
index d85ad209f3b..ac5d7dc093d 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -40,43 +40,50 @@ import org.elasticsearch.transport.TransportService;
import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
/**
* Flush Action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportFlushAction extends TransportBroadcastOperationAction {
private final IndicesService indicesService;
- @Inject public TransportFlushAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) {
+ @Inject
+ public TransportFlushAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.FLUSH;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/flush/shard";
}
- @Override protected FlushRequest newRequest() {
+ @Override
+ protected FlushRequest newRequest() {
return new FlushRequest();
}
- @Override protected boolean ignoreNonActiveExceptions() {
+ @Override
+ protected boolean ignoreNonActiveExceptions() {
return true;
}
- @Override protected FlushResponse newResponse(FlushRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
+ @Override
+ protected FlushResponse newResponse(FlushRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
int successfulShards = 0;
int failedShards = 0;
List shardFailures = null;
@@ -97,19 +104,23 @@ public class TransportFlushAction extends TransportBroadcastOperationAction {
private final IndicesService indicesService;
- @Inject public TransportGatewaySnapshotAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
- TransportService transportService, IndicesService indicesService) {
+ @Inject
+ public TransportGatewaySnapshotAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
+ TransportService transportService, IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.Gateway.SNAPSHOT;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/gateway/snapshot/shard";
}
- @Override protected GatewaySnapshotRequest newRequest() {
+ @Override
+ protected GatewaySnapshotRequest newRequest() {
return new GatewaySnapshotRequest();
}
- @Override protected boolean ignoreNonActiveExceptions() {
+ @Override
+ protected boolean ignoreNonActiveExceptions() {
return true;
}
- @Override protected GatewaySnapshotResponse newResponse(GatewaySnapshotRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
+ @Override
+ protected GatewaySnapshotResponse newResponse(GatewaySnapshotRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
int successfulShards = 0;
int failedShards = 0;
List shardFailures = null;
@@ -94,19 +101,23 @@ public class TransportGatewaySnapshotAction extends TransportBroadcastOperationA
return new GatewaySnapshotResponse(shardsResponses.length(), successfulShards, failedShards, shardFailures);
}
- @Override protected ShardGatewaySnapshotRequest newShardRequest() {
+ @Override
+ protected ShardGatewaySnapshotRequest newShardRequest() {
return new ShardGatewaySnapshotRequest();
}
- @Override protected ShardGatewaySnapshotRequest newShardRequest(ShardRouting shard, GatewaySnapshotRequest request) {
+ @Override
+ protected ShardGatewaySnapshotRequest newShardRequest(ShardRouting shard, GatewaySnapshotRequest request) {
return new ShardGatewaySnapshotRequest(shard.index(), shard.id());
}
- @Override protected ShardGatewaySnapshotResponse newShardResponse() {
+ @Override
+ protected ShardGatewaySnapshotResponse newShardResponse() {
return new ShardGatewaySnapshotResponse();
}
- @Override protected ShardGatewaySnapshotResponse shardOperation(ShardGatewaySnapshotRequest request) throws ElasticSearchException {
+ @Override
+ protected ShardGatewaySnapshotResponse shardOperation(ShardGatewaySnapshotRequest request) throws ElasticSearchException {
IndexShardGatewayService shardGatewayService = indicesService.indexServiceSafe(request.index())
.shardInjectorSafe(request.shardId()).getInstance(IndexShardGatewayService.class);
shardGatewayService.snapshot("api");
@@ -116,7 +127,8 @@ public class TransportGatewaySnapshotAction extends TransportBroadcastOperationA
/**
* The snapshot request works against all primary shards.
*/
- @Override protected GroupShardsIterator shards(GatewaySnapshotRequest request, String[] concreteIndices, ClusterState clusterState) {
+ @Override
+ protected GroupShardsIterator shards(GatewaySnapshotRequest request, String[] concreteIndices, ClusterState clusterState) {
return clusterState.routingTable().activePrimaryShardsGrouped(concreteIndices, true);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/package-info.java b/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/package-info.java
index 21204f16c89..d1d73b97c08 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/package-info.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/package-info.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/DeleteMappingRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/DeleteMappingRequest.java
index 603ac7c9f14..854c55359e5 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/DeleteMappingRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/DeleteMappingRequest.java
@@ -26,10 +26,10 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
-import static org.elasticsearch.action.Actions.*;
+import static org.elasticsearch.action.Actions.addValidationError;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class DeleteMappingRequest extends MasterNodeOperationRequest {
@@ -48,7 +48,8 @@ public class DeleteMappingRequest extends MasterNodeOperationRequest {
this.indices = indices;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (mappingType == null) {
validationException = addValidationError("mapping type is missing", validationException);
@@ -86,7 +87,8 @@ public class DeleteMappingRequest extends MasterNodeOperationRequest {
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = new String[in.readVInt()];
for (int i = 0; i < indices.length; i++) {
@@ -97,7 +99,8 @@ public class DeleteMappingRequest extends MasterNodeOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (indices == null) {
out.writeVInt(0);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/DeleteMappingResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/DeleteMappingResponse.java
index 85c63ab47a0..7823b00a738 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/DeleteMappingResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/DeleteMappingResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* The response of remove mapping operation.
*
- * @author kimchy (shay.banon)
+ *
*/
public class DeleteMappingResponse implements ActionResponse, Streamable {
@@ -37,9 +37,11 @@ public class DeleteMappingResponse implements ActionResponse, Streamable {
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/TransportDeleteMappingAction.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/TransportDeleteMappingAction.java
index a28ca784122..09639790c27 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/TransportDeleteMappingAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/delete/TransportDeleteMappingAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -46,7 +46,7 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Delete mapping action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportDeleteMappingAction extends TransportMasterNodeOperationAction {
@@ -56,61 +56,73 @@ public class TransportDeleteMappingAction extends TransportMasterNodeOperationAc
private final TransportRefreshAction refreshAction;
- @Inject public TransportDeleteMappingAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataMappingService metaDataMappingService,
- TransportDeleteByQueryAction deleteByQueryAction, TransportRefreshAction refreshAction) {
+ @Inject
+ public TransportDeleteMappingAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataMappingService metaDataMappingService,
+ TransportDeleteByQueryAction deleteByQueryAction, TransportRefreshAction refreshAction) {
super(settings, transportService, clusterService, threadPool);
this.metaDataMappingService = metaDataMappingService;
this.deleteByQueryAction = deleteByQueryAction;
this.refreshAction = refreshAction;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.Mapping.DELETE;
}
- @Override protected DeleteMappingRequest newRequest() {
+ @Override
+ protected DeleteMappingRequest newRequest() {
return new DeleteMappingRequest();
}
- @Override protected DeleteMappingResponse newResponse() {
+ @Override
+ protected DeleteMappingResponse newResponse() {
return new DeleteMappingResponse();
}
- @Override protected void doExecute(DeleteMappingRequest request, ActionListener listener) {
+ @Override
+ protected void doExecute(DeleteMappingRequest request, ActionListener listener) {
// update to concrete indices
request.indices(clusterService.state().metaData().concreteIndices(request.indices()));
super.doExecute(request, listener);
}
- @Override protected ClusterBlockException checkBlock(DeleteMappingRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(DeleteMappingRequest request, ClusterState state) {
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, request.indices());
}
- @Override protected DeleteMappingResponse masterOperation(final DeleteMappingRequest request, final ClusterState state) throws ElasticSearchException {
+ @Override
+ protected DeleteMappingResponse masterOperation(final DeleteMappingRequest request, final ClusterState state) throws ElasticSearchException {
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
deleteByQueryAction.execute(Requests.deleteByQueryRequest(request.indices()).query(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), FilterBuilders.typeFilter(request.type()))), new ActionListener() {
- @Override public void onResponse(DeleteByQueryResponse deleteByQueryResponse) {
+ @Override
+ public void onResponse(DeleteByQueryResponse deleteByQueryResponse) {
refreshAction.execute(Requests.refreshRequest(request.indices()), new ActionListener() {
- @Override public void onResponse(RefreshResponse refreshResponse) {
+ @Override
+ public void onResponse(RefreshResponse refreshResponse) {
metaDataMappingService.removeMapping(new MetaDataMappingService.RemoveRequest(request.indices(), request.type()));
latch.countDown();
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
metaDataMappingService.removeMapping(new MetaDataMappingService.RemoveRequest(request.indices(), request.type()));
latch.countDown();
}
});
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
failureRef.set(e);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/package-info.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/package-info.java
index 0676efde518..f660d504489 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/package-info.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/package-info.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java
index 88f67d149ea..400427b0b83 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingRequest.java
@@ -35,18 +35,18 @@ import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.unit.TimeValue.*;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
/**
* Puts mapping definition registered under a specific type into one or more indices. Best created with
* {@link org.elasticsearch.client.Requests#putMappingRequest(String...)}.
- *
+ *
* If the mappings already exists, the new mappings will be merged with the new one. If there are elements
* that can't be merged are detected, the request will be rejected unless the {@link #ignoreConflicts(boolean)}
* is set. In such a case, the duplicate mappings will be rejected.
*
- * @author kimchy (shay.banon)
+ *
* @see org.elasticsearch.client.Requests#putMappingRequest(String...)
* @see org.elasticsearch.client.IndicesAdminClient#putMapping(PutMappingRequest)
* @see PutMappingResponse
@@ -74,7 +74,8 @@ public class PutMappingRequest extends MasterNodeOperationRequest {
this.indices = indices;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (mappingType == null) {
validationException = addValidationError("mapping type is missing", validationException);
@@ -110,7 +111,8 @@ public class PutMappingRequest extends MasterNodeOperationRequest {
/**
* The type of the mappings.
*/
- @Required public PutMappingRequest type(String mappingType) {
+ @Required
+ public PutMappingRequest type(String mappingType) {
this.mappingType = mappingType;
return this;
}
@@ -125,7 +127,8 @@ public class PutMappingRequest extends MasterNodeOperationRequest {
/**
* The mapping source definition.
*/
- @Required public PutMappingRequest source(XContentBuilder mappingBuilder) {
+ @Required
+ public PutMappingRequest source(XContentBuilder mappingBuilder) {
try {
return source(mappingBuilder.string());
} catch (IOException e) {
@@ -136,7 +139,8 @@ public class PutMappingRequest extends MasterNodeOperationRequest {
/**
* The mapping source definition.
*/
- @Required public PutMappingRequest source(Map mappingSource) {
+ @Required
+ public PutMappingRequest source(Map mappingSource) {
try {
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
builder.map(mappingSource);
@@ -149,7 +153,8 @@ public class PutMappingRequest extends MasterNodeOperationRequest {
/**
* The mapping source definition.
*/
- @Required public PutMappingRequest source(String mappingSource) {
+ @Required
+ public PutMappingRequest source(String mappingSource) {
this.mappingSource = mappingSource;
return this;
}
@@ -198,7 +203,8 @@ public class PutMappingRequest extends MasterNodeOperationRequest {
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = new String[in.readVInt()];
for (int i = 0; i < indices.length; i++) {
@@ -212,7 +218,8 @@ public class PutMappingRequest extends MasterNodeOperationRequest {
ignoreConflicts = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (indices == null) {
out.writeVInt(0);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingResponse.java
index 9dcaec0d8ff..fad38492cfb 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/PutMappingResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* The response of put mapping operation.
*
- * @author kimchy (shay.banon)
+ *
*/
public class PutMappingResponse implements ActionResponse, Streamable {
@@ -59,11 +59,13 @@ public class PutMappingResponse implements ActionResponse, Streamable {
return acknowledged();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
acknowledged = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(acknowledged);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/TransportPutMappingAction.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/TransportPutMappingAction.java
index 6091daaa081..666465dd723 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/TransportPutMappingAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/TransportPutMappingAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -39,44 +39,52 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Put mapping action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportPutMappingAction extends TransportMasterNodeOperationAction {
private final MetaDataMappingService metaDataMappingService;
- @Inject public TransportPutMappingAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataMappingService metaDataMappingService) {
+ @Inject
+ public TransportPutMappingAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataMappingService metaDataMappingService) {
super(settings, transportService, clusterService, threadPool);
this.metaDataMappingService = metaDataMappingService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.Mapping.PUT;
}
- @Override protected PutMappingRequest newRequest() {
+ @Override
+ protected PutMappingRequest newRequest() {
return new PutMappingRequest();
}
- @Override protected PutMappingResponse newResponse() {
+ @Override
+ protected PutMappingResponse newResponse() {
return new PutMappingResponse();
}
- @Override protected void doExecute(PutMappingRequest request, ActionListener listener) {
+ @Override
+ protected void doExecute(PutMappingRequest request, ActionListener listener) {
request.indices(clusterService.state().metaData().concreteIndices(request.indices()));
super.doExecute(request, listener);
}
- @Override protected ClusterBlockException checkBlock(PutMappingRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(PutMappingRequest request, ClusterState state) {
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, request.indices());
}
- @Override protected PutMappingResponse masterOperation(PutMappingRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected PutMappingResponse masterOperation(PutMappingRequest request, ClusterState state) throws ElasticSearchException {
ClusterState clusterState = clusterService.state();
// update to concrete indices
@@ -86,12 +94,14 @@ public class TransportPutMappingAction extends TransportMasterNodeOperationActio
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
metaDataMappingService.putMapping(new MetaDataMappingService.PutRequest(request.indices(), request.type(), request.source()).ignoreConflicts(request.ignoreConflicts()).timeout(request.timeout()), new MetaDataMappingService.Listener() {
- @Override public void onResponse(MetaDataMappingService.Response response) {
+ @Override
+ public void onResponse(MetaDataMappingService.Response response) {
responseRef.set(new PutMappingResponse(response.acknowledged()));
latch.countDown();
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/package-info.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/package-info.java
index 93d8886da1b..b59faa59aef 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/package-info.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/put/package-info.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexRequest.java
index 2052fcb7e93..d9bdd78710e 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,13 +27,14 @@ import org.elasticsearch.common.unit.TimeValue;
import java.io.IOException;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.unit.TimeValue.*;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
+import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
/**
* A request to open an index.
*
- * @author kimchy (shay.banon)
+ *
*/
public class OpenIndexRequest extends MasterNodeOperationRequest {
@@ -51,7 +52,8 @@ public class OpenIndexRequest extends MasterNodeOperationRequest {
this.index = index;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (index == null) {
validationException = addValidationError("index is missing", validationException);
@@ -91,13 +93,15 @@ public class OpenIndexRequest extends MasterNodeOperationRequest {
return timeout(TimeValue.parseTimeValue(timeout, null));
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
index = in.readUTF();
timeout = readTimeValue(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(index);
timeout.writeTo(out);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponse.java
index 4c928bdd6a3..a0a7cb78610 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/open/OpenIndexResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* A response for a open index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class OpenIndexResponse implements ActionResponse, Streamable {
@@ -50,11 +50,13 @@ public class OpenIndexResponse implements ActionResponse, Streamable {
return acknowledged();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
acknowledged = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(acknowledged);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java b/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java
index b2604b8f409..5dd400ce6c6 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/open/TransportOpenIndexAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -38,49 +38,58 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Delete index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportOpenIndexAction extends TransportMasterNodeOperationAction {
private final MetaDataStateIndexService stateIndexService;
- @Inject public TransportOpenIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataStateIndexService stateIndexService) {
+ @Inject
+ public TransportOpenIndexAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataStateIndexService stateIndexService) {
super(settings, transportService, clusterService, threadPool);
this.stateIndexService = stateIndexService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.OPEN;
}
- @Override protected OpenIndexRequest newRequest() {
+ @Override
+ protected OpenIndexRequest newRequest() {
return new OpenIndexRequest();
}
- @Override protected OpenIndexResponse newResponse() {
+ @Override
+ protected OpenIndexResponse newResponse() {
return new OpenIndexResponse();
}
- @Override protected ClusterBlockException checkBlock(OpenIndexRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(OpenIndexRequest request, ClusterState state) {
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, request.index());
}
- @Override protected OpenIndexResponse masterOperation(OpenIndexRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected OpenIndexResponse masterOperation(OpenIndexRequest request, ClusterState state) throws ElasticSearchException {
final AtomicReference responseRef = new AtomicReference();
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
stateIndexService.openIndex(new MetaDataStateIndexService.Request(request.index()).timeout(request.timeout()), new MetaDataStateIndexService.Listener() {
- @Override public void onResponse(MetaDataStateIndexService.Response response) {
+ @Override
+ public void onResponse(MetaDataStateIndexService.Response response) {
responseRef.set(new OpenIndexResponse(response.acknowledged()));
latch.countDown();
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java
index 5aa558cae32..b488681364d 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,14 +29,14 @@ import java.io.IOException;
/**
* A request to optimize one or more indices. In order to optimize on all the indices, pass an empty array or
* null for the indices.
- *
+ *
* {@link #waitForMerge(boolean)} allows to control if the call will block until the optimize completes and
* defaults to true.
- *
+ *
* {@link #maxNumSegments(int)} allows to control the number of segments to optimize down to. By default, will
* cause the optimize process to optimize down to half the configured number of segments.
*
- * @author kimchy (shay.banon)
+ *
* @see org.elasticsearch.client.Requests#optimizeRequest(String...)
* @see org.elasticsearch.client.IndicesAdminClient#optimize(OptimizeRequest)
* @see OptimizeResponse
@@ -76,12 +76,14 @@ public class OptimizeRequest extends BroadcastOperationRequest {
}
- @Override public OptimizeRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public OptimizeRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
- @Override public OptimizeRequest operationThreading(BroadcastOperationThreading operationThreading) {
+ @Override
+ public OptimizeRequest operationThreading(BroadcastOperationThreading operationThreading) {
super.operationThreading(operationThreading);
return this;
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeResponse.java
index 0817fb0e18e..27c76888f14 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -30,7 +30,7 @@ import java.util.List;
/**
* A response for optimize action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class OptimizeResponse extends BroadcastOperationResponse {
@@ -42,11 +42,13 @@ public class OptimizeResponse extends BroadcastOperationResponse {
super(totalShards, successfulShards, failedShards, shardFailures);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeRequest.java
index a33d0bc543e..b847709b344 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
class ShardOptimizeRequest extends BroadcastShardOperationRequest {
@@ -72,7 +72,8 @@ class ShardOptimizeRequest extends BroadcastShardOperationRequest {
return refresh;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
waitForMerge = in.readBoolean();
maxNumSegments = in.readInt();
@@ -81,7 +82,8 @@ class ShardOptimizeRequest extends BroadcastShardOperationRequest {
refresh = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(waitForMerge);
out.writeInt(maxNumSegments);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeResponse.java
index 5b43e62e82a..b5dbaa98ffb 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/optimize/ShardOptimizeResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
class ShardOptimizeResponse extends BroadcastShardOperationResponse {
@@ -37,11 +37,13 @@ class ShardOptimizeResponse extends BroadcastShardOperationResponse {
super(index, shardId);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java b/src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java
index 4703e13f504..53b623327d9 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -40,12 +40,12 @@ import org.elasticsearch.transport.TransportService;
import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
/**
* Optimize index/indices action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportOptimizeAction extends TransportBroadcastOperationAction {
@@ -53,33 +53,40 @@ public class TransportOptimizeAction extends TransportBroadcastOperationAction shardFailures = null;
@@ -100,19 +107,23 @@ public class TransportOptimizeAction extends TransportBroadcastOperationAction {
private final IndicesService indicesService;
- @Inject public TransportRefreshAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
- TransportService transportService, IndicesService indicesService) {
+ @Inject
+ public TransportRefreshAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
+ TransportService transportService, IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.REFRESH;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/refresh/shard";
}
- @Override protected RefreshRequest newRequest() {
+ @Override
+ protected RefreshRequest newRequest() {
return new RefreshRequest();
}
- @Override protected boolean ignoreNonActiveExceptions() {
+ @Override
+ protected boolean ignoreNonActiveExceptions() {
return true;
}
- @Override protected boolean ignoreException(Throwable t) {
+ @Override
+ protected boolean ignoreException(Throwable t) {
Throwable actual = ExceptionsHelper.unwrapCause(t);
if (actual instanceof IllegalIndexShardStateException) {
return true;
@@ -91,7 +98,8 @@ public class TransportRefreshAction extends TransportBroadcastOperationAction shardFailures = null;
@@ -112,19 +120,23 @@ public class TransportRefreshAction extends TransportBroadcastOperationAction {
return shards();
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return indexShards.values().iterator();
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/segments/IndexShardSegments.java b/src/main/java/org/elasticsearch/action/admin/indices/segments/IndexShardSegments.java
index e75cea1954b..b971d072c0b 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/segments/IndexShardSegments.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/segments/IndexShardSegments.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,7 +19,7 @@
package org.elasticsearch.action.admin.indices.segments;
-import org.elasticsearch.common.collect.Iterators;
+import com.google.common.collect.Iterators;
import org.elasticsearch.index.shard.ShardId;
import java.util.Iterator;
@@ -55,7 +55,8 @@ public class IndexShardSegments implements Iterable {
return this.shards;
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return Iterators.forArray(shards);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java
index c36f0cacdd0..28422b0e9ea 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.indices.segments;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
import org.elasticsearch.action.ShardOperationFailedException;
import org.elasticsearch.action.support.broadcast.BroadcastOperationResponse;
import org.elasticsearch.cluster.ClusterState;
-import org.elasticsearch.common.collect.Lists;
-import org.elasticsearch.common.collect.Maps;
-import org.elasticsearch.common.collect.Sets;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ToXContent;
@@ -81,7 +81,8 @@ public class IndicesSegmentResponse extends BroadcastOperationResponse implement
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shards = new ShardSegments[in.readVInt()];
for (int i = 0; i < shards.length; i++) {
@@ -89,7 +90,8 @@ public class IndicesSegmentResponse extends BroadcastOperationResponse implement
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(shards.length);
for (ShardSegments shard : shards) {
@@ -97,7 +99,8 @@ public class IndicesSegmentResponse extends BroadcastOperationResponse implement
}
}
- @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
+ @Override
+ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject(Fields.INDICES);
for (IndexSegments indexSegments : indices().values()) {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java
index 901758095c4..43565ef7031 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/segments/IndicesSegmentsRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/segments/ShardSegments.java b/src/main/java/org/elasticsearch/action/admin/indices/segments/ShardSegments.java
index a96660077f1..33baa5bc629 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/segments/ShardSegments.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/segments/ShardSegments.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.segments;
+import com.google.common.collect.ImmutableList;
import org.elasticsearch.action.support.broadcast.BroadcastShardOperationResponse;
import org.elasticsearch.cluster.routing.ShardRouting;
-import org.elasticsearch.common.collect.ImmutableList;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.index.engine.Segment;
@@ -31,7 +31,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import static org.elasticsearch.cluster.routing.ImmutableShardRouting.*;
+import static org.elasticsearch.cluster.routing.ImmutableShardRouting.readShardRoutingEntry;
public class ShardSegments extends BroadcastShardOperationResponse implements Iterable {
@@ -48,7 +48,8 @@ public class ShardSegments extends BroadcastShardOperationResponse implements It
this.segments = segments;
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return segments.iterator();
}
@@ -94,7 +95,8 @@ public class ShardSegments extends BroadcastShardOperationResponse implements It
return shard;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shardRouting = readShardRoutingEntry(in);
int size = in.readVInt();
@@ -108,7 +110,8 @@ public class ShardSegments extends BroadcastShardOperationResponse implements It
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
shardRouting.writeTo(out);
out.writeVInt(segments.size());
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java b/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java
index 66b5104a2fd..07d7fee2375 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -44,49 +44,57 @@ import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportIndicesSegmentsAction extends TransportBroadcastOperationAction {
private final IndicesService indicesService;
- @Inject public TransportIndicesSegmentsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
- IndicesService indicesService) {
+ @Inject
+ public TransportIndicesSegmentsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
+ IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.SEGMENTS;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/segments/shard";
}
- @Override protected IndicesSegmentsRequest newRequest() {
+ @Override
+ protected IndicesSegmentsRequest newRequest() {
return new IndicesSegmentsRequest();
}
- @Override protected boolean ignoreNonActiveExceptions() {
+ @Override
+ protected boolean ignoreNonActiveExceptions() {
return true;
}
/**
* Segments goes across *all* active shards.
*/
- @Override protected GroupShardsIterator shards(IndicesSegmentsRequest request, String[] concreteIndices, ClusterState clusterState) {
+ @Override
+ protected GroupShardsIterator shards(IndicesSegmentsRequest request, String[] concreteIndices, ClusterState clusterState) {
return clusterState.routingTable().allActiveShardsGrouped(concreteIndices, true);
}
- @Override protected IndicesSegmentResponse newResponse(IndicesSegmentsRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
+ @Override
+ protected IndicesSegmentResponse newResponse(IndicesSegmentsRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
int successfulShards = 0;
int failedShards = 0;
List shardFailures = null;
@@ -109,19 +117,23 @@ public class TransportIndicesSegmentsAction extends TransportBroadcastOperationA
return new IndicesSegmentResponse(shards.toArray(new ShardSegments[shards.size()]), clusterState, shardsResponses.length(), successfulShards, failedShards, shardFailures);
}
- @Override protected IndexShardSegmentRequest newShardRequest() {
+ @Override
+ protected IndexShardSegmentRequest newShardRequest() {
return new IndexShardSegmentRequest();
}
- @Override protected IndexShardSegmentRequest newShardRequest(ShardRouting shard, IndicesSegmentsRequest request) {
+ @Override
+ protected IndexShardSegmentRequest newShardRequest(ShardRouting shard, IndicesSegmentsRequest request) {
return new IndexShardSegmentRequest(shard.index(), shard.id(), request);
}
- @Override protected ShardSegments newShardResponse() {
+ @Override
+ protected ShardSegments newShardResponse() {
return new ShardSegments();
}
- @Override protected ShardSegments shardOperation(IndexShardSegmentRequest request) throws ElasticSearchException {
+ @Override
+ protected ShardSegments shardOperation(IndexShardSegmentRequest request) throws ElasticSearchException {
InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(request.shardId());
return new ShardSegments(indexShard.routingEntry(), indexShard.engine().segments());
@@ -136,11 +148,13 @@ public class TransportIndicesSegmentsAction extends TransportBroadcastOperationA
super(index, shardId);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/settings/TransportUpdateSettingsAction.java b/src/main/java/org/elasticsearch/action/admin/indices/settings/TransportUpdateSettingsAction.java
index 7fdf438356a..99b7de6cba2 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/settings/TransportUpdateSettingsAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/settings/TransportUpdateSettingsAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -34,44 +34,52 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportUpdateSettingsAction extends TransportMasterNodeOperationAction {
private final MetaDataUpdateSettingsService updateSettingsService;
- @Inject public TransportUpdateSettingsAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
- MetaDataUpdateSettingsService updateSettingsService) {
+ @Inject
+ public TransportUpdateSettingsAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
+ MetaDataUpdateSettingsService updateSettingsService) {
super(settings, transportService, clusterService, threadPool);
this.updateSettingsService = updateSettingsService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.UPDATE_SETTINGS;
}
- @Override protected UpdateSettingsRequest newRequest() {
+ @Override
+ protected UpdateSettingsRequest newRequest() {
return new UpdateSettingsRequest();
}
- @Override protected UpdateSettingsResponse newResponse() {
+ @Override
+ protected UpdateSettingsResponse newResponse() {
return new UpdateSettingsResponse();
}
- @Override protected UpdateSettingsResponse masterOperation(UpdateSettingsRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected UpdateSettingsResponse masterOperation(UpdateSettingsRequest request, ClusterState state) throws ElasticSearchException {
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
updateSettingsService.updateSettings(request.settings(), request.indices(), new MetaDataUpdateSettingsService.Listener() {
- @Override public void onSuccess() {
+ @Override
+ public void onSuccess() {
latch.countDown();
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/settings/UpdateSettingsRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/settings/UpdateSettingsRequest.java
index e8c091d75ac..149fcf4d446 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/settings/UpdateSettingsRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/settings/UpdateSettingsRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -33,12 +33,13 @@ import org.elasticsearch.common.xcontent.XContentType;
import java.io.IOException;
import java.util.Map;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.settings.ImmutableSettings.Builder.*;
-import static org.elasticsearch.common.settings.ImmutableSettings.*;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS;
+import static org.elasticsearch.common.settings.ImmutableSettings.readSettingsFromStream;
+import static org.elasticsearch.common.settings.ImmutableSettings.writeSettingsToStream;
/**
- * @author kimchy
+ *
*/
public class UpdateSettingsRequest extends MasterNodeOperationRequest {
@@ -64,7 +65,8 @@ public class UpdateSettingsRequest extends MasterNodeOperationRequest {
this.settings = settings;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (settings.getAsMap().isEmpty()) {
validationException = addValidationError("no settings to update", validationException);
@@ -123,7 +125,8 @@ public class UpdateSettingsRequest extends MasterNodeOperationRequest {
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
indices = new String[in.readVInt()];
for (int i = 0; i < indices.length; i++) {
@@ -132,7 +135,8 @@ public class UpdateSettingsRequest extends MasterNodeOperationRequest {
settings = readSettingsFromStream(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (indices == null) {
out.writeVInt(0);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/settings/UpdateSettingsResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/settings/UpdateSettingsResponse.java
index f84645f292e..5f86c98fba5 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/settings/UpdateSettingsResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/settings/UpdateSettingsResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,16 +29,18 @@ import java.io.IOException;
/**
* A response for a update settings action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class UpdateSettingsResponse implements ActionResponse, Streamable {
UpdateSettingsResponse() {
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java b/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
index 3c7abd733a4..a95fa74957a 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -40,21 +40,29 @@ import java.io.IOException;
*/
public class CommonStats implements Streamable, ToXContent {
- @Nullable DocsStats docs;
+ @Nullable
+ DocsStats docs;
- @Nullable StoreStats store;
+ @Nullable
+ StoreStats store;
- @Nullable IndexingStats indexing;
+ @Nullable
+ IndexingStats indexing;
- @Nullable GetStats get;
+ @Nullable
+ GetStats get;
- @Nullable SearchStats search;
+ @Nullable
+ SearchStats search;
- @Nullable MergeStats merge;
+ @Nullable
+ MergeStats merge;
- @Nullable RefreshStats refresh;
+ @Nullable
+ RefreshStats refresh;
- @Nullable FlushStats flush;
+ @Nullable
+ FlushStats flush;
public void add(CommonStats stats) {
if (docs == null) {
@@ -123,67 +131,83 @@ public class CommonStats implements Streamable, ToXContent {
}
}
- @Nullable public DocsStats docs() {
+ @Nullable
+ public DocsStats docs() {
return this.docs;
}
- @Nullable public DocsStats getDocs() {
+ @Nullable
+ public DocsStats getDocs() {
return this.docs;
}
- @Nullable public StoreStats store() {
+ @Nullable
+ public StoreStats store() {
return store;
}
- @Nullable public StoreStats getStore() {
+ @Nullable
+ public StoreStats getStore() {
return store;
}
- @Nullable public IndexingStats indexing() {
+ @Nullable
+ public IndexingStats indexing() {
return indexing;
}
- @Nullable public IndexingStats getIndexing() {
+ @Nullable
+ public IndexingStats getIndexing() {
return indexing;
}
- @Nullable public GetStats get() {
+ @Nullable
+ public GetStats get() {
return get;
}
- @Nullable public GetStats getGet() {
+ @Nullable
+ public GetStats getGet() {
return get;
}
- @Nullable public SearchStats search() {
+ @Nullable
+ public SearchStats search() {
return search;
}
- @Nullable public SearchStats getSearch() {
+ @Nullable
+ public SearchStats getSearch() {
return search;
}
- @Nullable public MergeStats merge() {
+ @Nullable
+ public MergeStats merge() {
return merge;
}
- @Nullable public MergeStats getMerge() {
+ @Nullable
+ public MergeStats getMerge() {
return merge;
}
- @Nullable public RefreshStats refresh() {
+ @Nullable
+ public RefreshStats refresh() {
return refresh;
}
- @Nullable public RefreshStats getRefresh() {
+ @Nullable
+ public RefreshStats getRefresh() {
return refresh;
}
- @Nullable public FlushStats flush() {
+ @Nullable
+ public FlushStats flush() {
return flush;
}
- @Nullable public FlushStats getFlush() {
+ @Nullable
+ public FlushStats getFlush() {
return flush;
}
@@ -193,7 +217,8 @@ public class CommonStats implements Streamable, ToXContent {
return stats;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
if (in.readBoolean()) {
docs = DocsStats.readDocStats(in);
}
@@ -220,7 +245,8 @@ public class CommonStats implements Streamable, ToXContent {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
if (docs == null) {
out.writeBoolean(false);
} else {
@@ -272,7 +298,8 @@ public class CommonStats implements Streamable, ToXContent {
}
// note, requires a wrapping object
- @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
+ @Override
+ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
if (docs != null) {
docs.toXContent(builder, params);
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/stats/IndexShardStats.java b/src/main/java/org/elasticsearch/action/admin/indices/stats/IndexShardStats.java
index 5771d29fa81..f32f2b83742 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/stats/IndexShardStats.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/stats/IndexShardStats.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,7 +19,7 @@
package org.elasticsearch.action.admin.indices.stats;
-import org.elasticsearch.common.collect.Iterators;
+import com.google.common.collect.Iterators;
import org.elasticsearch.index.shard.ShardId;
import java.util.Iterator;
@@ -57,7 +57,8 @@ public class IndexShardStats implements Iterable {
return shards[position];
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return Iterators.forArray(shards);
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/stats/IndexStats.java b/src/main/java/org/elasticsearch/action/admin/indices/stats/IndexStats.java
index 0578d1b90f1..691fdfb129b 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/stats/IndexStats.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/stats/IndexStats.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,8 +19,8 @@
package org.elasticsearch.action.admin.indices.stats;
-import org.elasticsearch.common.collect.Lists;
-import org.elasticsearch.common.collect.Maps;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
import java.util.Iterator;
import java.util.List;
@@ -69,7 +69,8 @@ public class IndexStats implements Iterable {
return indexShards;
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return indexShards().values().iterator();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStats.java b/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStats.java
index 66809ea406d..262b873b01a 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStats.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStats.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.indices.stats;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
import org.elasticsearch.action.ShardOperationFailedException;
import org.elasticsearch.action.support.broadcast.BroadcastOperationResponse;
import org.elasticsearch.cluster.ClusterState;
-import org.elasticsearch.common.collect.Lists;
-import org.elasticsearch.common.collect.Maps;
-import org.elasticsearch.common.collect.Sets;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ToXContent;
@@ -135,7 +135,8 @@ public class IndicesStats extends BroadcastOperationResponse implements ToXConte
return stats;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shards = new ShardStats[in.readVInt()];
for (int i = 0; i < shards.length; i++) {
@@ -143,7 +144,8 @@ public class IndicesStats extends BroadcastOperationResponse implements ToXConte
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(shards.length);
for (ShardStats shard : shards) {
@@ -151,7 +153,8 @@ public class IndicesStats extends BroadcastOperationResponse implements ToXConte
}
}
- @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
+ @Override
+ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject("_all");
builder.startObject("primaries");
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsRequest.java
index cc58ffbcd96..f594d52ea58 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/stats/IndicesStatsRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,10 +27,10 @@ import java.io.IOException;
/**
* A request to get indices level stats. Allow to enable different stats to be returned.
- *
+ *
* By default, the {@link #docs(boolean)}, {@link #store(boolean)}, {@link #indexing(boolean)}
* are enabled. Other stats can be enabled as well.
- *
+ *
* All the stats to be returned can be cleared using {@link #clear()}, at which point, specific
* stats can be enabled.
*/
@@ -171,7 +171,8 @@ public class IndicesStatsRequest extends BroadcastOperationRequest {
return this.flush;
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(docs);
out.writeBoolean(store);
@@ -199,7 +200,8 @@ public class IndicesStatsRequest extends BroadcastOperationRequest {
}
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
docs = in.readBoolean();
store = in.readBoolean();
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java b/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java
index 09564160568..dc437931d35 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/stats/ShardStats.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
-import static org.elasticsearch.cluster.routing.ImmutableShardRouting.*;
+import static org.elasticsearch.cluster.routing.ImmutableShardRouting.readShardRoutingEntry;
/**
*/
@@ -73,13 +73,15 @@ public class ShardStats extends BroadcastShardOperationResponse {
return stats;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shardRouting = readShardRoutingEntry(in);
stats = CommonStats.readCommonStats(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
shardRouting.writeTo(out);
stats.writeTo(out);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java b/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java
index b2841953f52..aaec96d5eaf 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/stats/TransportIndicesStatsAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,6 +19,7 @@
package org.elasticsearch.action.admin.indices.stats;
+import com.google.common.collect.Lists;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.ShardOperationFailedException;
import org.elasticsearch.action.TransportActions;
@@ -30,7 +31,6 @@ import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.routing.GroupShardsIterator;
import org.elasticsearch.cluster.routing.ShardRouting;
-import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -45,7 +45,7 @@ import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
/**
*/
@@ -53,40 +53,48 @@ public class TransportIndicesStatsAction extends TransportBroadcastOperationActi
private final IndicesService indicesService;
- @Inject public TransportIndicesStatsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
- IndicesService indicesService) {
+ @Inject
+ public TransportIndicesStatsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
+ IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.STATS;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/stats/shard";
}
- @Override protected IndicesStatsRequest newRequest() {
+ @Override
+ protected IndicesStatsRequest newRequest() {
return new IndicesStatsRequest();
}
- @Override protected boolean ignoreNonActiveExceptions() {
+ @Override
+ protected boolean ignoreNonActiveExceptions() {
return true;
}
/**
* Status goes across *all* shards.
*/
- @Override protected GroupShardsIterator shards(IndicesStatsRequest request, String[] concreteIndices, ClusterState clusterState) {
+ @Override
+ protected GroupShardsIterator shards(IndicesStatsRequest request, String[] concreteIndices, ClusterState clusterState) {
return clusterState.routingTable().allAssignedShardsGrouped(concreteIndices, true);
}
- @Override protected IndicesStats newResponse(IndicesStatsRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
+ @Override
+ protected IndicesStats newResponse(IndicesStatsRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
int successfulShards = 0;
int failedShards = 0;
List shardFailures = null;
@@ -109,19 +117,23 @@ public class TransportIndicesStatsAction extends TransportBroadcastOperationActi
return new IndicesStats(shards.toArray(new ShardStats[shards.size()]), clusterState, shardsResponses.length(), successfulShards, failedShards, shardFailures);
}
- @Override protected IndexShardStatsRequest newShardRequest() {
+ @Override
+ protected IndexShardStatsRequest newShardRequest() {
return new IndexShardStatsRequest();
}
- @Override protected IndexShardStatsRequest newShardRequest(ShardRouting shard, IndicesStatsRequest request) {
+ @Override
+ protected IndexShardStatsRequest newShardRequest(ShardRouting shard, IndicesStatsRequest request) {
return new IndexShardStatsRequest(shard.index(), shard.id(), request);
}
- @Override protected ShardStats newShardResponse() {
+ @Override
+ protected ShardStats newShardResponse() {
return new ShardStats();
}
- @Override protected ShardStats shardOperation(IndexShardStatsRequest request) throws ElasticSearchException {
+ @Override
+ protected ShardStats shardOperation(IndexShardStatsRequest request) throws ElasticSearchException {
InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(request.shardId());
ShardStats stats = new ShardStats(indexShard.routingEntry());
@@ -166,13 +178,15 @@ public class TransportIndicesStatsAction extends TransportBroadcastOperationActi
this.request = request;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
request = new IndicesStatsRequest();
request.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
request.writeTo(out);
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/DocsStatus.java b/src/main/java/org/elasticsearch/action/admin/indices/status/DocsStatus.java
index d6aa2c2a996..aca640c2799 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/DocsStatus.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/DocsStatus.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -20,7 +20,7 @@
package org.elasticsearch.action.admin.indices.status;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class DocsStatus {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/GatewayRecoveryStatus.java b/src/main/java/org/elasticsearch/action/admin/indices/status/GatewayRecoveryStatus.java
index 101b3bc8403..75b2e242f09 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/GatewayRecoveryStatus.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/GatewayRecoveryStatus.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class GatewayRecoveryStatus {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/GatewaySnapshotStatus.java b/src/main/java/org/elasticsearch/action/admin/indices/status/GatewaySnapshotStatus.java
index d6010c95469..1fe87a01466 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/GatewaySnapshotStatus.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/GatewaySnapshotStatus.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class GatewaySnapshotStatus {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/IndexShardStatus.java b/src/main/java/org/elasticsearch/action/admin/indices/status/IndexShardStatus.java
index a86a4e5167d..350df3615fe 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/IndexShardStatus.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/IndexShardStatus.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,7 +19,7 @@
package org.elasticsearch.action.admin.indices.status;
-import org.elasticsearch.common.collect.Iterators;
+import com.google.common.collect.Iterators;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.index.flush.FlushStats;
import org.elasticsearch.index.merge.MergeStats;
@@ -29,7 +29,7 @@ import org.elasticsearch.index.shard.ShardId;
import java.util.Iterator;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class IndexShardStatus implements Iterable {
@@ -207,7 +207,8 @@ public class IndexShardStatus implements Iterable {
return flushStats();
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return Iterators.forArray(shards);
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/IndexStatus.java b/src/main/java/org/elasticsearch/action/admin/indices/status/IndexStatus.java
index 3b85a28ce7c..ad3c26f6e00 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/IndexStatus.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/IndexStatus.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,7 +19,7 @@
package org.elasticsearch.action.admin.indices.status;
-import org.elasticsearch.common.collect.Maps;
+import com.google.common.collect.Maps;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.index.flush.FlushStats;
import org.elasticsearch.index.merge.MergeStats;
@@ -29,10 +29,10 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class IndexStatus implements Iterable {
@@ -215,7 +215,8 @@ public class IndexStatus implements Iterable {
return flushStats();
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return indexShards.values().iterator();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/IndicesStatusRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/status/IndicesStatusRequest.java
index e1e72939610..4483cd51960 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/IndicesStatusRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/IndicesStatusRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -28,7 +28,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class IndicesStatusRequest extends BroadcastOperationRequest {
@@ -68,22 +68,26 @@ public class IndicesStatusRequest extends BroadcastOperationRequest {
return this.snapshot;
}
- @Override public IndicesStatusRequest listenerThreaded(boolean listenerThreaded) {
+ @Override
+ public IndicesStatusRequest listenerThreaded(boolean listenerThreaded) {
super.listenerThreaded(listenerThreaded);
return this;
}
- @Override public BroadcastOperationRequest operationThreading(BroadcastOperationThreading operationThreading) {
+ @Override
+ public BroadcastOperationRequest operationThreading(BroadcastOperationThreading operationThreading) {
return super.operationThreading(operationThreading);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(recovery);
out.writeBoolean(snapshot);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
recovery = in.readBoolean();
snapshot = in.readBoolean();
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/IndicesStatusResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/status/IndicesStatusResponse.java
index 35318ed65af..3fa9470e790 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/IndicesStatusResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/IndicesStatusResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,11 +19,11 @@
package org.elasticsearch.action.admin.indices.status;
+import com.google.common.collect.Sets;
import org.elasticsearch.action.ShardOperationFailedException;
import org.elasticsearch.action.support.broadcast.BroadcastOperationResponse;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.common.Nullable;
-import org.elasticsearch.common.collect.Sets;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.SettingsFilter;
@@ -39,12 +39,12 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import static org.elasticsearch.action.admin.indices.status.ShardStatus.*;
-import static org.elasticsearch.common.collect.Lists.*;
-import static org.elasticsearch.common.collect.Maps.*;
+import static com.google.common.collect.Lists.newArrayList;
+import static com.google.common.collect.Maps.newHashMap;
+import static org.elasticsearch.action.admin.indices.status.ShardStatus.readIndexShardStatus;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class IndicesStatusResponse extends BroadcastOperationResponse implements ToXContent {
@@ -104,7 +104,8 @@ public class IndicesStatusResponse extends BroadcastOperationResponse implements
return indicesStatus;
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(shards().length);
for (ShardStatus status : shards()) {
@@ -112,7 +113,8 @@ public class IndicesStatusResponse extends BroadcastOperationResponse implements
}
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shards = new ShardStatus[in.readVInt()];
for (int i = 0; i < shards.length; i++) {
@@ -120,7 +122,8 @@ public class IndicesStatusResponse extends BroadcastOperationResponse implements
}
}
- @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
+ @Override
+ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return toXContent(builder, params, null);
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/PeerRecoveryStatus.java b/src/main/java/org/elasticsearch/action/admin/indices/status/PeerRecoveryStatus.java
index 4e361a3734e..38224b5e33e 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/PeerRecoveryStatus.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/PeerRecoveryStatus.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -24,7 +24,7 @@ import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class PeerRecoveryStatus {
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/ShardStatus.java b/src/main/java/org/elasticsearch/action/admin/indices/status/ShardStatus.java
index 4d16711d7c2..c905b777f7b 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/ShardStatus.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/ShardStatus.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -31,13 +31,13 @@ import org.elasticsearch.index.shard.IndexShardState;
import java.io.IOException;
-import static org.elasticsearch.cluster.routing.ImmutableShardRouting.*;
-import static org.elasticsearch.common.unit.ByteSizeValue.*;
+import static org.elasticsearch.cluster.routing.ImmutableShardRouting.readShardRoutingEntry;
+import static org.elasticsearch.common.unit.ByteSizeValue.readBytesSizeValue;
/**
* Shard instance (actual allocated shard) status.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ShardStatus extends BroadcastShardOperationResponse {
@@ -245,7 +245,8 @@ public class ShardStatus extends BroadcastShardOperationResponse {
return shardStatus;
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
shardRouting.writeTo(out);
out.writeByte(state.id());
@@ -322,7 +323,8 @@ public class ShardStatus extends BroadcastShardOperationResponse {
}
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shardRouting = readShardRoutingEntry(in);
state = IndexShardState.fromId(in.readByte());
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/status/TransportIndicesStatusAction.java b/src/main/java/org/elasticsearch/action/admin/indices/status/TransportIndicesStatusAction.java
index 0dad125120b..5646cba8db0 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/status/TransportIndicesStatusAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/status/TransportIndicesStatusAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -50,10 +50,10 @@ import java.io.IOException;
import java.util.List;
import java.util.concurrent.atomic.AtomicReferenceArray;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportIndicesStatusAction extends TransportBroadcastOperationAction {
@@ -61,41 +61,49 @@ public class TransportIndicesStatusAction extends TransportBroadcastOperationAct
private final RecoveryTarget peerRecoveryTarget;
- @Inject public TransportIndicesStatusAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
- IndicesService indicesService, RecoveryTarget peerRecoveryTarget) {
+ @Inject
+ public TransportIndicesStatusAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
+ IndicesService indicesService, RecoveryTarget peerRecoveryTarget) {
super(settings, threadPool, clusterService, transportService);
this.peerRecoveryTarget = peerRecoveryTarget;
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.STATUS;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/status/shard";
}
- @Override protected IndicesStatusRequest newRequest() {
+ @Override
+ protected IndicesStatusRequest newRequest() {
return new IndicesStatusRequest();
}
- @Override protected boolean ignoreNonActiveExceptions() {
+ @Override
+ protected boolean ignoreNonActiveExceptions() {
return true;
}
/**
* Status goes across *all* shards.
*/
- @Override protected GroupShardsIterator shards(IndicesStatusRequest request, String[] concreteIndices, ClusterState clusterState) {
+ @Override
+ protected GroupShardsIterator shards(IndicesStatusRequest request, String[] concreteIndices, ClusterState clusterState) {
return clusterState.routingTable().allAssignedShardsGrouped(concreteIndices, true);
}
- @Override protected IndicesStatusResponse newResponse(IndicesStatusRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
+ @Override
+ protected IndicesStatusResponse newResponse(IndicesStatusRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
int successfulShards = 0;
int failedShards = 0;
List shardFailures = null;
@@ -118,19 +126,23 @@ public class TransportIndicesStatusAction extends TransportBroadcastOperationAct
return new IndicesStatusResponse(shards.toArray(new ShardStatus[shards.size()]), clusterState, shardsResponses.length(), successfulShards, failedShards, shardFailures);
}
- @Override protected IndexShardStatusRequest newShardRequest() {
+ @Override
+ protected IndexShardStatusRequest newShardRequest() {
return new IndexShardStatusRequest();
}
- @Override protected IndexShardStatusRequest newShardRequest(ShardRouting shard, IndicesStatusRequest request) {
+ @Override
+ protected IndexShardStatusRequest newShardRequest(ShardRouting shard, IndicesStatusRequest request) {
return new IndexShardStatusRequest(shard.index(), shard.id(), request);
}
- @Override protected ShardStatus newShardResponse() {
+ @Override
+ protected ShardStatus newShardResponse() {
return new ShardStatus();
}
- @Override protected ShardStatus shardOperation(IndexShardStatusRequest request) throws ElasticSearchException {
+ @Override
+ protected ShardStatus shardOperation(IndexShardStatusRequest request) throws ElasticSearchException {
InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(request.shardId());
ShardStatus shardStatus = new ShardStatus(indexShard.routingEntry());
@@ -264,13 +276,15 @@ public class TransportIndicesStatusAction extends TransportBroadcastOperationAct
snapshot = request.snapshot();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
recovery = in.readBoolean();
snapshot = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeBoolean(recovery);
out.writeBoolean(snapshot);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java
index e4d862e758e..07d0e18b33e 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java
@@ -27,13 +27,14 @@ import org.elasticsearch.common.unit.TimeValue;
import java.io.IOException;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.unit.TimeValue.*;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
+import static org.elasticsearch.common.unit.TimeValue.timeValueSeconds;
/**
* A request to delete an index template.
*
- * @author kimchy (shay.banon)
+ *
*/
public class DeleteIndexTemplateRequest extends MasterNodeOperationRequest {
@@ -51,7 +52,8 @@ public class DeleteIndexTemplateRequest extends MasterNodeOperationRequest {
this.name = name;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (name == null) {
validationException = addValidationError("name is missing", validationException);
@@ -91,13 +93,15 @@ public class DeleteIndexTemplateRequest extends MasterNodeOperationRequest {
return timeout(TimeValue.parseTimeValue(timeout, null));
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
name = in.readUTF();
timeout = readTimeValue(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(name);
timeout.writeTo(out);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateResponse.java
index 968b36166ff..d6c56ec8c24 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/template/delete/DeleteIndexTemplateResponse.java
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* A response for a delete index template.
*
- * @author kimchy (shay.banon)
+ *
*/
public class DeleteIndexTemplateResponse implements ActionResponse, Streamable {
@@ -50,11 +50,13 @@ public class DeleteIndexTemplateResponse implements ActionResponse, Streamable {
return acknowledged();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
acknowledged = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(acknowledged);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java b/src/main/java/org/elasticsearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java
index 89879942987..2ac0a23aa1c 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java
@@ -38,50 +38,59 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Delete index action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportDeleteIndexTemplateAction extends TransportMasterNodeOperationAction {
private final MetaDataIndexTemplateService indexTemplateService;
- @Inject public TransportDeleteIndexTemplateAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataIndexTemplateService indexTemplateService) {
+ @Inject
+ public TransportDeleteIndexTemplateAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataIndexTemplateService indexTemplateService) {
super(settings, transportService, clusterService, threadPool);
this.indexTemplateService = indexTemplateService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.DELETE_INDEX_TEMPLATE;
}
- @Override protected DeleteIndexTemplateRequest newRequest() {
+ @Override
+ protected DeleteIndexTemplateRequest newRequest() {
return new DeleteIndexTemplateRequest();
}
- @Override protected DeleteIndexTemplateResponse newResponse() {
+ @Override
+ protected DeleteIndexTemplateResponse newResponse() {
return new DeleteIndexTemplateResponse();
}
- @Override protected ClusterBlockException checkBlock(DeleteIndexTemplateRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(DeleteIndexTemplateRequest request, ClusterState state) {
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, "");
}
- @Override protected DeleteIndexTemplateResponse masterOperation(DeleteIndexTemplateRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected DeleteIndexTemplateResponse masterOperation(DeleteIndexTemplateRequest request, ClusterState state) throws ElasticSearchException {
final AtomicReference responseRef = new AtomicReference();
final AtomicReference failureRef = new AtomicReference();
final CountDownLatch latch = new CountDownLatch(1);
indexTemplateService.removeTemplate(new MetaDataIndexTemplateService.RemoveRequest(request.name()), new MetaDataIndexTemplateService.RemoveListener() {
- @Override public void onResponse(MetaDataIndexTemplateService.RemoveResponse response) {
+ @Override
+ public void onResponse(MetaDataIndexTemplateService.RemoveResponse response) {
responseRef.set(new DeleteIndexTemplateResponse(response.acknowledged()));
latch.countDown();
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java
index d2567839d2d..308ab2d0225 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java
@@ -37,14 +37,15 @@ import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-import static org.elasticsearch.action.Actions.*;
-import static org.elasticsearch.common.collect.Maps.*;
-import static org.elasticsearch.common.settings.ImmutableSettings.Builder.*;
-import static org.elasticsearch.common.settings.ImmutableSettings.*;
-import static org.elasticsearch.common.unit.TimeValue.*;
+import static com.google.common.collect.Maps.newHashMap;
+import static org.elasticsearch.action.Actions.addValidationError;
+import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS;
+import static org.elasticsearch.common.settings.ImmutableSettings.readSettingsFromStream;
+import static org.elasticsearch.common.settings.ImmutableSettings.writeSettingsToStream;
+import static org.elasticsearch.common.unit.TimeValue.readTimeValue;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class PutIndexTemplateRequest extends MasterNodeOperationRequest {
@@ -74,7 +75,8 @@ public class PutIndexTemplateRequest extends MasterNodeOperationRequest {
this.name = name;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (name == null) {
validationException = addValidationError("name is missing", validationException);
@@ -261,7 +263,8 @@ public class PutIndexTemplateRequest extends MasterNodeOperationRequest {
return timeout(TimeValue.parseTimeValue(timeout, null));
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
cause = in.readUTF();
name = in.readUTF();
@@ -276,7 +279,8 @@ public class PutIndexTemplateRequest extends MasterNodeOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(cause);
out.writeUTF(name);
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateResponse.java
index 591df8b7051..4d7777ee4ec 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateResponse.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateResponse.java
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* A response for a put index template action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class PutIndexTemplateResponse implements ActionResponse, Streamable {
@@ -50,11 +50,13 @@ public class PutIndexTemplateResponse implements ActionResponse, Streamable {
return acknowledged();
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
acknowledged = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(acknowledged);
}
}
diff --git a/src/main/java/org/elasticsearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java b/src/main/java/org/elasticsearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java
index fb2cef8f831..4b9d0887fb9 100644
--- a/src/main/java/org/elasticsearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java
+++ b/src/main/java/org/elasticsearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java
@@ -38,39 +38,46 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* Put index template action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportPutIndexTemplateAction extends TransportMasterNodeOperationAction {
private final MetaDataIndexTemplateService indexTemplateService;
- @Inject public TransportPutIndexTemplateAction(Settings settings, TransportService transportService, ClusterService clusterService,
- ThreadPool threadPool, MetaDataIndexTemplateService indexTemplateService) {
+ @Inject
+ public TransportPutIndexTemplateAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ ThreadPool threadPool, MetaDataIndexTemplateService indexTemplateService) {
super(settings, transportService, clusterService, threadPool);
this.indexTemplateService = indexTemplateService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.MANAGEMENT;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.Admin.Indices.PUT_INDEX_TEMPLATE;
}
- @Override protected PutIndexTemplateRequest newRequest() {
+ @Override
+ protected PutIndexTemplateRequest newRequest() {
return new PutIndexTemplateRequest();
}
- @Override protected PutIndexTemplateResponse newResponse() {
+ @Override
+ protected PutIndexTemplateResponse newResponse() {
return new PutIndexTemplateResponse();
}
- @Override protected ClusterBlockException checkBlock(PutIndexTemplateRequest request, ClusterState state) {
+ @Override
+ protected ClusterBlockException checkBlock(PutIndexTemplateRequest request, ClusterState state) {
return state.blocks().indexBlockedException(ClusterBlockLevel.METADATA, "");
}
- @Override protected PutIndexTemplateResponse masterOperation(PutIndexTemplateRequest request, ClusterState state) throws ElasticSearchException {
+ @Override
+ protected PutIndexTemplateResponse masterOperation(PutIndexTemplateRequest request, ClusterState state) throws ElasticSearchException {
String cause = request.cause();
if (cause.length() == 0) {
cause = "api";
@@ -86,12 +93,14 @@ public class TransportPutIndexTemplateAction extends TransportMasterNodeOperatio
.mappings(request.mappings()),
new MetaDataIndexTemplateService.PutListener() {
- @Override public void onResponse(MetaDataIndexTemplateService.PutResponse response) {
+ @Override
+ public void onResponse(MetaDataIndexTemplateService.PutResponse response) {
responseRef.set(new PutIndexTemplateResponse(response.acknowledged()));
latch.countDown();
}
- @Override public void onFailure(Throwable t) {
+ @Override
+ public void onFailure(Throwable t) {
failureRef.set(t);
latch.countDown();
}
diff --git a/src/main/java/org/elasticsearch/action/admin/package-info.java b/src/main/java/org/elasticsearch/action/admin/package-info.java
index 6611abb3264..71d28c6ae14 100644
--- a/src/main/java/org/elasticsearch/action/admin/package-info.java
+++ b/src/main/java/org/elasticsearch/action/admin/package-info.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/bulk/BulkItemRequest.java b/src/main/java/org/elasticsearch/action/bulk/BulkItemRequest.java
index c2ddf4d9ab3..24233054c34 100644
--- a/src/main/java/org/elasticsearch/action/bulk/BulkItemRequest.java
+++ b/src/main/java/org/elasticsearch/action/bulk/BulkItemRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import org.elasticsearch.common.io.stream.Streamable;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class BulkItemRequest implements Streamable {
@@ -60,7 +60,8 @@ public class BulkItemRequest implements Streamable {
return item;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
id = in.readVInt();
byte type = in.readByte();
if (type == 0) {
@@ -71,7 +72,8 @@ public class BulkItemRequest implements Streamable {
request.readFrom(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(id);
if (request instanceof IndexRequest) {
out.writeByte((byte) 0);
diff --git a/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java b/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java
index d707ad86add..fbbc5edfb1c 100644
--- a/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java
+++ b/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -32,7 +32,7 @@ import java.io.IOException;
* Represents a single item response for an action executed as part of the bulk API. Holds the index/type/id
* of the relevant action, and if it has failed or not (with the failure message incase it failed).
*
- * @author kimchy (shay.banon)
+ *
*/
public class BulkItemResponse implements Streamable {
@@ -287,7 +287,8 @@ public class BulkItemResponse implements Streamable {
return response;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
id = in.readVInt();
opType = in.readUTF();
@@ -305,7 +306,8 @@ public class BulkItemResponse implements Streamable {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(id);
out.writeUTF(opType);
if (response == null) {
diff --git a/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java b/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java
index 4ce6c184361..a5a49a7a83e 100644
--- a/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java
+++ b/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,6 +19,7 @@
package org.elasticsearch.action.bulk;
+import com.google.common.collect.Lists;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.WriteConsistencyLevel;
@@ -26,7 +27,6 @@ import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.support.replication.ReplicationType;
import org.elasticsearch.common.Nullable;
-import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.unit.TimeValue;
@@ -38,13 +38,13 @@ import org.elasticsearch.index.VersionType;
import java.io.IOException;
import java.util.List;
-import static org.elasticsearch.action.Actions.*;
+import static org.elasticsearch.action.Actions.addValidationError;
/**
* A bulk request holds an ordered {@link IndexRequest}s and {@link DeleteRequest}s and allows to executes
* it in a single batch.
*
- * @author kimchy (shay.banon)
+ *
* @see org.elasticsearch.client.Client#bulk(BulkRequest)
*/
public class BulkRequest implements ActionRequest {
@@ -249,7 +249,8 @@ public class BulkRequest implements ActionRequest {
return requests.size();
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (requests.isEmpty()) {
validationException = addValidationError("no requests added", validationException);
@@ -267,16 +268,19 @@ public class BulkRequest implements ActionRequest {
return validationException;
}
- @Override public boolean listenerThreaded() {
+ @Override
+ public boolean listenerThreaded() {
return listenerThreaded;
}
- @Override public BulkRequest listenerThreaded(boolean listenerThreaded) {
+ @Override
+ public BulkRequest listenerThreaded(boolean listenerThreaded) {
this.listenerThreaded = listenerThreaded;
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
replicationType = ReplicationType.fromId(in.readByte());
consistencyLevel = WriteConsistencyLevel.fromId(in.readByte());
int size = in.readVInt();
@@ -295,7 +299,8 @@ public class BulkRequest implements ActionRequest {
refresh = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeByte(replicationType.id());
out.writeByte(consistencyLevel.id());
out.writeVInt(requests.size());
diff --git a/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java b/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java
index 67c2ed2df31..843253581f6 100644
--- a/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java
+++ b/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,8 +19,8 @@
package org.elasticsearch.action.bulk;
+import com.google.common.collect.Iterators;
import org.elasticsearch.action.ActionResponse;
-import org.elasticsearch.common.collect.Iterators;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.unit.TimeValue;
@@ -33,7 +33,7 @@ import java.util.Iterator;
* bulk requests. Each item holds the index/type/id is operated on, and if it failed or not (with the
* failure message).
*
- * @author kimchy (shay.banon)
+ *
*/
public class BulkResponse implements ActionResponse, Iterable {
@@ -110,11 +110,13 @@ public class BulkResponse implements ActionResponse, Iterable
return responses;
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return Iterators.forArray(responses);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
responses = new BulkItemResponse[in.readVInt()];
for (int i = 0; i < responses.length; i++) {
responses[i] = BulkItemResponse.readBulkItem(in);
@@ -122,7 +124,8 @@ public class BulkResponse implements ActionResponse, Iterable
tookInMillis = in.readVLong();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(responses.length);
for (BulkItemResponse response : responses) {
response.writeTo(out);
diff --git a/src/main/java/org/elasticsearch/action/bulk/BulkShardRequest.java b/src/main/java/org/elasticsearch/action/bulk/BulkShardRequest.java
index 0a60ea50a78..b12b4c0ba65 100644
--- a/src/main/java/org/elasticsearch/action/bulk/BulkShardRequest.java
+++ b/src/main/java/org/elasticsearch/action/bulk/BulkShardRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class BulkShardRequest extends ShardReplicationOperationRequest {
@@ -61,13 +61,15 @@ public class BulkShardRequest extends ShardReplicationOperationRequest {
/**
* Before we fork on a local thread, make sure we copy over the bytes if they are unsafe
*/
- @Override public void beforeLocalFork() {
+ @Override
+ public void beforeLocalFork() {
for (BulkItemRequest item : items) {
((ShardReplicationOperationRequest) item.request()).beforeLocalFork();
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(shardId);
out.writeVInt(items.length);
@@ -82,7 +84,8 @@ public class BulkShardRequest extends ShardReplicationOperationRequest {
out.writeBoolean(refresh);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shardId = in.readVInt();
items = new BulkItemRequest[in.readVInt()];
diff --git a/src/main/java/org/elasticsearch/action/bulk/BulkShardResponse.java b/src/main/java/org/elasticsearch/action/bulk/BulkShardResponse.java
index e6915221227..f3d5d665d21 100644
--- a/src/main/java/org/elasticsearch/action/bulk/BulkShardResponse.java
+++ b/src/main/java/org/elasticsearch/action/bulk/BulkShardResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ import org.elasticsearch.index.shard.ShardId;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class BulkShardResponse implements ActionResponse {
@@ -51,7 +51,8 @@ public class BulkShardResponse implements ActionResponse {
return responses;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
shardId = ShardId.readShardId(in);
responses = new BulkItemResponse[in.readVInt()];
for (int i = 0; i < responses.length; i++) {
@@ -59,7 +60,8 @@ public class BulkShardResponse implements ActionResponse {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
shardId.writeTo(out);
out.writeVInt(responses.length);
for (BulkItemResponse response : responses) {
diff --git a/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java b/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
index c30e7c4670a..84e37db2fcc 100644
--- a/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
+++ b/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,6 +19,9 @@
package org.elasticsearch.action.bulk;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
@@ -35,9 +38,6 @@ import org.elasticsearch.cluster.metadata.MappingMetaData;
import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.cluster.routing.GroupShardsIterator;
import org.elasticsearch.cluster.routing.ShardIterator;
-import org.elasticsearch.common.collect.Lists;
-import org.elasticsearch.common.collect.Maps;
-import org.elasticsearch.common.collect.Sets;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.shard.ShardId;
@@ -54,7 +54,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportBulkAction extends BaseAction {
@@ -68,8 +68,9 @@ public class TransportBulkAction extends BaseAction {
private final TransportCreateIndexAction createIndexAction;
- @Inject public TransportBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService,
- TransportShardBulkAction shardBulkAction, TransportCreateIndexAction createIndexAction) {
+ @Inject
+ public TransportBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService,
+ TransportShardBulkAction shardBulkAction, TransportCreateIndexAction createIndexAction) {
super(settings, threadPool);
this.clusterService = clusterService;
this.shardBulkAction = shardBulkAction;
@@ -81,7 +82,8 @@ public class TransportBulkAction extends BaseAction {
transportService.registerHandler(TransportActions.BULK, new TransportHandler());
}
- @Override protected void doExecute(final BulkRequest bulkRequest, final ActionListener listener) {
+ @Override
+ protected void doExecute(final BulkRequest bulkRequest, final ActionListener listener) {
final long startTime = System.currentTimeMillis();
Set indices = Sets.newHashSet();
for (ActionRequest request : bulkRequest.requests) {
@@ -104,13 +106,15 @@ public class TransportBulkAction extends BaseAction {
for (String index : indices) {
if (!clusterService.state().metaData().hasConcreteIndex(index)) {
createIndexAction.execute(new CreateIndexRequest(index).cause("auto(bulk api)"), new ActionListener() {
- @Override public void onResponse(CreateIndexResponse result) {
+ @Override
+ public void onResponse(CreateIndexResponse result) {
if (counter.decrementAndGet() == 0) {
executeBulk(bulkRequest, startTime, listener);
}
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
if (ExceptionsHelper.unwrapCause(e) instanceof IndexAlreadyExistsException) {
// we have the index, do it
if (counter.decrementAndGet() == 0) {
@@ -206,7 +210,8 @@ public class TransportBulkAction extends BaseAction {
bulkShardRequest.replicationType(bulkRequest.replicationType());
bulkShardRequest.consistencyLevel(bulkRequest.consistencyLevel());
shardBulkAction.execute(bulkShardRequest, new ActionListener() {
- @Override public void onResponse(BulkShardResponse bulkShardResponse) {
+ @Override
+ public void onResponse(BulkShardResponse bulkShardResponse) {
synchronized (responses) {
for (BulkItemResponse bulkItemResponse : bulkShardResponse.responses()) {
responses[bulkItemResponse.itemId()] = bulkItemResponse;
@@ -217,7 +222,8 @@ public class TransportBulkAction extends BaseAction {
}
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
// create failures for all relevant requests
String message = ExceptionsHelper.detailedMessage(e);
synchronized (responses) {
@@ -247,15 +253,18 @@ public class TransportBulkAction extends BaseAction {
class TransportHandler extends BaseTransportRequestHandler {
- @Override public BulkRequest newInstance() {
+ @Override
+ public BulkRequest newInstance() {
return new BulkRequest();
}
- @Override public void messageReceived(final BulkRequest request, final TransportChannel channel) throws Exception {
+ @Override
+ public void messageReceived(final BulkRequest request, final TransportChannel channel) throws Exception {
// no need to use threaded listener, since we just send a response
request.listenerThreaded(false);
execute(request, new ActionListener() {
- @Override public void onResponse(BulkResponse result) {
+ @Override
+ public void onResponse(BulkResponse result) {
try {
channel.sendResponse(result);
} catch (Exception e) {
@@ -263,7 +272,8 @@ public class TransportBulkAction extends BaseAction {
}
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
try {
channel.sendResponse(e);
} catch (Exception e1) {
@@ -273,7 +283,8 @@ public class TransportBulkAction extends BaseAction {
});
}
- @Override public String executor() {
+ @Override
+ public String executor() {
return ThreadPool.Names.SAME;
}
}
diff --git a/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java b/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java
index 77aa7ad2b81..d639d1407ca 100644
--- a/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java
+++ b/src/main/java/org/elasticsearch/action/bulk/TransportShardBulkAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -56,57 +56,68 @@ import java.io.IOException;
/**
* Performs the index operation.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportShardBulkAction extends TransportShardReplicationOperationAction {
private final MappingUpdatedAction mappingUpdatedAction;
- @Inject public TransportShardBulkAction(Settings settings, TransportService transportService, ClusterService clusterService,
- IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
- MappingUpdatedAction mappingUpdatedAction) {
+ @Inject
+ public TransportShardBulkAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
+ MappingUpdatedAction mappingUpdatedAction) {
super(settings, transportService, clusterService, indicesService, threadPool, shardStateAction);
this.mappingUpdatedAction = mappingUpdatedAction;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.INDEX;
}
- @Override protected boolean checkWriteConsistency() {
+ @Override
+ protected boolean checkWriteConsistency() {
return true;
}
- @Override protected TransportRequestOptions transportOptions() {
+ @Override
+ protected TransportRequestOptions transportOptions() {
// low type since we don't want the large bulk requests to cause high latency on typical requests
return TransportRequestOptions.options().withCompress(true).withLowType();
}
- @Override protected BulkShardRequest newRequestInstance() {
+ @Override
+ protected BulkShardRequest newRequestInstance() {
return new BulkShardRequest();
}
- @Override protected BulkShardRequest newReplicaRequestInstance() {
+ @Override
+ protected BulkShardRequest newReplicaRequestInstance() {
return new BulkShardRequest();
}
- @Override protected BulkShardResponse newResponseInstance() {
+ @Override
+ protected BulkShardResponse newResponseInstance() {
return new BulkShardResponse();
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return "indices/index/shard/bulk";
}
- @Override protected void checkBlock(BulkShardRequest request, ClusterState state) {
+ @Override
+ protected void checkBlock(BulkShardRequest request, ClusterState state) {
state.blocks().indexBlockedRaiseException(ClusterBlockLevel.WRITE, request.index());
}
- @Override protected ShardIterator shards(ClusterState clusterState, BulkShardRequest request) {
+ @Override
+ protected ShardIterator shards(ClusterState clusterState, BulkShardRequest request) {
return clusterState.routingTable().index(request.index()).shard(request.shardId()).shardsIt();
}
- @Override protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
+ @Override
+ protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
final BulkShardRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardRequest.shardId);
@@ -209,7 +220,8 @@ public class TransportShardBulkAction extends TransportShardReplicationOperation
return new PrimaryResponse(shardRequest.request, response, ops);
}
- @Override protected void postPrimaryOperation(BulkShardRequest request, PrimaryResponse response) {
+ @Override
+ protected void postPrimaryOperation(BulkShardRequest request, PrimaryResponse response) {
IndexService indexService = indicesService.indexServiceSafe(request.index());
Engine.IndexingOperation[] ops = (Engine.IndexingOperation[]) response.payload();
if (ops == null) {
@@ -241,7 +253,8 @@ public class TransportShardBulkAction extends TransportShardReplicationOperation
}
}
- @Override protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
+ @Override
+ protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardRequest.shardId);
final BulkShardRequest request = shardRequest.request;
for (int i = 0; i < request.items().length; i++) {
@@ -295,11 +308,13 @@ public class TransportShardBulkAction extends TransportShardReplicationOperation
documentMapper.refreshSource();
mappingUpdatedAction.execute(new MappingUpdatedAction.MappingUpdatedRequest(request.index(), request.type(), documentMapper.mappingSource()), new ActionListener() {
- @Override public void onResponse(MappingUpdatedAction.MappingUpdatedResponse mappingUpdatedResponse) {
+ @Override
+ public void onResponse(MappingUpdatedAction.MappingUpdatedResponse mappingUpdatedResponse) {
// all is well
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
try {
logger.warn("Failed to update master on updated mapping for index [" + request.index() + "], type [" + request.type() + "] and source [" + documentMapper.mappingSource().string() + "]", e);
} catch (IOException e1) {
diff --git a/src/main/java/org/elasticsearch/action/count/CountRequest.java b/src/main/java/org/elasticsearch/action/count/CountRequest.java
index d2bf0424768..4a352aaef8e 100644
--- a/src/main/java/org/elasticsearch/action/count/CountRequest.java
+++ b/src/main/java/org/elasticsearch/action/count/CountRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -44,11 +44,11 @@ import java.util.Map;
/**
* A request to count the number of documents matching a specific query. Best created with
* {@link org.elasticsearch.client.Requests#countRequest(String...)}.
- *
+ *
* The request requires the query source to be set either using {@link #query(org.elasticsearch.index.query.QueryBuilder)},
* or {@link #query(byte[])}.
*
- * @author kimchy (shay.banon)
+ *
* @see CountResponse
* @see org.elasticsearch.client.Client#count(CountRequest)
* @see org.elasticsearch.client.Requests#countRequest(String...)
@@ -61,8 +61,10 @@ public class CountRequest extends BroadcastOperationRequest {
private float minScore = DEFAULT_MIN_SCORE;
- @Nullable protected String queryHint;
- @Nullable protected String routing;
+ @Nullable
+ protected String queryHint;
+ @Nullable
+ protected String routing;
private byte[] querySource;
private int querySourceOffset;
@@ -83,7 +85,8 @@ public class CountRequest extends BroadcastOperationRequest {
this.queryHint = null;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = super.validate();
return validationException;
}
@@ -95,12 +98,14 @@ public class CountRequest extends BroadcastOperationRequest {
/**
* Controls the operation threading model.
*/
- @Override public CountRequest operationThreading(BroadcastOperationThreading operationThreading) {
+ @Override
+ public CountRequest operationThreading(BroadcastOperationThreading operationThreading) {
super.operationThreading(operationThreading);
return this;
}
- @Override protected void beforeStart() {
+ @Override
+ protected void beforeStart() {
if (querySourceUnsafe) {
querySource = Arrays.copyOfRange(querySource, querySourceOffset, querySourceOffset + querySourceLength);
querySourceOffset = 0;
@@ -111,7 +116,8 @@ public class CountRequest extends BroadcastOperationRequest {
/**
* Should the listener be called on a separate thread if needed.
*/
- @Override public CountRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public CountRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
@@ -165,7 +171,8 @@ public class CountRequest extends BroadcastOperationRequest {
*
* @see org.elasticsearch.index.query.QueryBuilders
*/
- @Required public CountRequest query(QueryBuilder queryBuilder) {
+ @Required
+ public CountRequest query(QueryBuilder queryBuilder) {
BytesStream bos = queryBuilder.buildAsUnsafeBytes();
this.querySource = bos.underlyingBytes();
this.querySourceOffset = 0;
@@ -177,7 +184,8 @@ public class CountRequest extends BroadcastOperationRequest {
/**
* The query source to execute in the form of a map.
*/
- @Required public CountRequest query(Map querySource) {
+ @Required
+ public CountRequest query(Map querySource) {
try {
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
builder.map(querySource);
@@ -187,7 +195,8 @@ public class CountRequest extends BroadcastOperationRequest {
}
}
- @Required public CountRequest query(XContentBuilder builder) {
+ @Required
+ public CountRequest query(XContentBuilder builder) {
try {
this.querySource = builder.underlyingBytes();
this.querySourceOffset = 0;
@@ -203,7 +212,8 @@ public class CountRequest extends BroadcastOperationRequest {
* The query source to execute. It is preferable to use either {@link #query(byte[])}
* or {@link #query(org.elasticsearch.index.query.QueryBuilder)}.
*/
- @Required public CountRequest query(String querySource) {
+ @Required
+ public CountRequest query(String querySource) {
UnicodeUtil.UTF8Result result = Unicode.fromStringAsUtf8(querySource);
this.querySource = result.result;
this.querySourceOffset = 0;
@@ -215,14 +225,16 @@ public class CountRequest extends BroadcastOperationRequest {
/**
* The query source to execute.
*/
- @Required public CountRequest query(byte[] querySource) {
+ @Required
+ public CountRequest query(byte[] querySource) {
return query(querySource, 0, querySource.length, false);
}
/**
* The query source to execute.
*/
- @Required public CountRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
+ @Required
+ public CountRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
this.querySource = querySource;
this.querySourceOffset = offset;
this.querySourceLength = length;
@@ -268,7 +280,8 @@ public class CountRequest extends BroadcastOperationRequest {
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
minScore = in.readFloat();
@@ -294,7 +307,8 @@ public class CountRequest extends BroadcastOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeFloat(minScore);
@@ -320,7 +334,8 @@ public class CountRequest extends BroadcastOperationRequest {
}
}
- @Override public String toString() {
+ @Override
+ public String toString() {
return "[" + Arrays.toString(indices) + "]" + Arrays.toString(types) + ", querySource[" + Unicode.fromBytes(querySource) + "]";
}
}
diff --git a/src/main/java/org/elasticsearch/action/count/CountResponse.java b/src/main/java/org/elasticsearch/action/count/CountResponse.java
index 5402dd2cfb7..dcc80157ec0 100644
--- a/src/main/java/org/elasticsearch/action/count/CountResponse.java
+++ b/src/main/java/org/elasticsearch/action/count/CountResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -30,7 +30,7 @@ import java.util.List;
/**
* The response of the count action.
*
- * @author kimchy (shay.banon)
+ *
*/
public class CountResponse extends BroadcastOperationResponse {
@@ -59,12 +59,14 @@ public class CountResponse extends BroadcastOperationResponse {
return count;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
count = in.readVLong();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVLong(count);
}
diff --git a/src/main/java/org/elasticsearch/action/count/ShardCountRequest.java b/src/main/java/org/elasticsearch/action/count/ShardCountRequest.java
index 0fd2a1be5d6..6aa5f7569bf 100644
--- a/src/main/java/org/elasticsearch/action/count/ShardCountRequest.java
+++ b/src/main/java/org/elasticsearch/action/count/ShardCountRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -30,7 +30,7 @@ import java.io.IOException;
/**
* Internal count request executed directly against a specific index shard.
*
- * @author kimchy (shay.banon)
+ *
*/
class ShardCountRequest extends BroadcastShardOperationRequest {
@@ -42,7 +42,8 @@ class ShardCountRequest extends BroadcastShardOperationRequest {
private String[] types = Strings.EMPTY_ARRAY;
- @Nullable private String[] filteringAliases;
+ @Nullable
+ private String[] filteringAliases;
ShardCountRequest() {
@@ -82,7 +83,8 @@ class ShardCountRequest extends BroadcastShardOperationRequest {
return filteringAliases;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
minScore = in.readFloat();
querySourceLength = in.readVInt();
@@ -105,7 +107,8 @@ class ShardCountRequest extends BroadcastShardOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeFloat(minScore);
out.writeVInt(querySourceLength);
diff --git a/src/main/java/org/elasticsearch/action/count/ShardCountResponse.java b/src/main/java/org/elasticsearch/action/count/ShardCountResponse.java
index d5a8217bed4..6f7a6a939d3 100644
--- a/src/main/java/org/elasticsearch/action/count/ShardCountResponse.java
+++ b/src/main/java/org/elasticsearch/action/count/ShardCountResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -28,7 +28,7 @@ import java.io.IOException;
/**
* Internal count response of a shard count request executed directly against a specific shard.
*
- * @author kimchy (shay.banon)
+ *
*/
class ShardCountResponse extends BroadcastShardOperationResponse {
@@ -47,12 +47,14 @@ class ShardCountResponse extends BroadcastShardOperationResponse {
return this.count;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
count = in.readVLong();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVLong(count);
}
diff --git a/src/main/java/org/elasticsearch/action/count/TransportCountAction.java b/src/main/java/org/elasticsearch/action/count/TransportCountAction.java
index f9d8dc8b1d7..117730cae4c 100644
--- a/src/main/java/org/elasticsearch/action/count/TransportCountAction.java
+++ b/src/main/java/org/elasticsearch/action/count/TransportCountAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -42,61 +42,72 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReferenceArray;
-import static org.elasticsearch.common.collect.Lists.*;
+import static com.google.common.collect.Lists.newArrayList;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportCountAction extends TransportBroadcastOperationAction {
private final IndicesService indicesService;
- @Inject public TransportCountAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) {
+ @Inject
+ public TransportCountAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) {
super(settings, threadPool, clusterService, transportService);
this.indicesService = indicesService;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.SEARCH;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.COUNT;
}
- @Override protected String transportShardAction() {
+ @Override
+ protected String transportShardAction() {
return "indices/count/shard";
}
- @Override protected CountRequest newRequest() {
+ @Override
+ protected CountRequest newRequest() {
return new CountRequest();
}
- @Override protected ShardCountRequest newShardRequest() {
+ @Override
+ protected ShardCountRequest newShardRequest() {
return new ShardCountRequest();
}
- @Override protected ShardCountRequest newShardRequest(ShardRouting shard, CountRequest request) {
+ @Override
+ protected ShardCountRequest newShardRequest(ShardRouting shard, CountRequest request) {
String[] filteringAliases = clusterService.state().metaData().filteringAliases(shard.index(), request.indices());
return new ShardCountRequest(shard.index(), shard.id(), filteringAliases, request);
}
- @Override protected ShardCountResponse newShardResponse() {
+ @Override
+ protected ShardCountResponse newShardResponse() {
return new ShardCountResponse();
}
- @Override protected GroupShardsIterator shards(CountRequest request, String[] concreteIndices, ClusterState clusterState) {
+ @Override
+ protected GroupShardsIterator shards(CountRequest request, String[] concreteIndices, ClusterState clusterState) {
Map> routingMap = clusterState.metaData().resolveSearchRouting(request.routing(), request.indices());
return clusterService.operationRouting().searchShards(clusterState, request.indices(), concreteIndices, request.queryHint(), routingMap, null);
}
- @Override protected void checkBlock(CountRequest request, String[] concreteIndices, ClusterState state) {
+ @Override
+ protected void checkBlock(CountRequest request, String[] concreteIndices, ClusterState state) {
for (String index : concreteIndices) {
state.blocks().indexBlocked(ClusterBlockLevel.READ, index);
}
}
- @Override protected CountResponse newResponse(CountRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
+ @Override
+ protected CountResponse newResponse(CountRequest request, AtomicReferenceArray shardsResponses, ClusterState clusterState) {
int successfulShards = 0;
int failedShards = 0;
long count = 0;
@@ -119,7 +130,8 @@ public class TransportCountAction extends TransportBroadcastOperationAction
* The operation requires the {@link #index()}, {@link #type(String)} and {@link #id(String)} to
* be set.
*
- * @author kimchy (shay.banon)
+ *
* @see DeleteResponse
* @see org.elasticsearch.client.Client#delete(DeleteRequest)
* @see org.elasticsearch.client.Requests#deleteRequest(String)
@@ -50,7 +50,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
private String type;
private String id;
- @Nullable private String routing;
+ @Nullable
+ private String routing;
private boolean refresh;
private long version;
private VersionType versionType = VersionType.INTERNAL;
@@ -79,7 +80,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
public DeleteRequest() {
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = super.validate();
if (type == null) {
validationException = addValidationError("type is missing", validationException);
@@ -93,7 +95,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
/**
* Sets the index the delete will happen on.
*/
- @Override public DeleteRequest index(String index) {
+ @Override
+ public DeleteRequest index(String index) {
super.index(index);
return this;
}
@@ -101,7 +104,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
/**
* Should the listener be called on a separate thread if needed.
*/
- @Override public DeleteRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public DeleteRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
@@ -110,7 +114,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
* Controls if the operation will be executed on a separate thread when executed locally. Defaults
* to true when running in embedded mode.
*/
- @Override public DeleteRequest operationThreaded(boolean threadedOperation) {
+ @Override
+ public DeleteRequest operationThreaded(boolean threadedOperation) {
super.operationThreaded(threadedOperation);
return this;
}
@@ -118,7 +123,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
/**
* Set the replication type for this operation.
*/
- @Override public DeleteRequest replicationType(ReplicationType replicationType) {
+ @Override
+ public DeleteRequest replicationType(ReplicationType replicationType) {
super.replicationType(replicationType);
return this;
}
@@ -126,7 +132,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
/**
* Sets the consistency level of write. Defaults to {@link org.elasticsearch.action.WriteConsistencyLevel#DEFAULT}
*/
- @Override public DeleteRequest consistencyLevel(WriteConsistencyLevel consistencyLevel) {
+ @Override
+ public DeleteRequest consistencyLevel(WriteConsistencyLevel consistencyLevel) {
super.consistencyLevel(consistencyLevel);
return this;
}
@@ -141,7 +148,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
/**
* Sets the type of the document to delete.
*/
- @Required public DeleteRequest type(String type) {
+ @Required
+ public DeleteRequest type(String type) {
this.type = type;
return this;
}
@@ -156,7 +164,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
/**
* Sets the id of the document to delete.
*/
- @Required public DeleteRequest id(String id) {
+ @Required
+ public DeleteRequest id(String id) {
this.id = id;
return this;
}
@@ -237,7 +246,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
return this.versionType;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
type = in.readUTF();
id = in.readUTF();
@@ -249,7 +259,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
versionType = VersionType.fromValue(in.readByte());
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(type);
out.writeUTF(id);
@@ -264,7 +275,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
out.writeByte(versionType.getValue());
}
- @Override public String toString() {
+ @Override
+ public String toString() {
return "delete {[" + index + "][" + type + "][" + id + "]}";
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/delete/DeleteResponse.java b/src/main/java/org/elasticsearch/action/delete/DeleteResponse.java
index 2980d42efa8..cef5fa62306 100644
--- a/src/main/java/org/elasticsearch/action/delete/DeleteResponse.java
+++ b/src/main/java/org/elasticsearch/action/delete/DeleteResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* The response of the delete action.
*
- * @author kimchy (shay.banon)
+ *
* @see org.elasticsearch.action.delete.DeleteRequest
* @see org.elasticsearch.client.Client#delete(DeleteRequest)
*/
@@ -127,7 +127,8 @@ public class DeleteResponse implements ActionResponse, Streamable {
return notFound;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
index = in.readUTF();
id = in.readUTF();
type = in.readUTF();
@@ -135,7 +136,8 @@ public class DeleteResponse implements ActionResponse, Streamable {
notFound = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeUTF(index);
out.writeUTF(id);
out.writeUTF(type);
diff --git a/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java b/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java
index b91bbfa1791..a67e90b2388 100644
--- a/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java
+++ b/src/main/java/org/elasticsearch/action/delete/TransportDeleteAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -48,7 +48,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Performs the delete operation.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportDeleteAction extends TransportShardReplicationOperationAction {
@@ -58,28 +58,33 @@ public class TransportDeleteAction extends TransportShardReplicationOperationAct
private final TransportIndexDeleteAction indexDeleteAction;
- @Inject public TransportDeleteAction(Settings settings, TransportService transportService, ClusterService clusterService,
- IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
- TransportCreateIndexAction createIndexAction, TransportIndexDeleteAction indexDeleteAction) {
+ @Inject
+ public TransportDeleteAction(Settings settings, TransportService transportService, ClusterService clusterService,
+ IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
+ TransportCreateIndexAction createIndexAction, TransportIndexDeleteAction indexDeleteAction) {
super(settings, transportService, clusterService, indicesService, threadPool, shardStateAction);
this.createIndexAction = createIndexAction;
this.indexDeleteAction = indexDeleteAction;
this.autoCreateIndex = settings.getAsBoolean("action.auto_create_index", true);
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.INDEX;
}
- @Override protected void doExecute(final DeleteRequest request, final ActionListener listener) {
+ @Override
+ protected void doExecute(final DeleteRequest request, final ActionListener listener) {
if (autoCreateIndex && !clusterService.state().metaData().hasConcreteIndex(request.index())) {
request.beforeLocalFork();
createIndexAction.execute(new CreateIndexRequest(request.index()), new ActionListener() {
- @Override public void onResponse(CreateIndexResponse result) {
+ @Override
+ public void onResponse(CreateIndexResponse result) {
innerExecute(request, listener);
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
if (ExceptionsHelper.unwrapCause(e) instanceof IndexAlreadyExistsException) {
// we have the index, do it
innerExecute(request, listener);
@@ -103,7 +108,8 @@ public class TransportDeleteAction extends TransportShardReplicationOperationAct
if (mappingMd != null && mappingMd.routing().required()) {
if (request.routing() == null) {
indexDeleteAction.execute(new IndexDeleteRequest(request), new ActionListener() {
- @Override public void onResponse(IndexDeleteResponse indexDeleteResponse) {
+ @Override
+ public void onResponse(IndexDeleteResponse indexDeleteResponse) {
// go over the response, see if we have found one, and the version if found
long version = 0;
boolean found = false;
@@ -117,7 +123,8 @@ public class TransportDeleteAction extends TransportShardReplicationOperationAct
listener.onResponse(new DeleteResponse(request.index(), request.type(), request.id(), version, !found));
}
- @Override public void onFailure(Throwable e) {
+ @Override
+ public void onFailure(Throwable e) {
listener.onFailure(e);
}
});
@@ -128,31 +135,38 @@ public class TransportDeleteAction extends TransportShardReplicationOperationAct
super.doExecute(request, listener);
}
- @Override protected boolean checkWriteConsistency() {
+ @Override
+ protected boolean checkWriteConsistency() {
return true;
}
- @Override protected DeleteRequest newRequestInstance() {
+ @Override
+ protected DeleteRequest newRequestInstance() {
return new DeleteRequest();
}
- @Override protected DeleteRequest newReplicaRequestInstance() {
+ @Override
+ protected DeleteRequest newReplicaRequestInstance() {
return new DeleteRequest();
}
- @Override protected DeleteResponse newResponseInstance() {
+ @Override
+ protected DeleteResponse newResponseInstance() {
return new DeleteResponse();
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.DELETE;
}
- @Override protected void checkBlock(DeleteRequest request, ClusterState state) {
+ @Override
+ protected void checkBlock(DeleteRequest request, ClusterState state) {
state.blocks().indexBlockedRaiseException(ClusterBlockLevel.WRITE, request.index());
}
- @Override protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
+ @Override
+ protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
DeleteRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardRequest.shardId);
Engine.Delete delete = indexShard.prepareDelete(request.type(), request.id(), request.version())
@@ -174,7 +188,8 @@ public class TransportDeleteAction extends TransportShardReplicationOperationAct
return new PrimaryResponse(shardRequest.request, response, null);
}
- @Override protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
+ @Override
+ protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
DeleteRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardRequest.shardId);
Engine.Delete delete = indexShard.prepareDelete(request.type(), request.id(), request.version())
@@ -192,7 +207,8 @@ public class TransportDeleteAction extends TransportShardReplicationOperationAct
}
- @Override protected ShardIterator shards(ClusterState clusterState, DeleteRequest request) {
+ @Override
+ protected ShardIterator shards(ClusterState clusterState, DeleteRequest request) {
return clusterService.operationRouting()
.deleteShards(clusterService.state(), request.index(), request.type(), request.id(), request.routing());
}
diff --git a/src/main/java/org/elasticsearch/action/delete/index/IndexDeleteRequest.java b/src/main/java/org/elasticsearch/action/delete/index/IndexDeleteRequest.java
index 9f6907920bf..f5b2d1e56b8 100644
--- a/src/main/java/org/elasticsearch/action/delete/index/IndexDeleteRequest.java
+++ b/src/main/java/org/elasticsearch/action/delete/index/IndexDeleteRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class IndexDeleteRequest extends IndexReplicationOperationRequest {
@@ -69,7 +69,8 @@ public class IndexDeleteRequest extends IndexReplicationOperationRequest {
return this.version;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
type = in.readUTF();
id = in.readUTF();
@@ -77,7 +78,8 @@ public class IndexDeleteRequest extends IndexReplicationOperationRequest {
version = in.readLong();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(type);
out.writeUTF(id);
diff --git a/src/main/java/org/elasticsearch/action/delete/index/IndexDeleteResponse.java b/src/main/java/org/elasticsearch/action/delete/index/IndexDeleteResponse.java
index 3acdf581f25..264e49957c7 100644
--- a/src/main/java/org/elasticsearch/action/delete/index/IndexDeleteResponse.java
+++ b/src/main/java/org/elasticsearch/action/delete/index/IndexDeleteResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* Delete by query response executed on a specific index.
*
- * @author kimchy (shay.banon)
+ *
*/
public class IndexDeleteResponse implements ActionResponse, Streamable {
@@ -112,7 +112,8 @@ public class IndexDeleteResponse implements ActionResponse, Streamable {
return this.deleteResponses;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
index = in.readUTF();
successfulShards = in.readVInt();
failedShards = in.readVInt();
@@ -123,7 +124,8 @@ public class IndexDeleteResponse implements ActionResponse, Streamable {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeUTF(index);
out.writeVInt(successfulShards);
out.writeVInt(failedShards);
diff --git a/src/main/java/org/elasticsearch/action/delete/index/ShardDeleteRequest.java b/src/main/java/org/elasticsearch/action/delete/index/ShardDeleteRequest.java
index d1d7da50128..1a98942b571 100644
--- a/src/main/java/org/elasticsearch/action/delete/index/ShardDeleteRequest.java
+++ b/src/main/java/org/elasticsearch/action/delete/index/ShardDeleteRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -26,12 +26,12 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException;
-import static org.elasticsearch.action.Actions.*;
+import static org.elasticsearch.action.Actions.addValidationError;
/**
* Delete by query request to execute on a specific shard.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ShardDeleteRequest extends ShardReplicationOperationRequest {
@@ -56,7 +56,8 @@ public class ShardDeleteRequest extends ShardReplicationOperationRequest {
ShardDeleteRequest() {
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = super.validate();
if (type == null) {
addValidationError("type is missing", validationException);
@@ -91,7 +92,8 @@ public class ShardDeleteRequest extends ShardReplicationOperationRequest {
return this.version;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
shardId = in.readVInt();
type = in.readUTF();
@@ -100,7 +102,8 @@ public class ShardDeleteRequest extends ShardReplicationOperationRequest {
version = in.readLong();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(shardId);
out.writeUTF(type);
diff --git a/src/main/java/org/elasticsearch/action/delete/index/ShardDeleteResponse.java b/src/main/java/org/elasticsearch/action/delete/index/ShardDeleteResponse.java
index b42ad1be57f..8536e2caba4 100644
--- a/src/main/java/org/elasticsearch/action/delete/index/ShardDeleteResponse.java
+++ b/src/main/java/org/elasticsearch/action/delete/index/ShardDeleteResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* Delete response executed on a specific shard.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ShardDeleteResponse implements ActionResponse, Streamable {
@@ -53,12 +53,14 @@ public class ShardDeleteResponse implements ActionResponse, Streamable {
return notFound;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
version = in.readLong();
notFound = in.readBoolean();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeLong(version);
out.writeBoolean(notFound);
}
diff --git a/src/main/java/org/elasticsearch/action/delete/index/TransportIndexDeleteAction.java b/src/main/java/org/elasticsearch/action/delete/index/TransportIndexDeleteAction.java
index ff691c6a355..c0fb6dc4e1f 100644
--- a/src/main/java/org/elasticsearch/action/delete/index/TransportIndexDeleteAction.java
+++ b/src/main/java/org/elasticsearch/action/delete/index/TransportIndexDeleteAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -33,20 +33,23 @@ import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicReferenceArray;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportIndexDeleteAction extends TransportIndexReplicationOperationAction {
- @Inject public TransportIndexDeleteAction(Settings settings, ClusterService clusterService, TransportService transportService,
- ThreadPool threadPool, TransportShardDeleteAction deleteAction) {
+ @Inject
+ public TransportIndexDeleteAction(Settings settings, ClusterService clusterService, TransportService transportService,
+ ThreadPool threadPool, TransportShardDeleteAction deleteAction) {
super(settings, transportService, clusterService, threadPool, deleteAction);
}
- @Override protected IndexDeleteRequest newRequestInstance() {
+ @Override
+ protected IndexDeleteRequest newRequestInstance() {
return new IndexDeleteRequest();
}
- @Override protected IndexDeleteResponse newResponseInstance(IndexDeleteRequest request, AtomicReferenceArray shardsResponses) {
+ @Override
+ protected IndexDeleteResponse newResponseInstance(IndexDeleteRequest request, AtomicReferenceArray shardsResponses) {
int successfulShards = 0;
int failedShards = 0;
ArrayList responses = new ArrayList();
@@ -61,23 +64,28 @@ public class TransportIndexDeleteAction extends TransportIndexReplicationOperati
return new IndexDeleteResponse(request.index(), successfulShards, failedShards, responses.toArray(new ShardDeleteResponse[responses.size()]));
}
- @Override protected boolean accumulateExceptions() {
+ @Override
+ protected boolean accumulateExceptions() {
return false;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return "indices/index/delete";
}
- @Override protected void checkBlock(IndexDeleteRequest request, ClusterState state) {
+ @Override
+ protected void checkBlock(IndexDeleteRequest request, ClusterState state) {
state.blocks().indexBlockedRaiseException(ClusterBlockLevel.WRITE, request.index());
}
- @Override protected GroupShardsIterator shards(IndexDeleteRequest request) {
+ @Override
+ protected GroupShardsIterator shards(IndexDeleteRequest request) {
return clusterService.operationRouting().broadcastDeleteShards(clusterService.state(), request.index());
}
- @Override protected ShardDeleteRequest newShardRequestInstance(IndexDeleteRequest request, int shardId) {
+ @Override
+ protected ShardDeleteRequest newShardRequestInstance(IndexDeleteRequest request, int shardId) {
return new ShardDeleteRequest(request, shardId);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/delete/index/TransportShardDeleteAction.java b/src/main/java/org/elasticsearch/action/delete/index/TransportShardDeleteAction.java
index 57e89a53ec1..9a0c016e8b1 100644
--- a/src/main/java/org/elasticsearch/action/delete/index/TransportShardDeleteAction.java
+++ b/src/main/java/org/elasticsearch/action/delete/index/TransportShardDeleteAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -36,45 +36,54 @@ import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class TransportShardDeleteAction extends TransportShardReplicationOperationAction {
- @Inject public TransportShardDeleteAction(Settings settings, TransportService transportService,
- ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool,
- ShardStateAction shardStateAction) {
+ @Inject
+ public TransportShardDeleteAction(Settings settings, TransportService transportService,
+ ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool,
+ ShardStateAction shardStateAction) {
super(settings, transportService, clusterService, indicesService, threadPool, shardStateAction);
}
- @Override protected boolean checkWriteConsistency() {
+ @Override
+ protected boolean checkWriteConsistency() {
return true;
}
- @Override protected ShardDeleteRequest newRequestInstance() {
+ @Override
+ protected ShardDeleteRequest newRequestInstance() {
return new ShardDeleteRequest();
}
- @Override protected ShardDeleteRequest newReplicaRequestInstance() {
+ @Override
+ protected ShardDeleteRequest newReplicaRequestInstance() {
return new ShardDeleteRequest();
}
- @Override protected ShardDeleteResponse newResponseInstance() {
+ @Override
+ protected ShardDeleteResponse newResponseInstance() {
return new ShardDeleteResponse();
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return "indices/index/b_shard/delete";
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.INDEX;
}
- @Override protected void checkBlock(ShardDeleteRequest request, ClusterState state) {
+ @Override
+ protected void checkBlock(ShardDeleteRequest request, ClusterState state) {
state.blocks().indexBlockedRaiseException(ClusterBlockLevel.WRITE, request.index());
}
- @Override protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
+ @Override
+ protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
ShardDeleteRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardRequest.shardId);
Engine.Delete delete = indexShard.prepareDelete(request.type(), request.id(), request.version())
@@ -96,7 +105,8 @@ public class TransportShardDeleteAction extends TransportShardReplicationOperati
return new PrimaryResponse(shardRequest.request, response, null);
}
- @Override protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
+ @Override
+ protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
ShardDeleteRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardRequest.shardId);
Engine.Delete delete = indexShard.prepareDelete(request.type(), request.id(), request.version())
@@ -113,7 +123,8 @@ public class TransportShardDeleteAction extends TransportShardReplicationOperati
}
- @Override protected ShardIterator shards(ClusterState clusterState, ShardDeleteRequest request) {
+ @Override
+ protected ShardIterator shards(ClusterState clusterState, ShardDeleteRequest request) {
GroupShardsIterator group = clusterService.operationRouting().broadcastDeleteShards(clusterService.state(), request.index());
for (ShardIterator shardIt : group) {
if (shardIt.shardId().id() == request.shardId()) {
diff --git a/src/main/java/org/elasticsearch/action/delete/package-info.java b/src/main/java/org/elasticsearch/action/delete/package-info.java
index 3a78f839bf7..cf23bb769b7 100644
--- a/src/main/java/org/elasticsearch/action/delete/package-info.java
+++ b/src/main/java/org/elasticsearch/action/delete/package-info.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java b/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java
index 54308a30ea1..7ecf5ed8b47 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -43,16 +43,16 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Map;
-import static org.elasticsearch.action.Actions.*;
+import static org.elasticsearch.action.Actions.addValidationError;
/**
* A request to delete all documents that matching a specific query. Best created with
* {@link org.elasticsearch.client.Requests#deleteByQueryRequest(String...)}.
- *
+ *
* The request requires the query source to be set either using {@link #query(org.elasticsearch.index.query.QueryBuilder)},
* or {@link #query(byte[])}.
*
- * @author kimchy (shay.banon)
+ *
* @see DeleteByQueryResponse
* @see org.elasticsearch.client.Requests#deleteByQueryRequest(String...)
* @see org.elasticsearch.client.Client#deleteByQuery(DeleteByQueryRequest)
@@ -67,7 +67,8 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
private boolean querySourceUnsafe;
private String[] types = Strings.EMPTY_ARRAY;
- @Nullable private String routing;
+ @Nullable
+ private String routing;
/**
* Constructs a new delete by query request to run against the provided indices. No indices means
@@ -83,12 +84,14 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
/**
* Should the listener be called on a separate thread if needed.
*/
- @Override public DeleteByQueryRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public DeleteByQueryRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = super.validate();
if (querySource == null) {
validationException = addValidationError("query is missing", validationException);
@@ -121,7 +124,8 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
*
* @see org.elasticsearch.index.query.QueryBuilders
*/
- @Required public DeleteByQueryRequest query(QueryBuilder queryBuilder) {
+ @Required
+ public DeleteByQueryRequest query(QueryBuilder queryBuilder) {
BytesStream bos = queryBuilder.buildAsUnsafeBytes();
this.querySource = bos.underlyingBytes();
this.querySourceOffset = 0;
@@ -134,7 +138,8 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
* The query source to execute. It is preferable to use either {@link #query(byte[])}
* or {@link #query(org.elasticsearch.index.query.QueryBuilder)}.
*/
- @Required public DeleteByQueryRequest query(String querySource) {
+ @Required
+ public DeleteByQueryRequest query(String querySource) {
UnicodeUtil.UTF8Result result = Unicode.fromStringAsUtf8(querySource);
this.querySource = result.result;
this.querySourceOffset = 0;
@@ -146,7 +151,8 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
/**
* The query source to execute in the form of a map.
*/
- @Required public DeleteByQueryRequest query(Map querySource) {
+ @Required
+ public DeleteByQueryRequest query(Map querySource) {
try {
XContentBuilder builder = XContentFactory.contentBuilder(contentType);
builder.map(querySource);
@@ -156,7 +162,8 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
}
}
- @Required public DeleteByQueryRequest query(XContentBuilder builder) {
+ @Required
+ public DeleteByQueryRequest query(XContentBuilder builder) {
try {
this.querySource = builder.underlyingBytes();
this.querySourceOffset = 0;
@@ -171,14 +178,16 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
/**
* The query source to execute.
*/
- @Required public DeleteByQueryRequest query(byte[] querySource) {
+ @Required
+ public DeleteByQueryRequest query(byte[] querySource) {
return query(querySource, 0, querySource.length, false);
}
/**
* The query source to execute.
*/
- @Required public DeleteByQueryRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
+ @Required
+ public DeleteByQueryRequest query(byte[] querySource, int offset, int length, boolean unsafe) {
this.querySource = querySource;
this.querySourceOffset = offset;
this.querySourceLength = length;
@@ -196,7 +205,8 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
/**
* A comma separated list of routing values to control the shards the search will be executed on.
*/
- @Override public String routing() {
+ @Override
+ public String routing() {
return this.routing;
}
@@ -304,7 +314,8 @@ public class DeleteByQueryRequest extends IndicesReplicationOperationRequest {
}
}
- @Override public String toString() {
+ @Override
+ public String toString() {
return "[" + Arrays.toString(indices) + "][" + Arrays.toString(types) + "], querySource[" + Unicode.fromBytes(querySource) + "]";
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java b/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java
index cc76a04ac4d..808cf5f1e74 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/DeleteByQueryResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -28,13 +28,13 @@ import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
-import static org.elasticsearch.common.collect.Maps.*;
+import static com.google.common.collect.Maps.newHashMap;
/**
* The response of delete by query action. Holds the {@link IndexDeleteByQueryResponse}s from all the
* different indices.
*
- * @author kimchy (shay.banon)
+ *
*/
public class DeleteByQueryResponse implements ActionResponse, Streamable, Iterable {
@@ -44,7 +44,8 @@ public class DeleteByQueryResponse implements ActionResponse, Streamable, Iterab
}
- @Override public Iterator iterator() {
+ @Override
+ public Iterator iterator() {
return indices.values().iterator();
}
@@ -69,7 +70,8 @@ public class DeleteByQueryResponse implements ActionResponse, Streamable, Iterab
return indices.get(index);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
int size = in.readVInt();
for (int i = 0; i < size; i++) {
IndexDeleteByQueryResponse response = new IndexDeleteByQueryResponse();
@@ -78,7 +80,8 @@ public class DeleteByQueryResponse implements ActionResponse, Streamable, Iterab
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(indices.size());
for (IndexDeleteByQueryResponse indexResponse : indices.values()) {
indexResponse.writeTo(out);
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryRequest.java b/src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryRequest.java
index 3f5953ec9c8..48134cc2478 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryRequest.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,6 +19,7 @@
package org.elasticsearch.action.deletebyquery;
+import gnu.trove.set.hash.THashSet;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.replication.IndexReplicationOperationRequest;
import org.elasticsearch.common.Nullable;
@@ -26,26 +27,27 @@ import org.elasticsearch.common.Required;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
-import org.elasticsearch.common.trove.set.hash.THashSet;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.QueryBuilder;
import java.io.IOException;
import java.util.Set;
-import static org.elasticsearch.action.Actions.*;
+import static org.elasticsearch.action.Actions.addValidationError;
/**
* Delete by query request to execute on a specific index.
*
- * @author kimchy (shay.banon)
+ *
*/
public class IndexDeleteByQueryRequest extends IndexReplicationOperationRequest {
private byte[] querySource;
private String[] types = Strings.EMPTY_ARRAY;
- @Nullable private Set routing;
- @Nullable private String[] filteringAliases;
+ @Nullable
+ private Set routing;
+ @Nullable
+ private String[] filteringAliases;
IndexDeleteByQueryRequest(DeleteByQueryRequest request, String index, @Nullable Set routing, @Nullable String[] filteringAliases) {
this.index = index;
@@ -65,7 +67,8 @@ public class IndexDeleteByQueryRequest extends IndexReplicationOperationRequest
return querySource;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = super.validate();
if (querySource == null) {
validationException = addValidationError("querySource is missing", validationException);
@@ -73,11 +76,13 @@ public class IndexDeleteByQueryRequest extends IndexReplicationOperationRequest
return validationException;
}
- @Required public IndexDeleteByQueryRequest querySource(QueryBuilder queryBuilder) {
+ @Required
+ public IndexDeleteByQueryRequest querySource(QueryBuilder queryBuilder) {
return querySource(queryBuilder.buildAsBytes());
}
- @Required public IndexDeleteByQueryRequest querySource(byte[] querySource) {
+ @Required
+ public IndexDeleteByQueryRequest querySource(byte[] querySource) {
this.querySource = querySource;
return this;
}
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryResponse.java b/src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryResponse.java
index ed967cda9cc..145ba46f72d 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryResponse.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/IndexDeleteByQueryResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,7 +29,7 @@ import java.io.IOException;
/**
* Delete by query response executed on a specific index.
*
- * @author kimchy (shay.banon)
+ *
*/
public class IndexDeleteByQueryResponse implements ActionResponse, Streamable {
@@ -105,13 +105,15 @@ public class IndexDeleteByQueryResponse implements ActionResponse, Streamable {
return failedShards;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
index = in.readUTF();
successfulShards = in.readVInt();
failedShards = in.readVInt();
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeUTF(index);
out.writeVInt(successfulShards);
out.writeVInt(failedShards);
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryRequest.java b/src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryRequest.java
index 5ff263c6242..f9f5baebf43 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryRequest.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,6 +19,7 @@
package org.elasticsearch.action.deletebyquery;
+import gnu.trove.set.hash.THashSet;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.replication.ShardReplicationOperationRequest;
import org.elasticsearch.common.Nullable;
@@ -26,26 +27,27 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Unicode;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
-import org.elasticsearch.common.trove.set.hash.THashSet;
import java.io.IOException;
import java.util.Arrays;
import java.util.Set;
-import static org.elasticsearch.action.Actions.*;
+import static org.elasticsearch.action.Actions.addValidationError;
/**
* Delete by query request to execute on a specific shard.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ShardDeleteByQueryRequest extends ShardReplicationOperationRequest {
private int shardId;
private byte[] querySource;
private String[] types = Strings.EMPTY_ARRAY;
- @Nullable private Set routing;
- @Nullable private String[] filteringAliases;
+ @Nullable
+ private Set routing;
+ @Nullable
+ private String[] filteringAliases;
ShardDeleteByQueryRequest(IndexDeleteByQueryRequest request, int shardId) {
this.index = request.index();
@@ -62,7 +64,8 @@ public class ShardDeleteByQueryRequest extends ShardReplicationOperationRequest
ShardDeleteByQueryRequest() {
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = super.validate();
if (querySource == null) {
addValidationError("querySource is missing", validationException);
@@ -90,7 +93,8 @@ public class ShardDeleteByQueryRequest extends ShardReplicationOperationRequest
return filteringAliases;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
querySource = new byte[in.readVInt()];
in.readFully(querySource);
@@ -118,7 +122,8 @@ public class ShardDeleteByQueryRequest extends ShardReplicationOperationRequest
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(querySource.length);
out.writeBytes(querySource);
@@ -145,7 +150,8 @@ public class ShardDeleteByQueryRequest extends ShardReplicationOperationRequest
}
}
- @Override public String toString() {
+ @Override
+ public String toString() {
String sSource = "_na_";
try {
sSource = Unicode.fromBytes(querySource);
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryResponse.java b/src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryResponse.java
index 264e584b350..3cea46f3bb3 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryResponse.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/ShardDeleteByQueryResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -29,13 +29,15 @@ import java.io.IOException;
/**
* Delete by query response executed on a specific shard.
*
- * @author kimchy (shay.banon)
+ *
*/
public class ShardDeleteByQueryResponse implements ActionResponse, Streamable {
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/TransportDeleteByQueryAction.java b/src/main/java/org/elasticsearch/action/deletebyquery/TransportDeleteByQueryAction.java
index e0405286bb7..e8d523dfb3d 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/TransportDeleteByQueryAction.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/TransportDeleteByQueryAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -36,16 +36,19 @@ import java.util.concurrent.atomic.AtomicReferenceArray;
*/
public class TransportDeleteByQueryAction extends TransportIndicesReplicationOperationAction {
- @Inject public TransportDeleteByQueryAction(Settings settings, ClusterService clusterService, TransportService transportService,
- ThreadPool threadPool, TransportIndexDeleteByQueryAction indexDeleteByQueryAction) {
+ @Inject
+ public TransportDeleteByQueryAction(Settings settings, ClusterService clusterService, TransportService transportService,
+ ThreadPool threadPool, TransportIndexDeleteByQueryAction indexDeleteByQueryAction) {
super(settings, transportService, clusterService, threadPool, indexDeleteByQueryAction);
}
- @Override protected DeleteByQueryRequest newRequestInstance() {
+ @Override
+ protected DeleteByQueryRequest newRequestInstance() {
return new DeleteByQueryRequest();
}
- @Override protected DeleteByQueryResponse newResponseInstance(DeleteByQueryRequest request, AtomicReferenceArray indexResponses) {
+ @Override
+ protected DeleteByQueryResponse newResponseInstance(DeleteByQueryRequest request, AtomicReferenceArray indexResponses) {
DeleteByQueryResponse response = new DeleteByQueryResponse();
for (int i = 0; i < indexResponses.length(); i++) {
IndexDeleteByQueryResponse indexResponse = (IndexDeleteByQueryResponse) indexResponses.get(i);
@@ -56,21 +59,25 @@ public class TransportDeleteByQueryAction extends TransportIndicesReplicationOpe
return response;
}
- @Override protected boolean accumulateExceptions() {
+ @Override
+ protected boolean accumulateExceptions() {
return false;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return TransportActions.DELETE_BY_QUERY;
}
- @Override protected void checkBlock(DeleteByQueryRequest request, String[] concreteIndices, ClusterState state) {
+ @Override
+ protected void checkBlock(DeleteByQueryRequest request, String[] concreteIndices, ClusterState state) {
for (String index : concreteIndices) {
state.blocks().indexBlockedRaiseException(ClusterBlockLevel.WRITE, index);
}
}
- @Override protected IndexDeleteByQueryRequest newIndexRequestInstance(DeleteByQueryRequest request, String index, Set routing) {
+ @Override
+ protected IndexDeleteByQueryRequest newIndexRequestInstance(DeleteByQueryRequest request, String index, Set routing) {
String[] filteringAliases = clusterService.state().metaData().filteringAliases(index, request.indices());
return new IndexDeleteByQueryRequest(request, index, routing, filteringAliases);
}
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java b/src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java
index c2001537f6e..cf4de3a1300 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -32,20 +32,23 @@ import org.elasticsearch.transport.TransportService;
import java.util.concurrent.atomic.AtomicReferenceArray;
/**
- * @author kimchy (shay.banon)
+ *
*/
public class TransportIndexDeleteByQueryAction extends TransportIndexReplicationOperationAction {
- @Inject public TransportIndexDeleteByQueryAction(Settings settings, ClusterService clusterService, TransportService transportService,
- ThreadPool threadPool, TransportShardDeleteByQueryAction shardDeleteByQueryAction) {
+ @Inject
+ public TransportIndexDeleteByQueryAction(Settings settings, ClusterService clusterService, TransportService transportService,
+ ThreadPool threadPool, TransportShardDeleteByQueryAction shardDeleteByQueryAction) {
super(settings, transportService, clusterService, threadPool, shardDeleteByQueryAction);
}
- @Override protected IndexDeleteByQueryRequest newRequestInstance() {
+ @Override
+ protected IndexDeleteByQueryRequest newRequestInstance() {
return new IndexDeleteByQueryRequest();
}
- @Override protected IndexDeleteByQueryResponse newResponseInstance(IndexDeleteByQueryRequest request, AtomicReferenceArray shardsResponses) {
+ @Override
+ protected IndexDeleteByQueryResponse newResponseInstance(IndexDeleteByQueryRequest request, AtomicReferenceArray shardsResponses) {
int successfulShards = 0;
int failedShards = 0;
for (int i = 0; i < shardsResponses.length(); i++) {
@@ -58,23 +61,28 @@ public class TransportIndexDeleteByQueryAction extends TransportIndexReplication
return new IndexDeleteByQueryResponse(request.index(), successfulShards, failedShards);
}
- @Override protected boolean accumulateExceptions() {
+ @Override
+ protected boolean accumulateExceptions() {
return false;
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return "indices/index/deleteByQuery";
}
- @Override protected void checkBlock(IndexDeleteByQueryRequest request, ClusterState state) {
+ @Override
+ protected void checkBlock(IndexDeleteByQueryRequest request, ClusterState state) {
state.blocks().indexBlockedRaiseException(ClusterBlockLevel.WRITE, request.index());
}
- @Override protected GroupShardsIterator shards(IndexDeleteByQueryRequest request) {
+ @Override
+ protected GroupShardsIterator shards(IndexDeleteByQueryRequest request) {
return clusterService.operationRouting().deleteByQueryShards(clusterService.state(), request.index(), request.routing());
}
- @Override protected ShardDeleteByQueryRequest newShardRequestInstance(IndexDeleteByQueryRequest request, int shardId) {
+ @Override
+ protected ShardDeleteByQueryRequest newShardRequestInstance(IndexDeleteByQueryRequest request, int shardId) {
return new ShardDeleteByQueryRequest(request, shardId);
}
}
\ No newline at end of file
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java b/src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java
index f295b77f746..d4958569020 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/TransportShardDeleteByQueryAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -36,45 +36,54 @@ import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
/**
- * @author kimchy (Shay Banon)
+ *
*/
public class TransportShardDeleteByQueryAction extends TransportShardReplicationOperationAction {
- @Inject public TransportShardDeleteByQueryAction(Settings settings, TransportService transportService,
- ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool,
- ShardStateAction shardStateAction) {
+ @Inject
+ public TransportShardDeleteByQueryAction(Settings settings, TransportService transportService,
+ ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool,
+ ShardStateAction shardStateAction) {
super(settings, transportService, clusterService, indicesService, threadPool, shardStateAction);
}
- @Override protected boolean checkWriteConsistency() {
+ @Override
+ protected boolean checkWriteConsistency() {
return true;
}
- @Override protected String executor() {
+ @Override
+ protected String executor() {
return ThreadPool.Names.INDEX;
}
- @Override protected ShardDeleteByQueryRequest newRequestInstance() {
+ @Override
+ protected ShardDeleteByQueryRequest newRequestInstance() {
return new ShardDeleteByQueryRequest();
}
- @Override protected ShardDeleteByQueryRequest newReplicaRequestInstance() {
+ @Override
+ protected ShardDeleteByQueryRequest newReplicaRequestInstance() {
return new ShardDeleteByQueryRequest();
}
- @Override protected ShardDeleteByQueryResponse newResponseInstance() {
+ @Override
+ protected ShardDeleteByQueryResponse newResponseInstance() {
return new ShardDeleteByQueryResponse();
}
- @Override protected String transportAction() {
+ @Override
+ protected String transportAction() {
return "indices/index/shard/deleteByQuery";
}
- @Override protected void checkBlock(ShardDeleteByQueryRequest request, ClusterState state) {
+ @Override
+ protected void checkBlock(ShardDeleteByQueryRequest request, ClusterState state) {
state.blocks().indexBlockedRaiseException(ClusterBlockLevel.WRITE, request.index());
}
- @Override protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
+ @Override
+ protected PrimaryResponse shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
ShardDeleteByQueryRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardRequest.shardId);
Engine.DeleteByQuery deleteByQuery = indexShard.prepareDeleteByQuery(request.querySource(), request.filteringAliases(), request.types());
@@ -83,14 +92,16 @@ public class TransportShardDeleteByQueryAction extends TransportShardReplication
}
- @Override protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
+ @Override
+ protected void shardOperationOnReplica(ReplicaOperationRequest shardRequest) {
ShardDeleteByQueryRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shardSafe(shardRequest.shardId);
Engine.DeleteByQuery deleteByQuery = indexShard.prepareDeleteByQuery(request.querySource(), request.filteringAliases(), request.types());
indexShard.deleteByQuery(deleteByQuery);
}
- @Override protected ShardIterator shards(ClusterState clusterState, ShardDeleteByQueryRequest request) {
+ @Override
+ protected ShardIterator shards(ClusterState clusterState, ShardDeleteByQueryRequest request) {
GroupShardsIterator group = clusterService.operationRouting().deleteByQueryShards(clusterService.state(), request.index(), request.routing());
for (ShardIterator shardIt : group) {
if (shardIt.shardId().id() == request.shardId()) {
diff --git a/src/main/java/org/elasticsearch/action/deletebyquery/package-info.java b/src/main/java/org/elasticsearch/action/deletebyquery/package-info.java
index 1a0bd668b3f..11de5d664c2 100644
--- a/src/main/java/org/elasticsearch/action/deletebyquery/package-info.java
+++ b/src/main/java/org/elasticsearch/action/deletebyquery/package-info.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
diff --git a/src/main/java/org/elasticsearch/action/get/GetRequest.java b/src/main/java/org/elasticsearch/action/get/GetRequest.java
index 2c291e3ed6a..ac02194aa58 100644
--- a/src/main/java/org/elasticsearch/action/get/GetRequest.java
+++ b/src/main/java/org/elasticsearch/action/get/GetRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -32,11 +32,11 @@ import java.io.IOException;
/**
* A request to get a document (its source) from an index based on its type (optional) and id. Best created using
* {@link org.elasticsearch.client.Requests#getRequest(String)}.
- *
+ *
* The operation requires the {@link #index()}, {@link #type(String)} and {@link #id(String)}
* to be set.
*
- * @author kimchy (shay.banon)
+ *
* @see org.elasticsearch.action.get.GetResponse
* @see org.elasticsearch.client.Requests#getRequest(String)
* @see org.elasticsearch.client.Client#get(GetRequest)
@@ -80,7 +80,8 @@ public class GetRequest extends SingleShardOperationRequest {
this.id = id;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = super.validate();
if (type == null) {
validationException = Actions.addValidationError("type is missing", validationException);
@@ -94,7 +95,8 @@ public class GetRequest extends SingleShardOperationRequest {
/**
* Sets the index of the document to fetch.
*/
- @Required public GetRequest index(String index) {
+ @Required
+ public GetRequest index(String index) {
this.index = index;
return this;
}
@@ -113,7 +115,8 @@ public class GetRequest extends SingleShardOperationRequest {
/**
* Sets the id of the document to fetch.
*/
- @Required public GetRequest id(String id) {
+ @Required
+ public GetRequest id(String id) {
this.id = id;
return this;
}
@@ -196,7 +199,8 @@ public class GetRequest extends SingleShardOperationRequest {
/**
* Should the listener be called on a separate thread if needed.
*/
- @Override public GetRequest listenerThreaded(boolean threadedListener) {
+ @Override
+ public GetRequest listenerThreaded(boolean threadedListener) {
super.listenerThreaded(threadedListener);
return this;
}
@@ -204,12 +208,14 @@ public class GetRequest extends SingleShardOperationRequest {
/**
* Controls if the operation will be executed on a separate thread when executed locally.
*/
- @Override public GetRequest operationThreaded(boolean threadedOperation) {
+ @Override
+ public GetRequest operationThreaded(boolean threadedOperation) {
super.operationThreaded(threadedOperation);
return this;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
type = in.readUTF();
@@ -237,7 +243,8 @@ public class GetRequest extends SingleShardOperationRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeUTF(type);
@@ -273,7 +280,8 @@ public class GetRequest extends SingleShardOperationRequest {
}
}
- @Override public String toString() {
+ @Override
+ public String toString() {
return "[" + index + "][" + type + "][" + id + "]: routing [" + routing + "]";
}
}
diff --git a/src/main/java/org/elasticsearch/action/get/GetResponse.java b/src/main/java/org/elasticsearch/action/get/GetResponse.java
index bb2ff5d9fb6..5ba4a524f3b 100644
--- a/src/main/java/org/elasticsearch/action/get/GetResponse.java
+++ b/src/main/java/org/elasticsearch/action/get/GetResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -37,7 +37,7 @@ import java.util.Map;
/**
* The response of a get action.
*
- * @author kimchy (shay.banon)
+ *
* @see GetRequest
* @see org.elasticsearch.client.Client#get(GetRequest)
*/
@@ -174,19 +174,23 @@ public class GetResponse implements ActionResponse, Streamable, Iterable iterator() {
+ @Override
+ public Iterator iterator() {
return getResult.iterator();
}
- @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
+ @Override
+ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return getResult.toXContent(builder, params);
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
getResult = GetResult.readGetResult(in);
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
getResult.writeTo(out);
}
}
diff --git a/src/main/java/org/elasticsearch/action/get/MultiGetItemResponse.java b/src/main/java/org/elasticsearch/action/get/MultiGetItemResponse.java
index 5a4397e85a1..b16ec14eff4 100644
--- a/src/main/java/org/elasticsearch/action/get/MultiGetItemResponse.java
+++ b/src/main/java/org/elasticsearch/action/get/MultiGetItemResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -141,7 +141,8 @@ public class MultiGetItemResponse implements Streamable {
return response;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
if (in.readBoolean()) {
failure = MultiGetResponse.Failure.readFailure(in);
} else {
@@ -150,7 +151,8 @@ public class MultiGetItemResponse implements Streamable {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
if (failure != null) {
out.writeBoolean(true);
failure.writeTo(out);
diff --git a/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java b/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java
index 96fc637d260..10bba6e0dec 100644
--- a/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java
+++ b/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -107,7 +107,8 @@ public class MultiGetRequest implements ActionRequest {
return item;
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
index = in.readUTF();
if (in.readBoolean()) {
type = in.readUTF();
@@ -125,7 +126,8 @@ public class MultiGetRequest implements ActionRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeUTF(index);
if (type == null) {
out.writeBoolean(false);
@@ -169,16 +171,19 @@ public class MultiGetRequest implements ActionRequest {
return this;
}
- @Override public boolean listenerThreaded() {
+ @Override
+ public boolean listenerThreaded() {
return listenerThreaded;
}
- @Override public MultiGetRequest listenerThreaded(boolean listenerThreaded) {
+ @Override
+ public MultiGetRequest listenerThreaded(boolean listenerThreaded) {
this.listenerThreaded = listenerThreaded;
return this;
}
- @Override public ActionRequestValidationException validate() {
+ @Override
+ public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (items.isEmpty()) {
validationException = Actions.addValidationError("no documents to get", validationException);
@@ -292,7 +297,8 @@ public class MultiGetRequest implements ActionRequest {
}
}
- @Override public void readFrom(StreamInput in) throws IOException {
+ @Override
+ public void readFrom(StreamInput in) throws IOException {
if (in.readBoolean()) {
preference = in.readUTF();
}
@@ -311,7 +317,8 @@ public class MultiGetRequest implements ActionRequest {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
if (preference == null) {
out.writeBoolean(false);
} else {
diff --git a/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java b/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java
index 54955b0d8e5..a23832be597 100644
--- a/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java
+++ b/src/main/java/org/elasticsearch/action/get/MultiGetResponse.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -19,8 +19,8 @@
package org.elasticsearch.action.get;
+import com.google.common.collect.Iterators;
import org.elasticsearch.action.ActionResponse;
-import org.elasticsearch.common.collect.Iterators;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Streamable;
@@ -115,7 +115,8 @@ public class MultiGetResponse implements ActionResponse, Iterable iterator() {
+ @Override
+ public Iterator iterator() {
return Iterators.forArray(responses);
}
- @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
+ @Override
+ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
builder.startArray(Fields.DOCS);
for (MultiGetItemResponse response : responses) {
@@ -184,14 +188,16 @@ public class MultiGetResponse implements ActionResponse, Iterable(size);
@@ -74,7 +75,8 @@ public class MultiGetShardResponse implements ActionResponse {
}
}
- @Override public void writeTo(StreamOutput out) throws IOException {
+ @Override
+ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(locations.size());
for (int i = 0; i < locations.size(); i++) {
out.writeVInt(locations.get(i));
diff --git a/src/main/java/org/elasticsearch/action/get/TransportGetAction.java b/src/main/java/org/elasticsearch/action/get/TransportGetAction.java
index 8437ad17b4f..202670c3f6d 100644
--- a/src/main/java/org/elasticsearch/action/get/TransportGetAction.java
+++ b/src/main/java/org/elasticsearch/action/get/TransportGetAction.java
@@ -1,8 +1,8 @@
/*
- * Licensed to Elastic Search and Shay Banon under one
+ * Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. Elastic Search licenses this
+ * regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@@ -41,7 +41,7 @@ import org.elasticsearch.transport.TransportService;
/**
* Performs the get operation.
*
- * @author kimchy (shay.banon)
+ *
*/
public class TransportGetAction extends TransportShardSingleOperationAction {
@@ -49,36 +49,43 @@ public class TransportGetAction extends TransportShardSingleOperationAction listener) {
+ @Override
+ protected void doExecute(GetRequest request, ActionListener listener) {
if (request.realtime == null) {
request.realtime = this.realtime;
}
@@ -89,7 +96,8 @@ public class TransportGetAction extends TransportShardSingleOperationAction listener) {
+ @Override
+ protected void doExecute(final MultiGetRequest request, final ActionListener listener) {
ClusterState clusterState = clusterService.state();
Map shardRequests = new HashMap();
for (int i = 0; i < request.items.size(); i++) {
@@ -76,7 +78,8 @@ public class TransportMultiGetAction extends BaseAction() {
- @Override public void onResponse(MultiGetShardResponse response) {
+ @Override
+ public void onResponse(MultiGetShardResponse response) {
synchronized (responses) {
for (int i = 0; i < response.locations.size(); i++) {
responses[response.locations.get(i)] = new MultiGetItemResponse(response.responses.get(i), response.failures.get(i));
@@ -87,7 +90,8 @@ public class TransportMultiGetAction extends BaseAction {
- @Override public MultiGetRequest newInstance() {
+ @Override
+ public MultiGetRequest newInstance() {
return new MultiGetRequest();
}
- @Override public void messageReceived(final MultiGetRequest request, final TransportChannel channel) throws Exception {
+ @Override
+ public void messageReceived(final MultiGetRequest request, final TransportChannel channel) throws Exception {
// no need to use threaded listener, since we just send a response
request.listenerThreaded(false);
execute(request, new ActionListener