本文整理了Java中cascading.tap.Tap.openForRead()
方法的一些代码示例,展示了Tap.openForRead()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tap.openForRead()
方法的具体详情如下:
包路径:cascading.tap.Tap
类名称:Tap
方法名:openForRead
[英]Method openForRead opens the resource represented by this Tap instance for reading.
Note the returned iterator will return the same instance of cascading.tuple.TupleEntry on every call, thus a copy must be made of either the TupleEntry or the underlying Tuple instance if they are to be stored in a Collection.
[中]方法openForRead打开此Tap实例表示的资源进行读取。
注意,返回的迭代器将返回相同的级联实例。元组。因此,如果要将TupleEntry或底层Tuple实例存储在集合中,则必须对它们进行复制。
代码示例来源:origin: elastic/elasticsearch-hadoop
@Override
public TupleEntryIterator openForRead(FlowProcess<Object> flowProcess, Object input) throws IOException {
initInnerTapIfNotSetFromFlowProcess(flowProcess);
return actualTap.openForRead(flowProcess, input);
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openTapForRead( Tap tap ) throws IOException
{
return tap.openForRead( this );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openForRead( FlowProcess<? extends Config> flowProcess ) throws IOException
{
return original.openForRead( flowProcess );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openForRead( FlowProcess<? extends Config> flowProcess, Input input ) throws IOException
{
return original.openForRead( flowProcess, input );
}
代码示例来源:origin: cascading/cascading-hadoop2-tez
@Override
public TupleEntryIterator openTapForRead( Tap tap ) throws IOException
{
return tap.openForRead( this );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openTapForRead( Tap tap ) throws IOException
{
return tap.openForRead( this );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openTapForRead( Tap tap ) throws IOException
{
return tap.openForRead( this );
}
代码示例来源:origin: cwensel/cascading
protected TupleEntryIterator openForReadUnchecked( FlowProcess<? extends Config> flowProcess )
{
try
{
return openForRead( flowProcess );
}
catch( IOException exception )
{
throw new UncheckedIOException( exception );
}
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openForRead( FlowProcess<? extends TConfig> flowProcess ) throws IOException
{
return original.openForRead( processProvider.apply( flowProcess ) );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openForRead( FlowProcess<? extends TConfig> flowProcess, TInput input ) throws IOException
{
return original.openForRead( processProvider.apply( flowProcess ), null );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openSink() throws IOException
{
return sinks.values().iterator().next().openForRead( getFlowProcess() );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openTapForRead( Tap tap ) throws IOException
{
return tap.openForRead( getFlowProcess() );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openSource() throws IOException
{
return sources.values().iterator().next().openForRead( getFlowProcess() );
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openSink( String name ) throws IOException
{
if( !sinks.containsKey( name ) )
throw new IllegalArgumentException( "sink does not exist: " + name );
return sinks.get( name ).openForRead( getFlowProcess() );
}
代码示例来源:origin: org.elasticsearch/elasticsearch-hadoop
@Override
public TupleEntryIterator openForRead(FlowProcess<Object> flowProcess, Object input) throws IOException {
initInnerTapIfNotSetFromFlowProcess(flowProcess);
return actualTap.openForRead(flowProcess, input);
}
代码示例来源:origin: com.hotels/plunger
private TupleEntryIterator getHadoopTupleEntryIterator() throws IOException {
@SuppressWarnings("unchecked")
Tap<JobConf, ?, ?> hadoopTap = (Tap<JobConf, ?, ?>) source;
JobConf conf = new JobConf();
FlowProcess<JobConf> flowProcess = new HadoopFlowProcess(conf);
hadoopTap.sourceConfInit(flowProcess, conf);
return hadoopTap.openForRead(flowProcess);
}
代码示例来源:origin: com.hotels/plunger
private TupleEntryIterator getLocalTupleEntryIterator() throws IOException {
@SuppressWarnings("unchecked")
Tap<Properties, ?, ?> localTap = (Tap<Properties, ?, ?>) source;
Properties properties = new Properties();
FlowProcess<Properties> flowProcess = new LocalFlowProcess(properties);
localTap.sourceConfInit(flowProcess, properties);
return localTap.openForRead(flowProcess);
}
代码示例来源:origin: cwensel/cascading
@Override
public TupleEntryIterator openForRead( FlowProcess<? extends Config> flowProcess, Input input ) throws IOException
{
if( input != null )
return findMatchingTap( flowProcess ).openForRead( flowProcess, input );
Iterator iterators[] = new Iterator[ getTaps().length ];
for( int i = 0; i < getTaps().length; i++ )
iterators[ i ] = new TupleIterator( getTaps()[ i ].openForRead( flowProcess ) );
return new TupleEntryChainIterator( getSourceFields(), iterators );
}
代码示例来源:origin: cwensel/cascading
@Test
public void testMultiSourceIterator() throws Exception
{
getPlatform().copyFromLocal( inputFileLower );
getPlatform().copyFromLocal( inputFileUpper );
Tap sourceLower = getPlatform().getTextFile( new Fields( "offset", "line" ), inputFileLower );
Tap sourceUpper = getPlatform().getTextFile( new Fields( "offset", "line" ), inputFileUpper );
Tap source = new MultiSourceTap( sourceLower, sourceUpper );
validateLength( source.openForRead( getPlatform().getFlowProcess() ), 10 );
}
代码示例来源:origin: cascading/cascading-platform
@Test
public void testMultiSourceIterator() throws Exception
{
getPlatform().copyFromLocal( inputFileLower );
getPlatform().copyFromLocal( inputFileUpper );
Tap sourceLower = getPlatform().getTextFile( new Fields( "offset", "line" ), inputFileLower );
Tap sourceUpper = getPlatform().getTextFile( new Fields( "offset", "line" ), inputFileUpper );
Tap source = new MultiSourceTap( sourceLower, sourceUpper );
validateLength( source.openForRead( getPlatform().getFlowProcess() ), 10 );
}
内容来源于网络,如有侵权,请联系作者删除!