Unable to update to bigtable-hbase-2.x 2.0.0

284 views
Skip to first unread message

Niels Basjes

unread,
Feb 21, 2022, 8:59:56 AM2/21/22
to Google Cloud Bigtable Discuss
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_KEYgetDockerIpAddress() + ":" + 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

Mattie Fu

unread,
Feb 22, 2022, 10:59:28 AM2/22/22
to Google Cloud Bigtable Discuss
Hi Niels,

Can you verify that environment variable BIGTABLE_EMULATOR_HOST is not set when you're running with the 2 versions?

The check you pointed out calls System.getenv(...) which verifies the BIGTABLE_EMULATOR_HOST environment variable instead of checking for the BIGTABLE_EMULATOR_HOST_KEY in the Configuration.

Please let me know if this helps.

Thanks! 
Mattie
Reply all
Reply to author
Forward
0 new messages