Skip to content

Commit

Permalink
Updated dataflow, datastore, dlp, errorreporting, firestore, iap, and…
Browse files Browse the repository at this point in the history
… iot folders. (#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.
  • Loading branch information
kurtisvg authored Jan 11, 2018
1 parent adea168 commit 387b1d1
Show file tree
Hide file tree
Showing 56 changed files with 412 additions and 297 deletions.
10 changes: 10 additions & 0 deletions dataflow/spanner-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Removing or replacing it should not affect the execution of the samples in anyway.
-->
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.8</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
Copyright 2017, Google, Inc.
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.
*/
* Copyright 2017 Google Inc.
*
* 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.example.dataflow;

Expand Down Expand Up @@ -65,21 +65,25 @@ public interface Options extends PipelineOptions {
@Description("Spanner instance ID to query from")
@Validation.Required
String getInstanceId();

void setInstanceId(String value);

@Description("Spanner database name to query from")
@Validation.Required
String getDatabaseId();

void setDatabaseId(String value);

@Description("Spanner table name to query from")
@Validation.Required
String getTable();

void setTable(String value);

@Description("Output filename for records size")
@Validation.Required
String getOutput();

void setOutput(String value);
}

Expand Down Expand Up @@ -119,6 +123,8 @@ public void processElement(ProcessContext c) throws Exception {
throw new IllegalArgumentException("Arrays are not supported :(");
case STRUCT:
throw new IllegalArgumentException("Structs are not supported :(");
default:
throw new IllegalArgumentException("Unsupported type :(");
}
}
c.output(sum);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
Copyright 2017, Google, Inc.
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.
*/
* Copyright 2017 Google Inc.
*
* 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.example.dataflow;

Expand Down Expand Up @@ -75,31 +75,37 @@ public interface Options extends PipelineOptions {
@Description("Singers filename in the format: singer_id\tfirst_name\tlast_name")
@Default.String("data/singers.txt")
String getSingersFilename();

void setSingersFilename(String value);

@Description("Albums filename in the format: singer_id\talbum_id\talbum_title")
@Default.String("data/albums.txt")
String getAlbumsFilename();

void setAlbumsFilename(String value);

@Description("Spanner instance ID to write to")
@Validation.Required
String getInstanceId();

void setInstanceId(String value);

@Description("Spanner database name to write to")
@Validation.Required
String getDatabaseId();

void setDatabaseId(String value);

@Description("Spanner singers table name to write to")
@Validation.Required
String getSingersTable();

void setSingersTable(String value);

@Description("Spanner albums table name to write to")
@Validation.Required
String getAlbumsTable();

void setAlbumsTable(String value);
}

Expand Down
3 changes: 3 additions & 0 deletions datastore/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Datastore Samples

<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">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

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.

## Run the `TaskList` sample application.
Expand Down
3 changes: 3 additions & 0 deletions datastore/cloud-client/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Getting Started with Cloud Datastore and the Google Cloud Client libraries

<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">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

[Google Cloud Datastore][Datastore] is a highly-scalable NoSQL database for your applications.
These sample Java applications demonstrate how to access the Datastore API using
the [Google Cloud Client Library for Java][google-cloud-java].
Expand Down
12 changes: 7 additions & 5 deletions datastore/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
<artifactId>datastore-google-cloud-samples</artifactId>
<packaging>jar</packaging>

<!-- Parent defines config for testing & linting. -->
<!--
The parent pom defines common style checks and testing strategies for our samples.
Removing or replacing it should not affect the execution of the samples in anyway.
-->
<parent>
<artifactId>doc-samples</artifactId>
<groupId>com.google.cloud</groupId>
<version>1.0.0</version>
<relativePath>../..</relativePath>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.8</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
Copyright 2016, Google, Inc.
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.
*/
* Copyright 2016 Google Inc.
*
* 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.example.datastore;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
Copyright 2016, Google, Inc.
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.
*/
* Copyright 2016 Google Inc.
*
* 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.example.datastore;

Expand All @@ -21,15 +21,14 @@
import com.google.cloud.datastore.Datastore;
import com.google.cloud.datastore.DatastoreOptions;
import com.google.cloud.datastore.Key;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

/**
* Tests for quickstart sample.
*/
Expand Down
17 changes: 10 additions & 7 deletions datastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@
<artifactId>datastore-snippets</artifactId>
<version>1.0</version>

<parent>
<artifactId>doc-samples</artifactId>
<groupId>com.google.cloud</groupId>
<version>1.0.0</version>
<relativePath>..</relativePath>
</parent>

<packaging>jar</packaging>
<name>Google Cloud Datastore Snippets</name>
<description>
Example snippets for Datastore concepts and getting started documentation.
</description>

<!--
The parent pom defines common style checks and testing strategies for our samples.
Removing or replacing it should not affect the execution of the samples in anyway.
-->
<parent>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.8</version>
</parent>

<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.google.cloud.datastore.StringValue;
import com.google.cloud.datastore.StructuredQuery.OrderBy;
import com.google.cloud.datastore.Transaction;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterators;

import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.threeten.bp.Duration;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
Expand All @@ -74,6 +63,15 @@
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.TimeoutException;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.threeten.bp.Duration;

/**
* Contains Cloud Datastore snippets demonstrating concepts for documentation.
Expand Down
4 changes: 4 additions & 0 deletions dlp/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Cloud Data Loss Prevention (DLP) API Samples

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=dlp/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

The [Data Loss Prevention API](https://cloud.google.com/dlp/docs/) provides programmatic access to
a powerful detection engine for personally identifiable information and other privacy-sensitive data
in unstructured data streams.
Expand Down
12 changes: 7 additions & 5 deletions dlp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
<artifactId>dlp-samples</artifactId>
<version>1.0</version>

<!-- Parent defines config for testing & linting. -->
<!--
The parent pom defines common style checks and testing strategies for our samples.
Removing or replacing it should not affect the execution of the samples in anyway.
-->
<parent>
<artifactId>doc-samples</artifactId>
<groupId>com.google.cloud</groupId>
<version>1.0.0</version>
<relativePath>..</relativePath>
<groupId>com.google.cloud.samples</groupId>
<artifactId>shared-configuration</artifactId>
<version>1.0.8</version>
</parent>

<properties>
Expand Down
8 changes: 4 additions & 4 deletions dlp/src/main/java/com/example/dlp/DeIdentification.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
/*
* Copyright 2017 Google Inc.
* <p>
*
* 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
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.
Expand Down
Loading

0 comments on commit 387b1d1

Please sign in to comment.