cascading.flow.Flow.writeDOT()方法的使用及代码示例

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

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

Flow.writeDOT介绍

[英]Method writeDOT writes this Flow instance to the given filename as a DOT file for import into a graphics package.
[中]方法writeDOT将此流实例作为点文件写入给定的文件名,以便导入到图形包中。

代码示例

代码示例来源:origin: org.springframework.data/spring-cascading

@Override
public void afterPropertiesSet() throws Exception {
  flow = createFlow();
  if (skipStrategy != null) {
    flow.setFlowSkipStrategy(skipStrategy);
  }
  if (stepStrategy != null) {
    flow.setFlowStepStrategy(stepStrategy);
  }
  if (listeners != null) {
    for (FlowListener listener : listeners) {
      flow.addListener(listener);
    }
  }
  if (StringUtils.hasText(writeDOT)) {
    flow.writeDOT(writeDOT);
  }
  if (StringUtils.hasText(writeStepsDOT)) {
    flow.writeStepsDOT(writeStepsDOT);
  }
  if (priority != null) {
    flow.setSubmitPriority(priority);
  }
}

代码示例来源:origin: cascading/lingual-core

flow.writeDOT( flowPlanPath );

代码示例来源:origin: cascading/pattern-core

protected void performTest( String inputData, Fields predictedFields, Fields expectedFields, EnsembleSpec<TreeSpec> ensembleSpec ) throws IOException
 {
 Pipe pipe = new Pipe( "head" );
 pipe = new Discard( pipe, predictedFields );
 pipe = new ParallelEnsembleAssembly( pipe, ensembleSpec );
 pipe = new Pipe( "tail", pipe );
 Tap source = getPlatform().getDelimitedFile( expectedFields.append( predictedFields ), true, ",", "\"", DATA_PATH + inputData, SinkMode.KEEP );
 Tap sink = getPlatform().getDelimitedFile( Fields.ALL, true, ",", "\"", getResultPath(), SinkMode.REPLACE );
 FlowDef flowDef = FlowDef.flowDef()
  .addSource( "head", source )
  .addSink( "tail", sink )
  .addTail( pipe );
 Flow flow = getPlatform().getFlowConnector().connect( flowDef );
 flow.writeDOT( getFlowPlanPath() + "/plan.dot" );
 flow.complete();
 Fields sourceSelector = source.getSourceFields();
 Fields sinkSelector = sink.getSinkFields();
 LOG.debug( "source select = {}", sourceSelector.printVerbose() );
 LOG.debug( "sink select   = {}", sinkSelector.printVerbose() );
 List<Tuple> sourceTuples = asList( flow, source, sourceSelector );
 List<Tuple> sinkTuples = asList( flow, sink, sinkSelector );
 assertEquals( sourceTuples, sinkTuples, 0.000001d );
 }
}

代码示例来源:origin: cwensel/cascading

/**
 * sanity check to make sure writeDOT still works
 *
 * @throws Exception
 */
@Test
public void testWriteDot() throws Exception
 {
 Tap source = getPlatform().getTextFile( "input" );
 Tap sink = getPlatform().getTextFile( "unknown" );
 Pipe pipe = new Pipe( "test" );
 pipe = new Each( pipe, new Fields( "line" ), new RegexSplitter( Fields.UNKNOWN ) );
 pipe = new Each( pipe, new Debug() );
 pipe = new Each( pipe, new Fields( 2 ), new Identity( new Fields( "label" ) ) );
 pipe = new Each( pipe, new Debug() );
 pipe = new Each( pipe, new Fields( "label" ), new RegexFilter( "[A-Z]*" ) );
 pipe = new Each( pipe, new Debug() );
 pipe = new GroupBy( pipe, Fields.ALL );
 pipe = new GroupBy( pipe, Fields.ALL );
 Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
 String outputPath = getOutputPath( "writedot.dot" );
 flow.writeDOT( outputPath );
 assertTrue( new File( outputPath ).exists() );
 outputPath = getOutputPath( "writestepdot.dot" );
 flow.writeStepsDOT( outputPath );
 assertTrue( new File( outputPath ).exists() );
 }

代码示例来源:origin: cascading/cascading-platform

/**
 * sanity check to make sure writeDOT still works
 *
 * @throws Exception
 */
@Test
public void testWriteDot() throws Exception
 {
 Tap source = getPlatform().getTextFile( "input" );
 Tap sink = getPlatform().getTextFile( "unknown" );
 Pipe pipe = new Pipe( "test" );
 pipe = new Each( pipe, new Fields( "line" ), new RegexSplitter( Fields.UNKNOWN ) );
 pipe = new Each( pipe, new Debug() );
 pipe = new Each( pipe, new Fields( 2 ), new Identity( new Fields( "label" ) ) );
 pipe = new Each( pipe, new Debug() );
 pipe = new Each( pipe, new Fields( "label" ), new RegexFilter( "[A-Z]*" ) );
 pipe = new Each( pipe, new Debug() );
 pipe = new GroupBy( pipe, Fields.ALL );
 pipe = new GroupBy( pipe, Fields.ALL );
 Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
 String outputPath = getOutputPath( "writedot.dot" );
 flow.writeDOT( outputPath );
 assertTrue( new File( outputPath ).exists() );
 outputPath = getOutputPath( "writestepdot.dot" );
 flow.writeStepsDOT( outputPath );
 assertTrue( new File( outputPath ).exists() );
 }

代码示例来源:origin: sujitpal/hia-examples

flow.writeDOT("data/newsclip.dot");
flow.complete();

代码示例来源:origin: cwensel/cascading

flow.writeDOT( getName() + ".dot" ); // use display name

代码示例来源:origin: cascading/cascading-platform

flow.writeDOT( getName() + ".dot" ); // use display name

相关文章