Skip to content

Commit ab40a32

Browse files
committed
---
yaml --- r: 2673 b: refs/heads/update-datastore c: 1ab0ac5 h: refs/heads/master i: 2671: 28f95ab
1 parent d943f77 commit ab40a32

16 files changed

Lines changed: 111 additions & 82 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
8-
refs/heads/update-datastore: 824c46c55e09c3d7cc4ea45144a159724e8ed609
8+
refs/heads/update-datastore: 1ab0ac5106b384f90868b726be933230fefab4cd
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
1010
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
1111
refs/tags/v0.0.11: ffbfba48a6426ff63c08ff2117e58681f251fbf2

branches/update-datastore/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ import java.nio.channels.WritableByteChannel;
250250
251251
Storage storage = StorageOptions.defaultInstance().service();
252252
BlobId blobId = BlobId.of("bucket", "blob_name");
253-
Blob blob = Blob.load(storage, blobId);
253+
Blob blob = Blob.get(storage, blobId);
254254
if (blob == null) {
255255
BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
256256
storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public Dataset(BigQuery bigquery, DatasetInfo info) {
131131
* @return the {@code Dataset} object or {@code null} if not found
132132
* @throws BigQueryException upon failure
133133
*/
134-
public static Dataset load(BigQuery bigquery, String dataset, BigQuery.DatasetOption... options) {
134+
public static Dataset get(BigQuery bigquery, String dataset, BigQuery.DatasetOption... options) {
135135
DatasetInfo info = bigquery.getDataset(dataset, options);
136136
return info != null ? new Dataset(bigquery, info) : null;
137137
}
@@ -162,7 +162,7 @@ public boolean exists() {
162162
* @throws BigQueryException upon failure
163163
*/
164164
public Dataset reload(BigQuery.DatasetOption... options) {
165-
return Dataset.load(bigquery, info.datasetId().dataset(), options);
165+
return Dataset.get(bigquery, info.datasetId().dataset(), options);
166166
}
167167

168168
/**

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Job(BigQuery bigquery, JobInfo info) {
5252
* @return the {@code Job} object or {@code null} if not found
5353
* @throws BigQueryException upon failure
5454
*/
55-
public static Job load(BigQuery bigquery, String job, BigQuery.JobOption... options) {
55+
public static Job get(BigQuery bigquery, String job, BigQuery.JobOption... options) {
5656
JobInfo info = bigquery.getJob(job, options);
5757
return info != null ? new Job(bigquery, info) : null;
5858
}
@@ -103,7 +103,7 @@ public boolean isDone() {
103103
* @throws BigQueryException upon failure
104104
*/
105105
public Job reload(BigQuery.JobOption... options) {
106-
return Job.load(bigquery, info.jobId().job(), options);
106+
return Job.get(bigquery, info.jobId().job(), options);
107107
}
108108

109109
/**

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public Table(BigQuery bigquery, BaseTableInfo info) {
6161
* @return the {@code Table} object or {@code null} if not found
6262
* @throws BigQueryException upon failure
6363
*/
64-
public static Table load(BigQuery bigquery, String dataset, String table,
64+
public static Table get(BigQuery bigquery, String dataset, String table,
6565
BigQuery.TableOption... options) {
66-
return load(bigquery, TableId.of(dataset, table), options);
66+
return get(bigquery, TableId.of(dataset, table), options);
6767
}
6868

6969
/**
@@ -76,7 +76,7 @@ public static Table load(BigQuery bigquery, String dataset, String table,
7676
* @return the {@code Table} object or {@code null} if not found
7777
* @throws BigQueryException upon failure
7878
*/
79-
public static Table load(BigQuery bigquery, TableId table, BigQuery.TableOption... options) {
79+
public static Table get(BigQuery bigquery, TableId table, BigQuery.TableOption... options) {
8080
BaseTableInfo info = bigquery.getTable(table, options);
8181
return info != null ? new Table(bigquery, info) : null;
8282
}
@@ -106,7 +106,7 @@ public boolean exists() {
106106
* @throws BigQueryException upon failure
107107
*/
108108
public Table reload(BigQuery.TableOption... options) {
109-
return Table.load(bigquery, info.tableId(), options);
109+
return Table.get(bigquery, info.tableId(), options);
110110
}
111111

112112
/**

branches/update-datastore/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,27 +304,27 @@ public void testCreateExternalTableWithOptions() throws Exception {
304304
}
305305

306306
@Test
307-
public void testLoad() throws Exception {
307+
public void testStaticGet() throws Exception {
308308
expect(bigquery.getDataset(DATASET_INFO.datasetId().dataset())).andReturn(DATASET_INFO);
309309
replay(bigquery);
310-
Dataset loadedDataset = Dataset.load(bigquery, DATASET_INFO.datasetId().dataset());
310+
Dataset loadedDataset = Dataset.get(bigquery, DATASET_INFO.datasetId().dataset());
311311
assertNotNull(loadedDataset);
312312
assertEquals(DATASET_INFO, loadedDataset.info());
313313
}
314314

315315
@Test
316-
public void testLoadNull() throws Exception {
316+
public void testStaticGetNull() throws Exception {
317317
expect(bigquery.getDataset(DATASET_INFO.datasetId().dataset())).andReturn(null);
318318
replay(bigquery);
319-
assertNull(Dataset.load(bigquery, DATASET_INFO.datasetId().dataset()));
319+
assertNull(Dataset.get(bigquery, DATASET_INFO.datasetId().dataset()));
320320
}
321321

322322
@Test
323-
public void testLoadWithOptions() throws Exception {
323+
public void testStaticGetWithOptions() throws Exception {
324324
expect(bigquery.getDataset(DATASET_INFO.datasetId().dataset(), BigQuery.DatasetOption.fields()))
325325
.andReturn(DATASET_INFO);
326326
replay(bigquery);
327-
Dataset loadedDataset = Dataset.load(bigquery, DATASET_INFO.datasetId().dataset(),
327+
Dataset loadedDataset = Dataset.get(bigquery, DATASET_INFO.datasetId().dataset(),
328328
BigQuery.DatasetOption.fields());
329329
assertNotNull(loadedDataset);
330330
assertEquals(DATASET_INFO, loadedDataset.info());

branches/update-datastore/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,27 +148,27 @@ public void testCancel() throws Exception {
148148
}
149149

150150
@Test
151-
public void testLoad() throws Exception {
151+
public void testGet() throws Exception {
152152
expect(bigquery.getJob(JOB_INFO.jobId().job())).andReturn(JOB_INFO);
153153
replay(bigquery);
154-
Job loadedJob = Job.load(bigquery, JOB_INFO.jobId().job());
154+
Job loadedJob = Job.get(bigquery, JOB_INFO.jobId().job());
155155
assertNotNull(loadedJob);
156156
assertEquals(JOB_INFO, loadedJob.info());
157157
}
158158

159159
@Test
160-
public void testLoadNull() throws Exception {
160+
public void testGetNull() throws Exception {
161161
expect(bigquery.getJob(JOB_INFO.jobId().job())).andReturn(null);
162162
replay(bigquery);
163-
assertNull(Job.load(bigquery, JOB_INFO.jobId().job()));
163+
assertNull(Job.get(bigquery, JOB_INFO.jobId().job()));
164164
}
165165

166166
@Test
167-
public void testLoadWithOptions() throws Exception {
167+
public void testGetWithOptions() throws Exception {
168168
expect(bigquery.getJob(JOB_INFO.jobId().job(), BigQuery.JobOption.fields()))
169169
.andReturn(JOB_INFO);
170170
replay(bigquery);
171-
Job loadedJob = Job.load(bigquery, JOB_INFO.jobId().job(), BigQuery.JobOption.fields());
171+
Job loadedJob = Job.get(bigquery, JOB_INFO.jobId().job(), BigQuery.JobOption.fields());
172172
assertNotNull(loadedJob);
173173
assertEquals(JOB_INFO, loadedJob.info());
174174
}

branches/update-datastore/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -292,54 +292,54 @@ public void testExtractDataUris() throws Exception {
292292
}
293293

294294
@Test
295-
public void testLoadFromId() throws Exception {
295+
public void testGetFromId() throws Exception {
296296
expect(bigquery.getTable(TABLE_INFO.tableId())).andReturn(TABLE_INFO);
297297
replay(bigquery);
298-
Table loadedTable = Table.load(bigquery, TABLE_INFO.tableId());
298+
Table loadedTable = Table.get(bigquery, TABLE_INFO.tableId());
299299
assertNotNull(loadedTable);
300300
assertEquals(TABLE_INFO, loadedTable.info());
301301
}
302302

303303
@Test
304-
public void testLoadFromStrings() throws Exception {
304+
public void testGetFromStrings() throws Exception {
305305
expect(bigquery.getTable(TABLE_INFO.tableId())).andReturn(TABLE_INFO);
306306
replay(bigquery);
307-
Table loadedTable = Table.load(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table());
307+
Table loadedTable = Table.get(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table());
308308
assertNotNull(loadedTable);
309309
assertEquals(TABLE_INFO, loadedTable.info());
310310
}
311311

312312
@Test
313-
public void testLoadFromIdNull() throws Exception {
313+
public void testGetFromIdNull() throws Exception {
314314
expect(bigquery.getTable(TABLE_INFO.tableId())).andReturn(null);
315315
replay(bigquery);
316-
assertNull(Table.load(bigquery, TABLE_INFO.tableId()));
316+
assertNull(Table.get(bigquery, TABLE_INFO.tableId()));
317317
}
318318

319319
@Test
320-
public void testLoadFromStringsNull() throws Exception {
320+
public void testGetFromStringsNull() throws Exception {
321321
expect(bigquery.getTable(TABLE_INFO.tableId())).andReturn(null);
322322
replay(bigquery);
323-
assertNull(Table.load(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table()));
323+
assertNull(Table.get(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table()));
324324
}
325325

326326
@Test
327-
public void testLoadFromIdWithOptions() throws Exception {
327+
public void testGetFromIdWithOptions() throws Exception {
328328
expect(bigquery.getTable(TABLE_INFO.tableId(), BigQuery.TableOption.fields()))
329329
.andReturn(TABLE_INFO);
330330
replay(bigquery);
331-
Table loadedTable = Table.load(bigquery, TABLE_INFO.tableId(), BigQuery.TableOption.fields());
331+
Table loadedTable = Table.get(bigquery, TABLE_INFO.tableId(), BigQuery.TableOption.fields());
332332
assertNotNull(loadedTable);
333333
assertEquals(TABLE_INFO, loadedTable.info());
334334
}
335335

336336
@Test
337-
public void testLoadFromStringsWithOptions() throws Exception {
337+
public void testGetFromStringsWithOptions() throws Exception {
338338
expect(bigquery.getTable(TABLE_INFO.tableId(), BigQuery.TableOption.fields()))
339339
.andReturn(TABLE_INFO);
340340
replay(bigquery);
341341
Table loadedTable =
342-
Table.load(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table(), BigQuery.TableOption.fields());
342+
Table.get(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table(), BigQuery.TableOption.fields());
343343
assertNotNull(loadedTable);
344344
assertEquals(TABLE_INFO, loadedTable.info());
345345
}

branches/update-datastore/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ public void run(Storage storage, BlobId... blobIds) {
134134
if (blobIds.length == 1) {
135135
if (blobIds[0].name().isEmpty()) {
136136
// get Bucket
137-
Bucket bucket = Bucket.load(storage, blobIds[0].bucket());
137+
Bucket bucket = Bucket.get(storage, blobIds[0].bucket());
138138
if (bucket == null) {
139139
System.out.println("No such bucket");
140140
return;
141141
}
142142
System.out.println("Bucket info: " + bucket.info());
143143
} else {
144144
// get Blob
145-
Blob blob = Blob.load(storage, blobIds[0]);
145+
Blob blob = Blob.get(storage, blobIds[0]);
146146
if (blob == null) {
147147
System.out.println("No such object");
148148
return;
@@ -151,7 +151,7 @@ public void run(Storage storage, BlobId... blobIds) {
151151
}
152152
} else {
153153
// use batch to get multiple blobs.
154-
List<Blob> blobs = Blob.get(storage, blobIds);
154+
List<Blob> blobs = Blob.get(storage, Arrays.asList(blobIds));
155155
for (Blob blob : blobs) {
156156
if (blob != null) {
157157
System.out.println(blob.info());
@@ -225,7 +225,7 @@ public void run(Storage storage, String bucketName) {
225225
}
226226
} else {
227227
// list a bucket's blobs
228-
Bucket bucket = Bucket.load(storage, bucketName);
228+
Bucket bucket = Bucket.get(storage, bucketName);
229229
if (bucket == null) {
230230
System.out.println("No such bucket");
231231
return;
@@ -312,7 +312,7 @@ public void run(Storage storage, Tuple<BlobId, Path> tuple) throws IOException {
312312
}
313313

314314
private void run(Storage storage, BlobId blobId, Path downloadTo) throws IOException {
315-
Blob blob = Blob.load(storage, blobId);
315+
Blob blob = Blob.get(storage, blobId);
316316
if (blob == null) {
317317
System.out.println("No such object");
318318
return;
@@ -439,7 +439,7 @@ public void run(Storage storage, Tuple<BlobId, Map<String, String>> tuple)
439439
}
440440

441441
private void run(Storage storage, BlobId blobId, Map<String, String> metadata) {
442-
Blob blob = Blob.load(storage, blobId);
442+
Blob blob = Blob.get(storage, blobId);
443443
if (blob == null) {
444444
System.out.println("No such object");
445445
return;

branches/update-datastore/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public Project(ResourceManager resourceManager, ProjectInfo projectInfo) {
4040
}
4141

4242
/**
43-
* Constructs a Project object that contains project information loaded from the server.
43+
* Constructs a Project object that contains project information got from the server.
4444
*
4545
* @return Project object containing the project's metadata or {@code null} if not found
4646
* @throws ResourceManagerException upon failure
4747
*/
48-
public static Project load(ResourceManager resourceManager, String projectId) {
48+
public static Project get(ResourceManager resourceManager, String projectId) {
4949
ProjectInfo projectInfo = resourceManager.get(projectId);
5050
return projectInfo != null ? new Project(resourceManager, projectInfo) : null;
5151
}
@@ -72,7 +72,7 @@ public ResourceManager resourceManager() {
7272
* @throws ResourceManagerException upon failure
7373
*/
7474
public Project reload() {
75-
return Project.load(resourceManager, info.projectId());
75+
return Project.get(resourceManager, info.projectId());
7676
}
7777

7878
/**

0 commit comments

Comments
 (0)