File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
java-spanner/google-cloud-spanner/src/main/java/com/google/cloud/spanner Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -981,9 +981,11 @@ protected SpannerOptions(Builder builder) {
981981 } else {
982982 enableBuiltInMetrics = builder .enableBuiltInMetrics ;
983983 }
984- if (builder .experimentalHost != null
985- && System .getenv (EXPERIMENTAL_LOCATION_API_ENV_VAR ) == null ) {
986- enableLocationApi = true ;
984+ // Enable location API when experimental host is set, unless explicitly disabled
985+ // via GOOGLE_SPANNER_EXPERIMENTAL_LOCATION_API=false.
986+ if (builder .experimentalHost != null ) {
987+ String locationApiEnvValue = System .getenv (EXPERIMENTAL_LOCATION_API_ENV_VAR );
988+ enableLocationApi = locationApiEnvValue == null || Boolean .parseBoolean (locationApiEnvValue );
987989 } else {
988990 enableLocationApi = builder .enableLocationApi ;
989991 }
You can’t perform that action at this time.
0 commit comments