-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Query engine
Trino
Question
I'd like to reuse extraCredentials option of the trino driver and communicate with a rest catalog via token that we provide via this option.
In this case a session is being created via AuthSession.fromAccessToken because Trino passes it as a property.
But the thing is that RestSessionCatalog uses cache for sessions. And it means that in case we send a new token, the old one will be used until cache is expired (1 hour is default).
I see there is a property auth.session-timeout-ms, but can't override it. Is it possible?
private static Cache<String, AuthSession> newSessionCache(Map<String, String> properties) {
long expirationIntervalMs =
PropertyUtil.propertyAsLong(
properties,
CatalogProperties.AUTH_SESSION_TIMEOUT_MS,
CatalogProperties.AUTH_SESSION_TIMEOUT_MS_DEFAULT);
return Caffeine.newBuilder()
.expireAfterAccess(Duration.ofMillis(expirationIntervalMs))
.removalListener(
(RemovalListener<String, AuthSession>)
(id, auth, cause) -> {
if (auth != null) {
auth.stopRefreshing();
}
})
.build();
}
i-mechanik, nqvuong1998 and drnta
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested