Skip to content

Commit 387b1d1

Browse files
authored
Updated dataflow, datastore, dlp, errorreporting, firestore, iap, and iot folders. (GoogleCloudPlatform#986)
* Updated dataflow/spanner-io * Updated datastore. * Updated dlp * Updated errorreporting. * Updated firestore/ * Updated iap/ * Updated iot. * Updated datastore/cloud-client. * Re-updated dlp samples.
1 parent adea168 commit 387b1d1

File tree

56 files changed

+412
-297
lines changed

Some content is hidden

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

56 files changed

+412
-297
lines changed

dataflow/spanner-io/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
<version>1.0-SNAPSHOT</version>
2424
<packaging>jar</packaging>
2525

26+
<!--
27+
The parent pom defines common style checks and testing strategies for our samples.
28+
Removing or replacing it should not affect the execution of the samples in anyway.
29+
-->
30+
<parent>
31+
<groupId>com.google.cloud.samples</groupId>
32+
<artifactId>shared-configuration</artifactId>
33+
<version>1.0.8</version>
34+
</parent>
35+
2636
<properties>
2737
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2838
<java.version>1.8</java.version>

dataflow/spanner-io/src/main/java/com/example/dataflow/SpannerRead.java

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
Copyright 2017, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2017 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.dataflow;
1818

@@ -65,21 +65,25 @@ public interface Options extends PipelineOptions {
6565
@Description("Spanner instance ID to query from")
6666
@Validation.Required
6767
String getInstanceId();
68+
6869
void setInstanceId(String value);
6970

7071
@Description("Spanner database name to query from")
7172
@Validation.Required
7273
String getDatabaseId();
74+
7375
void setDatabaseId(String value);
7476

7577
@Description("Spanner table name to query from")
7678
@Validation.Required
7779
String getTable();
80+
7881
void setTable(String value);
7982

8083
@Description("Output filename for records size")
8184
@Validation.Required
8285
String getOutput();
86+
8387
void setOutput(String value);
8488
}
8589

@@ -119,6 +123,8 @@ public void processElement(ProcessContext c) throws Exception {
119123
throw new IllegalArgumentException("Arrays are not supported :(");
120124
case STRUCT:
121125
throw new IllegalArgumentException("Structs are not supported :(");
126+
default:
127+
throw new IllegalArgumentException("Unsupported type :(");
122128
}
123129
}
124130
c.output(sum);

dataflow/spanner-io/src/main/java/com/example/dataflow/SpannerWrite.java

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
Copyright 2017, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2017 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.dataflow;
1818

@@ -75,31 +75,37 @@ public interface Options extends PipelineOptions {
7575
@Description("Singers filename in the format: singer_id\tfirst_name\tlast_name")
7676
@Default.String("data/singers.txt")
7777
String getSingersFilename();
78+
7879
void setSingersFilename(String value);
7980

8081
@Description("Albums filename in the format: singer_id\talbum_id\talbum_title")
8182
@Default.String("data/albums.txt")
8283
String getAlbumsFilename();
84+
8385
void setAlbumsFilename(String value);
8486

8587
@Description("Spanner instance ID to write to")
8688
@Validation.Required
8789
String getInstanceId();
90+
8891
void setInstanceId(String value);
8992

9093
@Description("Spanner database name to write to")
9194
@Validation.Required
9295
String getDatabaseId();
96+
9397
void setDatabaseId(String value);
9498

9599
@Description("Spanner singers table name to write to")
96100
@Validation.Required
97101
String getSingersTable();
102+
98103
void setSingersTable(String value);
99104

100105
@Description("Spanner albums table name to write to")
101106
@Validation.Required
102107
String getAlbumsTable();
108+
103109
void setAlbumsTable(String value);
104110
}
105111

datastore/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Datastore Samples
22

3+
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=datastore/README.md">
4+
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
5+
36
This directory contains sample code used in Google Cloud Datastore documentation. Included here is a sample command line application, `TaskList`, that interacts with Datastore to manage a to-do list.
47

58
## Run the `TaskList` sample application.

datastore/cloud-client/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Getting Started with Cloud Datastore and the Google Cloud Client libraries
22

3+
<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=datastore/cloud-client/README.md">
4+
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>
5+
36
[Google Cloud Datastore][Datastore] is a highly-scalable NoSQL database for your applications.
47
These sample Java applications demonstrate how to access the Datastore API using
58
the [Google Cloud Client Library for Java][google-cloud-java].

datastore/cloud-client/pom.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
<artifactId>datastore-google-cloud-samples</artifactId>
2020
<packaging>jar</packaging>
2121

22-
<!-- Parent defines config for testing & linting. -->
22+
<!--
23+
The parent pom defines common style checks and testing strategies for our samples.
24+
Removing or replacing it should not affect the execution of the samples in anyway.
25+
-->
2326
<parent>
24-
<artifactId>doc-samples</artifactId>
25-
<groupId>com.google.cloud</groupId>
26-
<version>1.0.0</version>
27-
<relativePath>../..</relativePath>
27+
<groupId>com.google.cloud.samples</groupId>
28+
<artifactId>shared-configuration</artifactId>
29+
<version>1.0.8</version>
2830
</parent>
2931

3032
<properties>

datastore/cloud-client/src/main/java/com/example/datastore/QuickstartSample.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
Copyright 2016, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2016 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.datastore;
1818

datastore/cloud-client/src/test/java/com/example/datastore/QuickstartSampleIT.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
Copyright 2016, Google, Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
2+
* Copyright 2016 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1616

1717
package com.example.datastore;
1818

@@ -21,15 +21,14 @@
2121
import com.google.cloud.datastore.Datastore;
2222
import com.google.cloud.datastore.DatastoreOptions;
2323
import com.google.cloud.datastore.Key;
24+
import java.io.ByteArrayOutputStream;
25+
import java.io.PrintStream;
2426
import org.junit.After;
2527
import org.junit.Before;
2628
import org.junit.Test;
2729
import org.junit.runner.RunWith;
2830
import org.junit.runners.JUnit4;
2931

30-
import java.io.ByteArrayOutputStream;
31-
import java.io.PrintStream;
32-
3332
/**
3433
* Tests for quickstart sample.
3534
*/

datastore/pom.xml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,22 @@
1919
<artifactId>datastore-snippets</artifactId>
2020
<version>1.0</version>
2121

22-
<parent>
23-
<artifactId>doc-samples</artifactId>
24-
<groupId>com.google.cloud</groupId>
25-
<version>1.0.0</version>
26-
<relativePath>..</relativePath>
27-
</parent>
28-
2922
<packaging>jar</packaging>
3023
<name>Google Cloud Datastore Snippets</name>
3124
<description>
3225
Example snippets for Datastore concepts and getting started documentation.
3326
</description>
3427

28+
<!--
29+
The parent pom defines common style checks and testing strategies for our samples.
30+
Removing or replacing it should not affect the execution of the samples in anyway.
31+
-->
32+
<parent>
33+
<groupId>com.google.cloud.samples</groupId>
34+
<artifactId>shared-configuration</artifactId>
35+
<version>1.0.8</version>
36+
</parent>
37+
3538
<properties>
3639
<maven.compiler.target>1.8</maven.compiler.target>
3740
<maven.compiler.source>1.8</maven.compiler.source>

datastore/src/main/java/com/google/datastore/snippets/TaskList.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import com.google.cloud.datastore.StringValue;
2727
import com.google.cloud.datastore.StructuredQuery.OrderBy;
2828
import com.google.cloud.datastore.Transaction;
29-
3029
import java.util.ArrayList;
3130
import java.util.Iterator;
3231
import java.util.List;

0 commit comments

Comments
 (0)