Skip to content

Commit acfbaef

Browse files
committed
incorporating feedbacks
1 parent 2984146 commit acfbaef

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreOptions.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected String getDefaultHost() {
122122
System.getProperty(
123123
com.google.datastore.v1.client.DatastoreHelper.LOCAL_HOST_ENV_VAR,
124124
System.getenv(com.google.datastore.v1.client.DatastoreHelper.LOCAL_HOST_ENV_VAR));
125-
return host != null ? host : DatastoreDefaults.INSTANCE.getHost();
125+
return host != null ? host : DatastoreSettings.getDefaultEndpoint();
126126
}
127127

128128
@Override
@@ -136,13 +136,6 @@ protected String getDefaultProject() {
136136

137137
private static class DatastoreDefaults implements ServiceDefaults<Datastore, DatastoreOptions> {
138138

139-
private static final DatastoreDefaults INSTANCE = new DatastoreDefaults();
140-
private final String HOST = DatastoreSettings.getDefaultEndpoint();
141-
142-
String getHost() {
143-
return HOST;
144-
}
145-
146139
@Override
147140
public DatastoreFactory getDefaultServiceFactory() {
148141
return DefaultDatastoreFactory.INSTANCE;

google-cloud-datastore/src/main/java/com/google/cloud/datastore/spi/v1/GrpcDatastoreRpc.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1+
/*
2+
* Copyright 2023 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.datastore.spi.v1;
218

319
import static java.util.concurrent.TimeUnit.SECONDS;
420

521
import com.google.api.core.ApiFunction;
22+
import com.google.api.core.InternalApi;
623
import com.google.api.gax.core.BackgroundResource;
724
import com.google.api.gax.core.GaxProperties;
825
import com.google.api.gax.grpc.GrpcCallContext;
@@ -43,7 +60,7 @@
4360
import java.io.IOException;
4461
import java.util.Collections;
4562

46-
// TODO(gapic_upgrade): Make it implement AutoCloseable
63+
@InternalApi
4764
public class GrpcDatastoreRpc implements AutoCloseable, DatastoreRpc {
4865

4966
private final GrpcDatastoreStub datastoreStub;

0 commit comments

Comments
 (0)