flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janani Chakkaradhari <janani.cs...@gmail.com>
Subject ConstantFields in Java API
Date Wed, 25 Jun 2014 17:40:37 GMT
Hi,

Can someone check the following UDF for constantFileds setup?

In simple, I wanted to do :
First Input of Join :    Tuple3<Long, FMCounter, Double> first,
Second Input of Join: Tuple2<Long, Long> second
Output:                     Tuple3<second.f0, first.f1, first.f1>


UDF:
    @ConstantFieldsFirst("2 -> 2")
    @ConstantFieldsSecond("0 -> 0")
    public static final class SendingMessageToNeighbors
        extends
        JoinFunction<Tuple3<Long, FMCounter, Double>,
        Tuple2<Long, Long>, Tuple3<Long, FMCounter, Double>> {

        @Override
        public Tuple3<Long, FMCounter, Double> join(
            Tuple3<Long, FMCounter, Double> vertex_workset,
            Tuple2<Long, Long> neighbors) throws Exception {
            return new Tuple3<Long,
                    FMCounter,
Double>(neighbors.f0,vertex_workset.f1,vertex_workset.f2);
        }

    }

Here, I only mapped for two fields (0 and 2) in output tuple. Is it fine?

Regards,
Janani

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message