Skip to content

Commit 0948424

Browse files
committed
Fix compilation error
1 parent 0383960 commit 0948424

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/async/AsyncExecutionId.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import org.elasticsearch.common.io.stream.ByteBufferStreamInput;
1111
import org.elasticsearch.common.io.stream.BytesStreamOutput;
1212
import org.elasticsearch.common.io.stream.StreamInput;
13+
import org.elasticsearch.common.io.stream.StreamOutput;
14+
import org.elasticsearch.common.io.stream.Writeable;
1315
import org.elasticsearch.tasks.TaskId;
1416

1517
import java.io.IOException;
@@ -20,7 +22,7 @@
2022
/**
2123
* A class that contains all information related to a submitted async execution.
2224
*/
23-
public final class AsyncExecutionId {
25+
public final class AsyncExecutionId implements Writeable {
2426
public static final String ASYNC_EXECUTION_ID_HEADER = "X-Elasticsearch-Async-Id";
2527
public static final String ASYNC_EXECUTION_IS_RUNNING_HEADER = "X-Elasticsearch-Async-Is-Running";
2628

@@ -115,4 +117,13 @@ public static AsyncExecutionId decode(String id) {
115117
}
116118
return new AsyncExecutionId(docId, new TaskId(taskId), id);
117119
}
120+
121+
@Override
122+
public void writeTo(StreamOutput out) throws IOException {
123+
out.writeString(getEncoded());
124+
}
125+
126+
public static AsyncExecutionId readFrom(StreamInput input) throws IOException {
127+
return decode(input.readString());
128+
}
118129
}

0 commit comments

Comments
 (0)