Examples of CustomType


Examples of eu.stratosphere.test.javaApiOperators.util.CollectionDataSets.CustomType

        sum += element.f0;
        id = element.f2;
      }
     
      while(second.hasNext()) {
        CustomType element = second.next();
        id = element.myInt;
        sum += element.myLong;
      }
     
      out.collect(new Tuple3<Integer, Long, String>(id, sum, "test"));
View Full Code Here

Examples of eu.stratosphere.test.javaApiOperators.util.CollectionDataSets.CustomType

    @Override
    public void coGroup(Iterator<CustomType> first,
        Iterator<Tuple5<Integer, Long, Integer, String, Long>> second,
        Collector<CustomType> out) throws Exception {
     
      CustomType o = new CustomType(0,0,"test");
     
      while(first.hasNext()) {
        CustomType element = first.next();
        o.myInt = element.myInt;
        o.myLong += element.myLong;
      }
     
      while(second.hasNext()) {
View Full Code Here

Examples of eu.stratosphere.test.javaApiOperators.util.CollectionDataSets.CustomType

    @Override
    public CustomType cross(CustomType first, CustomType second)
        throws Exception {
     
      return new CustomType(first.myInt * second.myInt, first.myLong + second.myLong, first.myString + second.myString);
    }
View Full Code Here

Examples of org.apache.cxf.wsn.types.CustomType

        Publisher publisher = new Publisher(publisherCallback, "http://localhost:" + port2
                                            + "/test/publisher");
        Registration registration = notificationBroker.registerPublisher(publisher, "myTopic");

        synchronized (consumerCallback.notifications) {
            notificationBroker.notify(publisher, "myTopic", new CustomType(1, 2));
            consumerCallback.notifications.wait(1000000);
        }
        assertEquals(1, consumerCallback.notifications.size());
        NotificationMessageHolderType message = consumerCallback.notifications.get(0);
        assertEquals(WSNHelper.getInstance().getWSAAddress(subscription.getEpr()),
View Full Code Here

Examples of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType

 
  private static List<CustomType> customTypeData = new ArrayList<CustomType>();
 
  @BeforeClass
  public static void insertCustomData() {
    customTypeData.add(new CustomType());
  }
View Full Code Here

Examples of org.apache.flink.test.javaApiOperators.util.CollectionDataSets.CustomType

                Iterable<Tuple7<Integer, String, Integer, Integer, Long, String, Long>> second,
                Collector<CustomType> out) throws Exception {
              for(POJO p : first) {
                for(Tuple7<Integer, String, Integer, Integer, Long, String, Long> t: second) {
                  Assert.assertTrue(p.nestedPojo.longNumber == t.f6);
                  out.collect(new CustomType(-1, p.nestedPojo.longNumber, "Flink"));
                }
              }
            }
        });
        coGroupDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return   "-1,20000,Flink\n" +
            "-1,10000,Flink\n" +
            "-1,30000,Flink\n";
      }
      case 12: {
        /*
         * CoGroup field-selector (expression keys) + key selector function
         * The key selector is unnecessary complicated (Tuple1) ;)
         */
       
        final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
       
        DataSet<POJO> ds = CollectionDataSets.getSmallPojoDataSet(env);
        DataSet<Tuple7<Integer, String, Integer, Integer, Long, String, Long>> ds2 = CollectionDataSets.getSmallTuplebasedDataSet(env);
        DataSet<CustomType> coGroupDs = ds.coGroup(ds2)
            .where(new KeySelector<POJO, Tuple1<Long>>() {
              private static final long serialVersionUID = 1L;

              @Override
              public Tuple1<Long> getKey(POJO value)
                  throws Exception {
                return new Tuple1<Long>(value.nestedPojo.longNumber);
              }
            }).equalTo(6).with(new CoGroupFunction<POJO, Tuple7<Integer, String, Integer, Integer, Long, String, Long>, CustomType>() {
              private static final long serialVersionUID = 1L;

            @Override
            public void coGroup(
                Iterable<POJO> first,
                Iterable<Tuple7<Integer, String, Integer, Integer, Long, String, Long>> second,
                Collector<CustomType> out) throws Exception {
              for(POJO p : first) {
                for(Tuple7<Integer, String, Integer, Integer, Long, String, Long> t: second) {
                  Assert.assertTrue(p.nestedPojo.longNumber == t.f6);
                  out.collect(new CustomType(-1, p.nestedPojo.longNumber, "Flink"));
                }
              }
            }
        });
        coGroupDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return   "-1,20000,Flink\n" +
            "-1,10000,Flink\n" +
            "-1,30000,Flink\n";
      }
      case 13: {
        /*
         * CoGroup field-selector (expression keys) + key selector function
         * The key selector is simple here
         */
       
        final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
       
        DataSet<POJO> ds = CollectionDataSets.getSmallPojoDataSet(env);
        DataSet<Tuple7<Integer, String, Integer, Integer, Long, String, Long>> ds2 = CollectionDataSets.getSmallTuplebasedDataSet(env);
        DataSet<CustomType> coGroupDs = ds.coGroup(ds2)
            .where(new KeySelector<POJO, Long>() {
              private static final long serialVersionUID = 1L;

              @Override
              public Long getKey(POJO value)
                  throws Exception {
                return value.nestedPojo.longNumber;
              }
            }).equalTo(6).with(new CoGroupFunction<POJO, Tuple7<Integer, String, Integer, Integer, Long, String, Long>, CustomType>() {
              private static final long serialVersionUID = 1L;

            @Override
            public void coGroup(
                Iterable<POJO> first,
                Iterable<Tuple7<Integer, String, Integer, Integer, Long, String, Long>> second,
                Collector<CustomType> out) throws Exception {
              for(POJO p : first) {
                for(Tuple7<Integer, String, Integer, Integer, Long, String, Long> t: second) {
                  Assert.assertTrue(p.nestedPojo.longNumber == t.f6);
                  out.collect(new CustomType(-1, p.nestedPojo.longNumber, "Flink"));
                }
              }
            }
        });
        coGroupDs.writeAsText(resultPath);
View Full Code Here

Examples of org.apache.flink.test.javaApiOperators.util.CollectionDataSets.CustomType

    private static final long serialVersionUID = 1L;

    @Override
    public void coGroup(Iterable<CustomType> first, Iterable<CustomType> second, Collector<CustomType> out) {
     
      CustomType o = new CustomType(0,0,"test");
     
      for ( CustomType element : first ) {
        o.myInt = element.myInt;
        o.myLong += element.myLong;
      }
View Full Code Here

Examples of org.apache.flink.test.javaApiOperators.util.CollectionDataSets.CustomType

    @Override
    public void coGroup(Iterable<CustomType> first,
        Iterable<Tuple5<Integer, Long, Integer, String, Long>> second,
        Collector<CustomType> out)
    {
      CustomType o = new CustomType(0,0,"test");
     
      for (CustomType element : first) {
        o.myInt = element.myInt;
        o.myLong += element.myLong;
      }
View Full Code Here

Examples of org.apache.flink.test.javaApiOperators.util.CollectionDataSets.CustomType

    @Override
    public void reduce(Iterable<CustomType> values, Collector<CustomType> out) {
      final Iterator<CustomType> iter = values.iterator();
     
      CustomType o = new CustomType();
      CustomType c = iter.next();
     
      o.myString = "Hello!";
      o.myInt = c.myInt;
      o.myLong = c.myLong;
     
      while (iter.hasNext()) {
        CustomType next = iter.next();
        o.myLong += next.myLong;
      }
     
      out.collect(o);
     
View Full Code Here

Examples of org.apache.flink.test.javaApiOperators.util.CollectionDataSets.CustomType

    private static final long serialVersionUID = 1L;
   
    @Override
    public void reduce(Iterable<CustomType> values, Collector<CustomType> out) {

      CustomType o = new CustomType(0, 0, "Hello!");
     
      for (CustomType next : values) {
        o.myInt += next.myInt;
        o.myLong += next.myLong;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.