Skip to content

Commit 29d295f

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 4753 b: refs/heads/logging-alpha c: 43b2ef9 h: refs/heads/master i: 4751: b392773
1 parent bb46cf9 commit 29d295f

93 files changed

Lines changed: 1513 additions & 1744 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ refs/heads/compute-alpha: 969cba2627f1d53d352cc4a5ffe0879dacf65e6c
1212
refs/heads/dns-alpha: 2f90e7e338349287ace33375896907af0f032ca1
1313
refs/heads/dns-alpha-batch: 17442b07867021b85d0452f5f3eda29a3413288f
1414
refs/heads/gcs-nio: 283aeaf15efdcf3621eb6859f05e55ad7764375d
15-
refs/heads/logging-alpha: ba07c3f5bd972d6b52f3dc272bc2ef32611f4873
15+
refs/heads/logging-alpha: 43b2ef990fd27944823722aaf6caee902f9d429c
1616
refs/tags/v0.1.0: a615317f7424ed58621b1f65d5c4d8cbbe8a6ed8
1717
refs/tags/v0.1.1: 7a7f6985fe465e9dd6a075af55493f42b4933be0
1818
refs/tags/v0.1.2: 3eb3fe866ba22487686048f45d927b8c8638ea3f

branches/logging-alpha/gcloud-java-bigquery/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>com.google.gcloud</groupId>
1212
<artifactId>gcloud-java-pom</artifactId>
13-
<version>0.1.7-SNAPSHOT</version>
13+
<version>0.1.7</version>
1414
</parent>
1515
<properties>
1616
<site.installationModule>gcloud-java-bigquery</site.installationModule>

branches/logging-alpha/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/QueryStage.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static QueryStep fromPb(com.google.api.services.bigquery.model.ExplainQueryStep
137137

138138
private final double computeRatioAvg;
139139
private final double computeRatioMax;
140-
private final long generatedId;
140+
private final long id;
141141
private final String name;
142142
private final double readRatioAvg;
143143
private final double readRatioMax;
@@ -153,7 +153,7 @@ static final class Builder {
153153

154154
private double computeRatioAvg;
155155
private double computeRatioMax;
156-
private long generatedId;
156+
private long id;
157157
private String name;
158158
private double readRatioAvg;
159159
private double readRatioMax;
@@ -177,8 +177,8 @@ Builder computeRatioMax(double computeRatioMax) {
177177
return this;
178178
}
179179

180-
Builder generatedId(long generatedId) {
181-
this.generatedId = generatedId;
180+
Builder id(long id) {
181+
this.id = id;
182182
return this;
183183
}
184184

@@ -240,7 +240,7 @@ QueryStage build() {
240240
QueryStage(Builder builder) {
241241
computeRatioAvg = builder.computeRatioAvg;
242242
computeRatioMax = builder.computeRatioMax;
243-
generatedId = builder.generatedId;
243+
id = builder.id;
244244
name = builder.name;
245245
readRatioAvg = builder.readRatioAvg;
246246
readRatioMax = builder.readRatioMax;
@@ -270,10 +270,10 @@ public double computeRatioMax() {
270270
}
271271

272272
/**
273-
* Returns a unique, server-generated ID for the stage within its plan.
273+
* Returns a unique ID for the stage within its plan.
274274
*/
275-
public long generatedId() {
276-
return generatedId;
275+
public long id() {
276+
return id;
277277
}
278278

279279
/**
@@ -357,7 +357,7 @@ public String toString() {
357357
return MoreObjects.toStringHelper(this)
358358
.add("computeRatioAvg", computeRatioAvg)
359359
.add("computeRatioMax", computeRatioMax)
360-
.add("generatedId", generatedId)
360+
.add("id", id)
361361
.add("name", name)
362362
.add("readRatioAvg", readRatioAvg)
363363
.add("readRatioMax", readRatioMax)
@@ -373,7 +373,7 @@ public String toString() {
373373

374374
@Override
375375
public int hashCode() {
376-
return Objects.hash(computeRatioAvg, computeRatioMax, generatedId, name, readRatioAvg, readRatioMax,
376+
return Objects.hash(computeRatioAvg, computeRatioMax, id, name, readRatioAvg, readRatioMax,
377377
recordsRead, recordsWritten, steps, waitRatioAvg, waitRatioMax, writeRatioAvg);
378378
}
379379

@@ -383,7 +383,7 @@ public boolean equals(Object obj) {
383383
return false;
384384
}
385385
QueryStage other = (QueryStage) obj;
386-
return generatedId == other.generatedId
386+
return id == other.id
387387
&& computeRatioAvg == other.computeRatioAvg
388388
&& computeRatioMax == other.computeRatioMax
389389
&& readRatioAvg == other.readRatioAvg
@@ -406,7 +406,7 @@ ExplainQueryStage toPb() {
406406
ExplainQueryStage stagePb = new ExplainQueryStage()
407407
.setComputeRatioAvg(computeRatioAvg)
408408
.setComputeRatioMax(computeRatioMax)
409-
.setId(generatedId)
409+
.setId(id)
410410
.setName(name)
411411
.setReadRatioAvg(readRatioAvg)
412412
.setReadRatioMax(readRatioMax)
@@ -426,7 +426,7 @@ static QueryStage fromPb(com.google.api.services.bigquery.model.ExplainQueryStag
426426
Builder builder = new QueryStage.Builder();
427427
builder.computeRatioAvg(stagePb.getComputeRatioAvg());
428428
builder.computeRatioMax(stagePb.getComputeRatioMax());
429-
builder.generatedId(stagePb.getId());
429+
builder.id(stagePb.getId());
430430
builder.name(stagePb.getName());
431431
builder.readRatioAvg(stagePb.getReadRatioAvg());
432432
builder.readRatioMax(stagePb.getReadRatioMax());

branches/logging-alpha/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobStatisticsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class JobStatisticsTest {
7171
private static final QueryStage QUERY_STAGE = QueryStage.builder()
7272
.computeRatioAvg(1.1)
7373
.computeRatioMax(2.2)
74-
.generatedId(42L)
74+
.id(42L)
7575
.name("stage")
7676
.readRatioAvg(3.3)
7777
.readRatioMax(4.4)

branches/logging-alpha/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/QueryStageTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class QueryStageTest {
4848
private static final QueryStage QUERY_STAGE = QueryStage.builder()
4949
.computeRatioAvg(COMPUTE_RATIO_AVG)
5050
.computeRatioMax(COMPUTE_RATIO_MAX)
51-
.generatedId(ID)
51+
.id(ID)
5252
.name(NAME)
5353
.readRatioAvg(READ_RATIO_AVG)
5454
.readRatioMax(READ_RATIO_MAX)
@@ -73,7 +73,7 @@ public void testQueryStepConstructor() {
7373
public void testBuilder() {
7474
assertEquals(COMPUTE_RATIO_AVG, QUERY_STAGE.computeRatioAvg(), 0);
7575
assertEquals(COMPUTE_RATIO_MAX, QUERY_STAGE.computeRatioMax(), 0);
76-
assertEquals(ID, QUERY_STAGE.generatedId());
76+
assertEquals(ID, QUERY_STAGE.id());
7777
assertEquals(NAME, QUERY_STAGE.name());
7878
assertEquals(READ_RATIO_AVG, QUERY_STAGE.readRatioAvg(), 0);
7979
assertEquals(READ_RATIO_MAX, QUERY_STAGE.readRatioMax(), 0);
@@ -108,7 +108,7 @@ private void compareQueryStage(QueryStage expected, QueryStage value) {
108108
assertEquals(expected, value);
109109
assertEquals(expected.computeRatioAvg(), value.computeRatioAvg(), 0);
110110
assertEquals(expected.computeRatioMax(), value.computeRatioMax(), 0);
111-
assertEquals(expected.generatedId(), value.generatedId());
111+
assertEquals(expected.id(), value.id());
112112
assertEquals(expected.name(), value.name());
113113
assertEquals(expected.readRatioAvg(), value.readRatioAvg(), 0);
114114
assertEquals(expected.readRatioMax(), value.readRatioMax(), 0);

branches/logging-alpha/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/it/ITBigQueryTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171

7272
import org.junit.AfterClass;
7373
import org.junit.BeforeClass;
74-
import org.junit.Ignore;
7574
import org.junit.Rule;
7675
import org.junit.Test;
7776
import org.junit.rules.Timeout;
@@ -624,7 +623,6 @@ public void testInsertAllWithErrors() {
624623
assertTrue(bigquery.delete(TableId.of(DATASET, tableName)));
625624
}
626625

627-
@Ignore("Flaky test; see issue #836")
628626
@Test
629627
public void testListAllTableData() {
630628
Page<List<FieldValue>> rows = bigquery.listTableData(TABLE_ID);
@@ -908,7 +906,6 @@ public void testCancelNonExistingJob() {
908906
assertFalse(bigquery.cancel("test_cancel_non_existing_job"));
909907
}
910908

911-
@Ignore("Flaky test; see #836")
912909
@Test
913910
public void testInsertFromFile() throws InterruptedException {
914911
String destinationTableName = "test_insert_from_file_table";

branches/logging-alpha/gcloud-java-contrib/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>com.google.gcloud</groupId>
1212
<artifactId>gcloud-java-pom</artifactId>
13-
<version>0.1.7-SNAPSHOT</version>
13+
<version>0.1.7</version>
1414
</parent>
1515
<properties>
1616
<site.installationModule>gcloud-java-contrib</site.installationModule>

branches/logging-alpha/gcloud-java-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>com.google.gcloud</groupId>
1212
<artifactId>gcloud-java-pom</artifactId>
13-
<version>0.1.7-SNAPSHOT</version>
13+
<version>0.1.7</version>
1414
</parent>
1515
<properties>
1616
<site.installationModule>gcloud-java-core</site.installationModule>

branches/logging-alpha/gcloud-java-datastore/pom.xml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>com.google.gcloud</groupId>
1212
<artifactId>gcloud-java-pom</artifactId>
13-
<version>0.1.7-SNAPSHOT</version>
13+
<version>0.1.7</version>
1414
</parent>
1515
<properties>
1616
<site.installationModule>gcloud-java-datastore</site.installationModule>
@@ -22,14 +22,16 @@
2222
<version>${project.version}</version>
2323
</dependency>
2424
<dependency>
25-
<groupId>com.google.cloud.datastore</groupId>
26-
<artifactId>datastore-v1beta3-protos</artifactId>
27-
<version>1.0.0-beta</version>
28-
</dependency>
29-
<dependency>
30-
<groupId>com.google.cloud.datastore</groupId>
31-
<artifactId>datastore-v1beta3-proto-client</artifactId>
32-
<version>1.0.0-beta</version>
25+
<groupId>com.google.apis</groupId>
26+
<artifactId>google-api-services-datastore-protobuf</artifactId>
27+
<version>v1beta2-rev1-4.0.0</version>
28+
<scope>compile</scope>
29+
<exclusions>
30+
<exclusion>
31+
<groupId>com.google.api-client</groupId>
32+
<artifactId>google-api-client</artifactId>
33+
</exclusion>
34+
</exclusions>
3335
</dependency>
3436
<dependency>
3537
<groupId>${project.groupId}</groupId>

branches/logging-alpha/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/BaseDatastoreBatchWriter.java

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
package com.google.gcloud.datastore;
1818

19+
import com.google.api.services.datastore.DatastoreV1;
1920
import com.google.common.base.Preconditions;
2021
import com.google.common.collect.Iterables;
2122
import com.google.common.collect.Lists;
2223

23-
import java.util.ArrayList;
2424
import java.util.Collections;
2525
import java.util.Iterator;
2626
import java.util.LinkedHashMap;
@@ -88,7 +88,9 @@ public final List<Entity> add(FullEntity<?>... entities) {
8888
for (FullEntity<?> entity : entities) {
8989
IncompleteKey key = entity.key();
9090
Preconditions.checkArgument(key != null, "Entity must have a key");
91-
if (!(key instanceof Key)) {
91+
if (key instanceof Key) {
92+
addInternal((FullEntity<Key>) entity);
93+
} else {
9294
incompleteKeys.add(key);
9395
}
9496
}
@@ -102,7 +104,6 @@ public final List<Entity> add(FullEntity<?>... entities) {
102104
List<Entity> answer = Lists.newArrayListWithExpectedSize(entities.length);
103105
for (FullEntity<?> entity : entities) {
104106
if (entity.key() instanceof Key) {
105-
addInternal((FullEntity<Key>) entity);
106107
answer.add(Entity.convert((FullEntity<Key>) entity));
107108
} else {
108109
Entity entityWithAllocatedId = Entity.builder(allocated.next(), entity).build();
@@ -198,30 +199,24 @@ protected DatastoreException newInvalidRequest(String msg, Object... params) {
198199
return DatastoreException.throwInvalidRequest(String.format(msg, params));
199200
}
200201

201-
protected List<com.google.datastore.v1beta3.Mutation> toMutationPbList() {
202-
List<com.google.datastore.v1beta3.Mutation> mutationsPb =
203-
new ArrayList<>();
202+
DatastoreV1.Mutation.Builder toMutationPb() {
203+
DatastoreV1.Mutation.Builder mutationPb = DatastoreV1.Mutation.newBuilder();
204204
for (FullEntity<IncompleteKey> entity : toAddAutoId()) {
205-
mutationsPb.add(
206-
com.google.datastore.v1beta3.Mutation.newBuilder().setInsert(entity.toPb()).build());
205+
mutationPb.addInsertAutoId(entity.toPb());
207206
}
208207
for (FullEntity<Key> entity : toAdd().values()) {
209-
mutationsPb.add(
210-
com.google.datastore.v1beta3.Mutation.newBuilder().setInsert(entity.toPb()).build());
208+
mutationPb.addInsert(entity.toPb());
211209
}
212210
for (FullEntity<Key> entity : toUpdate().values()) {
213-
mutationsPb.add(
214-
com.google.datastore.v1beta3.Mutation.newBuilder().setUpdate(entity.toPb()).build());
211+
mutationPb.addUpdate(entity.toPb());
215212
}
216213
for (FullEntity<Key> entity : toPut().values()) {
217-
mutationsPb.add(
218-
com.google.datastore.v1beta3.Mutation.newBuilder().setUpsert(entity.toPb()).build());
214+
mutationPb.addUpsert(entity.toPb());
219215
}
220216
for (Key key : toDelete()) {
221-
mutationsPb.add(
222-
com.google.datastore.v1beta3.Mutation.newBuilder().setDelete(key.toPb()).build());
217+
mutationPb.addDelete(key.toPb());
223218
}
224-
return mutationsPb;
219+
return mutationPb;
225220
}
226221

227222
protected abstract Datastore datastore();

0 commit comments

Comments
 (0)