cz.seznam.euphoria.core.client.operator.FlatMap.output()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中cz.seznam.euphoria.core.client.operator.FlatMap.output()方法的一些代码示例,展示了FlatMap.output()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FlatMap.output()方法的具体详情如下:
包路径:cz.seznam.euphoria.core.client.operator.FlatMap
类名称:FlatMap
方法名:output

FlatMap.output介绍

暂无

代码示例

代码示例来源:origin: seznam/euphoria

@Override
 public Dataset<OUT> output(OutputHint... outputHints) {
  Flow flow = input.getFlow();
  FlatMap<IN, OUT> map = new FlatMap<>(name, flow, input, functor, evtTimeFn,
    Sets.newHashSet(outputHints));
  flow.add(map);
  return map.output();
 }
}

代码示例来源:origin: seznam/euphoria

@Override
 public Dataset<OUT> output(OutputHint... outputHints) {
  Flow flow = input.getFlow();
  FlatMap<IN, OUT> map = new FlatMap<>(name, flow, input, functor, evtTimeFn,
    Sets.newHashSet(outputHints));
  flow.add(map);
  return map.output();
 }
}

代码示例来源:origin: seznam/euphoria

@Test
public void testBuild() {
 Flow flow = Flow.create("TEST");
 Dataset<String> dataset = Util.createMockDataset(flow, 1);
 Dataset<String> mapped = FlatMap.named("FlatMap1")
   .of(dataset)
   .using((String s, Collector<String> c) -> c.collect(s))
   .output();
 assertEquals(flow, mapped.getFlow());
 assertEquals(1, flow.size());
 FlatMap map = (FlatMap) flow.operators().iterator().next();
 assertEquals(flow, map.getFlow());
 assertEquals("FlatMap1", map.getName());
 assertNotNull(map.getFunctor());
 assertEquals(mapped, map.output());
 assertNull(map.getEventTimeExtractor());
}

代码示例来源:origin: seznam/euphoria

@Test
public void testBuild_EventTimeExtractor() {
 Flow flow = Flow.create("TEST");
 Dataset<String> dataset = Util.createMockDataset(flow, 1);
 Dataset<BigDecimal> mapped = FlatMap.named("FlatMap2")
   .of(dataset)
   .using((String s, Collector<BigDecimal> c) -> c.collect(null))
   .eventTimeBy(Long::parseLong) // ~ consuming the original input elements
   .output();
 assertEquals(flow, mapped.getFlow());
 assertEquals(1, flow.size());
 FlatMap map = (FlatMap) flow.operators().iterator().next();
 assertEquals(flow, map.getFlow());
 assertEquals("FlatMap2", map.getName());
 assertNotNull(map.getFunctor());
 assertEquals(mapped, map.output());
 assertNotNull(map.getEventTimeExtractor());
}

代码示例来源:origin: seznam/euphoria

@Test
public void testBuild_WithCounters() {
 Flow flow = Flow.create("TEST");
 Dataset<String> dataset = Util.createMockDataset(flow, 1);
 Dataset<String> mapped = FlatMap.named("FlatMap1")
     .of(dataset)
     .using((String s, Collector<String> c) -> {
      c.getCounter("my-counter").increment();
      c.collect(s);
     })
     .output();
 assertEquals(flow, mapped.getFlow());
 assertEquals(1, flow.size());
 FlatMap map = (FlatMap) flow.operators().iterator().next();
 assertEquals(flow, map.getFlow());
 assertEquals("FlatMap1", map.getName());
 assertNotNull(map.getFunctor());
 assertEquals(mapped, map.output());
}

代码示例来源:origin: seznam/euphoria

null);
rbk = new ReduceByKey<>(
  getName() + "::ReduceByKey::attached", getFlow(), map.output(),
  Pair::getFirst, null, p -> valueExtractor.apply(p.getSecond()),
  null, reducer, valueComparator, getHints());

代码示例来源:origin: seznam/euphoria

null);
rbk = new ReduceByKey<>(
  getName() + "::ReduceByKey::attached", getFlow(), map.output(),
  Pair::getFirst, null, p -> valueExtractor.apply(p.getSecond()),
  null, reducer, valueComparator, getHints());

相关文章