Examples of nextTuple()


Examples of com.mapr.TailSpout.nextTuple()

        // add some files
        FileUtils.writeByteArrayToFile(new File(tempDir, "x-1"), payload("x-1"), true);
        FileUtils.writeByteArrayToFile(new File(tempDir, "x-2"), payload("x-2"), true);

        // verify we read both files in order
        spout.nextTuple();
        List<Object> tuple1 = collector.getTuple();
        assertEquals("x-1", new String((byte[]) tuple1.get(0), Charsets.UTF_8));

        spout.nextTuple();
        List<Object> tuple2 = collector.getTuple();
View Full Code Here

Examples of com.mapr.TailSpout.nextTuple()

        // verify we read both files in order
        spout.nextTuple();
        List<Object> tuple1 = collector.getTuple();
        assertEquals("x-1", new String((byte[]) tuple1.get(0), Charsets.UTF_8));

        spout.nextTuple();
        List<Object> tuple2 = collector.getTuple();
        Object msgId2 = collector.getMessageId();
        assertEquals("x-2", new String((byte[]) tuple2.get(0), Charsets.UTF_8));

        // verify that we get empty records for a bit
View Full Code Here

Examples of com.mapr.TailSpout.nextTuple()

        assertEquals("x-2", new String((byte[]) tuple2.get(0), Charsets.UTF_8));

        // verify that we get empty records for a bit
        // the fact that we get tuple2 values is because no 'emit' hits
        // collector, so values are unchanged.
        spout.nextTuple();
        List<Object> tuple3 = collector.getTuple();
        assertEquals("x-2", new String((byte[]) tuple3.get(0), Charsets.UTF_8));
        assertEquals(msgId2, collector.getMessageId());

        // delete an old file without a problem
View Full Code Here

Examples of com.mapr.TailSpout.nextTuple()

        assertEquals(msgId2, collector.getMessageId());

        // delete an old file without a problem
        assertTrue(new File(tempDir, "x-1").delete());

        spout.nextTuple();
        List<Object> tuple4 = collector.getTuple();
        assertEquals("x-2", new String((byte[]) tuple4.get(0), Charsets.UTF_8));
        assertEquals(msgId2, collector.getMessageId());

        // add a file that doesn't match the pattern without impact
View Full Code Here

Examples of com.mapr.TailSpout.nextTuple()

        assertEquals(msgId2, collector.getMessageId());

        // add a file that doesn't match the pattern without impact
        FileUtils.writeByteArrayToFile(new File(tempDir, "y-1"),
            payload("y-1"), true);
        spout.nextTuple();
        List<Object> tuple5 = collector.getTuple();
        assertEquals("x-2", new String((byte[]) tuple5.get(0), Charsets.UTF_8));
        assertEquals(msgId2, collector.getMessageId());

       
View Full Code Here

Examples of com.mapr.TailSpout.nextTuple()

        assertEquals(msgId2, collector.getMessageId());

       
        // append content to an existing file
        FileUtils.writeByteArrayToFile(new File(tempDir, "x-1"), payload("x-11"), true);
        spout.nextTuple();
        List<Object> tuple11 = collector.getTuple();
        assertEquals("x-11", new String((byte[]) tuple11.get(0), Charsets.UTF_8));

    }
   
View Full Code Here

Examples of org.teiid.common.buffer.IndexedTupleSource.nextTuple()

            result = new TreeSet<Object>();
        } else {
          result = new HashSet<Object>();
        }
          while (its.hasNext()) {
            Object value = its.nextTuple().get(index);
            if (value != null) {
              result.add(value);
            }
          }
          its.closeSource();
View Full Code Here

Examples of org.teiid.common.buffer.IndexedTupleSource.nextTuple()

      List<?> lastTuple = null;
      boolean sortedDistinct = sorted && !state.isDistinct();
      int sizeHint = index.getExpectedHeight(state.getTupleBuffer().getRowCount());
      outer: while (its.hasNext()) {
        //detect if sorted and distinct
        List<?> originalTuple = its.nextTuple();
        //remove the tuple if it has null
        for (int i : state.getExpressionIndexes()) {
          if (originalTuple.get(i) == null) {
            continue outer;
          }
View Full Code Here

Examples of org.teiid.common.buffer.TupleSource.nextTuple()

        TupleBuffer tsid = bm.createTupleBuffer(Arrays.asList(es1), "test", TupleSourceType.PROCESSOR); //$NON-NLS-1$
        tsid.addTuple(Arrays.asList(1));
      SortUtility su = new SortUtility(tsid.createIndexedTupleSource(), Arrays.asList(es1), Arrays.asList(Boolean.TRUE), Mode.DUP_REMOVE, bm, "test", tsid.getSchema()); //$NON-NLS-1$
      TupleBuffer out = su.sort();
      TupleSource ts = out.createIndexedTupleSource();
      assertEquals(Arrays.asList(1), ts.nextTuple());
      try {
        ts.nextTuple();
        fail();
      } catch (BlockedException e) {
       
View Full Code Here

Examples of org.teiid.common.buffer.TupleSource.nextTuple()

      SortUtility su = new SortUtility(tsid.createIndexedTupleSource(), Arrays.asList(es1), Arrays.asList(Boolean.TRUE), Mode.DUP_REMOVE, bm, "test", tsid.getSchema()); //$NON-NLS-1$
      TupleBuffer out = su.sort();
      TupleSource ts = out.createIndexedTupleSource();
      assertEquals(Arrays.asList(1), ts.nextTuple());
      try {
        ts.nextTuple();
        fail();
      } catch (BlockedException e) {
       
      }
      tsid.addTuple(Arrays.asList(2));
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.