Skip to content

Commit

Permalink
Cleanup after removing StreamableReader
Browse files Browse the repository at this point in the history
Javadoc and unused imports!
  • Loading branch information
nik9000 committed Apr 14, 2016
1 parent b8fa7ab commit 18f8f3f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,19 @@
*
* 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>
/**
* Write this into the {@linkplain StreamOutput}.
*/
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.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
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;

Expand Down

0 comments on commit 18f8f3f

Please sign in to comment.