本文整理了Java中cascading.flow.Flow.getSinkEntryStream()
方法的一些代码示例,展示了Flow.getSinkEntryStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flow.getSinkEntryStream()
方法的具体详情如下:
包路径:cascading.flow.Flow
类名称:Flow
方法名:getSinkEntryStream
暂无
代码示例来源:origin: cascading/cascading-platform
@Test
public void testFlowStream() throws Exception
{
getPlatform().copyFromLocal( inputFileNums20 );
Tap source = getPlatform().getDelimitedFile( new Fields( "num", Integer.class ), " ", inputFileNums20 );
Pipe pipe = new Pipe( "test" );
Tap sink = getPlatform().getDelimitedFile( new Fields( "num", Integer.class ), ",", getOutputPath(), SinkMode.REPLACE );
Flow<?> flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
flow.complete();
int sum = flow.getSinkEntryStream()
.mapToInt( TupleEntryStream.fieldToInt( Fields.FIRST ) )
.sum();
assertEquals( 210, sum );
}
代码示例来源:origin: cwensel/cascading
@Test
public void testFlowStream() throws Exception
{
getPlatform().copyFromLocal( inputFileNums20 );
Tap source = getPlatform().getDelimitedFile( new Fields( "num", Integer.class ), " ", inputFileNums20 );
Pipe pipe = new Pipe( "test" );
Tap sink = getPlatform().getDelimitedFile( new Fields( "num", Integer.class ), ",", getOutputPath(), SinkMode.REPLACE );
Flow<?> flow = getPlatform().getFlowConnector().connect( source, sink, pipe );
flow.complete();
int sum = flow.getSinkEntryStream()
.mapToInt( TupleEntryStream.fieldToInt( Fields.FIRST ) )
.sum();
assertEquals( 210, sum );
}
内容来源于网络,如有侵权,请联系作者删除!