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

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

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

Flow.getSources介绍

[英]Method getSources returns the sources of this Flow object.
[中]方法getSources返回此流对象的源。

代码示例

代码示例来源:origin: LiveRamp/cascading_ext

.format("  with input ").format(prettyTaps(flow.getSources())).format("\n")
.format("  and output ").format(prettyTaps(flow.getSinks())).format("\n");

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

@Override
public void onStarting( Flow flow )
 {
 Map<String, Tap> sources = flow.getSources();
 for( Map.Entry<String, Tap> entry : sources.entrySet() )
  {
  String key = entry.getKey();
  Tap value = entry.getValue();
  Set<Hfs> taps = Util.createIdentitySet();
  accumulate( taps, value );
  for( Hfs tap : taps )
   {
   if( !testExists( flow, tap ) )
    throw new FlowException( "cannot start flow: " + flow.getName() + ", _SUCCESS file missing in tap: '" + key + "', at: " + value.getIdentifier() );
   }
  }
 }

代码示例来源:origin: cascading/cascading-hadoop2-common

@Override
public void onStarting( Flow flow )
 {
 Map<String, Tap> sources = flow.getSources();
 for( Map.Entry<String, Tap> entry : sources.entrySet() )
  {
  String key = entry.getKey();
  Tap value = entry.getValue();
  Set<Hfs> taps = Util.createIdentitySet();
  accumulate( taps, value );
  for( Hfs tap : taps )
   {
   if( !testExists( flow, tap ) )
    throw new FlowException( "cannot start flow: " + flow.getName() + ", _SUCCESS file missing in tap: '" + key + "', at: " + value.getIdentifier() );
   }
  }
 }

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

private void initializeSchema( SQLPlanner sqlPlanner, Flow flowDef, TapSchema currentTapSchema )
 {
 if( sqlPlanner.getDefaultSchema() != null )
  currentTapSchema = createGetTapSchema( currentTapSchema, getDefaultSchema() );
 SchemaDef currentSchemaDef = new SchemaDef();
 if( sqlPlanner.getDefaultSchema() != null )
  currentSchemaDef = createGetSchemaDef( currentSchemaDef, getDefaultSchema() );
 addTaps( currentSchemaDef, currentTapSchema, flowDef.getSources(), new Function<Tap, Fields>()
 {
 @Override
 public Fields apply( Tap input )
  {
  return input.getSourceFields();
  }
 } );
 addTaps( currentSchemaDef, currentTapSchema, flowDef.getSinks(), new Function<Tap, Fields>()
 {
 @Override
 public Fields apply( Tap input )
  {
  return input.getSinkFields();
  }
 } );
 }

相关文章