Search in sources :

Example 1 with OrcConcatPageSource

use of io.prestosql.plugin.hive.orc.OrcConcatPageSource in project hetu-core by openlookeng.

the class TestOrcPageSourceMemoryTracking method testOrcConcatPageSourceDynamicFilterBlocked.

@Test
public void testOrcConcatPageSourceDynamicFilterBlocked() throws InterruptedException {
    OrcConcatPageSource orcConcatPageSource = getOrcConcatPageSource(1000);
    Page page = orcConcatPageSource.getNextPage();
    assertNull(page);
    TimeUnit.SECONDS.sleep(2);
    page = orcConcatPageSource.getNextPage();
    assertNotNull(page);
}
Also used : OrcConcatPageSource(io.prestosql.plugin.hive.orc.OrcConcatPageSource) Page(io.prestosql.spi.Page) Test(org.testng.annotations.Test)

Example 2 with OrcConcatPageSource

use of io.prestosql.plugin.hive.orc.OrcConcatPageSource in project hetu-core by openlookeng.

the class TestOrcPageSourceMemoryTracking method testOrcConcatPageSourceDynamicFilterNotBlocked.

@Test
public void testOrcConcatPageSourceDynamicFilterNotBlocked() {
    OrcConcatPageSource orcConcatPageSource = getOrcConcatPageSource(0);
    Page page = orcConcatPageSource.getNextPage();
    assertNotNull(page);
}
Also used : OrcConcatPageSource(io.prestosql.plugin.hive.orc.OrcConcatPageSource) Page(io.prestosql.spi.Page) Test(org.testng.annotations.Test)

Example 3 with OrcConcatPageSource

use of io.prestosql.plugin.hive.orc.OrcConcatPageSource in project boostkit-bigdata by kunpengcompute.

the class TestOrcPageSourceMemoryTracking method testOrcConcatPageSourceDynamicFilterNotBlocked.

@Test
public void testOrcConcatPageSourceDynamicFilterNotBlocked() {
    OrcConcatPageSource orcConcatPageSource = getOrcConcatPageSource(0);
    Page page = orcConcatPageSource.getNextPage();
    assertNotNull(page);
}
Also used : OrcConcatPageSource(io.prestosql.plugin.hive.orc.OrcConcatPageSource) Page(io.prestosql.spi.Page) Test(org.testng.annotations.Test)

Example 4 with OrcConcatPageSource

use of io.prestosql.plugin.hive.orc.OrcConcatPageSource in project boostkit-bigdata by kunpengcompute.

the class TestOrcPageSourceMemoryTracking method testOrcConcatPageSourceDynamicFilterBlocked.

@Test
public void testOrcConcatPageSourceDynamicFilterBlocked() throws InterruptedException {
    OrcConcatPageSource orcConcatPageSource = getOrcConcatPageSource(1000);
    Page page = orcConcatPageSource.getNextPage();
    assertNull(page);
    TimeUnit.SECONDS.sleep(2);
    page = orcConcatPageSource.getNextPage();
    assertNotNull(page);
}
Also used : OrcConcatPageSource(io.prestosql.plugin.hive.orc.OrcConcatPageSource) Page(io.prestosql.spi.Page) Test(org.testng.annotations.Test)

Example 5 with OrcConcatPageSource

use of io.prestosql.plugin.hive.orc.OrcConcatPageSource in project hetu-core by openlookeng.

the class TestOrcPageSourceMemoryTracking method getOrcConcatPageSource.

private OrcConcatPageSource getOrcConcatPageSource(long waitTime) {
    HiveConfig config = new HiveConfig();
    FileFormatDataSourceStats stats = new FileFormatDataSourceStats();
    ConnectorSession session = new TestingConnectorSession(new HiveSessionProperties(config, new OrcFileWriterConfig(), new ParquetFileWriterConfig()).getSessionProperties());
    List<ConnectorPageSource> pageSources = new ArrayList<>();
    Supplier<List<Map<ColumnHandle, DynamicFilter>>> supplier = null;
    DynamicFilterSupplier theSupplier = new DynamicFilterSupplier(supplier, System.currentTimeMillis(), waitTime);
    Optional<DynamicFilterSupplier> dynamicFilterSupplier = Optional.of(theSupplier);
    pageSources.add(testPreparer.newPageSource(stats, session, dynamicFilterSupplier));
    OrcConcatPageSource orcConcatPageSource = new OrcConcatPageSource(pageSources);
    return orcConcatPageSource;
}
Also used : ColumnHandle(io.prestosql.spi.connector.ColumnHandle) DynamicFilter(io.prestosql.spi.dynamicfilter.DynamicFilter) OrcConcatPageSource(io.prestosql.plugin.hive.orc.OrcConcatPageSource) TestingConnectorSession(io.prestosql.testing.TestingConnectorSession) ArrayList(java.util.ArrayList) ConnectorPageSource(io.prestosql.spi.connector.ConnectorPageSource) ConnectorSession(io.prestosql.spi.connector.ConnectorSession) TestingConnectorSession(io.prestosql.testing.TestingConnectorSession) ArrayList(java.util.ArrayList) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) Collectors.toList(java.util.stream.Collectors.toList) DynamicFilterSupplier(io.prestosql.spi.dynamicfilter.DynamicFilterSupplier)

Aggregations

OrcConcatPageSource (io.prestosql.plugin.hive.orc.OrcConcatPageSource)8 Page (io.prestosql.spi.Page)4 ConnectorPageSource (io.prestosql.spi.connector.ConnectorPageSource)4 Test (org.testng.annotations.Test)4 ImmutableList (com.google.common.collect.ImmutableList)2 ColumnHandle (io.prestosql.spi.connector.ColumnHandle)2 ConnectorSession (io.prestosql.spi.connector.ConnectorSession)2 RecordCursor (io.prestosql.spi.connector.RecordCursor)2 RecordPageSource (io.prestosql.spi.connector.RecordPageSource)2 DynamicFilter (io.prestosql.spi.dynamicfilter.DynamicFilter)2 DynamicFilterSupplier (io.prestosql.spi.dynamicfilter.DynamicFilterSupplier)2 TestingConnectorSession (io.prestosql.testing.TestingConnectorSession)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Collectors.toList (java.util.stream.Collectors.toList)2