This repository was archived by the owner on Apr 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathStatementResult.java
More file actions
157 lines (148 loc) · 4.5 KB
/
Copy pathStatementResult.java
File metadata and controls
157 lines (148 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.spanner.connection;
import com.google.api.core.InternalApi;
import com.google.cloud.spanner.ResultSet;
/**
* A result of the execution of a statement. Statements that are executed by the {@link
* Connection#execute(com.google.cloud.spanner.Statement)} method could have different types of
* return values. These are wrapped in a {@link StatementResult}.
*/
@InternalApi
public interface StatementResult {
/**
* Enum indicating the type of result that was returned by {@link
* Connection#execute(com.google.cloud.spanner.Statement)}
*/
enum ResultType {
/**
* A result set either returned by a query on Cloud Spanner or a local result set generated by a
* client side statement.
*/
RESULT_SET,
/** An update count returned by Cloud Spanner. */
UPDATE_COUNT,
/**
* DDL statements and client side statements that set the state of a connection return no
* result.
*/
NO_RESULT
}
/** The type of client side statement that was executed. */
enum ClientSideStatementType {
SHOW_AUTOCOMMIT,
SET_AUTOCOMMIT,
SHOW_READONLY,
SET_READONLY,
SHOW_RETRY_ABORTS_INTERNALLY,
SET_RETRY_ABORTS_INTERNALLY,
SHOW_AUTOCOMMIT_DML_MODE,
SET_AUTOCOMMIT_DML_MODE,
SHOW_STATEMENT_TIMEOUT,
SET_STATEMENT_TIMEOUT,
SHOW_TRANSACTION_TIMEOUT,
SET_TRANSACTION_TIMEOUT,
SHOW_READ_TIMESTAMP,
SHOW_COMMIT_TIMESTAMP,
SHOW_COMMIT_RESPONSE,
SHOW_READ_ONLY_STALENESS,
SET_READ_ONLY_STALENESS,
SHOW_DIRECTED_READ,
SET_DIRECTED_READ,
SHOW_OPTIMIZER_VERSION,
SET_OPTIMIZER_VERSION,
SHOW_OPTIMIZER_STATISTICS_PACKAGE,
SET_OPTIMIZER_STATISTICS_PACKAGE,
SHOW_RETURN_COMMIT_STATS,
SET_RETURN_COMMIT_STATS,
SHOW_MAX_COMMIT_DELAY,
SET_MAX_COMMIT_DELAY,
SHOW_DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE,
SET_DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE,
SHOW_KEEP_TRANSACTION_ALIVE,
SET_KEEP_TRANSACTION_ALIVE,
SHOW_STATEMENT_TAG,
SET_STATEMENT_TAG,
SHOW_TRANSACTION_TAG,
SET_TRANSACTION_TAG,
SHOW_EXCLUDE_TXN_FROM_CHANGE_STREAMS,
SET_EXCLUDE_TXN_FROM_CHANGE_STREAMS,
BEGIN,
COMMIT,
ROLLBACK,
SET_TRANSACTION_MODE,
SET_DEFAULT_TRANSACTION_ISOLATION,
START_BATCH_DDL,
START_BATCH_DML,
RUN_BATCH,
ABORT_BATCH,
RESET_ALL,
SET_RPC_PRIORITY,
SHOW_RPC_PRIORITY,
SHOW_TRANSACTION_ISOLATION_LEVEL,
SHOW_SAVEPOINT_SUPPORT,
SET_SAVEPOINT_SUPPORT,
SHOW_DATA_BOOST_ENABLED,
SET_DATA_BOOST_ENABLED,
SHOW_AUTO_PARTITION_MODE,
SET_AUTO_PARTITION_MODE,
SHOW_MAX_PARTITIONS,
SET_MAX_PARTITIONS,
SHOW_MAX_PARTITIONED_PARALLELISM,
SET_MAX_PARTITIONED_PARALLELISM,
EXPLAIN,
PARTITION,
RUN_PARTITION,
RUN_PARTITIONED_QUERY,
SET_PROTO_DESCRIPTORS,
SET_PROTO_DESCRIPTORS_FILE_PATH,
SHOW_PROTO_DESCRIPTORS,
SHOW_PROTO_DESCRIPTORS_FILE_PATH,
SET_AUTO_BATCH_DML,
SHOW_AUTO_BATCH_DML,
SET_AUTO_BATCH_DML_UPDATE_COUNT,
SHOW_AUTO_BATCH_DML_UPDATE_COUNT,
SET_AUTO_BATCH_DML_UPDATE_COUNT_VERIFICATION,
SHOW_AUTO_BATCH_DML_UPDATE_COUNT_VERIFICATION,
SHOW_READ_LOCK_MODE,
SET_READ_LOCK_MODE,
}
/**
* Returns the {@link ResultType} of this result.
*
* @return the result type.
*/
ResultType getResultType();
/**
* @return the {@link ClientSideStatementType} that was executed, or null if no such statement was
* executed.
*/
ClientSideStatementType getClientSideStatementType();
/**
* Returns the {@link ResultSet} held by this result. May only be called if the type of this
* result is {@link ResultType#RESULT_SET}.
*
* @return the {@link ResultSet} held by this result.
*/
ResultSet getResultSet();
/**
* Returns the update count held by this result. May only be called if the type of this result is
* {@link ResultType#UPDATE_COUNT}.
*
* @return the update count held by this result.
*/
Long getUpdateCount();
}