|
61 | 61 | import com.google.cloud.spanner.TimestampBound; |
62 | 62 | import com.google.gson.Gson; |
63 | 63 | import com.google.gson.GsonBuilder; |
| 64 | +import com.google.spanner.v1.DirectedReadOptions; |
64 | 65 | import java.io.ByteArrayInputStream; |
65 | 66 | import java.io.ByteArrayOutputStream; |
66 | 67 | import java.io.IOException; |
@@ -638,6 +639,24 @@ public ReadAll withExperimentalHost(String experimentalHost) { |
638 | 639 | return withExperimentalHost(ValueProvider.StaticValueProvider.of(experimentalHost)); |
639 | 640 | } |
640 | 641 |
|
| 642 | + /** Specifies the directed read options for Cloud Spanner. */ |
| 643 | + public ReadAll withDirectedReadOptions(DirectedReadOptions directedReadOptions) { |
| 644 | + SpannerConfig config = getSpannerConfig(); |
| 645 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 646 | + } |
| 647 | + |
| 648 | + /** Specifies the directed read options for Cloud Spanner. */ |
| 649 | + public ReadAll withDirectedReadOptions(ValueProvider<DirectedReadOptions> directedReadOptions) { |
| 650 | + SpannerConfig config = getSpannerConfig(); |
| 651 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 652 | + } |
| 653 | + |
| 654 | + /** Specifies the directed read options for Cloud Spanner from a string representation. */ |
| 655 | + public ReadAll withDirectedReadOptions(String directedReadOptions) { |
| 656 | + SpannerConfig config = getSpannerConfig(); |
| 657 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 658 | + } |
| 659 | + |
641 | 660 | /** |
642 | 661 | * Specifies whether to use plaintext channel. |
643 | 662 | * |
@@ -927,6 +946,24 @@ public Read withExperimentalHost(String experimentalHost) { |
927 | 946 | return withExperimentalHost(ValueProvider.StaticValueProvider.of(experimentalHost)); |
928 | 947 | } |
929 | 948 |
|
| 949 | + /** Specifies the directed read options for Cloud Spanner. */ |
| 950 | + public Read withDirectedReadOptions(DirectedReadOptions directedReadOptions) { |
| 951 | + SpannerConfig config = getSpannerConfig(); |
| 952 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 953 | + } |
| 954 | + |
| 955 | + /** Specifies the directed read options for Cloud Spanner. */ |
| 956 | + public Read withDirectedReadOptions(ValueProvider<DirectedReadOptions> directedReadOptions) { |
| 957 | + SpannerConfig config = getSpannerConfig(); |
| 958 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 959 | + } |
| 960 | + |
| 961 | + /** Specifies the directed read options for Cloud Spanner from a string representation. */ |
| 962 | + public Read withDirectedReadOptions(String directedReadOptions) { |
| 963 | + SpannerConfig config = getSpannerConfig(); |
| 964 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 965 | + } |
| 966 | + |
930 | 967 | /** |
931 | 968 | * Specifies whether to use plaintext channel. |
932 | 969 | * |
@@ -2052,6 +2089,28 @@ public ReadChangeStream withExperimentalHost(String experimentalHost) { |
2052 | 2089 | return withExperimentalHost(ValueProvider.StaticValueProvider.of(experimentalHost)); |
2053 | 2090 | } |
2054 | 2091 |
|
| 2092 | + /** Specifies the directed read options for change stream queries. */ |
| 2093 | + public ReadChangeStream withDirectedReadOptions(DirectedReadOptions directedReadOptions) { |
| 2094 | + SpannerConfig config = getSpannerConfig(); |
| 2095 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 2096 | + } |
| 2097 | + |
| 2098 | + /** Specifies the directed read options for change stream queries. */ |
| 2099 | + public ReadChangeStream withDirectedReadOptions( |
| 2100 | + ValueProvider<DirectedReadOptions> directedReadOptions) { |
| 2101 | + SpannerConfig config = getSpannerConfig(); |
| 2102 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 2103 | + } |
| 2104 | + |
| 2105 | + /** |
| 2106 | + * Specifies the directed read options for change stream queries from a string representation |
| 2107 | + * (e.g., JSON string or "us-central1:READ_ONLY"). |
| 2108 | + */ |
| 2109 | + public ReadChangeStream withDirectedReadOptions(String directedReadOptions) { |
| 2110 | + SpannerConfig config = getSpannerConfig(); |
| 2111 | + return withSpannerConfig(config.withDirectedReadOptions(directedReadOptions)); |
| 2112 | + } |
| 2113 | + |
2055 | 2114 | /** |
2056 | 2115 | * Specifies whether to use plaintext channel. |
2057 | 2116 | * |
|
0 commit comments