Class SpannerOptions.SpannerCallContextTimeoutConfigurator (6.80.1)
Stay organized with collections
Save and categorize content based on your preferences.
Helper class to configure timeouts for specific Spanner RPCs. The SpannerCallContextTimeoutConfigurator must be set as a value on the Context using the
SpannerOptions#CALL_CONTEXT_CONFIGURATOR_KEY key.
Example usage:
// Create a context with a ExecuteQuery timeout of 10 seconds.Contextcontext=Context.current().withValue(SpannerOptions.CALL_CONTEXT_CONFIGURATOR_KEY,SpannerCallContextTimeoutConfigurator.create().withExecuteQueryTimeout(Duration.ofSeconds(10L)));context.run(()->{try(ResultSetrs=client.singleUse().executeQuery(Statement.of("SELECT SingerId, FirstName, LastName FROM Singers ORDER BY LastName"))){while(rs.next()){System.out.printf("%d %s %s%n",rs.getLong(0),rs.getString(1),rs.getString(2));}}catch(SpannerExceptione){if(e.getErrorCode()==ErrorCode.DEADLINE_EXCEEDED){// Handle timeout.}}}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]