Cleanup after removing StreamableReader

Javadoc and unused imports!
This commit is contained in:
Nik Everett 2016-04-13 15:07:31 -04:00
parent b8fa7abf6a
commit 18f8f3f67a
4 changed files with 5 additions and 12 deletions

View File

@ -22,7 +22,6 @@ package org.elasticsearch.cluster;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.StreamableReader;
import java.io.IOException;

View File

@ -31,11 +31,6 @@ 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.
*
* The fact that this interface extends {@link StreamableReader} should be consider vestigial. Instead of using its
* {@link #readFrom(StreamInput)} method you should prefer using the Reader interface as a reference to a constructor that takes
* {@link StreamInput}. The reasoning behind this is that most "good" readFrom implementations just delegated to such a constructor anyway
* and they required an unsightly PROTOTYPE object.
*/
public interface Writeable<T> { // TODO remove <T>
/**
@ -43,8 +38,12 @@ public interface Writeable<T> { // TODO remove <T>
*/
void writeTo(StreamOutput out) throws IOException;
/**
* Read this object from a stream. Use a {@link Writeable.Reader} instead. This lives on for backwards compatibility but should be
* removed before 5.0.0GA. It is not deprecated because Diffable extends this interface and it shouldn't be deprecated there.
*/
default T readFrom(StreamInput in) throws IOException {
// See class javadoc for reasoning
// NORELEASE remove before 5.0.0GA
throw new UnsupportedOperationException(
"Prefer calling a constructor or static method that takes a StreamInput to calling readFrom.");
}

View File

@ -20,15 +20,11 @@
package org.elasticsearch.common.xcontent;
import org.elasticsearch.common.ParseFieldMatcher;
import org.elasticsearch.common.io.stream.StreamableReader;
import java.io.IOException;
/**
* Indicates that the class supports XContent deserialization.
*
* This interface is similar to what {@link StreamableReader} does, only it works with XContent serialization
* instead of binary serialization.
*/
public interface FromXContentBuilder<T> {
/**

View File

@ -28,7 +28,6 @@ import org.elasticsearch.common.collect.ImmutableOpenMap;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.StreamableReader;
import org.elasticsearch.common.util.set.Sets;
import org.elasticsearch.test.ESTestCase;