A stub to allow clients to do asynchronous rpc calls to service Datastore.
Each RPC normalizes the partition IDs of the keys in its input entities,
and always returns entities with keys with normalized partition IDs.
This applies to all keys and entities, including those in values, except keys
with both an empty path and an empty or unset partition ID. Normalization of
input keys sets the project ID (if not already set) to the project ID from
the request.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class DatastoreGrpc.DatastoreStub (2.31.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.31.2 (latest)](/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.31.1](/java/docs/reference/google-cloud-datastore/2.31.1/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.30.0](/java/docs/reference/google-cloud-datastore/2.30.0/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.29.1](/java/docs/reference/google-cloud-datastore/2.29.1/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.28.2](/java/docs/reference/google-cloud-datastore/2.28.2/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.27.1](/java/docs/reference/google-cloud-datastore/2.27.1/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.26.4](/java/docs/reference/google-cloud-datastore/2.26.4/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.25.2](/java/docs/reference/google-cloud-datastore/2.25.2/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.24.3](/java/docs/reference/google-cloud-datastore/2.24.3/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.23.0](/java/docs/reference/google-cloud-datastore/2.23.0/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.22.0](/java/docs/reference/google-cloud-datastore/2.22.0/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.21.3](/java/docs/reference/google-cloud-datastore/2.21.3/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.20.2](/java/docs/reference/google-cloud-datastore/2.20.2/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.19.2](/java/docs/reference/google-cloud-datastore/2.19.2/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.18.5](/java/docs/reference/google-cloud-datastore/2.18.5/com.google.datastore.v1.DatastoreGrpc.DatastoreStub)\n- [2.17.6](/java/docs/reference/google-cloud-datastore/2.17.6/com.google.datastore.v1.DatastoreGrpc.DatastoreStub) \n\n public static final class DatastoreGrpc.DatastoreStub extends AbstractAsyncStub\u003cDatastoreGrpc.DatastoreStub\u003e\n\nA stub to allow clients to do asynchronous rpc calls to service Datastore.\n\nEach RPC normalizes the partition IDs of the keys in its input entities,\nand always returns entities with keys with normalized partition IDs.\nThis applies to all keys and entities, including those in values, except keys\nwith both an empty path and an empty or unset partition ID. Normalization of\ninput keys sets the project ID (if not already set) to the project ID from\nthe request. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e io.grpc.stub.AbstractStub \\\u003e io.grpc.stub.AbstractAsyncStub \\\u003e DatastoreGrpc.DatastoreStub \n\nInherited Members\n-----------------\n\nio.grpc.stub.AbstractAsyncStub.\\\u003cT\\\u003enewStub(io.grpc.stub.AbstractStub.StubFactory\\\u003cT\\\u003e,io.grpc.Channel) \nio.grpc.stub.AbstractAsyncStub.\\\u003cT\\\u003enewStub(io.grpc.stub.AbstractStub.StubFactory\\\u003cT\\\u003e,io.grpc.Channel,io.grpc.CallOptions) \nio.grpc.stub.AbstractStub.\\\u003cT\\\u003ewithOption(io.grpc.CallOptions.Key\\\u003cT\\\u003e,T) \nio.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions) \nio.grpc.stub.AbstractStub.getCallOptions() \nio.grpc.stub.AbstractStub.getChannel() \nio.grpc.stub.AbstractStub.withCallCredentials(io.grpc.CallCredentials) \nio.grpc.stub.AbstractStub.withChannel(io.grpc.Channel) \nio.grpc.stub.AbstractStub.withCompression(java.lang.String) \nio.grpc.stub.AbstractStub.withDeadline(io.grpc.Deadline) \nio.grpc.stub.AbstractStub.withDeadlineAfter(java.time.Duration) \nio.grpc.stub.AbstractStub.withDeadlineAfter(long,java.util.concurrent.TimeUnit) \nio.grpc.stub.AbstractStub.withExecutor(java.util.concurrent.Executor) \nio.grpc.stub.AbstractStub.withInterceptors(io.grpc.ClientInterceptor...) \nio.grpc.stub.AbstractStub.withMaxInboundMessageSize(int) \nio.grpc.stub.AbstractStub.withMaxOutboundMessageSize(int) \nio.grpc.stub.AbstractStub.withOnReadyThreshold(int) \nio.grpc.stub.AbstractStub.withWaitForReady() \n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nMethods\n-------\n\n### allocateIds(AllocateIdsRequest request, StreamObserver\\\u003cAllocateIdsResponse\\\u003e responseObserver)\n\n public void allocateIds(AllocateIdsRequest request, StreamObserver\u003cAllocateIdsResponse\u003e responseObserver)\n\nAllocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted.\n\n### beginTransaction(BeginTransactionRequest request, StreamObserver\\\u003cBeginTransactionResponse\\\u003e responseObserver)\n\n public void beginTransaction(BeginTransactionRequest request, StreamObserver\u003cBeginTransactionResponse\u003e responseObserver)\n\nBegins a new transaction.\n\n### build(Channel channel, CallOptions callOptions)\n\n protected DatastoreGrpc.DatastoreStub build(Channel channel, CallOptions callOptions)\n\n**Overrides** \nio.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)\n\n### commit(CommitRequest request, StreamObserver\\\u003cCommitResponse\\\u003e responseObserver)\n\n public void commit(CommitRequest request, StreamObserver\u003cCommitResponse\u003e responseObserver)\n\nCommits a transaction, optionally creating, deleting or modifying some\nentities.\n\n### lookup(LookupRequest request, StreamObserver\\\u003cLookupResponse\\\u003e responseObserver)\n\n public void lookup(LookupRequest request, StreamObserver\u003cLookupResponse\u003e responseObserver)\n\nLooks up entities by key.\n\n### reserveIds(ReserveIdsRequest request, StreamObserver\\\u003cReserveIdsResponse\\\u003e responseObserver)\n\n public void reserveIds(ReserveIdsRequest request, StreamObserver\u003cReserveIdsResponse\u003e responseObserver)\n\nPrevents the supplied keys' IDs from being auto-allocated by Cloud\nDatastore.\n\n### rollback(RollbackRequest request, StreamObserver\\\u003cRollbackResponse\\\u003e responseObserver)\n\n public void rollback(RollbackRequest request, StreamObserver\u003cRollbackResponse\u003e responseObserver)\n\nRolls back a transaction.\n\n### runAggregationQuery(RunAggregationQueryRequest request, StreamObserver\\\u003cRunAggregationQueryResponse\\\u003e responseObserver)\n\n public void runAggregationQuery(RunAggregationQueryRequest request, StreamObserver\u003cRunAggregationQueryResponse\u003e responseObserver)\n\nRuns an aggregation query.\n\n### runQuery(RunQueryRequest request, StreamObserver\\\u003cRunQueryResponse\\\u003e responseObserver)\n\n public void runQuery(RunQueryRequest request, StreamObserver\u003cRunQueryResponse\u003e responseObserver)\n\nQueries for entities."]]