morningman commented on code in PR #68901:
URL: https://github.com/apache/doris/pull/68901#discussion_r4240062961
##########
fe/fe-connector/fe-connector-spi/src/main/java/org/apache/doris/connector/spi/ConnectorStatementScope.java:
##########
@@ -44,6 +44,27 @@ public interface ConnectorStatementScope {
*/
<T> T computeIfAbsent(String key, Supplier<T> loader);
+ /**
+ * {@link #computeIfAbsent} for a value only planning reads, such as a
memo that lets the identical scans of
+ * one plan share their planned ranges. The engine drops such values once
planning ends ({@link #endPlanning}),
+ * so nothing they reference is held while the statement executes. A call
after that computes and registers
+ * the value again, which a scan planned at execution time (a partition
batch planned through
+ * {@code ConnectorScanPlanProvider#planScanForPartitionBatch}'s default)
would do: the value then stays until
+ * {@link #closeAll}. The value must hold nothing to close, because it is
dropped without being closed. Under
+ * {@link #NONE} the loader runs on every call.
+ */
+ default <T> T computeIfAbsentForPlanning(String key, Supplier<T> loader) {
Review Comment:
Not bumping here, on purpose, as on #68874. The connector SPI has not
shipped in a release: the FE and every connector plugin are built from the same
tree and released together, so no released FE serves 13.0 without this method,
and pairing plugin jars with an FE from another commit is not a supported
installation. Until the SPI ships, methods are added without moving
`connector.plugin.api.version`. `ConnectorStatementScope` is not in the frozen
surface list today, and neither are the scope methods plugins already call
(`computeIfAbsent`, `getOrCreateMetadata`); whether to freeze it belongs with
versioning the SPI, so this PR leaves the list unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]