Java Examples for hu.sztaki.stratosphere.workshop.utils.Util

The following java examples will help you to understand the usage of hu.sztaki.stratosphere.workshop.utils.Util. These source code samples are taken from different open source projects.

Example 1
Project: strato-workshop-master  File: View source code
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