Remove <T> from Writeable

It isn't needed any more! Hurray!

Closes #17085
This commit is contained in:
Nik Everett 2016-04-21 11:06:19 -04:00
parent 9f4cb3de9f
commit 9511c269c6
98 changed files with 114 additions and 120 deletions

View File

@ -739,7 +739,6 @@
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]AggregationContext.java" checks="LineLength" />
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]AggregationPath.java" checks="LineLength" />
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]GeoPointParser.java" checks="LineLength" />
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]ValueType.java" checks="LineLength" />
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]ValuesSourceParser.java" checks="LineLength" />
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]format[/\\]ValueFormat.java" checks="LineLength" />
<suppress files="core[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]search[/\\]aggregations[/\\]support[/\\]format[/\\]ValueParser.java" checks="LineLength" />

View File

@ -37,7 +37,7 @@ import static org.elasticsearch.ExceptionsHelper.detailedMessage;
*
* The class is final due to serialization limitations
*/
public final class TaskOperationFailure implements Writeable<TaskOperationFailure>, ToXContent {
public final class TaskOperationFailure implements Writeable, ToXContent {
private final String nodeId;

View File

@ -40,7 +40,7 @@ import java.util.Map;
* A {@code ClusterAllocationExplanation} is an explanation of why a shard may or may not be allocated to nodes. It also includes weights
* for where the shard is likely to be assigned. It is an immutable class
*/
public final class ClusterAllocationExplanation implements ToXContent, Writeable<ClusterAllocationExplanation> {
public final class ClusterAllocationExplanation implements ToXContent, Writeable {
private final ShardId shard;
private final boolean primary;

View File

@ -39,7 +39,7 @@ import java.util.concurrent.TimeUnit;
* and use in APIs. Instead, immutable and streamable TaskInfo objects are used to represent
* snapshot information about currently running tasks.
*/
public class TaskInfo implements Writeable<TaskInfo>, ToXContent {
public class TaskInfo implements Writeable, ToXContent {
private final DiscoveryNode node;

View File

@ -48,7 +48,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
public class ClusterStatsNodes implements ToXContent, Writeable<ClusterStatsNodes> {
public class ClusterStatsNodes implements ToXContent, Writeable {
private final Counts counts;
private final Set<Version> versions;
@ -200,7 +200,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable<ClusterStatsNode
return builder;
}
public static class Counts implements Writeable<Counts>, ToXContent {
public static class Counts implements Writeable, ToXContent {
static final String COORDINATING_ONLY = "coordinating_only";
private final int total;
@ -263,7 +263,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable<ClusterStatsNode
}
}
public static class OsStats implements ToXContent, Writeable<OsStats> {
public static class OsStats implements ToXContent, Writeable {
final int availableProcessors;
final int allocatedProcessors;
final ObjectIntHashMap<String> names;
@ -343,7 +343,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable<ClusterStatsNode
}
}
public static class ProcessStats implements ToXContent, Writeable<ProcessStats> {
public static class ProcessStats implements ToXContent, Writeable {
final int count;
final int cpuPercent;
@ -456,7 +456,7 @@ public class ClusterStatsNodes implements ToXContent, Writeable<ClusterStatsNode
}
}
public static class JvmStats implements Writeable<JvmStats>, ToXContent {
public static class JvmStats implements Writeable, ToXContent {
private final ObjectIntHashMap<JvmVersion> versions;
private final long threads;

View File

@ -78,7 +78,7 @@ public class BulkItemResponse implements Streamable, StatusToXContent {
/**
* Represents a failure.
*/
public static class Failure implements Writeable<Failure>, ToXContent {
public static class Failure implements Writeable, ToXContent {
static final String INDEX_FIELD = "index";
static final String TYPE_FIELD = "type";
static final String ID_FIELD = "id";

View File

@ -29,7 +29,7 @@ import java.io.IOException;
/**
* Holds the end result of what a pipeline did to sample document provided via the simulate api.
*/
public final class SimulateDocumentBaseResult implements SimulateDocumentResult<SimulateDocumentBaseResult> {
public final class SimulateDocumentBaseResult implements SimulateDocumentResult {
private final WriteableIngestDocument ingestDocument;
private final Exception failure;

View File

@ -21,6 +21,6 @@ package org.elasticsearch.action.ingest;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.xcontent.ToXContent;
public interface SimulateDocumentResult<T extends SimulateDocumentResult> extends Writeable<T>, ToXContent {
public interface SimulateDocumentResult extends Writeable, ToXContent {
}

View File

@ -30,7 +30,7 @@ import java.util.List;
* Holds the result of what a pipeline did to a sample document via the simulate api, but instead of {@link SimulateDocumentBaseResult}
* this result class holds the intermediate result each processor did to the sample document.
*/
public final class SimulateDocumentVerboseResult implements SimulateDocumentResult<SimulateDocumentVerboseResult> {
public final class SimulateDocumentVerboseResult implements SimulateDocumentResult {
private final List<SimulateProcessorResult> processorResults;
public SimulateDocumentVerboseResult(List<SimulateProcessorResult> processorResults) {

View File

@ -76,7 +76,7 @@ public class SimulatePipelineResponse extends ActionResponse implements ToXConte
int responsesLength = in.readVInt();
results = new ArrayList<>();
for (int i = 0; i < responsesLength; i++) {
SimulateDocumentResult<?> simulateDocumentResult;
SimulateDocumentResult simulateDocumentResult;
if (verbose) {
simulateDocumentResult = new SimulateDocumentVerboseResult(in);
} else {

View File

@ -29,7 +29,7 @@ import org.elasticsearch.ingest.core.IngestDocument;
import java.io.IOException;
public class SimulateProcessorResult implements Writeable<SimulateProcessorResult>, ToXContent {
public class SimulateProcessorResult implements Writeable, ToXContent {
private final String processorTag;
private final WriteableIngestDocument ingestDocument;
private final Exception failure;

View File

@ -30,7 +30,7 @@ import java.io.IOException;
import java.util.Map;
import java.util.Objects;
final class WriteableIngestDocument implements Writeable<WriteableIngestDocument>, ToXContent {
final class WriteableIngestDocument implements Writeable, ToXContent {
private final IngestDocument ingestDocument;

View File

@ -61,10 +61,10 @@ import java.util.function.Supplier;
* The base class for transport actions that are interacting with currently running tasks.
*/
public abstract class TransportTasksAction<
OperationTask extends Task,
TasksRequest extends BaseTasksRequest<TasksRequest>,
TasksResponse extends BaseTasksResponse,
TaskResponse extends Writeable<TaskResponse>
OperationTask extends Task,
TasksRequest extends BaseTasksRequest<TasksRequest>,
TasksResponse extends BaseTasksResponse,
TaskResponse extends Writeable
> extends HandledTransportAction<TasksRequest, TasksResponse> {
protected final ClusterName clusterName;

View File

@ -27,7 +27,7 @@ import java.io.IOException;
/**
* Cluster state part, changes in which can be serialized
*/
public interface Diffable<T> extends Writeable<T> {
public interface Diffable<T> extends Writeable {
/**
* Returns serializable object representing differences between this and previousState

View File

@ -44,7 +44,7 @@ import static org.elasticsearch.common.transport.TransportAddressSerializers.add
/**
* A discovery node represents a node that is part of the cluster.
*/
public class DiscoveryNode implements Writeable<DiscoveryNode>, ToXContent {
public class DiscoveryNode implements Writeable, ToXContent {
public static boolean isLocalNode(Settings settings) {
if (Node.NODE_LOCAL_SETTING.exists(settings)) {

View File

@ -40,7 +40,7 @@ import java.io.IOException;
/**
* Holds additional information as to why the shard is in unassigned state.
*/
public class UnassignedInfo implements ToXContent, Writeable<UnassignedInfo> {
public class UnassignedInfo implements ToXContent, Writeable {
public static final FormatDateTimeFormatter DATE_TIME_FORMATTER = Joda.forPattern("dateOptionalTime");
private static final TimeValue DEFAULT_DELAYED_NODE_LEFT_TIMEOUT = TimeValue.timeValueMinutes(1);

View File

@ -30,7 +30,7 @@ import java.io.IOException;
/**
* This interface defines the basic methods of commands for allocation
*/
public interface AllocationCommand extends NamedWriteable<AllocationCommand>, ToXContent {
public interface AllocationCommand extends NamedWriteable, ToXContent {
interface Parser<T extends AllocationCommand> {
/**
* Reads an {@link AllocationCommand} of type <code>T</code> from a {@link XContentParser}.

View File

@ -38,7 +38,7 @@ import java.util.Locale;
/**
* Geo distance calculation.
*/
public enum GeoDistance implements Writeable<GeoDistance> {
public enum GeoDistance implements Writeable {
/**
* Calculates distance as points on a plane. Faster, but less accurate than {@link #ARC}.
*/

View File

@ -30,7 +30,7 @@ import java.util.Locale;
* Enum representing the relationship between a Query / Filter Shape and indexed Shapes
* that will be used to determine if a Document should be matched or not
*/
public enum ShapeRelation implements Writeable<ShapeRelation>{
public enum ShapeRelation implements Writeable {
INTERSECTS("intersects"),
DISJOINT("disjoint"),

View File

@ -27,7 +27,7 @@ import java.io.IOException;
/**
*
*/
public enum SpatialStrategy implements Writeable<SpatialStrategy> {
public enum SpatialStrategy implements Writeable {
TERM("term"),
RECURSIVE("recursive");

View File

@ -51,7 +51,7 @@ import java.util.Locale;
/**
* Basic class for building GeoJSON shapes like Polygons, Linestrings, etc
*/
public abstract class ShapeBuilder extends ToXContentToBytes implements NamedWriteable<ShapeBuilder> {
public abstract class ShapeBuilder extends ToXContentToBytes implements NamedWriteable {
protected static final ESLogger LOGGER = ESLoggerFactory.getLogger(ShapeBuilder.class.getName());

View File

@ -24,7 +24,7 @@ package org.elasticsearch.common.io.stream;
* To be used for arbitrary serializable objects (e.g. queries); when reading them, their name tells
* which specific object needs to be created.
*/
public interface NamedWriteable<T> extends Writeable<T> {
public interface NamedWriteable extends Writeable {
/**
* Returns the name of the writeable object

View File

@ -34,7 +34,7 @@ public class NamedWriteableAwareStreamInput extends FilterStreamInput {
}
@Override
public <C extends NamedWriteable<?>> C readNamedWriteable(Class<C> categoryClass) throws IOException {
public <C extends NamedWriteable> C readNamedWriteable(Class<C> categoryClass) throws IOException {
String name = readString();
Writeable.Reader<? extends C> reader = namedWriteableRegistry.getReader(categoryClass, name);
C c = reader.read(this);

View File

@ -36,7 +36,6 @@ public class NamedWriteableRegistry {
* This method suppresses the rawtypes warning because it intentionally using NamedWriteable instead of {@code NamedWriteable<T>} so it
* is easier to use and because we might be able to drop the type parameter from NamedWriteable entirely some day.
*/
@SuppressWarnings("rawtypes")
public synchronized <T extends NamedWriteable> void register(Class<T> categoryClass, String name,
Writeable.Reader<? extends T> reader) {
@SuppressWarnings("unchecked")

View File

@ -714,14 +714,14 @@ public abstract class StreamInput extends InputStream {
* Use {@link FilterInputStream} instead which wraps a stream and supports a {@link NamedWriteableRegistry} too.
*/
@Nullable
public <C extends NamedWriteable<?>> C readNamedWriteable(@SuppressWarnings("unused") Class<C> categoryClass) throws IOException {
public <C extends NamedWriteable> C readNamedWriteable(@SuppressWarnings("unused") Class<C> categoryClass) throws IOException {
throw new UnsupportedOperationException("can't read named writeable from StreamInput");
}
/**
* Reads an optional {@link NamedWriteable}.
*/
public <C extends NamedWriteable<?>> C readOptionalNamedWriteable(Class<C> categoryClass) throws IOException {
public <C extends NamedWriteable> C readOptionalNamedWriteable(Class<C> categoryClass) throws IOException {
if (readBoolean()) {
return readNamedWriteable(categoryClass);
}

View File

@ -544,7 +544,7 @@ public abstract class StreamOutput extends OutputStream {
}
}
public void writeOptionalWriteable(@Nullable Writeable<?> writeable) throws IOException {
public void writeOptionalWriteable(@Nullable Writeable writeable) throws IOException {
if (writeable != null) {
writeBoolean(true);
writeable.writeTo(this);
@ -675,7 +675,7 @@ public abstract class StreamOutput extends OutputStream {
/**
* Writes a {@link NamedWriteable} to the current stream, by first writing its name and then the object itself
*/
public void writeNamedWriteable(NamedWriteable<?> namedWriteable) throws IOException {
public void writeNamedWriteable(NamedWriteable namedWriteable) throws IOException {
writeString(namedWriteable.getWriteableName());
namedWriteable.writeTo(this);
}
@ -683,7 +683,7 @@ public abstract class StreamOutput extends OutputStream {
/**
* Write an optional {@link NamedWriteable} to the stream.
*/
public void writeOptionalNamedWriteable(@Nullable NamedWriteable<?> namedWriteable) throws IOException {
public void writeOptionalNamedWriteable(@Nullable NamedWriteable namedWriteable) throws IOException {
if (namedWriteable == null) {
writeBoolean(false);
} else {
@ -722,7 +722,7 @@ public abstract class StreamOutput extends OutputStream {
/**
* Writes a list of {@link Writeable} objects
*/
public <T extends Writeable<T>> void writeList(List<T> list) throws IOException {
public <T extends Writeable> void writeList(List<T> list) throws IOException {
writeVInt(list.size());
for (T obj: list) {
obj.writeTo(this);

View File

@ -32,7 +32,7 @@ import java.io.IOException;
* Prefer implementing this interface over implementing {@link Streamable} where possible. Lots of code depends on {@linkplain Streamable}
* so this isn't always possible.
*/
public interface Writeable<T> { // TODO remove <T>
public interface Writeable {
/**
* Write this into the {@linkplain StreamOutput}.
*/

View File

@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.Writeable;
import java.io.IOException;
import java.util.Locale;
public enum CombineFunction implements Writeable<CombineFunction> {
public enum CombineFunction implements Writeable {
MULTIPLY {
@Override
public float combine(double queryScore, double funcScore, double maxBoost) {

View File

@ -125,7 +125,7 @@ public class FieldValueFactorFunction extends ScoreFunction {
* The Type class encapsulates the modification types that can be applied
* to the score/value product.
*/
public enum Modifier implements Writeable<Modifier> {
public enum Modifier implements Writeable {
NONE {
@Override
public double apply(double n) {

View File

@ -75,7 +75,7 @@ public class FiltersFunctionScoreQuery extends Query {
}
}
public enum ScoreMode implements Writeable<ScoreMode> {
public enum ScoreMode implements Writeable {
FIRST, AVG, MAX, SUM, MIN, MULTIPLY;
@Override

View File

@ -25,7 +25,7 @@ import org.elasticsearch.common.io.stream.Writeable;
/**
*
*/
public interface TransportAddress extends Writeable<TransportAddress> {
public interface TransportAddress extends Writeable {
/**
* Returns the host string for this transport address

View File

@ -33,7 +33,7 @@ import java.io.IOException;
* the earth ellipsoid defined in {@link GeoUtils}. The default unit used within
* this project is <code>METERS</code> which is defined by <code>DEFAULT</code>
*/
public enum DistanceUnit implements Writeable<DistanceUnit> {
public enum DistanceUnit implements Writeable {
INCH(0.0254, "in", "inch"),
YARD(0.9144, "yd", "yards"),
FEET(0.3048, "ft", "feet"),

View File

@ -35,7 +35,7 @@ import java.util.Objects;
* parsing and conversion from similarities to edit distances
* etc.
*/
public final class Fuzziness implements ToXContent, Writeable<Fuzziness> {
public final class Fuzziness implements ToXContent, Writeable {
public static final String X_FIELD_NAME = "fuzziness";
public static final Fuzziness ZERO = new Fuzziness(0);

View File

@ -60,7 +60,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* </pre>
*
*/
public final class ThreadContext implements Closeable, Writeable<ThreadContext> {
public final class ThreadContext implements Closeable, Writeable {
public static final String PREFIX = "request.headers";
public static final Setting<Settings> DEFAULT_HEADERS_SETTING = Setting.groupSetting(PREFIX + ".", Property.NodeScope);

View File

@ -29,7 +29,7 @@ import java.io.IOException;
/**
*
*/
public class Index implements Writeable<Index> {
public class Index implements Writeable {
public static final Index[] EMPTY_ARRAY = new Index[0];

View File

@ -28,7 +28,7 @@ import java.io.IOException;
/**
*
*/
public enum VersionType implements Writeable<VersionType> {
public enum VersionType implements Writeable {
INTERNAL((byte) 0) {
@Override
public boolean isVersionConflictForWrites(long currentVersion, long expectedVersion, boolean deleted) {

View File

@ -27,7 +27,7 @@ import org.elasticsearch.common.io.stream.Writeable;
import java.io.IOException;
/** Specifies how a geo query should be run. */
public enum GeoExecType implements Writeable<GeoExecType> {
public enum GeoExecType implements Writeable {
MEMORY(0), INDEXED(1);

View File

@ -34,7 +34,7 @@ import java.io.IOException;
* On IGNORE_MALFORMED invalid coordinates are being accepted.
* On COERCE invalid coordinates are being corrected to the most likely valid coordinate.
* */
public enum GeoValidationMethod implements Writeable<GeoValidationMethod>{
public enum GeoValidationMethod implements Writeable {
COERCE, IGNORE_MALFORMED, STRICT;
public static final GeoValidationMethod DEFAULT = STRICT;

View File

@ -147,7 +147,7 @@ public class MoreLikeThisQueryBuilder extends AbstractQueryBuilder<MoreLikeThisQ
/**
* A single item to be used for a {@link MoreLikeThisQueryBuilder}.
*/
public static final class Item implements ToXContent, Writeable<Item> {
public static final class Item implements ToXContent, Writeable {
public static final Item[] EMPTY_ARRAY = new Item[0];
public interface Field {

View File

@ -93,7 +93,7 @@ public class MultiMatchQueryBuilder extends AbstractQueryBuilder<MultiMatchQuery
private Float cutoffFrequency = null;
private MatchQuery.ZeroTermsQuery zeroTermsQuery = DEFAULT_ZERO_TERMS_QUERY;
public enum Type implements Writeable<Type> {
public enum Type implements Writeable {
/**
* Uses the best matching boolean field as main score and uses

View File

@ -28,7 +28,7 @@ import org.elasticsearch.common.util.CollectionUtils;
import java.io.IOException;
import java.util.Locale;
public enum Operator implements Writeable<Operator> {
public enum Operator implements Writeable {
OR, AND;
public BooleanClause.Occur toBooleanClauseOccur() {

View File

@ -25,7 +25,7 @@ import org.elasticsearch.common.xcontent.ToXContent;
import java.io.IOException;
public interface QueryBuilder<QB extends QueryBuilder<QB>> extends NamedWriteable<QB>, ToXContent {
public interface QueryBuilder<QB extends QueryBuilder<QB>> extends NamedWriteable, ToXContent {
/**
* Converts this QueryBuilder to a lucene {@link Query}.

View File

@ -331,7 +331,7 @@ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder<FunctionScor
* Function to be associated with an optional filter, meaning it will be executed only for the documents
* that match the given filter.
*/
public static class FilterFunctionBuilder implements ToXContent, Writeable<FilterFunctionBuilder> {
public static class FilterFunctionBuilder implements ToXContent, Writeable {
private final QueryBuilder<?> filter;
private final ScoreFunctionBuilder<?> scoreFunction;

View File

@ -31,7 +31,7 @@ import org.elasticsearch.index.query.QueryShardContext;
import java.io.IOException;
import java.util.Objects;
public abstract class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>> implements ToXContent, NamedWriteable<FB> {
public abstract class ScoreFunctionBuilder<FB extends ScoreFunctionBuilder<FB>> implements ToXContent, NamedWriteable {
private Float weight;

View File

@ -59,7 +59,7 @@ import java.util.Optional;
import static org.elasticsearch.common.xcontent.XContentParser.Token.END_OBJECT;
public final class InnerHitBuilder extends ToXContentToBytes implements Writeable<InnerHitBuilder> {
public final class InnerHitBuilder extends ToXContentToBytes implements Writeable {
public static final ParseField NAME_FIELD = new ParseField("name");
public static final ParseField NESTED_PATH_FIELD = new ParseField("path");

View File

@ -33,7 +33,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public final class InnerHitsBuilder extends ToXContentToBytes implements Writeable<InnerHitsBuilder> {
public final class InnerHitsBuilder extends ToXContentToBytes implements Writeable {
private final Map<String, InnerHitBuilder> innerHitsBuilders;
public InnerHitsBuilder() {

View File

@ -48,7 +48,7 @@ import java.io.IOException;
public class MatchQuery {
public static enum Type implements Writeable<Type> {
public static enum Type implements Writeable {
/**
* The text is analyzed and terms are added to a boolean query.
*/
@ -84,7 +84,7 @@ public class MatchQuery {
}
}
public static enum ZeroTermsQuery implements Writeable<ZeroTermsQuery> {
public static enum ZeroTermsQuery implements Writeable {
NONE(0),
ALL(1);

View File

@ -729,7 +729,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
*
* @see StoreFileMetaData
*/
public final static class MetadataSnapshot implements Iterable<StoreFileMetaData>, Writeable<MetadataSnapshot> {
public final static class MetadataSnapshot implements Iterable<StoreFileMetaData>, Writeable {
private final Map<String, StoreFileMetaData> metadata;
public static final MetadataSnapshot EMPTY = new MetadataSnapshot();

View File

@ -34,7 +34,7 @@ import java.util.Objects;
/**
* Encapsulates the parameters needed to fetch terms.
*/
public class TermsLookup implements Writeable<TermsLookup>, ToXContent {
public class TermsLookup implements Writeable, ToXContent {
private String index;
private final String type;
private final String id;

View File

@ -30,7 +30,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
public class IngestStats implements Writeable<IngestStats>, ToXContent {
public class IngestStats implements Writeable, ToXContent {
private final Stats totalStats;
private final Map<String, Stats> statsPerPipeline;
@ -93,7 +93,7 @@ public class IngestStats implements Writeable<IngestStats>, ToXContent {
return builder;
}
public static class Stats implements Writeable<Stats>, ToXContent {
public static class Stats implements Writeable, ToXContent {
private final long ingestCount;
private final long ingestTimeInMillis;

View File

@ -31,7 +31,7 @@ import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
public class IngestInfo implements Writeable<IngestInfo>, ToXContent {
public class IngestInfo implements Writeable, ToXContent {
private final Set<ProcessorInfo> processors;

View File

@ -27,7 +27,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import java.io.IOException;
public class ProcessorInfo implements Writeable<ProcessorInfo>, ToXContent, Comparable<ProcessorInfo> {
public class ProcessorInfo implements Writeable, ToXContent, Comparable<ProcessorInfo> {
private final String type;

View File

@ -46,7 +46,7 @@ import java.util.Objects;
import java.util.concurrent.Callable;
/** A formatter for values as returned by the fielddata/doc-values APIs. */
public interface DocValueFormat extends NamedWriteable<DocValueFormat> {
public interface DocValueFormat extends NamedWriteable {
String format(long value);

View File

@ -45,7 +45,7 @@ import java.util.Locale;
/**
* Defines what values to pick in the case a document contains multiple values for a particular field.
*/
public enum MultiValueMode implements Writeable<MultiValueMode> {
public enum MultiValueMode implements Writeable {
/**
* Pick the sum of all the values.

View File

@ -33,7 +33,7 @@ import java.io.IOException;
/**
* The target that the search request was executed on.
*/
public class SearchShardTarget implements Writeable<SearchShardTarget>, Comparable<SearchShardTarget> {
public class SearchShardTarget implements Writeable, Comparable<SearchShardTarget> {
private Text nodeId;
private Text index;

View File

@ -102,7 +102,7 @@ public abstract class Aggregator extends BucketCollector implements Releasable {
public abstract InternalAggregation buildEmptyAggregation();
/** Aggregation mode for sub aggregations. */
public enum SubAggCollectionMode implements Writeable<SubAggCollectionMode> {
public enum SubAggCollectionMode implements Writeable {
/**
* Creates buckets and delegates to child aggregators in a single pass over

View File

@ -36,8 +36,7 @@ import java.util.Objects;
/**
* A factory that knows how to create an {@link Aggregator} of a specific type.
*/
public abstract class AggregatorBuilder<AB extends AggregatorBuilder<AB>> extends ToXContentToBytes
implements NamedWriteable<AB>, ToXContent {
public abstract class AggregatorBuilder<AB extends AggregatorBuilder<AB>> extends ToXContentToBytes implements NamedWriteable, ToXContent {
protected String name;
protected Type type;

View File

@ -122,7 +122,7 @@ public class AggregatorFactories {
}
}
public static class Builder extends ToXContentToBytes implements Writeable<Builder> {
public static class Builder extends ToXContentToBytes implements Writeable {
private final Set<String> names = new HashSet<>();
private final List<AggregatorBuilder<?>> aggregatorBuilders = new ArrayList<>();
private final List<PipelineAggregatorBuilder<?>> pipelineAggregatorBuilders = new ArrayList<>();

View File

@ -57,7 +57,7 @@ public class FiltersAggregator extends BucketsAggregator {
public static final ParseField OTHER_BUCKET_FIELD = new ParseField("other_bucket");
public static final ParseField OTHER_BUCKET_KEY_FIELD = new ParseField("other_bucket_key");
public static class KeyedFilter implements Writeable<KeyedFilter>, ToXContent {
public static class KeyedFilter implements Writeable, ToXContent {
private final String key;
private final QueryBuilder<?> filter;

View File

@ -29,7 +29,7 @@ import java.util.Objects;
/**
* The interval the date histogram is based on.
*/
public class DateHistogramInterval implements Writeable<DateHistogramInterval> {
public class DateHistogramInterval implements Writeable {
public static final DateHistogramInterval SECOND = new DateHistogramInterval("1s");
public static final DateHistogramInterval MINUTE = new DateHistogramInterval("1m");

View File

@ -36,7 +36,7 @@ import org.elasticsearch.search.internal.SearchContext;
import java.io.IOException;
import java.util.Objects;
public class ExtendedBounds implements ToXContent, Writeable<ExtendedBounds> {
public class ExtendedBounds implements ToXContent, Writeable {
static final ParseField EXTENDED_BOUNDS_FIELD = new ParseField("extended_bounds");
static final ParseField MIN_FIELD = new ParseField("min");

View File

@ -57,7 +57,7 @@ public class RangeAggregator extends BucketsAggregator {
public static final ParseField RANGES_FIELD = new ParseField("ranges");
public static final ParseField KEYED_FIELD = new ParseField("keyed");
public static class Range implements Writeable<Range>, ToXContent {
public static class Range implements Writeable, ToXContent {
public static final ParseField KEY_FIELD = new ParseField("key");
public static final ParseField FROM_FIELD = new ParseField("from");
public static final ParseField TO_FIELD = new ParseField("to");

View File

@ -25,7 +25,7 @@ import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.search.aggregations.InternalAggregation;
import org.elasticsearch.search.internal.SearchContext;
public abstract class SignificanceHeuristic implements NamedWriteable<SignificanceHeuristic>, ToXContent {
public abstract class SignificanceHeuristic implements NamedWriteable, ToXContent {
/**
* @param subsetFreq The frequency of the term in the selected sample
* @param subsetSize The size of the selected sample (typically number of docs)

View File

@ -45,7 +45,7 @@ import java.util.Set;
public abstract class TermsAggregator extends BucketsAggregator {
public static class BucketCountThresholds implements Writeable<BucketCountThresholds>, ToXContent {
public static class BucketCountThresholds implements Writeable, ToXContent {
private long minDocCount;
private long shardMinDocCount;
private int requiredSize;

View File

@ -58,7 +58,7 @@ import java.util.TreeSet;
* Defines the include/exclude regular expression filtering for string terms aggregation. In this filtering logic,
* exclusion has precedence, where the {@code include} is evaluated first and then the {@code exclude}.
*/
public class IncludeExclude implements Writeable<IncludeExclude>, ToXContent {
public class IncludeExclude implements Writeable, ToXContent {
private static final ParseField INCLUDE_FIELD = new ParseField("include");
private static final ParseField EXCLUDE_FIELD = new ParseField("exclude");
private static final ParseField PATTERN_FIELD = new ParseField("pattern");

View File

@ -28,7 +28,7 @@ import java.io.IOException;
/**
* An enum representing the methods for calculating percentiles
*/
public enum PercentilesMethod implements Writeable<PercentilesMethod> {
public enum PercentilesMethod implements Writeable {
/**
* The TDigest method for calculating percentiles
*/

View File

@ -37,7 +37,7 @@ import java.util.Objects;
* specific type.
*/
public abstract class PipelineAggregatorBuilder<PAB extends PipelineAggregatorBuilder<PAB>> extends ToXContentToBytes
implements NamedWriteable<PipelineAggregatorBuilder<PAB>> {
implements NamedWriteable {
/**
* Field shared by many parsers.

View File

@ -31,7 +31,7 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
public abstract class MovAvgModel implements NamedWriteable<MovAvgModel>, ToXContent {
public abstract class MovAvgModel implements NamedWriteable, ToXContent {
/**
* Should this model be fit to the data via a cost minimizing algorithm by default?

View File

@ -34,7 +34,7 @@ import java.io.IOException;
/**
*
*/
public enum ValueType implements Writeable<ValueType> {
public enum ValueType implements Writeable {
STRING((byte) 1, "string", "string", ValuesSourceType.BYTES,
IndexFieldData.class, DocValueFormat.RAW),
@ -96,8 +96,8 @@ public enum ValueType implements Writeable<ValueType> {
private final byte id;
private String preferredName;
private ValueType(byte id, String description, String preferredName, ValuesSourceType valuesSourceType, Class<? extends IndexFieldData> fieldDataType,
DocValueFormat defaultFormat) {
private ValueType(byte id, String description, String preferredName, ValuesSourceType valuesSourceType,
Class<? extends IndexFieldData> fieldDataType, DocValueFormat defaultFormat) {
this.id = id;
this.description = description;
this.preferredName = preferredName;

View File

@ -71,7 +71,7 @@ import java.util.Objects;
*
* @see org.elasticsearch.action.search.SearchRequest#source(SearchSourceBuilder)
*/
public final class SearchSourceBuilder extends ToXContentToBytes implements Writeable<SearchSourceBuilder> {
public final class SearchSourceBuilder extends ToXContentToBytes implements Writeable {
public static final ParseField FROM_FIELD = new ParseField("from");
public static final ParseField SIZE_FIELD = new ParseField("size");
@ -1264,7 +1264,7 @@ public final class SearchSourceBuilder extends ToXContentToBytes implements Writ
}
}
public static class ScriptField implements Writeable<ScriptField>, ToXContent {
public static class ScriptField implements Writeable, ToXContent {
private final boolean ignoreFailure;
private final String fieldName;

View File

@ -46,8 +46,7 @@ import static org.elasticsearch.common.xcontent.ObjectParser.fromList;
* This abstract class holds parameters shared by {@link HighlightBuilder} and {@link HighlightBuilder.Field}
* and provides the common setters, equality, hashCode calculation and common serialization
*/
public abstract class AbstractHighlighterBuilder<HB extends AbstractHighlighterBuilder<?>> extends ToXContentToBytes
implements Writeable<HB> {
public abstract class AbstractHighlighterBuilder<HB extends AbstractHighlighterBuilder<?>> extends ToXContentToBytes implements Writeable {
public static final ParseField PRE_TAGS_FIELD = new ParseField("pre_tags");
public static final ParseField POST_TAGS_FIELD = new ParseField("post_tags");
public static final ParseField FIELDS_FIELD = new ParseField("fields");

View File

@ -494,7 +494,7 @@ public class HighlightBuilder extends AbstractHighlighterBuilder<HighlightBuilde
}
}
public enum Order implements Writeable<Order> {
public enum Order implements Writeable {
NONE, SCORE;
public static Order readFromStream(StreamInput in) throws IOException {

View File

@ -37,7 +37,7 @@ import java.util.stream.Collectors;
* A container class to hold all the profile results across all shards. Internally
* holds a map of shard ID -&gt; Profiled results
*/
public final class InternalProfileShardResults implements Writeable<InternalProfileShardResults>, ToXContent{
public final class InternalProfileShardResults implements Writeable, ToXContent{
private Map<String, List<ProfileShardResult>> shardResults;

View File

@ -43,7 +43,7 @@ import java.util.Map;
* Each InternalProfileResult has a List of InternalProfileResults, which will contain
* "children" queries if applicable
*/
final class ProfileResult implements Writeable<ProfileResult>, ToXContent {
final class ProfileResult implements Writeable, ToXContent {
private static final ParseField QUERY_TYPE = new ParseField("query_type");
private static final ParseField LUCENE_DESCRIPTION = new ParseField("lucene");

View File

@ -34,7 +34,7 @@ import java.util.List;
* A container class to hold the profile results for a single shard in the request.
* Contains a list of query profiles, a collector tree and a total rewrite tree.
*/
public final class ProfileShardResult implements Writeable<ProfileShardResult>, ToXContent {
public final class ProfileShardResult implements Writeable, ToXContent {
private final List<ProfileResult> profileResults;

View File

@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.Writeable;
import java.io.IOException;
import java.util.Locale;
public enum QueryRescoreMode implements Writeable<QueryRescoreMode> {
public enum QueryRescoreMode implements Writeable {
Avg {
@Override
public float combine(float primary, float secondary) {

View File

@ -38,7 +38,7 @@ import java.util.Objects;
/**
* The abstract base builder for instances of {@link RescoreBuilder}.
*/
public abstract class RescoreBuilder<RB extends RescoreBuilder<RB>> extends ToXContentToBytes implements NamedWriteable<RB> {
public abstract class RescoreBuilder<RB extends RescoreBuilder<RB>> extends ToXContentToBytes implements NamedWriteable {
protected Integer windowSize;

View File

@ -46,7 +46,7 @@ import java.util.Objects;
/**
*
*/
public class SearchAfterBuilder implements ToXContent, Writeable<SearchAfterBuilder> {
public class SearchAfterBuilder implements ToXContent, Writeable {
public static final ParseField SEARCH_AFTER = new ParseField("search_after");
private static final Object[] EMPTY_SORT_VALUES = new Object[0];

View File

@ -396,7 +396,7 @@ public class ScriptSortBuilder extends SortBuilder<ScriptSortBuilder> {
return NAME;
}
public enum ScriptSortType implements Writeable<ScriptSortType> {
public enum ScriptSortType implements Writeable {
/** script sort for a string value **/
STRING,
/** script sort for a numeric value **/

View File

@ -48,7 +48,7 @@ import static java.util.Collections.unmodifiableMap;
/**
*
*/
public abstract class SortBuilder<T extends SortBuilder<?>> extends ToXContentToBytes implements NamedWriteable<T> {
public abstract class SortBuilder<T extends SortBuilder<T>> extends ToXContentToBytes implements NamedWriteable {
protected SortOrder order = SortOrder.ASC;
public static final ParseField ORDER_FIELD = new ParseField("order");

View File

@ -38,7 +38,7 @@ import java.util.Objects;
* <li>median - Use the median of all values as sort value. Only applicable for number based array fields.</li>
* </ul>
*/
public enum SortMode implements Writeable<SortMode> {
public enum SortMode implements Writeable {
/** pick the lowest value **/
MIN,
/** pick the highest value **/

View File

@ -31,7 +31,7 @@ import java.util.Locale;
*
*
*/
public enum SortOrder implements Writeable<SortOrder> {
public enum SortOrder implements Writeable {
/**
* Ascending order.
*/

View File

@ -30,7 +30,7 @@ import java.util.Objects;
/**
* An enum representing the valid sorting options
*/
public enum SortBy implements Writeable<SortBy> {
public enum SortBy implements Writeable {
/** Sort should first be based on score, then document frequency and then the term itself. */
SCORE,
/** Sort should first be based on document frequency, then score and then the term itself. */

View File

@ -46,7 +46,7 @@ import java.util.Objects;
* Suggesting works by suggesting terms/phrases that appear in the suggest text that are similar compared
* to the terms in provided text. These suggestions are based on several options described in this class.
*/
public class SuggestBuilder extends ToXContentToBytes implements Writeable<SuggestBuilder> {
public class SuggestBuilder extends ToXContentToBytes implements Writeable {
protected static final ParseField GLOBAL_TEXT_FIELD = new ParseField("text");
private String globalText;

View File

@ -43,7 +43,7 @@ import java.util.Objects;
/**
* Base class for the different suggestion implementations.
*/
public abstract class SuggestionBuilder<T extends SuggestionBuilder<T>> extends ToXContentToBytes implements NamedWriteable<T> {
public abstract class SuggestionBuilder<T extends SuggestionBuilder<T>> extends ToXContentToBytes implements NamedWriteable {
protected final String field;
protected String text;

View File

@ -39,7 +39,7 @@ import java.util.Objects;
/**
* Fuzzy options for completion suggester
*/
public class FuzzyOptions implements ToXContent, Writeable<FuzzyOptions> {
public class FuzzyOptions implements ToXContent, Writeable {
static final ParseField FUZZY_OPTIONS = new ParseField("fuzzy");
private static final ParseField TRANSPOSITION_FIELD = new ParseField("transpositions");
private static final ParseField MIN_LENGTH_FIELD = new ParseField("min_length");

View File

@ -38,7 +38,7 @@ import java.io.IOException;
/**
* Regular expression options for completion suggester
*/
public class RegexOptions implements ToXContent, Writeable<RegexOptions> {
public class RegexOptions implements ToXContent, Writeable {
static final ParseField REGEX_OPTIONS = new ParseField("regex");
private static final ParseField FLAGS_VALUE = new ParseField("flags", "flags_value");
private static final ParseField MAX_DETERMINIZED_STATES = new ParseField("max_determinized_states");

View File

@ -40,8 +40,7 @@ import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
public final class DirectCandidateGeneratorBuilder
implements CandidateGenerator {
public final class DirectCandidateGeneratorBuilder implements CandidateGenerator {
private static final String TYPE = "direct_generator";

View File

@ -708,7 +708,7 @@ public class PhraseSuggestionBuilder extends SuggestionBuilder<PhraseSuggestionB
/**
* {@link CandidateGenerator} interface.
*/
public interface CandidateGenerator extends Writeable<CandidateGenerator>, ToXContent {
public interface CandidateGenerator extends Writeable, ToXContent {
String getType();
PhraseSuggestionContext.DirectCandidateGenerator build(MapperService mapperService) throws IOException;

View File

@ -30,7 +30,7 @@ import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory;
import java.io.IOException;
public abstract class SmoothingModel implements NamedWriteable<SmoothingModel>, ToXContent {
public abstract class SmoothingModel implements NamedWriteable, ToXContent {
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {

View File

@ -491,7 +491,7 @@ public class TermSuggestionBuilder extends SuggestionBuilder<TermSuggestionBuild
}
/** An enum representing the valid suggest modes. */
public enum SuggestMode implements Writeable<SuggestMode> {
public enum SuggestMode implements Writeable {
/** Only suggest terms in the suggest text that aren't in the index. This is the default. */
MISSING {
@Override
@ -536,7 +536,7 @@ public class TermSuggestionBuilder extends SuggestionBuilder<TermSuggestionBuild
}
/** An enum representing the valid string edit distance algorithms for determining suggestions. */
public enum StringDistanceImpl implements Writeable<StringDistanceImpl> {
public enum StringDistanceImpl implements Writeable {
/** This is the default and is based on <code>damerau_levenshtein</code>, but highly optimized
* for comparing string distance for terms inside the index. */
INTERNAL {

View File

@ -135,5 +135,5 @@ public class Task {
return null;
}
public interface Status extends ToXContent, NamedWriteable<Status> {}
public interface Status extends ToXContent, NamedWriteable {}
}

View File

@ -29,7 +29,7 @@ import java.io.IOException;
/**
* Task id that consists of node id and id of the task on the node
*/
public final class TaskId implements Writeable<TaskId> {
public final class TaskId implements Writeable {
public final static TaskId EMPTY_TASK_ID = new TaskId();

View File

@ -322,7 +322,7 @@ public class TestTaskPlugin extends Plugin {
}
public static class UnblockTestTaskResponse implements Writeable<UnblockTestTaskResponse> {
public static class UnblockTestTaskResponse implements Writeable {
public UnblockTestTaskResponse() {

View File

@ -187,7 +187,7 @@ public class TransportTasksActionTests extends TaskManagerTestCase {
}
}
static class TestTaskResponse implements Writeable<TestTaskResponse> {
static class TestTaskResponse implements Writeable {
private final String status;

View File

@ -57,7 +57,7 @@ public abstract class AbstractWriteableEnumTestCase extends ESTestCase {
public abstract void testWriteTo() throws IOException;
// a convenience method for testing the write of a writeable enum
protected static <T> void assertWriteToStream(final Writeable<T> writeableEnum, final int ordinal) throws IOException {
protected static void assertWriteToStream(final Writeable writeableEnum, final int ordinal) throws IOException {
try (BytesStreamOutput out = new BytesStreamOutput()) {
writeableEnum.writeTo(out);
try (StreamInput in = StreamInput.wrap(out.bytes())) {
@ -67,7 +67,7 @@ public abstract class AbstractWriteableEnumTestCase extends ESTestCase {
}
// a convenience method for testing the read of a writeable enum
protected <T extends Writeable<T>> void assertReadFromStream(final int ordinal, final Writeable<T> expected) throws IOException {
protected void assertReadFromStream(final int ordinal, final Writeable expected) throws IOException {
try (BytesStreamOutput out = new BytesStreamOutput()) {
out.writeVInt(ordinal);
try (StreamInput in = StreamInput.wrap(out.bytes())) {

View File

@ -431,11 +431,11 @@ public class BytesStreamsTests extends ESTestCase {
endsWith(" claims to have a different name [intentionally-broken] than it was read from [test-named-writeable]."));
}
private static abstract class BaseNamedWriteable<T> implements NamedWriteable<T> {
private static abstract class BaseNamedWriteable implements NamedWriteable {
}
private static class TestNamedWriteable extends BaseNamedWriteable<TestNamedWriteable> {
private static class TestNamedWriteable extends BaseNamedWriteable {
private static final String NAME = "test-named-writeable";

View File

@ -40,7 +40,6 @@ import org.elasticsearch.ingest.core.IngestDocument;
import org.elasticsearch.node.NodeModule;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.transport.RemoteTransportException;
import java.util.Collection;
import java.util.Collections;