Skip to content

Commit 7a7700e

Browse files
committed
fix: doc errors.
1 parent 21c71ca commit 7a7700e

14 files changed

+41
-35
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ interface ReadyCallback {
117117
* CursorState#NOT_READY}.
118118
* </ul>
119119
*
120-
* <h2>Flow Control</h2>
120+
* <h4>Flow Control</h4>
121121
*
122122
* If no flow control is needed (say because result sizes are known in advance to be finite in
123123
* size) then async processing is simple. The following is a code example that transfers work from

google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncRunner.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import com.google.api.core.ApiFuture;
2020
import com.google.cloud.Timestamp;
21+
import io.grpc.Status.Code;
2122
import java.util.concurrent.ExecutionException;
2223
import java.util.concurrent.Executor;
2324

@@ -40,8 +41,8 @@ interface AsyncWork<R> {
4041
* <p>In most cases, the implementation will not need to catch {@code SpannerException}s from
4142
* Spanner operations, instead letting these propagate to the framework. The transaction runner
4243
* will take appropriate action based on the type of exception. In particular, implementations
43-
* should never catch an exception of type {@link SpannerErrors#isAborted}: these indicate that
44-
* some reads may have returned inconsistent data and the transaction attempt must be aborted.
44+
* should never catch an exception of type {@link Code#ABORTED}: these indicate that some reads
45+
* may have returned inconsistent data and the transaction attempt must be aborted.
4546
*
4647
* @param txn the transaction
4748
* @return future over the result of the work

google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseAdminClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ default OperationFuture<Database, CreateDatabaseMetadata> createDatabase(
137137
* Database db = op.waitFor().getResult();
138138
* }</pre>
139139
*
140-
* @see also #createDatabase(String, String, Iterable)
140+
* @see #createDatabase(String, String, Iterable)
141141
*/
142142
OperationFuture<Database, CreateDatabaseMetadata> createDatabase(
143143
Database database, Iterable<String> statements) throws SpannerException;

google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ CommitResponse writeAtLeastOnceWithOptions(
412412
*
413413
* <p>Example of a read write transaction.
414414
*
415-
* <pre> <code>
415+
* <pre>{@code
416416
* Executor executor = Executors.newSingleThreadExecutor();
417417
* final long singerId = my_singer_id;
418418
* AsyncRunner runner = client.runAsync();
@@ -432,7 +432,7 @@ CommitResponse writeAtLeastOnceWithOptions(
432432
* .build());
433433
* },
434434
* executor);
435-
* </code></pre>
435+
* }</pre>
436436
*
437437
* Options for a transaction can include:
438438
*

google-cloud-spanner/src/main/java/com/google/cloud/spanner/InstanceConfigInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ public List<ReplicaInfo> getOptionalReplicas() {
117117
}
118118

119119
/**
120-
* Base configuration, e.g. projects/<project_name>/instanceConfigs/nam3, based on which this
121-
* configuration is created. Only set for user managed configurations. The base config must refer
122-
* to a configuration of type GOOGLE_MANAGED.
120+
* Base configuration, e.g. {@code projects/<project_name>/instanceConfigs/nam3}, based on which
121+
* this configuration is created. Only set for user managed configurations. The base config must
122+
* refer to a configuration of type GOOGLE_MANAGED.
123123
*/
124124
public InstanceConfigInfo getBaseConfig() {
125125
return baseConfig;

google-cloud-spanner/src/main/java/com/google/cloud/spanner/Options.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ public static ListOption pageSize(int pageSize) {
156156
}
157157

158158
/**
159-
* If this is for a partitioned read & query and this field is set to `true`, the request will be
160-
* executed via Spanner independent compute resources. The method is available in Beta mode (and
161-
* is not generally available now).
159+
* If this is for a partitioned read and query and this field is set to `true`, the request will
160+
* be executed via Spanner independent compute resources. The method is available in Beta mode
161+
* (and is not generally available now).
162162
*/
163163
@BetaApi
164164
public static DataBoostQueryOption dataBoostEnabled(Boolean dataBoostEnabled) {

google-cloud-spanner/src/main/java/com/google/cloud/spanner/Session.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import com.google.api.core.ApiFuture;
2020
import com.google.api.core.InternalApi;
21+
import com.google.cloud.spanner.Options.TransactionOption;
2122
import com.google.protobuf.Empty;
2223

2324
/**
@@ -48,11 +49,12 @@ public interface Session extends DatabaseClient, AutoCloseable {
4849
String getName();
4950

5051
/**
51-
* Prepares a transaction for use by a subsequent {@link #readWriteTransaction()} or {@link
52-
* #write(Iterable)} call. It is not necessary to call this method before running a transaction or
53-
* performing a write, but doing so may allow one round trip of the protocol to be performed in
54-
* advance; calling this method on an idle session that is expected to execute a transaction or
55-
* write in the near future may reduce the latency of the subsequent transaction/write.
52+
* Prepares a transaction for use by a subsequent {@link
53+
* DatabaseClient#readWriteTransaction(TransactionOption...)} or {@link #write(Iterable)} call. It
54+
* is not necessary to call this method before running a transaction or performing a write, but
55+
* doing so may allow one round trip of the protocol to be performed in advance; calling this
56+
* method on an idle session that is expected to execute a transaction or write in the near future
57+
* may reduce the latency of the subsequent transaction/write.
5658
*/
5759
void prepareReadWriteTransaction();
5860

google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionContext.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.spanner;
1818

1919
import com.google.api.core.ApiFuture;
20+
import com.google.cloud.spanner.Options.TransactionOption;
2021
import com.google.cloud.spanner.Options.UpdateOption;
2122
import com.google.spanner.v1.ResultSetStats;
2223

@@ -81,7 +82,7 @@
8182
* <p>If this behavior is undesirable, periodically executing a simple SQL query in the transaction
8283
* (e.g., {@code SELECT 1}) prevents the transaction from becoming idle.
8384
*
84-
* @see Session#readWriteTransaction()
85+
* @see DatabaseClient#readWriteTransaction(TransactionOption...)
8586
* @see TransactionRunner
8687
*/
8788
public interface TransactionContext extends ReadContext {

google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunner.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
package com.google.cloud.spanner;
1818

1919
import com.google.cloud.Timestamp;
20+
import com.google.cloud.spanner.Options.TransactionOption;
2021
import javax.annotation.Nullable;
2122

2223
/**
2324
* An interface for executing a body of work in the context of a read-write transaction, with
2425
* retries for transaction aborts. See {@link TransactionContext} for a description of transaction
2526
* semantics. {@code TransactionRunner} instances are obtained by calling {@link
26-
* Session#readWriteTransaction()}.
27+
* DatabaseClient#readWriteTransaction(TransactionOption...)}.
2728
*
2829
* <p>A {@code TransactionRunner} instance can only be used for a single invocation of {@link
2930
* #run(TransactionCallable)}.

google-cloud-spanner/src/test/java/com/google/cloud/spanner/GrpcResultSetTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
import org.junit.runner.RunWith;
5252
import org.junit.runners.JUnit4;
5353

54-
/** Unit tests for {@link com.google.cloud.spanner.SpannerImpl.GrpcResultSet}. */
54+
/** Unit tests for {@link com.google.cloud.spanner.AbstractResultSet.GrpcResultSet}. */
5555
@RunWith(JUnit4.class)
5656
public class GrpcResultSetTest {
5757

google-cloud-spanner/src/test/java/com/google/cloud/spanner/InstanceAdminClientImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import org.junit.runners.JUnit4;
5555
import org.mockito.Mock;
5656

57-
/** Unit tests for {@link com.google.cloud.spanner.SpannerImpl.InstanceAdminClientImpl}. */
57+
/** Unit tests for {@link com.google.cloud.spanner.InstanceAdminClientImpl}. */
5858
@RunWith(JUnit4.class)
5959
public class InstanceAdminClientImplTest {
6060
private static final String PROJECT_ID = "my-project";

google-cloud-spanner/src/test/java/com/google/cloud/spanner/TransactionRunnerImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
import org.mockito.Mockito;
7474
import org.mockito.MockitoAnnotations;
7575

76-
/** Unit test for {@link com.google.cloud.spanner.SpannerImpl.TransactionRunnerImpl} */
76+
/** Unit test for {@link com.google.cloud.spanner.TransactionRunnerImpl} */
7777
@RunWith(JUnit4.class)
7878
public class TransactionRunnerImplTest {
7979
private static final class TestExecutorFactory

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractSqlScriptVerifier.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@
7070
* equal. The value of a variable can be set using a @PUT statement.
7171
* </ul>
7272
*
73-
* The parser can set a temporary variable value using a @PUT statement: <code>
74-
* @PUT 'variable_name'\nSQL statement</code> The SQL statement must be a statement that returns a
75-
* {@link ResultSet} containing exactly one row and one column.
73+
* The parser can set a temporary variable value using a @PUT statement: {@code @PUT
74+
* 'variable_name'\nSQL statement} The SQL statement must be a statement that returns a {@link
75+
* ResultSet} containing exactly one row and one column.
7676
*
7777
* <p>In addition the verifier can create new connections if the script contains NEW_CONNECTION;
7878
* statements and the verifier has been created with a {@link GenericConnectionProvider}. See {@link
@@ -130,7 +130,7 @@ protected abstract static class GenericStatementResult {
130130

131131
/**
132132
* Generic wrapper around a connection to a database. The underlying connection could be a Spanner
133-
* {@link com.google.cloud.spanner.jdbc.Connection} or a JDBC {@link java.sql.Connection}
133+
* {@link com.google.cloud.spanner.connection.Connection} or a JDBC {@link java.sql.Connection}
134134
*/
135135
public abstract static class GenericConnection implements AutoCloseable {
136136
protected abstract GenericStatementResult execute(String sql) throws Exception;
@@ -208,8 +208,8 @@ public AbstractSqlScriptVerifier(GenericConnectionProvider provider) {
208208
* Statements without an @EXPECT statement will be executed and its result will be ignored, unless
209209
* the statement throws an exception, which will fail the test case.
210210
*
211-
* <p>The {@link com.google.cloud.spanner.jdbc.Connection}s that the statements are executed on
212-
* must be created by a {@link GenericConnectionProvider}
211+
* <p>The {@link com.google.cloud.spanner.connection.Connection}s that the statements are executed
212+
* on must be created by a {@link GenericConnectionProvider}
213213
*
214214
* @param filename The file name containing the statements. Statements must be separated by a
215215
* semicolon (;)
@@ -229,8 +229,8 @@ public void verifyStatementsInFile(String filename, Class<?> resourceClass, bool
229229
* Statements without an @EXPECT statement will be executed and its result will be ignored, unless
230230
* the statement throws an exception, which will fail the test case.
231231
*
232-
* <p>The {@link com.google.cloud.spanner.jdbc.Connection}s that the statements are executed on
233-
* must be created by a {@link GenericConnectionProvider}
232+
* <p>The {@link com.google.cloud.spanner.connection.Connection}s that the statements are executed
233+
* on must be created by a {@link GenericConnectionProvider}
234234
*
235235
* @param filename The file name containing the statements. Statements must be separated by a
236236
* semicolon (;)
@@ -250,8 +250,8 @@ public void verifyStatementsInFile(String filename, Class<?> resourceClass) thro
250250
* Statements without an @EXPECT statement will be executed and its result will be ignored, unless
251251
* the statement throws an exception, which will fail the test case.
252252
*
253-
* @param providedConnection The {@link com.google.cloud.spanner.jdbc.Connection} to execute the
254-
* statements against
253+
* @param providedConnection The {@link com.google.cloud.spanner.connection.Connection} to execute
254+
* the statements against
255255
* @param filename The file name containing the statements. Statements must be separated by a
256256
* semicolon (;)
257257
* @param resourceClass The class that defines the package where to find the input file
@@ -271,8 +271,8 @@ public void verifyStatementsInFile(
271271
* Statements without an @EXPECT statement will be executed and its result will be ignored, unless
272272
* the statement throws an exception, which will fail the test case.
273273
*
274-
* @param providedConnection The {@link com.google.cloud.spanner.jdbc.Connection} to execute the
275-
* statements against
274+
* @param providedConnection The {@link com.google.cloud.spanner.connection.Connection} to execute
275+
* the statements against
276276
* @param filename The file name containing the statements. Statements must be separated by a
277277
* semicolon (;)
278278
* @param resourceClass The class that defines the package where to find the input file

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/SqlScriptVerifier.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
import com.google.cloud.spanner.connection.StatementResult.ResultType;
2929

3030
/**
31-
* SQL script verifier implementation for Spanner {@link com.google.cloud.spanner.jdbc.Connection}
31+
* SQL script verifier implementation for Spanner {@link
32+
* com.google.cloud.spanner.connection.Connection}
3233
*
3334
* @see AbstractSqlScriptVerifier for more information
3435
*/

0 commit comments

Comments
 (0)