Skip to content
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

[Datastore question] How to build AllocateIdRequest? #1428

Closed
GabiAxel opened this issue Nov 27, 2016 · 4 comments
Closed

[Datastore question] How to build AllocateIdRequest? #1428

GabiAxel opened this issue Nov 27, 2016 · 4 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.

Comments

@GabiAxel
Copy link

Greetings,

As I understand, a Java AllocateIdsRequest instance can be built using Keys or PathElements, but according to the API it expects the key to contain incomplete paths. I saw no public way to build a Key without an id or name, and I no public way to get the path of an IncompleteKey. Can you please provide and example of building an AllocateIdsRequest from a string representing the kind? Also, wouldn't it make sense to be able to build AllocateIdsRequest from IncompleteKeys?

Thanks.

@garrettjonesgoogle
Copy link
Member

I will try to investigate this question within a few days.

@garrettjonesgoogle garrettjonesgoogle added api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue. triaged for beta labels Dec 1, 2016
@sai-pullabhotla
Copy link

@GabiAxel - Are you possibly looking for something like this?

Datastore ds = DatastoreOptions.newBuilder().build().getService();
//Create an incomplete key for kind, MyKind...
IncompleteKey incompleteKey = ds.newKeyFactory().setKind("MyKind").newKey();
System.out.println(incompleteKey);
//Allocate the ID 
Key completeKey = ds.allocateId(incompleteKey);
System.out.println(completeKey);

This would print the below to the console:

IncompleteKey{projectId=my-project-id, namespace=, path=[PathElement{kind=MyKind, id=null, name=null}]}
Key{projectId=my-project-id, namespace=, path=[PathElement{kind=MyKind, id=5640376756994048, name=null}]}

@GabiAxel
Copy link
Author

Yes, that's it. Thanks.

@garrettjonesgoogle
Copy link
Member

Looks like the question was answered - closing out the issue.

github-actions bot pushed a commit that referenced this issue Aug 9, 2022
…0.8 (#1428)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-pubsub](https://togithub.com/googleapis/java-pubsub) | `1.120.0` -> `1.120.8` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.120.8/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.120.8/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.120.8/compatibility-slim/1.120.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-pubsub/1.120.8/confidence-slim/1.120.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-pubsub</summary>

### [`v1.120.8`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11208-httpsgithubcomgoogleapisjava-pubsubcomparev11207v11208-2022-08-02)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.120.7...v1.120.8)

##### Dependencies

-   update dependency com.google.cloud:google-cloud-core to v2.8.6 ([#&#8203;1222](https://togithub.com/googleapis/java-pubsub/issues/1222)) ([55eebf5](https://togithub.com/googleapis/java-pubsub/commit/55eebf55785a700a67dc3a97b21837acf14d9a64))

### [`v1.120.7`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11207-httpsgithubcomgoogleapisjava-pubsubcomparev11206v11207-2022-08-01)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.120.6...v1.120.7)

##### Bug Fixes

-   Updated log level from WARNING -> INFO for EOD failures ([#&#8203;1218](https://togithub.com/googleapis/java-pubsub/issues/1218)) ([8782533](https://togithub.com/googleapis/java-pubsub/commit/8782533204fcc312c1063763f5073db83c72382f))

### [`v1.120.6`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11206-httpsgithubcomgoogleapisjava-pubsubcomparev11205v11206-2022-08-01)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.120.5...v1.120.6)

##### Dependencies

-   update dependency com.google.cloud:google-cloud-bigquery to v2.14.1 ([#&#8203;1215](https://togithub.com/googleapis/java-pubsub/issues/1215)) ([5667492](https://togithub.com/googleapis/java-pubsub/commit/56674928f2e671487c8d4c0dad4e45368da47e0e))
-   update dependency com.google.cloud:google-cloud-core to v2.8.5 ([#&#8203;1213](https://togithub.com/googleapis/java-pubsub/issues/1213)) ([5db0c2c](https://togithub.com/googleapis/java-pubsub/commit/5db0c2cafcf27a80ac4e18c623fc22c2af252774))
-   update dependency com.google.protobuf:protobuf-java-util to v3.21.4 ([#&#8203;1214](https://togithub.com/googleapis/java-pubsub/issues/1214)) ([bfc53d9](https://togithub.com/googleapis/java-pubsub/commit/bfc53d9fb616b4ee22e2c39dbaf1eed7354142a7))
-   update dependency org.apache.avro:avro to v1.11.1 ([#&#8203;1210](https://togithub.com/googleapis/java-pubsub/issues/1210)) ([fafcded](https://togithub.com/googleapis/java-pubsub/commit/fafcdede6b4e5ef5098b8b04a53d9e42b59cda3d))

### [`v1.120.5`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11205-httpsgithubcomgoogleapisjava-pubsubcomparev11204v11205-2022-07-30)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.120.4...v1.120.5)

##### Dependencies

-   update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#&#8203;1207](https://togithub.com/googleapis/java-pubsub/issues/1207)) ([d355509](https://togithub.com/googleapis/java-pubsub/commit/d355509be963b7d2c357d2c9dd3f97eaa5fd8717))

### [`v1.120.4`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11204-httpsgithubcomgoogleapisjava-pubsubcomparev11203v11204-2022-07-29)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.120.3...v1.120.4)

##### Bug Fixes

-   updating return types of ack/nack futures to be consistent with publish ([#&#8203;1204](https://togithub.com/googleapis/java-pubsub/issues/1204)) ([6e73ab9](https://togithub.com/googleapis/java-pubsub/commit/6e73ab9618f61ee1915e52abe3b80e356bc3c13f))

### [`v1.120.3`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11203-httpsgithubcomgoogleapisjava-pubsubcomparev11202v11203-2022-07-27)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.120.2...v1.120.3)

##### Dependencies

-   update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#&#8203;1201](https://togithub.com/googleapis/java-pubsub/issues/1201)) ([f18e562](https://togithub.com/googleapis/java-pubsub/commit/f18e5628f54b0ae6858cd046a11824a1698c50c6))

### [`v1.120.2`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11202-httpsgithubcomgoogleapisjava-pubsubcomparev11201v11202-2022-07-25)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.120.1...v1.120.2)

##### Bug Fixes

-   enable longpaths support for windows test ([#&#8203;1485](https://togithub.com/googleapis/java-pubsub/issues/1485)) ([#&#8203;1191](https://togithub.com/googleapis/java-pubsub/issues/1191)) ([c4b8d90](https://togithub.com/googleapis/java-pubsub/commit/c4b8d90a158a3360d626df8ca6378212e09f5a47))
-   PubSubMessage leak on MessageDispatcher ([#&#8203;1197](https://togithub.com/googleapis/java-pubsub/issues/1197)) ([1b8c440](https://togithub.com/googleapis/java-pubsub/commit/1b8c440fccc51dc2291c43b2972b1f5c08dfd65a))

##### Dependencies

-   update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#&#8203;1189](https://togithub.com/googleapis/java-pubsub/issues/1189)) ([0d96f8e](https://togithub.com/googleapis/java-pubsub/commit/0d96f8e2006c145de039d2f00c5eb1d8830eae3d))
-   update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#&#8203;1190](https://togithub.com/googleapis/java-pubsub/issues/1190)) ([c604080](https://togithub.com/googleapis/java-pubsub/commit/c6040802bcf97d063e2b91cdb5fa7fe3c3e3b807))

### [`v1.120.1`](https://togithub.com/googleapis/java-pubsub/blob/HEAD/CHANGELOG.md#&#8203;11201-httpsgithubcomgoogleapisjava-pubsubcomparev11200v11201-2022-07-11)

[Compare Source](https://togithub.com/googleapis/java-pubsub/compare/v1.120.0...v1.120.1)

##### Dependencies

-   update dependency com.google.cloud:google-cloud-bigquery to v2.13.8 ([#&#8203;1179](https://togithub.com/googleapis/java-pubsub/issues/1179)) ([5fc8f86](https://togithub.com/googleapis/java-pubsub/commit/5fc8f86b30cafaba1acde6f1f807b345e3b3b953))
-   update dependency com.google.cloud:google-cloud-core to v2.8.1 ([#&#8203;1178](https://togithub.com/googleapis/java-pubsub/issues/1178)) ([0052a6c](https://togithub.com/googleapis/java-pubsub/commit/0052a6c093030eaefa412cb0a8e35787a9b35c01))
-   update dependency com.google.protobuf:protobuf-java-util to v3.21.2 ([#&#8203;1176](https://togithub.com/googleapis/java-pubsub/issues/1176)) ([8ffe189](https://togithub.com/googleapis/java-pubsub/commit/8ffe189170e58cab1de630c41cab6cd8346f98b0))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerydatatransfer).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMzUuMSIsInVwZGF0ZWRJblZlciI6IjMyLjEzNS4xIn0=-->
github-actions bot pushed a commit that referenced this issue Aug 9, 2022
🤖 I have created a release *beep* *boop*
---


## [2.3.3](googleapis/java-bigquerydatatransfer@v2.3.2...v2.3.3) (2022-08-09)


### Dependencies

* update dependency com.google.cloud:google-cloud-bigquery to v2.14.1 ([#1430](googleapis/java-bigquerydatatransfer#1430)) ([befed25](googleapis/java-bigquerydatatransfer@befed25))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.2 ([#1433](googleapis/java-bigquerydatatransfer#1433)) ([30b6942](googleapis/java-bigquerydatatransfer@30b6942))
* update dependency com.google.cloud:google-cloud-bigquery to v2.14.3 ([#1434](googleapis/java-bigquerydatatransfer#1434)) ([5c054b0](googleapis/java-bigquerydatatransfer@5c054b0))
* update dependency com.google.cloud:google-cloud-pubsub to v1.120.10 ([#1432](googleapis/java-bigquerydatatransfer#1432)) ([4ab39e9](googleapis/java-bigquerydatatransfer@4ab39e9))
* update dependency com.google.cloud:google-cloud-pubsub to v1.120.8 ([#1428](googleapis/java-bigquerydatatransfer#1428)) ([ddab51f](googleapis/java-bigquerydatatransfer@ddab51f))
* update dependency com.google.cloud:google-cloud-pubsub to v1.120.9 ([#1431](googleapis/java-bigquerydatatransfer#1431)) ([f909343](googleapis/java-bigquerydatatransfer@f909343))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#1426](googleapis/java-bigquerydatatransfer#1426)) ([8a2c31e](googleapis/java-bigquerydatatransfer@8a2c31e))
* update dependency com.google.protobuf:protobuf-java-util to v3.21.3 ([#1423](googleapis/java-bigquerydatatransfer#1423)) ([50bc04e](googleapis/java-bigquerydatatransfer@50bc04e))
* update dependency com.google.protobuf:protobuf-java-util to v3.21.4 ([#1425](googleapis/java-bigquerydatatransfer#1425)) ([60d8c78](googleapis/java-bigquerydatatransfer@60d8c78))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants