提交 7941e5cd 编写于 作者: M Márton Balassi 提交者: Stephan Ewen

[streaming] BatchForwardLocal updated with Tuple

上级 3c07d689
......@@ -17,16 +17,15 @@ package eu.stratosphere.streaming.examples.batch;
import eu.stratosphere.streaming.api.invokable.UserSinkInvokable;
import eu.stratosphere.streaming.api.streamrecord.StreamRecord;
import eu.stratosphere.types.StringValue;
public class BatchForwardSink extends UserSinkInvokable {
private StringValue word = new StringValue("");
private String word = new String();
@Override
public void invoke(StreamRecord record) throws Exception {
word = (StringValue) record.getField(0, 0);
System.out.println("========" + word.getValue() + "=========");
word = record.getString(0, 0);
System.out.println("========" + word + "=========");
}
}
......@@ -15,13 +15,13 @@
package eu.stratosphere.streaming.examples.batch;
import eu.stratosphere.api.java.tuple.Tuple1;
import eu.stratosphere.streaming.api.invokable.UserSourceInvokable;
import eu.stratosphere.streaming.api.streamrecord.StreamRecord;
import eu.stratosphere.types.StringValue;
public class BatchForwardSource extends UserSourceInvokable {
private final StringValue motto = new StringValue("Stratosphere Big Data looks tiny from here");
private final StreamRecord mottoRecord = new StreamRecord(motto);
private final StreamRecord mottoRecord = new StreamRecord(
new Tuple1<String>("Stratosphere Big Data looks tiny from here"));
@Override
public void invoke() throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册