Package org.teiid.common.buffer.impl

Examples of org.teiid.common.buffer.impl.BufferManagerImpl


        TestProcessor.examineResults((List[])expected.toArray(new List[expected.size()]), bufferMgr, id);
    }

    private BufferManager createCustomBufferMgr(int batchSize) throws TeiidComponentException {
        BufferManagerImpl bufferMgr = new BufferManagerImpl();
        bufferMgr.setConnectorBatchSize(batchSize);
        bufferMgr.setProcessorBatchSize(batchSize);
        bufferMgr.initialize();

        // Add unmanaged memory storage manager
        bufferMgr.setStorageManager(new MemoryStorageManager());

        return bufferMgr;
    }
View Full Code Here


        LogManager.logDetail(LogConstants.CTX_DQP, "Starting BufferManager using", bufferDir); //$NON-NLS-1$
        if (!bufferDir.exists()) {
          this.bufferDir.mkdirs();
        }
            // Construct and initialize the buffer manager
            this.bufferMgr = new BufferManagerImpl();
            this.bufferMgr.setConnectorBatchSize(Integer.valueOf(connectorBatchSize));
            this.bufferMgr.setProcessorBatchSize(Integer.valueOf(processorBatchSize));
            this.bufferMgr.setMaxReserveBatchColumns(this.maxReserveBatchColumns);
            this.bufferMgr.setMaxProcessingBatchColumns(this.maxProcessingBatchesColumns);
           
View Full Code Here

* @since 4.2
*/
public class NodeTestUtil {
   
    static BufferManager getTestBufferManager(long bytesAvailable, int procBatchSize, int connectorBatchSize) {
      BufferManagerImpl bufferManager = new BufferManagerImpl();
      bufferManager.setProcessorBatchSize(procBatchSize);
      bufferManager.setConnectorBatchSize(connectorBatchSize);
      bufferManager.setMaxProcessingBatchColumns((int)(bytesAvailable/procBatchSize/BufferManagerImpl.KB_PER_VALUE/1024));
      bufferManager.setMaxReserveBatchColumns((int)(bytesAvailable/procBatchSize/BufferManagerImpl.KB_PER_VALUE/1024));
        // Get the properties for BufferManager
        return createBufferManager(bufferManager);
    }
View Full Code Here

        // Get the properties for BufferManager
        return createBufferManager(bufferManager);
    }
   
    static BufferManager getTestBufferManager(long bytesAvailable, int procBatchSize) {
      BufferManagerImpl bufferManager = new BufferManagerImpl();
      bufferManager.setProcessorBatchSize(procBatchSize);
      bufferManager.setMaxProcessingBatchColumns((int)(bytesAvailable/procBatchSize/BufferManagerImpl.KB_PER_VALUE/1024));
      bufferManager.setMaxReserveBatchColumns((int)(bytesAvailable/procBatchSize/BufferManagerImpl.KB_PER_VALUE/1024));
        // Get the properties for BufferManager
        return createBufferManager(bufferManager);
    }
View Full Code Here

        helpProcess(mgr, node, context, expected, null);
    }

    // Same as test2, but uses processor batch size smaller than number of groups
    @Test public void test3() throws Exception {
      BufferManagerImpl mgr = BufferManagerFactory.createBufferManager();
        mgr.setProcessorBatchSize(5);

        GroupingNode node = getExampleGroupingNode();        
        CommandContext context = new CommandContext("pid", "test", null, null,  1);               //$NON-NLS-1$ //$NON-NLS-2$
       
        List[] expected = new List[] {
View Full Code Here

        FakeTupleSource dataSource = new FakeTupleSource(symbols, data);           
        helpProcess(mgr, node, context, expected, dataSource, null);
    }

    private void helpTestLookupFunctionInAggregate(int batchSize) throws Exception {
        BufferManagerImpl mgr = BufferManagerFactory.createBufferManager();
        mgr.setProcessorBatchSize(batchSize);

        // Set up
        GroupingNode node = new GroupingNode(1);
        List outputElements = new ArrayList();
        ElementSymbol col1 = new ElementSymbol("col1"); //$NON-NLS-1$
View Full Code Here

        assertTrue("Not Directory", svc.getBufferDirectory().isDirectory()); //$NON-NLS-1$
        assertTrue("does not exist", svc.getBufferDirectory().exists()); //$NON-NLS-1$
        assertTrue("does not end with one", svc.getBufferDirectory().getParent().endsWith("1")); //$NON-NLS-1$ //$NON-NLS-2$
        assertTrue(svc.isUseDisk());
       
        BufferManagerImpl mgr = (BufferManagerImpl) svc.getBufferManager();
        assertTrue(((FileStorageManager)mgr.getStorageManager()).getDirectory().endsWith(svc.getBufferDirectory().getName()));
    }
View Full Code Here

    assertEquals(0, map.getRowCount());
    assertNull(map.insert(Arrays.asList(1, String.valueOf(1)), InsertMode.NEW, -1));
  }
 
  @Test public void testUnOrderedInsert() throws TeiidComponentException {
    BufferManagerImpl bm = BufferManagerFactory.createBufferManager();
    bm.setProcessorBatchSize(16);
   
    ElementSymbol e1 = new ElementSymbol("x");
    e1.setType(Integer.class);
    List elements = Arrays.asList(e1);
    STree map = bm.createSTree(elements, "1", 1);
   
    int size = (1<<16)+(1<<4)+1;
    int logSize = map.getExpectedHeight(size);

    for (int i = 0; i < size; i++) {
View Full Code Here

    }
    assertTrue(5 >= map.getHeight());
  }

  @Test public void testOrderedInsert() throws TeiidComponentException {
    BufferManagerImpl bm = BufferManagerFactory.createBufferManager();
    bm.setProcessorBatchSize(16);
   
    ElementSymbol e1 = new ElementSymbol("x");
    e1.setType(Integer.class);
    List elements = Arrays.asList(e1);
    STree map = bm.createSTree(elements, "1", 1);
   
    int size = (1<<16)+(1<<4)+1;
   
    for (int i = 0; i < size; i++) {
      assertNull(map.insert(Arrays.asList(i), InsertMode.ORDERED, size));
View Full Code Here

     * typically used for testing or when memory is not an issue.
     * @return BufferManager ready for use
     */
    public static BufferManager getStandaloneBufferManager() {
      if (INSTANCE == null) {
          BufferManagerImpl bufferMgr = createBufferManager();
          INSTANCE = bufferMgr;
      }

        return INSTANCE;
    }
View Full Code Here

TOP

Related Classes of org.teiid.common.buffer.impl.BufferManagerImpl

Copyright © 2015 www.massapicom. 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.