Examples of openForRead()


Examples of cascading.tap.hadoop.Hfs.openForRead()

    Pipe results = new MultiGroupBy(s1, new Fields("key"), s2, new Fields("key"),
        new Fields("key-rename"), new CustomBuffer(new Fields("result", " result1", "result2", "result3", "result4", "result5")));

    CascadingUtil.get().getFlowConnector().connect(sources, sink, results).complete();

    TupleEntryIterator iter = sink.openForRead(CascadingUtil.get().getFlowProcess());

    assertEquals(new Tuple(1, 108, 108, 108, 108, 108, 108), iter.next().getTuple());
    assertEquals(new Tuple(2, 5, 5, 5, 5, 5, 5), iter.next().getTuple());
    assertEquals(new Tuple(3, 6, 6, 6, 6, 6, 6), iter.next().getTuple());
    assertEquals(new Tuple(5, 7, 7, 7, 7, 7, 7), iter.next().getTuple());
View Full Code Here

Examples of cascading.tap.hadoop.Hfs.openForRead()

    Pipe results = new MultiGroupBy(s1, new Fields("key"), s2, new Fields("key"),
        new Fields("key-rename"), new CustomBuffer(new Fields("result")));

    CascadingUtil.get().getFlowConnector().connect(sources, sink, results).complete();

    TupleEntryIterator iter = sink.openForRead(CascadingUtil.get().getFlowProcess());

    assertEquals(new Tuple(1, 108), iter.next().getTuple());
    assertEquals(new Tuple(2, 5), iter.next().getTuple());
    assertEquals(new Tuple(3, 6), iter.next().getTuple());
    assertEquals(new Tuple(5, 7), iter.next().getTuple());
View Full Code Here

Examples of cascading.tap.hadoop.Hfs.openForRead()

    input = new RenameInPlace(input, new Fields("key", "num"), new Fields("key"), new Fields("key2"));


    CascadingUtil.get().getFlowConnector().connect(source1, sink, input).complete();

    assertEquals(new Tuple(3, 4), sink.openForRead(CascadingUtil.get().getFlowProcess()).next().getTuple());

    System.out.println(TapHelper.getAllTuples(sink));
  }

}
View Full Code Here

Examples of cascading.tap.hadoop.Lfs.openForRead()

    TupleEntryIterator reader = null;

    try
      {
      reader = temp.openForRead( new HadoopFlowProcess( jobConf ) );

      if( !reader.hasNext() )
        throw new FlowException( "step state path is empty: " + temp.getIdentifier() );

      return reader.next().getString( 0 );
View Full Code Here

Examples of cascading.tap.hadoop.Lfs.openForRead()

    Tap<JobConf, RecordReader, OutputCollector> dst = new Lfs(new SequenceFile(OUT_FIELD), getTestRoot()+"/out");

    Flow f = CascadingUtil.get().getFlowConnector().connect(src, dst, pipe);
    f.complete();

    TupleEntryIterator tupleEntryIterator = dst.openForRead(CascadingUtil.get().getFlowProcess());
    List<BytesWritable> outStrings = new ArrayList<BytesWritable>(6);
    while (tupleEntryIterator.hasNext()) {
      TupleEntry next = tupleEntryIterator.next();
      BytesWritable bytes = (BytesWritable) next.getObject(OUT_FIELD);
      outStrings.add(bytes);
View Full Code Here

Examples of cascading.tap.local.FileTap.openForRead()

    Flow flow = new LocalFlowConnector().connect( flowDef );

    flow.complete();

    TupleEntryIterator iterator = resultsTap.openForRead( flow.getFlowProcess() );

    while( iterator.hasNext() )
      System.out.println( iterator.next() );

    iterator.close();
View Full Code Here

Examples of com.nexirius.util.TextFile.openForRead()

            throws Exception {
        Style default_style = m_doc.addStyle(StyleContext.DEFAULT_STYLE, m_doc.getLogicalStyle(0));
        Style parent_style = default_style;
        TextFile file = new TextFile(stylefile);

        file.openForRead(file_id);

        TextToken token = file.nextToken();

        for (; token != null; token = file.nextToken()) {
            parent_style = default_style;
View Full Code Here

Examples of org.drools.examples.broker.events.StockTickPersister.openForRead()

        Broker broker = new Broker( window, registry );
       
        TimerService clock = new JDKTimerService(1);
        StockTickPersister source = new StockTickPersister();
        try {
            source.openForRead( new InputStreamReader( BrokerExample.class.getResourceAsStream("/org/drools/examples/broker/data/stocktickstream.dat") ),
                                System.currentTimeMillis() );
        } catch (FileNotFoundException e) {
            throw new IllegalArgumentException("Could not read data file.", e);
        }
View Full Code Here

Examples of org.drools.examples.broker.events.StockTickPersister.openForRead()

        Broker broker = new Broker( window, registry );
       
        TimerService clock = new JDKTimerService(1);
        StockTickPersister source = new StockTickPersister();
        try {
            source.openForRead( new InputStreamReader( BrokerExample.class.getResourceAsStream("/org/drools/examples/broker/data/stocktickstream.dat") ),
                                System.currentTimeMillis() );
        } catch (FileNotFoundException e) {
            throw new IllegalArgumentException("Could not read data file.", e);
        }
View Full Code Here

Examples of org.drools.examples.broker.events.StockTickPersister.openForRead()

        Broker broker = new Broker( window, registry );
       
        TimerService clock = new JDKTimerService(1);
        StockTickPersister source = new StockTickPersister();
        try {
            source.openForRead( new InputStreamReader( BrokerExample.class.getResourceAsStream("/org/drools/examples/broker/data/stocktickstream.dat") ),
                                System.currentTimeMillis() );
        } catch (FileNotFoundException e) {
            throw new IllegalArgumentException("Could not read data file.", e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.