提交 84e67e7c 编写于 作者: G gaborhermann 提交者: Stephan Ewen

[streaming] Implemented AckEvent and FailEvent serialization

上级 54c6a0d9
......@@ -1149,7 +1149,6 @@ public class StreamRecord implements IOReadableWritable, Serializable {
Class[] tupleBasicTypesFromString(String representation, int numberOfFields) {
// TODO: use StringTokenizer
String[] types = representation.split(",");
@SuppressWarnings("rawtypes")
Class[] basicTypes = new Class[types.length];
for (int i = 0; i < types.length; i++) {
try {
......
......@@ -20,6 +20,7 @@ import java.io.DataOutput;
import java.io.IOException;
import eu.stratosphere.nephele.event.task.AbstractTaskEvent;
import eu.stratosphere.types.StringValue;
/**
* TaskEvent for sending record acknowledgements to the input's fault tolerance
......@@ -41,10 +42,15 @@ public class AckEvent extends AbstractTaskEvent {
@Override
public void write(DataOutput out) throws IOException {
StringValue recordIdValue = new StringValue(recordId);
recordIdValue.write(out);
}
@Override
public void read(DataInput in) throws IOException {
StringValue recordIdValue = new StringValue("");
recordIdValue.read(in);
setRecordId(recordIdValue.getValue());
}
public void setRecordId(String recordId) {
......
......@@ -20,6 +20,7 @@ import java.io.DataOutput;
import java.io.IOException;
import eu.stratosphere.nephele.event.task.AbstractTaskEvent;
import eu.stratosphere.types.StringValue;
/**
* TaskEvent for sending record fails to the input's fault tolerance buffer
......@@ -42,10 +43,15 @@ public class FailEvent extends AbstractTaskEvent {
@Override
public void write(DataOutput out) throws IOException {
StringValue recordIdValue = new StringValue(recordId);
recordIdValue.write(out);
}
@Override
public void read(DataInput in) throws IOException {
StringValue recordIdValue = new StringValue("");
recordIdValue.read(in);
setRecordId(recordIdValue.getValue());
}
public void setRecordId(String recordId) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册