Class ResultFetcher
java.lang.Object
org.apache.flink.table.gateway.service.result.ResultFetcher
A fetcher to fetch result from submitted statement.
The fetcher uses the Iterator model. It means every time fetch the result with the
current token, the fetcher will move forward and retire the old data.
After closes, the fetcher will not fetch the results from the remote but is able to return all data in the local cache.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.apache.flink.table.gateway.api.results.ResultSetfetchResults(long token, int maxFetchSize) Fetch results from the result store.org.apache.flink.table.gateway.api.results.ResultSetfetchResults(org.apache.flink.table.gateway.api.results.FetchOrientation orientation, int maxFetchSize) static ResultFetcherfromResults(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, org.apache.flink.table.catalog.ResolvedSchema resultSchema, List<org.apache.flink.table.data.RowData> results) static ResultFetcherfromResults(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, org.apache.flink.table.catalog.ResolvedSchema resultSchema, List<org.apache.flink.table.data.RowData> results, org.apache.flink.api.common.JobID jobID, org.apache.flink.table.api.ResultKind resultKind) static ResultFetcherfromTableResult(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, org.apache.flink.table.api.internal.TableResultInternal tableResult, boolean isQueryResult) org.apache.flink.table.utils.print.RowDataToStringConverterorg.apache.flink.table.utils.print.PrintStyleorg.apache.flink.table.catalog.ResolvedSchemabooleanwithResourceManager(org.apache.flink.table.resource.ResourceManager resourceManager)
-
Method Details
-
fromTableResult
public static ResultFetcher fromTableResult(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, org.apache.flink.table.api.internal.TableResultInternal tableResult, boolean isQueryResult) -
fromResults
public static ResultFetcher fromResults(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, org.apache.flink.table.catalog.ResolvedSchema resultSchema, List<org.apache.flink.table.data.RowData> results) -
fromResults
public static ResultFetcher fromResults(org.apache.flink.table.gateway.api.operation.OperationHandle operationHandle, org.apache.flink.table.catalog.ResolvedSchema resultSchema, List<org.apache.flink.table.data.RowData> results, @Nullable org.apache.flink.api.common.JobID jobID, org.apache.flink.table.api.ResultKind resultKind) -
withResourceManager
public ResultFetcher withResourceManager(org.apache.flink.table.resource.ResourceManager resourceManager) -
close
public void close() -
getResultSchema
public org.apache.flink.table.catalog.ResolvedSchema getResultSchema() -
isQueryResult
public boolean isQueryResult() -
getPrintStyle
public org.apache.flink.table.utils.print.PrintStyle getPrintStyle() -
getConverter
@VisibleForTesting public org.apache.flink.table.utils.print.RowDataToStringConverter getConverter() -
fetchResults
public org.apache.flink.table.gateway.api.results.ResultSet fetchResults(org.apache.flink.table.gateway.api.results.FetchOrientation orientation, int maxFetchSize) -
fetchResults
public org.apache.flink.table.gateway.api.results.ResultSet fetchResults(long token, int maxFetchSize) Fetch results from the result store. It tries to return the data cached in the buffer first. If the buffer is empty, then fetch results from theResultStore. It's possible multiple threads try to fetch results in parallel. To keep the data integration, use the synchronized to allow only one thread can fetch the result at any time. -
getResultStore
-