Skip to content

Commit 9e835be

Browse files
chore: use specific credential load method (#4513)
1 parent fd3cc0d commit 9e835be

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/wrappers/veneer/BigtableHBaseVeneerSettings.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
import com.google.api.gax.rpc.StubSettings;
7474
import com.google.api.gax.rpc.UnaryCallSettings;
7575
import com.google.auth.Credentials;
76-
import com.google.auth.oauth2.GoogleCredentials;
7776
import com.google.auth.oauth2.ServiceAccountJwtAccessCredentials;
7877
import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings;
7978
import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings;
@@ -136,11 +135,11 @@ public class BigtableHBaseVeneerSettings extends BigtableHBaseSettings {
136135
Optional.of(Duration.ofMinutes(5)),
137136
Optional.of(Duration.ofMinutes(10)),
138137
Optional.absent()),
139-
/* bulkMutateTimeouts = */ new OperationTimeouts(
138+
/* bulkMutateTimeouts= */ new OperationTimeouts(
140139
Optional.absent(),
141140
Optional.of(Duration.ofMinutes(1)),
142141
Optional.of(Duration.ofMinutes(10))),
143-
/* sampleRowKeysTimeouts = */ new OperationTimeouts(
142+
/* sampleRowKeysTimeouts= */ new OperationTimeouts(
144143
Optional.absent(),
145144
Optional.of(Duration.ofMinutes(5)),
146145
Optional.of(Duration.ofMinutes(10))));
@@ -572,7 +571,7 @@ private void configureCredentialProvider(StubSettings.Builder<?, ?> stubSettings
572571
String jsonValue = configuration.get(BIGTABLE_SERVICE_ACCOUNT_JSON_VALUE_KEY);
573572
stubSettings.setCredentialsProvider(
574573
FixedCredentialsProvider.create(
575-
GoogleCredentials.fromStream(
574+
ServiceAccountJwtAccessCredentials.fromStream(
576575
new ByteArrayInputStream(jsonValue.getBytes(StandardCharsets.UTF_8)))));
577576

578577
} else if (!Strings.isNullOrEmpty(
@@ -581,7 +580,7 @@ private void configureCredentialProvider(StubSettings.Builder<?, ?> stubSettings
581580
configuration.get(BIGTABLE_SERVICE_ACCOUNT_JSON_KEYFILE_LOCATION_KEY);
582581
stubSettings.setCredentialsProvider(
583582
FixedCredentialsProvider.create(
584-
GoogleCredentials.fromStream(new FileInputStream(keyFileLocation))));
583+
ServiceAccountJwtAccessCredentials.fromStream(new FileInputStream(keyFileLocation))));
585584

586585
} else if (!Strings.isNullOrEmpty(configuration.get(BIGTABLE_SERVICE_ACCOUNT_EMAIL_KEY))) {
587586
String serviceAccount = configuration.get(BIGTABLE_SERVICE_ACCOUNT_EMAIL_KEY);

0 commit comments

Comments
 (0)