Cleanup after removing StreamableReader
Javadoc and unused imports!
This commit is contained in:
parent
b8fa7abf6a
commit
18f8f3f67a
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.");
|
||||
}
|
||||
|
|
|
@ -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> {
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue