cascading.pipe.Pipe.getConfigDef()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(129)

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

Pipe.getConfigDef介绍

[英]Returns a ConfigDef instance that allows for local properties to be set and made available via a resulting cascading.flow.FlowProcess instance when the pipe is invoked.

Any properties set on the configDef will not show up in any cascading.flow.Flow or cascading.flow.FlowStep process level configuration, but will override any of those values as seen by the current Pipe instance.
[中]返回一个ConfigDef实例,该实例允许通过产生的级联设置本地属性并使其可用。流调用管道时的FlowProcess实例。
configDef上设置的任何属性都不会在任何级联中显示。流流动或层叠。流FlowStep进程级配置,但将覆盖当前管道实例看到的任何值。

代码示例

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

public SpliceGate( FlowProcess flowProcess, Splice splice )
 {
 this.splice = splice;
 Pipe element = splice;
 while( element != null )
  {
  if( element.hasConfigDef() )
   flowProcess = new ElementFlowProcess( flowProcess, element.getConfigDef() );
  element = element.getParent();
  }
 this.flowProcess = flowProcess;
 }

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

public BoundaryStage( FlowProcess flowProcess, Boundary boundary )
 {
 this.boundary = boundary;
 Pipe element = boundary;
 while( element != null )
  {
  if( element.hasConfigDef() )
   flowProcess = new ElementFlowProcess( flowProcess, element.getConfigDef() );
  element = element.getParent();
  }
 this.flowProcess = flowProcess;
 }

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

@Test
public void testSubAssemblyConfigDef() throws IOException
 {
 getPlatform().copyFromLocal( inputFileNums20 );
 Tap source = getPlatform().getTextFile( new Fields( "line" ), inputFileNums20 );
 Pipe pipe = new Pipe( "test" );
 pipe = new ConfigSubAssembly( pipe, getPlatform().isDAG() );
 pipe.getConfigDef().setProperty( Mode.DEFAULT, "default", "pipe-default" );
 // steps on above value
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default", "process-default" );
 pipe.getConfigDef().setProperty( Mode.DEFAULT, "replace", "pipe-default" );
 pipe.getConfigDef().setProperty( Mode.REPLACE, "replace", "pipe-replace" );
 pipe.getNodeConfigDef().setProperty( Mode.REPLACE, "default-node", "node-replace" );
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "replace", "process-default" );
 pipe.getStepConfigDef().setProperty( Mode.REPLACE, "replace", "process-replace" );
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default-node", "process-default" );
 Tap sink = getPlatform().getTextFile( getOutputPath( "subassembly-configdef" ), SinkMode.REPLACE );
 Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
 flow.complete();
 assertTrue( flow.resourceExists( sink ) );
 }
}

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

@Test
public void testSubAssemblyConfigDef() throws IOException
 {
 getPlatform().copyFromLocal( inputFileNums20 );
 Tap source = getPlatform().getTextFile( new Fields( "line" ), inputFileNums20 );
 Pipe pipe = new Pipe( "test" );
 pipe = new ConfigSubAssembly( pipe, getPlatform().isDAG() );
 pipe.getConfigDef().setProperty( Mode.DEFAULT, "default", "pipe-default" );
 // steps on above value
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default", "process-default" );
 pipe.getConfigDef().setProperty( Mode.DEFAULT, "replace", "pipe-default" );
 pipe.getConfigDef().setProperty( Mode.REPLACE, "replace", "pipe-replace" );
 pipe.getNodeConfigDef().setProperty( Mode.REPLACE, "default-node", "node-replace" );
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "replace", "process-default" );
 pipe.getStepConfigDef().setProperty( Mode.REPLACE, "replace", "process-replace" );
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default-node", "process-default" );
 Tap sink = getPlatform().getTextFile( getOutputPath( "subassembly-configdef" ), SinkMode.REPLACE );
 Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
 flow.complete();
 assertTrue( flow.resourceExists( sink ) );
 }
}

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

@Test
public void testPipeConfigDef() throws IOException
 {
 getPlatform().copyFromLocal( inputFileNums20 );
 Tap source = getPlatform().getTextFile( new Fields( "line" ), inputFileNums20 );
 Pipe pipe = new Pipe( "test" );
 pipe = new Each( pipe, new IterateInsert( new Fields( "value" ), getPlatform().isDAG() ), Fields.ALL );
 pipe.getConfigDef().setProperty( Mode.DEFAULT, "default", "pipe-default" );
 // steps on above value
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default", "process-default" );
 pipe.getConfigDef().setProperty( Mode.DEFAULT, "replace", "pipe-default" );
 pipe.getConfigDef().setProperty( Mode.REPLACE, "replace", "pipe-replace" );
 pipe.getNodeConfigDef().setProperty( Mode.REPLACE, "default-node", "node-replace" );
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "replace", "process-default" );
 pipe.getStepConfigDef().setProperty( Mode.REPLACE, "replace", "process-replace" );
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default-node", "process-default" );
 Tap sink = getPlatform().getTextFile( getOutputPath( "configdef" ), SinkMode.REPLACE );
 Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
 flow.complete();
 assertTrue( flow.resourceExists( sink ) );
 }

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

@Test
public void testPipeConfigDef() throws IOException
 {
 getPlatform().copyFromLocal( inputFileNums20 );
 Tap source = getPlatform().getTextFile( new Fields( "line" ), inputFileNums20 );
 Pipe pipe = new Pipe( "test" );
 pipe = new Each( pipe, new IterateInsert( new Fields( "value" ), getPlatform().isDAG() ), Fields.ALL );
 pipe.getConfigDef().setProperty( Mode.DEFAULT, "default", "pipe-default" );
 // steps on above value
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default", "process-default" );
 pipe.getConfigDef().setProperty( Mode.DEFAULT, "replace", "pipe-default" );
 pipe.getConfigDef().setProperty( Mode.REPLACE, "replace", "pipe-replace" );
 pipe.getNodeConfigDef().setProperty( Mode.REPLACE, "default-node", "node-replace" );
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "replace", "process-default" );
 pipe.getStepConfigDef().setProperty( Mode.REPLACE, "replace", "process-replace" );
 pipe.getStepConfigDef().setProperty( Mode.DEFAULT, "default-node", "process-default" );
 Tap sink = getPlatform().getTextFile( getOutputPath( "configdef" ), SinkMode.REPLACE );
 Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
 flow.complete();
 assertTrue( flow.resourceExists( sink ) );
 }

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

.setProperties( pipe.getConfigDef() );

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

.setProperties( pipe.getConfigDef() );

相关文章