Package org.apache.flink.api.common.functions

Examples of org.apache.flink.api.common.functions.RuntimeContext


      final MapFunction<String, Integer> parser = new RichMapFunction<String, Integer>() {
       
        @Override
        public void open(Configuration parameters) throws Exception {
          opened.set(true);
          RuntimeContext ctx = getRuntimeContext();
          assertEquals(0, ctx.getIndexOfThisSubtask());
          assertEquals(1, ctx.getNumberOfParallelSubtasks());
          assertEquals(taskName, ctx.getTaskName());
        }
       
        @Override
        public Integer map(String value) {
          return Integer.parseInt(value);
View Full Code Here


    @Override
    public void open(Configuration parameters) throws Exception {
      isOpened = true;

      RuntimeContext ctx = getRuntimeContext();
      Assert.assertEquals("Test UDF", ctx.getTaskName());
      Assert.assertEquals(4, ctx.getNumberOfParallelSubtasks());
      Assert.assertEquals(0, ctx.getIndexOfThisSubtask());
    }
View Full Code Here

      final MapPartitionFunction<String, Integer> parser = new RichMapPartitionFunction<String, Integer>() {
       
        @Override
        public void open(Configuration parameters) throws Exception {
          opened.set(true);
          RuntimeContext ctx = getRuntimeContext();
          assertEquals(0, ctx.getIndexOfThisSubtask());
          assertEquals(1, ctx.getNumberOfParallelSubtasks());
          assertEquals(taskName, ctx.getTaskName());
        }
       
        @Override
        public void mapPartition(Iterable<String> values, Collector<Integer> out) {
          for (String s : values) {
View Full Code Here

        }

        @Override
        public void open(Configuration parameters) throws Exception {
          opened.set(true);
          RuntimeContext ctx = getRuntimeContext();
          assertEquals(0, ctx.getIndexOfThisSubtask());
          assertEquals(1, ctx.getNumberOfParallelSubtasks());
          assertEquals(taskName, ctx.getTaskName());
        }

        @Override
        public void close() throws Exception {
          closed.set(true);
View Full Code Here

        }

        @Override
        public void open(Configuration parameters) throws Exception {
          opened.set(true);
          RuntimeContext ctx = getRuntimeContext();
          assertEquals(0, ctx.getIndexOfThisSubtask());
          assertEquals(1, ctx.getNumberOfParallelSubtasks());
          assertEquals(taskName, ctx.getTaskName());
        }

        @Override
        public void close() throws Exception {
          closed.set(true);
View Full Code Here

              .add("barfoo", 1)
              .add("foo", 1)
              .build()
      );

      final RuntimeContext ctx = new RuntimeUDFContext("Test UDF", 4, 0, null);

      {
        SumCoGroup udf1 = new SumCoGroup();
        SumCoGroup udf2 = new SumCoGroup();
       
View Full Code Here

    @Override
    public void open(Configuration parameters) throws Exception {
      isOpened = true;

      RuntimeContext ctx = getRuntimeContext();
      Assert.assertEquals("Test UDF", ctx.getTaskName());
      Assert.assertEquals(4, ctx.getNumberOfParallelSubtasks());
      Assert.assertEquals(0, ctx.getIndexOfThisSubtask());
    }
View Full Code Here

TOP

Related Classes of org.apache.flink.api.common.functions.RuntimeContext

Copyright © 2018 www.massapicom. 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.