Skip to content

Cannot use the delete method on BigtableTable with Immutable lists #4522

@Gnark-code

Description

@Gnark-code

Environment details

Cannot delete rows using BigtableTable if the given List object is Immutable.
The workaround i've found is using plain ArrayList() as input but it seems wrong to me (how do we know we must provide mutable objects?)

  1. Specify the API at the beginning of the title. General, Core, and Other are also allowed as types
  2. OS type and version: Mac OS tahoe 26.2
  3. Java version: 8
  4. Version(s):
      <dependency>
        <groupId>com.google.cloud.bigtable</groupId>
        <artifactId>bigtable-hbase-1.x-shaded</artifactId>
        <version>2.13.0</version>
      </dependency>

Steps to reproduce

when migrating bigtable-hbase-1.x-shaded from 1.11.0 to 2.13.0

  1. use a BigtableTable object and use the delete method with an ImmutableList
  2. the operation fails if the List object does not allow the remove() operation

Code example

// example

// deletes is ImmutableList or Collections.unmodifiableList
 table.delete(deletes);
 // this will fail all the time
table.delete(Collections.unmodifiableList(deletes));

Stack trace

Any relevant stacktrace here.

java.lang.UnsupportedOperationException
	at com.google.common.collect.ImmutableList.remove(ImmutableList.java:569)
	at com.google.cloud.bigtable.hbase.BatchExecutor.batchCallback(BatchExecutor.java:303)
	at com.google.cloud.bigtable.hbase.BatchExecutor.batch(BatchExecutor.java:237)
	at com.google.cloud.bigtable.hbase.AbstractBigtableTable.delete(AbstractBigtableTable.java:422)

External references such as API reference guides

  • ?

Any additional information below

The issue is still present on the master branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigtableIssues related to the googleapis/java-bigtable-hbase API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions