Class ResultFetcher
- java.lang.Object
-
- org.apache.flink.table.gateway.service.result.ResultFetcher
-
public class ResultFetcher extends Object
A fetcher to fetch result from submitted statement.The fetcher uses the
Iteratormodel. 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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.catalog.ResolvedSchemagetResultSchema()ResultStoregetResultStore()
-
-
-
Method Detail
-
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)
-
close
public void close()
-
getResultSchema
public org.apache.flink.table.catalog.ResolvedSchema getResultSchema()
-
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
@VisibleForTesting public ResultStore getResultStore()
-
-