# Class GrpcDatastoreStub (3.1.0)

3.1.0 (latest) 2.40.0 2.37.0 2.36.0 2.34.0 2.33.3 2.32.3 2.31.4 2.30.0 2.29.1 2.28.2 2.27.1 2.26.4 2.25.2 2.24.3 2.23.0 2.22.0 2.21.3 2.20.2 2.19.2 2.18.5 2.17.6

    public class GrpcDatastoreStub extends DatastoreStub

gRPC stub implementation for the Datastore service API.

This class is for advanced usage and reflects the underlying API directly.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [DatastoreStub](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub) \> GrpcDatastoreStub

## Inherited Members

[DatastoreStub.allocateIdsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_allocateIdsCallable__) [DatastoreStub.beginTransactionCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_beginTransactionCallable__) [DatastoreStub.close()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_close__) [DatastoreStub.commitCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_commitCallable__) [DatastoreStub.lookupCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_lookupCallable__) [DatastoreStub.reserveIdsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_reserveIdsCallable__) [DatastoreStub.rollbackCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_rollbackCallable__) [DatastoreStub.runAggregationQueryCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_runAggregationQueryCallable__) [DatastoreStub.runQueryCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_runQueryCallable__) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### create(ClientContext clientContext)

    public static final GrpcDatastoreStub create(ClientContext clientContext)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clientContext` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ClientContext.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.GrpcDatastoreStub` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)

    public static final GrpcDatastoreStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `clientContext` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ClientContext.html` |
| `callableFactory` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.grpc.GrpcStubCallableFactory.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.GrpcDatastoreStub` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(DatastoreStubSettings settings)

    public static final GrpcDatastoreStub create(DatastoreStubSettings settings)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStubSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.GrpcDatastoreStub` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

## Constructors

### GrpcDatastoreStub(DatastoreStubSettings settings, ClientContext clientContext)

    protected GrpcDatastoreStub(DatastoreStubSettings settings, ClientContext clientContext)

Constructs an instance of GrpcDatastoreStub, using the given settings. This is protected so
that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStubSettings` |
| `clientContext` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ClientContext.html` |

### GrpcDatastoreStub(DatastoreStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)

    protected GrpcDatastoreStub(DatastoreStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)

Constructs an instance of GrpcDatastoreStub, using the given settings. This is protected so
that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStubSettings` |
| `clientContext` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ClientContext.html` |
| `callableFactory` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.grpc.GrpcStubCallableFactory.html` |

## Methods

### allocateIdsCallable()

    public UnaryCallable<AllocateIdsRequest,AllocateIdsResponse> allocateIdsCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.AllocateIdsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.AllocateIdsResponse>` |   |

**Overrides** [DatastoreStub.allocateIdsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_allocateIdsCallable__)

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### beginTransactionCallable()

    public UnaryCallable<BeginTransactionRequest,BeginTransactionResponse> beginTransactionCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.BeginTransactionRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.BeginTransactionResponse>` |   |

**Overrides** [DatastoreStub.beginTransactionCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_beginTransactionCallable__)

### close()

    public final void close()

**Overrides** [DatastoreStub.close()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_close__)

### commitCallable()

    public UnaryCallable<CommitRequest,CommitResponse> commitCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.CommitRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.CommitResponse>` |   |

**Overrides** [DatastoreStub.commitCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_commitCallable__)

### getOperationsStub()

    public GrpcOperationsStub getOperationsStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.stub.GrpcOperationsStub.html` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### lookupCallable()

    public UnaryCallable<LookupRequest,LookupResponse> lookupCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.LookupRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.LookupResponse>` |   |

**Overrides** [DatastoreStub.lookupCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_lookupCallable__)

### reserveIdsCallable()

    public UnaryCallable<ReserveIdsRequest,ReserveIdsResponse> reserveIdsCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.ReserveIdsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.ReserveIdsResponse>` |   |

**Overrides** [DatastoreStub.reserveIdsCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_reserveIdsCallable__)

### rollbackCallable()

    public UnaryCallable<RollbackRequest,RollbackResponse> rollbackCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.RollbackRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.RollbackResponse>` |   |

**Overrides** [DatastoreStub.rollbackCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_rollbackCallable__)

### runAggregationQueryCallable()

    public UnaryCallable<RunAggregationQueryRequest,RunAggregationQueryResponse> runAggregationQueryCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.RunAggregationQueryRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.RunAggregationQueryResponse>` |   |

**Overrides** [DatastoreStub.runAggregationQueryCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_runAggregationQueryCallable__)

### runQueryCallable()

    public UnaryCallable<RunQueryRequest,RunQueryResponse> runQueryCallable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.RunQueryRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.datastore.v1.RunQueryResponse>` |   |

**Overrides** [DatastoreStub.runQueryCallable()](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.v1.stub.DatastoreStub#com_google_cloud_datastore_v1_stub_DatastoreStub_runQueryCallable__)

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()