Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal Streamable #44647

Merged
merged 1 commit into from
Jul 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import static org.elasticsearch.common.unit.TimeValue.parseTimeValue;

/**
* Round trip tests for all Streamable things declared in this plugin.
* Round trip tests for all {@link Writeable} things declared in this plugin.
*/
public class RoundTripTests extends ESTestCase {
public void testReindexRequest() throws IOException {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
* Implementers can be written to a {@linkplain StreamOutput} and read from a {@linkplain StreamInput}. This allows them to be "thrown
* across the wire" using Elasticsearch's internal protocol. If the implementer also implements equals and hashCode then a copy made by
* serializing and deserializing must be equal and have the same hashCode. It isn't required that such a copy be entirely unchanged.
* <p>
* 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 {

Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/org/elasticsearch/tasks/TaskInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* <p>
* Tasks are used for communication with transport actions. As a result, they can contain callback
* references as well as mutable state. That makes it impractical to send tasks over transport channels
* and use in APIs. Instead, immutable and streamable TaskInfo objects are used to represent
* and use in APIs. Instead, immutable and writeable TaskInfo objects are used to represent
* snapshot information about currently running tasks.
*/
public final class TaskInfo implements Writeable, ToXContentFragment {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
package org.elasticsearch.transport;

import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.Streamable;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.transport.TransportAddress;

import java.io.IOException;

public abstract class TransportMessage implements Streamable, Writeable {
public abstract class TransportMessage implements Writeable {

private TransportAddress remoteAddress;

Expand All @@ -41,18 +38,11 @@ public TransportAddress remoteAddress() {
/**
* Constructs a new empty transport message
*/
public TransportMessage() {
}
public TransportMessage() {}

/**
* Constructs a new transport message with the data from the {@link StreamInput}. This is
* currently a no-op
*/
public TransportMessage(StreamInput in) throws IOException {
}

@Override
public final void readFrom(StreamInput in) throws IOException {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
public TransportMessage(StreamInput in) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import static org.hamcrest.CoreMatchers.containsString;

public class GetSnapshotsResponseTests extends ESTestCase {
// We can not subclass AbstractStreamableXContentTestCase because it
// We can not subclass AbstractSerializingTestCase because it
// can only be used for instances with equals and hashCode
// GetSnapshotResponse does not override equals and hashCode.
// It does not override equals and hashCode, because it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected Predicate<String> getRandomFieldsExcludeFilter() {
@Override
protected void assertEqualInstances(UpdateSettingsRequest expectedInstance, UpdateSettingsRequest newInstance) {
// here only the settings should be tested, as this test covers explicitly only the XContent parsing
// the rest of the request fields are tested by the StreamableTests
// the rest of the request fields are tested by the SerializingTests
super.assertEqualInstances(new UpdateSettingsRequest(expectedInstance.settings()),
new UpdateSettingsRequest(newInstance.settings()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public String getWriteableName() {
}
}

public void testWriteStreamableList() throws IOException {
public void testWriteWriteableList() throws IOException {
final int size = randomIntBetween(0, 5);
final List<TestWriteable> expected = new ArrayList<>(size);

Expand Down