Examples of TupleBatch


Examples of org.teiid.common.buffer.TupleBatch

        projectNode.open();
       
        int currentRow = 1;
        while(true) {
            try {
                TupleBatch batch = projectNode.nextBatch();
                for(int row = currentRow; row <= batch.getEndRow(); row++) {
                    assertEquals("Rows don't match at " + row, expected[row-1], batch.getTuple(row)); //$NON-NLS-1$
                }
               
                if(batch.getTerminationFlag()) {
                    break;
                }
                currentRow += batch.getRowCount();   
            } catch(BlockedException e) {
                // ignore and try again
            }
        }
    }
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

               
        try {
            projectNode.open();
           
            while(true) {
                TupleBatch batch = projectNode.nextBatch();               
                if(batch.getTerminationFlag()) {
                    break;
                }
            }
           
            fail("Expected error but test succeeded"); //$NON-NLS-1$
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

        List[] data = createData(1000);
        FakeRelationalNode fakeNode = this.createFakeNode(data);
       
        // read from fake node
        while(true) {
            TupleBatch batch = fakeNode.nextBatch();
            if(batch.getTerminationFlag()) {
                break;
            }
        }
       
        this.actualNodeBlocks = fakeNode.getNodeStatistics().getNodeBlocks();
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

        List[] data = createData(1000);
        FakeRelationalNode fakeNode = this.createFakeNode(data);
       
        // read from fake node
        while(true) {
            TupleBatch batch = fakeNode.nextBatch();
            if(batch.getTerminationFlag()) {
                break;
            }
        }
        assertEquals("FakeRelationalNode", fakeNode.getDescriptionProperties().getName()); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

        union.open();
       
        int currentRow = 1;
        while(true) {
            try {
                TupleBatch batch = union.nextBatch();
                for(int row = currentRow; row <= batch.getEndRow(); row++) {
                    List tuple = batch.getTuple(row);
                    //System.out.println(tuple);
                    assertEquals("Rows don't match at " + row, expected[row-1], tuple); //$NON-NLS-1$
                }
               
                currentRow += batch.getRowCount();   

                if(batch.getTerminationFlag()) {
                    break;
                }
            } catch(BlockedException e) {
                // ignore and retry
            }
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

        for (int i = 0; i < expectedResults.length; i++) {
            numExecutedCommands += expectedResults[i];
        }
        FakePDM fakePDM = new FakePDM(numExecutedCommands);
        BatchedUpdateNode node = helpOpen(commands, fakePDM);
        TupleBatch batch = null;
        try {
          batch = node.nextBatch();
        } catch (BlockedException e) {
          batch = node.nextBatch();
        }
        assertNotNull(batch);
        assertTrue(batch.getTerminationFlag());
        assertEquals(expectedResults.length, batch.getRowCount());
        for (int i = 0; i < expectedResults.length; i++) {
            List tuple = batch.getTuple(i+1);
            assertNotNull(tuple);
            Object result = tuple.get(0);
            assertNotNull(result);
            assertEquals(new Integer(expectedResults[i]), result);
        }
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

        for (int i = 0; i < commandsPerPlan.length; i++) {
            totalCommands += commandsPerPlan[i];
            plans.add(new FakeProcessorPlan(commandsPerPlan[i]));
        }
        BatchedUpdatePlan plan = new BatchedUpdatePlan(plans, totalCommands, null);
        TupleBatch batch = plan.nextBatch();
        assertEquals(totalCommands, batch.getRowCount());
        for (int i = 1; i <= totalCommands; i++) {
            assertEquals(new Integer(1), batch.getTuple(i).get(0));
        }
    }
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

        sortNode.open();
       
        int currentRow = 1;
        while(true) {
          try {
              TupleBatch batch = sortNode.nextBatch();
              if (mode != Mode.DUP_REMOVE) {
                  for(int row = currentRow; row <= batch.getEndRow(); row++) {
                      assertEquals("Rows don't match at " + row, expected[row-1], batch.getTuple(row)); //$NON-NLS-1$
                  }
              }
              currentRow += batch.getRowCount();   
              if(batch.getTerminationFlag()) {
                  break;
              }
          } catch (BlockedException e) {
           
          }
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

      String uuid = id.substring(0, index);
      int row = Integer.parseInt(id.substring(index+1));
      TupleBuffer tb = this.bufferMgr.getTupleBuffer(uuid);
      if (tb != null) {
        Map map = new HashMap();
        TupleBatch b = tb.getBatch(row);
        b.preserveTypes();
        map.put(id, b);
        return map;
      }
      return super.get(fqn);
    }
View Full Code Here

Examples of org.teiid.common.buffer.TupleBatch

      @Override
      protected TupleBatch nextBatchDirect() throws BlockedException,
          TeiidComponentException, TeiidProcessingException {
        if (i++ == 0) {
          return new TupleBatch(1, new List[] {Arrays.asList(1), Arrays.asList(1)});
        }
        TupleBatch batch = new TupleBatch(3, new List[0] );
        batch.setTerminationFlag(true);
        return batch;
      }
       
      };
     
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.