-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Data Catalog createEntry quickstart samples and tests. #1731
Merged
tswast
merged 32 commits into
GoogleCloudPlatform:master
from
mesmacosta:task/add-dc-fileset-quickstart-sample
Dec 10, 2019
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
4bc1c34
ADD sample for create fileset entry quickstart
mesmacosta 9ced693
RAN google java format
mesmacosta 08d40cf
CHANGE exception comment
mesmacosta 3a1460b
FIX lint issues
mesmacosta a896ec3
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta f6a4c02
Split quickstart into a new folder
mesmacosta 0f15c98
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta b0981ab
Rename files since class name will appear on samples
mesmacosta 19c9a25
Ran java formatter
mesmacosta 573074f
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 0f51ac9
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 63d7523
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 90948e5
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 1d5a089
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 350f6fa
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 71c4af2
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 11646ea
revert region tags change
mesmacosta faca3b7
remove extra space
mesmacosta 0f68bd0
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta fe434f3
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 8993ac4
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 594821e
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 9684187
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 420577d
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta db3c8a9
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 4760778
change to real bucket name
mesmacosta 283634d
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 09d1748
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 1e086cf
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta c434a8c
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta e986d0b
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta 0c13f44
Merge branch 'master' into task/add-dc-fileset-quickstart-sample
mesmacosta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Getting Started with Data Catalog 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=datacatalog/cloud-client/README.md"> | ||
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a> | ||
|
||
[Data Catalog][datacatalog] is a fully managed and scalable metadata management service that empowers organizations | ||
to quickly discover, manage, and understand all their data in Google Cloud. | ||
This sample Java application demonstrates how to access the Data Catalog API using | ||
the [Google Cloud Client Library for Java][google-cloud-java]. | ||
|
||
[datacatalog]: https://cloud.google.com/data-catalog/ | ||
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java | ||
|
||
## Quickstart | ||
|
||
#### Setup | ||
- Install [Maven](http://maven.apache.org/). | ||
- [Enable](https://console.cloud.google.com/apis/api/datacatalog.googleapis.com/overview) Data Catalog API. | ||
- Set up [authentication](https://cloud.google.com/docs/authentication/getting-started). | ||
|
||
#### Build | ||
- Build your project with: | ||
``` | ||
mvn clean package -DskipTests | ||
``` | ||
|
||
#### Testing | ||
Run the test with Maven. | ||
``` | ||
mvn verify | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2019 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. | ||
|
||
apply plugin: 'java' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile group: 'com.google.cloud', name: 'google-cloud-datacatalog-quickstart', version:'0.28.0-alpha' | ||
|
||
testCompile group: 'com.google.truth', name: 'truth', version:'0.42' | ||
testCompile group: 'junit', name: 'junit', version:'4.13-beta-2' | ||
} | ||
|
||
test { | ||
useJUnit() | ||
testLogging.showStandardStreams = true | ||
beforeTest { descriptor -> | ||
logger.lifecycle("test: " + descriptor + " Running") | ||
} | ||
|
||
onOutput { descriptor, event -> | ||
logger.lifecycle("test: " + descriptor + ": " + event.message ) | ||
} | ||
afterTest { descriptor, result -> | ||
logger.lifecycle("test: " + descriptor + ": " + result ) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!-- | ||
Copyright 2019 Google LLC. | ||
|
||
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. | ||
--> | ||
|
||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.example.datacatalog</groupId> | ||
<artifactId>datacatalog-google-cloud-quickstart</artifactId> | ||
<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.11</version> | ||
</parent> | ||
|
||
<properties> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud-datacatalog</artifactId> | ||
<version>0.29.0-alpha</version> | ||
</dependency> | ||
|
||
<!-- Test dependencies --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13-beta-3</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.truth</groupId> | ||
<artifactId>truth</artifactId> | ||
<version>1.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: I think these helpers are being deprecated. At least, they were deprecated in Python (googleapis/gapic-generator#3012) and the same reasoning applies to the Java generator (it's not possible with new proto annotations for configuring the generator).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know the recommended way?
I see two alternatives...
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least in Python (2) is recommended, as the resource builders are going away there. I haven't seen any discussion about it outside of Python, though.
I don't know why, as the same configuration changes affect all languages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, it makes sense going that way if this configuration will affect all languages...
@kurtisvg Could you point me the recommended way in Java ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, they aren't going away for Java. They are generally preferred to manually formatting the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tswast WDYT can we keep the helpers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have doubts that they will actually stay in Java, based on my conversations with Luke on the ACtools team. I'll check with him if the resource helper deprecation is supposed to affect more than just Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will wait for your confirmation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can proceed with using the resource builders. I misunderstood the reasoning for removal in Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so AFAIK the PR is ready to be merged, @tswast are you able to review it and merge if everything is ok?