googleapis / googleapis/java-bigtable-hbase

Cannot use the delete method on BigtableTable with Immutable lists

Open
#4,522 0 comments 0 reactions 0 assignees View on GitHub
api: bigtable
Dominant language
Java
Stars
184
Forks
184
Avg merge
10h
Merged PRs (30d)
6

Description

#### 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
3. OS type and version: Mac OS tahoe 26.2
4. Java version: 8
5. Version(s):
```

com.google.cloud.bigtable
bigtable-hbase-1.x-shaded
2.13.0

```
#### 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

```java
// 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.
https://github.com/googleapis/java-bigtable-hbase/blob/b658fde3e71ee1e0b8cde0eb0c747ca2d05e7428/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BatchExecutor.java#L303

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.