use of org.apache.hyracks.api.dataflow.IDataWriter in project asterixdb by apache.
the class SerializationDeserializationTest method serdeser01.
@Test
public void serdeser01() throws Exception {
RecordDescriptor rDes = new RecordDescriptor(new ISerializerDeserializer[] { new UTF8StringSerializerDeserializer(), IntegerSerializerDeserializer.INSTANCE });
LineProcessor processor = new LineProcessor() {
@Override
public void process(String line, IDataWriter<Object[]> writer) throws Exception {
String[] splits = line.split(" ");
for (String s : splits) {
writer.writeData(new Object[] { s, Integer.valueOf(1) });
}
}
};
run(rDes, processor);
}
Aggregations