Hi,
I have a Java application that uses BigTable via the HBase API.
For local testing I use the provided BigTable emulator
I'm using this version of the client api
<dependency>
<groupId>com.google.cloud.bigtable</groupId>
<artifactId>bigtable-hbase-2.x</artifactId>
<version>1.26.3</version>
This code fragment works as expected (I have some additional code to get the hostname and IP of the running emulator) with this version:
Configuration config = BigtableConfiguration.configure("MyTestProject", "HBaseTestingInstance");
config.set(BIGTABLE_EMULATOR_HOST_KEY, getDockerIpAddress() + ":" + getDockerBigtablePort());
try (Connection connection = ConnectionFactory.createConnection(config)) {
LOG.info("We have a connection: {}", connection);
}
Today I updated to
<dependency>
<groupId>com.google.cloud.bigtable</groupId>
<artifactId>bigtable-hbase-2.x</artifactId>
<version>2.0.0</version>
And now I get an exception on the same code which is ultimately triggered by
Caused by: java.lang.IllegalStateException: BigtableInstanceAdminSettings doesn't supported on Emulator
at com.google.common.base.Preconditions.checkState(Preconditions.java:502)
at com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings.newBuilder(BigtableInstanceAdminSettings.java:118)
at com.google.cloud.bigtable.hbase.wrappers.veneer.BigtableHBaseVeneerSettings.buildBigtableInstanceAdminSettings(BigtableHBaseVeneerSettings.java:369)
at com.google.cloud.bigtable.hbase.wrappers.veneer.BigtableHBaseVeneerSettings.<init>(BigtableHBaseVeneerSettings.java:168)
at com.google.cloud.bigtable.hbase.wrappers.veneer.BigtableHBaseVeneerSettings.create(BigtableHBaseVeneerSettings.java:156)
at com.google.cloud.bigtable.hbase.wrappers.BigtableHBaseSettings.create(BigtableHBaseSettings.java:42)
at org.apache.hadoop.hbase.client.AbstractBigtableConnection.<init>(AbstractBigtableConnection.java:111)
at org.apache.hadoop.hbase.client.AbstractBigtableConnection.<init>(AbstractBigtableConnection.java:86)
at com.google.cloud.bigtable.hbase2_x.BigtableConnection.<init>(BigtableConnection.java:61)
... 41 more
The condition that triggers this failure:
public static BigtableInstanceAdminSettings.Builder newBuilder() {
Preconditions.checkState(System.getenv("BIGTABLE_EMULATOR_HOST") == null, "BigtableInstanceAdminSettings doesn't supported on Emulator");
Which was introduced with this commit a few years ago
Am I doing something incorrectly? If so; How do I fix this?
Or is this a bug in the new library?
Niels Basjes