Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
package io.trino.connector;

import io.trino.spi.Page;
import io.trino.spi.connector.ConnectorPageSource;
import io.trino.spi.connector.SourcePage;
import io.trino.spi.metrics.Metrics;
Expand Down Expand Up @@ -60,13 +59,6 @@ public boolean isFinished()
return delegate.isFinished();
}

@Override
@SuppressWarnings("removal")
public Page getNextPage()
{
return delegate.getNextPage();
}

@Override
public SourcePage getNextSourcePage()
{
Expand Down
18 changes: 18 additions & 0 deletions core/trino-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,24 @@
<code>java.annotation.removed</code>
<annotationType>io.trino.spi.Experimental</annotationType>
</item>
<item>
<ignore>true</ignore>
<code>java.method.removed</code>
<old>method io.trino.spi.Page io.trino.spi.connector.EmptyPageSource::getNextPage()</old>
<justification>Deprecated</justification>
</item>
<item>
<ignore>true</ignore>
<code>java.method.removed</code>
<old>method io.trino.spi.Page io.trino.spi.connector.FixedPageSource::getNextPage()</old>
<justification>Deprecated</justification>
</item>
<item>
<ignore>true</ignore>
<code>java.method.removed</code>
<old>method io.trino.spi.Page io.trino.spi.connector.RecordPageSource::getNextPage()</old>
<justification>Deprecated</justification>
</item>
</differences>
</revapi.differences>
</analysisConfiguration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
package io.trino.spi.connector;

import io.trino.spi.Page;
import io.trino.spi.metrics.Metrics;

import java.io.Closeable;
Expand Down Expand Up @@ -53,27 +52,12 @@ default OptionalLong getCompletedPositions()
*/
boolean isFinished();

/**
* Gets the next page of data. This method is allowed to return null.
*
* @deprecated Use {@link #getNextSourcePage()} instead
*/
@Deprecated(forRemoval = true)
default Page getNextPage()
{
throw new UnsupportedOperationException();
}

/**
* Gets the next page of data. This method is allowed to return null.
*/
default SourcePage getNextSourcePage()
{
Page nextPage = getNextPage();
if (nextPage == null) {
return null;
}
return SourcePage.create(nextPage);
throw new UnsupportedOperationException();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*/
package io.trino.spi.connector;

import io.trino.spi.Page;

public class EmptyPageSource
implements ConnectorPageSource
{
Expand All @@ -36,13 +34,6 @@ public boolean isFinished()
return true;
}

@Override
@SuppressWarnings("removal")
public Page getNextPage()
{
return null;
}

@Override
public SourcePage getNextSourcePage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@ public boolean isFinished()
}

@Override
@SuppressWarnings("removal")
public Page getNextPage()
public SourcePage getNextSourcePage()
{
if (isFinished()) {
return null;
}
Page page = pages.next();
completedBytes += page.getSizeInBytes();
return page;
return SourcePage.create(page);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public boolean isFinished()
}

@Override
@SuppressWarnings("removal")
public Page getNextPage()
public SourcePage getNextSourcePage()
{
if (!closed) {
for (int i = 0; i < ROWS_PER_REQUEST && !pageBuilder.isFull(); i++) {
Expand Down Expand Up @@ -125,7 +124,7 @@ else if (javaType == Slice.class) {
if ((closed && !pageBuilder.isEmpty()) || pageBuilder.isFull()) {
Page page = pageBuilder.build();
pageBuilder.reset();
return page;
return SourcePage.create(page);
}

return null;
Expand Down
Loading