Class MaterializedCollectResultBase
java.lang.Object
org.apache.flink.table.client.gateway.result.CollectResultBase
org.apache.flink.table.client.gateway.result.MaterializedCollectResultBase
- All Implemented Interfaces:
DynamicResult,MaterializedResult
- Direct Known Subclasses:
MaterializedCollectBatchResult,MaterializedCollectStreamResult
public abstract class MaterializedCollectResultBase
extends CollectResultBase
implements MaterializedResult
Base class to collect results and returns them as table snapshots.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.table.client.gateway.result.CollectResultBase
CollectResultBase.ResultRetrievalThread -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleFactor for the initial capacity of the materialized table.static final intMaximum initial capacity of the materialized table.static final intMaximum overcommitment of the materialized table.static final doubleFactor for cleaning up deleted rows in the materialized table.protected final List<org.apache.flink.table.data.RowData>Materialized table that is continuously updated by inserts and deletes.protected final intMaximum number of materialized rows to be stored.protected final intThreshold for cleaning up deleted rows in the materialized table.protected intCounter for deleted rows to be deleted at the beginning of the materialized table.Fields inherited from class org.apache.flink.table.client.gateway.result.CollectResultBase
executionException, resultLock, retrievalThread -
Constructor Summary
ConstructorsConstructorDescriptionMaterializedCollectResultBase(StatementResult tableResult, int maxRowCount, int overcommitThreshold) -
Method Summary
Modifier and TypeMethodDescriptionprotected static intcomputeMaterializedTableCapacity(int maxRowCount) protected static intcomputeMaterializedTableOvercommit(int maxRowCount) protected List<org.apache.flink.table.data.RowData>List<org.apache.flink.table.data.RowData>retrievePage(int page) Retrieves a page of a snapshotted result.snapshot(int pageSize) Takes a snapshot of the current table and returns the number of pages for navigating through the snapshot.Methods inherited from class org.apache.flink.table.client.gateway.result.CollectResultBase
close, handleMissingResult, isRetrieving, processRecordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.table.client.gateway.result.DynamicResult
close
-
Field Details
-
MATERIALIZED_TABLE_MAX_INITIAL_CAPACITY
public static final int MATERIALIZED_TABLE_MAX_INITIAL_CAPACITYMaximum initial capacity of the materialized table.- See Also:
-
MATERIALIZED_TABLE_MAX_OVERCOMMIT
public static final int MATERIALIZED_TABLE_MAX_OVERCOMMITMaximum overcommitment of the materialized table.- See Also:
-
MATERIALIZED_TABLE_CAPACITY_FACTOR
public static final double MATERIALIZED_TABLE_CAPACITY_FACTORFactor for the initial capacity of the materialized table.- See Also:
-
MATERIALIZED_TABLE_OVERCOMMIT_FACTOR
public static final double MATERIALIZED_TABLE_OVERCOMMIT_FACTORFactor for cleaning up deleted rows in the materialized table.- See Also:
-
maxRowCount
protected final int maxRowCountMaximum number of materialized rows to be stored. After the count is reached, oldest rows are dropped. -
overcommitThreshold
protected final int overcommitThresholdThreshold for cleaning up deleted rows in the materialized table. -
materializedTable
Materialized table that is continuously updated by inserts and deletes. Deletes at the beginning are lazily cleaned up when the threshold is reached. -
validRowPosition
protected int validRowPositionCounter for deleted rows to be deleted at the beginning of the materialized table.
-
-
Constructor Details
-
MaterializedCollectResultBase
public MaterializedCollectResultBase(StatementResult tableResult, int maxRowCount, int overcommitThreshold)
-
-
Method Details
-
snapshot
Description copied from interface:MaterializedResultTakes a snapshot of the current table and returns the number of pages for navigating through the snapshot.- Specified by:
snapshotin interfaceMaterializedResult
-
retrievePage
Description copied from interface:MaterializedResultRetrieves a page of a snapshotted result.- Specified by:
retrievePagein interfaceMaterializedResult
-
computeMaterializedTableCapacity
protected static int computeMaterializedTableCapacity(int maxRowCount) -
computeMaterializedTableOvercommit
protected static int computeMaterializedTableOvercommit(int maxRowCount) -
getMaterializedTable
-