Java Examples for eu.stratosphere.streaming.api.streamrecord.StreamRecord

The following java examples will help you to understand the usage of eu.stratosphere.streaming.api.streamrecord.StreamRecord. These source code samples are taken from different open source projects.

Example 1
Project: strato-workshop-master  File: ALSPredictionTopology.java View source code
@Override
public void invoke(StreamRecord record) throws Exception {
    Double[] userVector = (Double[]) record.getField(1);
    Double[] scores = new Double[partitionSize];
    // TODO calculate scores for all items
    for (int item = 0; item < partitionSize; item++) {
    // TODO calculate scalar products of the item feature vectors
    // and user vector
    }
// TODO get the top topItemCount items for the partitions
// use Util.getTopK() method
// TODO fill & emit outputRecord
}