perplexed perplexed - 1 month ago 10
Java Question

Alternative for DatastoreHelper Java class in Google Cloud Datastore v1 API

In the Datastore v1Beta2 API version, DatastoreHelper was a public class, and we rely on member functions like getOptionsFromEnv(), getComputeEngineCredential(), makeFilter() and makeValue(). Looks like that class is now private in the v1 API. What's the equivalent class that will provide us access to those functions?

Answer

Most of those methods are still public in google-cloud-datastore library:

https://github.com/GoogleCloudPlatform/google-cloud-datastore/blob/master/java/datastore/src/main/java/com/google/datastore/v1/client/DatastoreHelper.java

getComputeEngineCredential() was removed, but you can use Application Default Credentials instead, which supports getting a credential from Compute Engine.

Comments