Skip to content

Commit 762fa58

Browse files
committed
Merge pull request #367 from mziccard/bigquery
Add BigQueryRpc default implementation
2 parents 13e976a + 120fe12 commit 762fa58

File tree

2 files changed

+454
-2
lines changed

2 files changed

+454
-2
lines changed

gcloud-java-bigquery/src/main/java/com/google/gcloud/spi/BigQueryRpc.java

+44-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public interface BigQueryRpc {
3535

3636
// These options are part of the Google Cloud BigQuery query parameters
3737
enum Option {
38-
QUOTA_USER("quotaUser"),
39-
USER_IP("userIp"),
4038
FIELDS("fields"),
4139
DELETE_CONTENTS("deleteContents"),
4240
ALL_DATASETS("all"),
@@ -98,23 +96,57 @@ public Y y() {
9896
}
9997
}
10098

99+
/**
100+
* Returns the requested dataset or {@code null} if not found.
101+
*
102+
* @throws BigQueryException upon failure
103+
*/
101104
Dataset getDataset(String datasetId, Map<Option, ?> options) throws BigQueryException;
102105

106+
/**
107+
* Lists the project's datasets. Partial information is returned on a dataset (datasetReference,
108+
* friendlyName and id). To get full information use {@link #getDataset(String, Map)}.
109+
*
110+
* @throws BigQueryException upon failure
111+
*/
103112
Tuple<String, Iterable<Dataset>> listDatasets(Map<Option, ?> options) throws BigQueryException;
104113

105114
Dataset create(Dataset dataset, Map<Option, ?> options) throws BigQueryException;
106115

116+
/**
117+
* Delete the requested dataset.
118+
*
119+
* @return {@code true} if dataset was deleted, {@code false} if it was not found
120+
* @throws BigQueryException upon failure
121+
*/
107122
boolean deleteDataset(String datasetId, Map<Option, ?> options) throws BigQueryException;
108123

109124
Dataset patch(Dataset dataset, Map<Option, ?> options) throws BigQueryException;
110125

126+
/**
127+
* Returns the requested table or {@code null} if not found.
128+
*
129+
* @throws BigQueryException upon failure
130+
*/
111131
Table getTable(String datasetId, String tableId, Map<Option, ?> options) throws BigQueryException;
112132

133+
/**
134+
* Lists the dataset's tables. Partial information is returned on a table (tableReference,
135+
* friendlyName, id and type). To get full information use {@link #getTable(String, String, Map)}.
136+
*
137+
* @throws BigQueryException upon failure
138+
*/
113139
Tuple<String, Iterable<Table>> listTables(String dataset, Map<Option, ?> options)
114140
throws BigQueryException;
115141

116142
Table create(Table table, Map<Option, ?> options) throws BigQueryException;
117143

144+
/**
145+
* Delete the requested table.
146+
*
147+
* @return {@code true} if table was deleted, {@code false} if it was not found
148+
* @throws BigQueryException upon failure
149+
*/
118150
boolean deleteTable(String datasetId, String tableId, Map<Option, ?> options)
119151
throws BigQueryException;
120152

@@ -126,8 +158,18 @@ TableDataInsertAllResponse insertAll(TableReference table, TableDataInsertAllReq
126158
Tuple<String, Iterable<TableRow>> listTableData(String datasetId, String tableId,
127159
Map<Option, ?> options) throws BigQueryException;
128160

161+
/**
162+
* Returns the requested job or {@code null} if not found.
163+
*
164+
* @throws BigQueryException upon failure
165+
*/
129166
Job getJob(String jobId, Map<Option, ?> options) throws BigQueryException;
130167

168+
/**
169+
* Lists the project's jobs.
170+
*
171+
* @throws BigQueryException upon failure
172+
*/
131173
Tuple<String, Iterable<Job>> listJobs(Map<Option, ?> options) throws BigQueryException;
132174

133175
Job create(Job job, Map<Option, ?> options) throws BigQueryException;

0 commit comments

Comments
 (0)